@silexlabs/silex 3.0.0-alpha.121 → 3.0.0-alpha.123
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.
- package/.env.default +1 -1
- package/README.md +25 -9
- package/dist/client/js/main.js +1 -1
- package/dist/plugins/client/client/grapesjs/PublicationManager.js +1 -0
- package/dist/plugins/client/client/grapesjs/PublicationManager.js.map +1 -1
- package/dist/plugins/server/server/config.js +1 -1
- package/dist/plugins/server/server/config.js.map +1 -1
- package/dist/server/server/cli.js +5 -5
- package/dist/server/server/config.js +1 -1
- package/package.json +1 -1
- package/src/ts/client/grapesjs/PublicationManager.ts +1 -0
- package/src/ts/server/cli.ts +4 -4
- package/src/ts/server/config.ts +1 -1
package/.env.default
CHANGED
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
[](https://
|
|
1
|
+
[](https://v3.silex.me)
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
5
|
Brought to you by [Alex Hoyau](https://www.patreon.com/lexoyo) and [Silex contributors](https://github.com/silexlabs/Silex/graphs/contributors).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Help make Silex sustainable by being [part of the community](https://community.silex.me/), [contributing documentation](https://docs.silex.me/), [making a financial contribution](https://opencollective.com/silex), [report bugs](https://github.com/silexlabs/Silex/issues).
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Silex
|
|
10
10
|
|
|
11
11
|
Silex is a no-code tool for building websites. It also lets you code when needed. It can be used online, offline or in a JAMStack project.
|
|
12
12
|
|
|
@@ -48,13 +48,15 @@ There is a desktop application that you can install on your computer which may b
|
|
|
48
48
|
|
|
49
49
|
You can also run Silex locally or on your server using `npx`, `npm`, or `Docker`.
|
|
50
50
|
|
|
51
|
+
Check the [developer docs](https://docs.silex.me/en/dev) for configuration options and integration with your js projects.
|
|
52
|
+
|
|
51
53
|
#### Using npx
|
|
52
54
|
|
|
53
55
|
```bash
|
|
54
56
|
npx @silexlabs/silex
|
|
55
57
|
```
|
|
56
58
|
|
|
57
|
-
This command will run Silex with
|
|
59
|
+
This command will run Silex with default config.
|
|
58
60
|
|
|
59
61
|
#### Using Docker
|
|
60
62
|
|
|
@@ -62,7 +64,7 @@ This command will run Silex with the entry point being `src/ts/server/cli.ts`.
|
|
|
62
64
|
docker run -p 6805:6805 silexlabs/silex
|
|
63
65
|
```
|
|
64
66
|
|
|
65
|
-
This command will run Silex in a Docker container
|
|
67
|
+
This command will run Silex in a Docker container.
|
|
66
68
|
|
|
67
69
|
#### Using npm
|
|
68
70
|
|
|
@@ -72,16 +74,30 @@ First, install Silex as a dev dependency in your project:
|
|
|
72
74
|
npm install --save-dev @silexlabs/silex
|
|
73
75
|
```
|
|
74
76
|
|
|
75
|
-
Then, you can run Silex with the `silex` command
|
|
77
|
+
Then, you can run Silex with the `silex` command in your `package.json` scripts:
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"scripts": {
|
|
82
|
+
"start": "silex"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
76
86
|
|
|
77
87
|
## Configuration
|
|
78
88
|
|
|
79
|
-
You can configure Silex using environment variables and command-line options. All available options can be found in `src/ts/server/cli.ts
|
|
89
|
+
You can configure Silex using environment variables and command-line options. All available options can be found in the [developer docs](https://docs.silex.me/en/dev) as well as in the code: [`src/ts/server/cli.ts`](./src/ts/server/cli.ts).
|
|
90
|
+
|
|
91
|
+
Check the example config files - which are the same as plugins in Silex, in the [`examples/`](./examples/) folder. To test these configs, start Silex locally like this:
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
$ npx silex --client-config=./examples/client-config-transformers.js --server-config=`pwd`/examples/server-config-plugins.js
|
|
95
|
+
```
|
|
80
96
|
|
|
81
|
-
|
|
97
|
+
Or like this:
|
|
82
98
|
|
|
83
99
|
```sh
|
|
84
|
-
$ SILEX_CLIENT_CONFIG=./examples/client-config-transformers.js
|
|
100
|
+
$ SILEX_CLIENT_CONFIG=./examples/client-config-transformers.js SILEX_SERVER_CONFIG=`pwd`/examples/server-config-plugins.js npm run start:debug
|
|
85
101
|
```
|
|
86
102
|
|
|
87
103
|
## Contributing
|
package/dist/client/js/main.js
CHANGED
|
@@ -228,7 +228,7 @@ var silex;(()=>{var t={99:function(t){"undefined"!=typeof globalThis?globalThis:
|
|
|
228
228
|
@click=${()=>this.editor.Commands.stop(wr)}
|
|
229
229
|
>Close</button>
|
|
230
230
|
</footer>
|
|
231
|
-
`}}displayPending(t,e){this.errorMessage=null,this.renderDialog(t,e)}displayError(t,e,n){console.info(t),this.errorMessage=t,this.renderDialog(e,n)}async closeDialog(){this.isOpen=!1,this.renderDialog(null,null),this.sender&&this.sender.set("active",0),this.sender=null}async toggleDialog(){this.isOpen?this.closeDialog():this.openDialog()}async openDialog(){this.isOpen=!0;const t=this.editor.Panels.getPanel("options")?.view.el.querySelector(".publish-button");if(t){const e=t.getBoundingClientRect(),n=450,r=20,o=50;this.move({left:e.right-n-r,top:e.bottom+10,width:n,minHeight:o})}else console.error("Unable to find publish button");this.renderDialog(null,Wr.STATUS_NONE)}}var Cr;function Sr(t,e){t.Pages.getAll().forEach((t=>{t.getMainComponent().onAll((t=>e(t)))}))}!function(t){t.STARTUP_START="silex:startup:start",t.STARTUP_END="silex:startup:end",t.GRAPESJS_START="silex:grapesjs:start",t.GRAPESJS_END="silex:grapesjs:end",t.PUBLISH_START="silex:publish:start",t.PUBLISH_DATA="silex:publish:data",t.PUBLISH_END="silex:publish:end",t.PUBLISH_ERROR="silex:publish:error",t.PUBLISH_LOGIN_START="silex:publish:login:start",t.PUBLISH_LOGIN_END="silex:publish:login:end",t.ASSET_WRITE_END="silex:asset:write:end",t.WRITE_END="silex:write:end"}(Cr||(Cr={}));const Or="tmp-pre-publication-transformer-tohtml",Tr="tmp-pre-publication-transformer-src",Er="tmp-pre-publication-transformer-attributes-src",kr="tmp-pre-publication-transformer-inline-css",Ar="tmp-pre-publication-transformer-href",Pr="tmp-pre-publication-transformer-tocss",jr={renderComponent:(t,e)=>e(),renderCssRule:(t,e)=>e(),transformPath:(t,e)=>t,transformPermalink(t,e,n){switch(n){case Ae.HTML:return t;case Ae.CSS:return`../${t.replace(/^\//,"")}`;default:throw new Error(`Unknown initiator ${n}`)}},transformFile:t=>t};function Mr(t,e){const n=e["background-image"],r=n?.match(/url\(["']?(.*?)["']?\)/)?.pop();return r?{...e,"background-image":`url(${Lr(t,r,ke.ASSET,Ae.CSS)})`}:e}function Lr(t,e,n,r){return t.getModel().get("config").publicationTransformers.reduce(((t,e)=>{try{return e.transformPermalink?e.transformPermalink(t,n,r)??t:t}catch(e){return console.error("Publication transformer: error transforming path",t,e),t}}),e)}function Nr(t,e,n){return t.getModel().get("config").publicationTransformers.reduce(((t,e)=>{try{return e.transformPath?e.transformPath(t,n)??t:t}catch(e){return console.error("Publication transformer: error transforming path",t,e),t}}),e)}const Ir=window.location.pathname.replace(/\/$/,""),Dr=window.location.origin;function $r(t,e,n){if(t.startsWith("/assets")){const r=new URL(t,Dr);return r.pathname=r.pathname.replace(/^\/assets/,""),r.pathname=`${Ir}${rn}${gn}${xn}${r.pathname}`,r.searchParams.set("websiteId",e),r.searchParams.set("connectorId",n),`${decodeURIComponent(r.pathname)}${r.search}`}return console.warn("storedToDisplayed: path is not a stored path",t),t}function Rr(t){const e=`${Ir}${rn}${gn}${xn}`;if(t.startsWith(e)){const n=new URL(t,Dr);n.pathname=n.pathname.replace(new RegExp(`^${e}`),""),n.pathname=`${Ir}/assets${n.pathname}`,n.searchParams.delete("websiteId"),n.searchParams.delete("connectorId");const r="/"+n.toString().replace(new RegExp(`^${Dr}${Ir}`),"").replace(/^\//,"");return decodeURIComponent(r)}return console.warn("displayedToStored: path is not a displayed path",t),t}const Hr={transformPath(t,e){if(e===ke.ASSET)return Rr(t)},transformPermalink(t,e){if(e===ke.ASSET)return Rr(t)}};function Fr(t,e,n){const r=t.attributes?.src?{...t,attributes:{...t.attributes,src:$r(t.attributes.src,e,n)}}:t;return r.components&&(r.components=r.components.map((t=>Fr(t,e,n)))),r}function Vr(t){const e=t.attributes?.src?{...t,attributes:{...t.attributes,src:Rr(t.attributes.src)}}:t;return e.components&&(e.components=e.components.map((t=>Vr(t)))),e}const Ur="publish",Br="publish-login",zr="publish-logout";var Wr;function qr(t,e){t.PublicationManager=new Yr(t,e)}function Gr(t){switch(t){case je.IN_PROGRESS:return Wr.STATUS_PENDING;case je.ERROR:return Wr.STATUS_ERROR;case je.SUCCESS:return Wr.STATUS_SUCCESS}throw new Error(`Unknown job status ${t}`)}!function(t){t.STATUS_NONE="STATUS_NONE",t.STATUS_PENDING="STATUS_PENDING",t.STATUS_ERROR="STATUS_ERROR",t.STATUS_SUCCESS="STATUS_SUCCESS",t.STATUS_LOGGED_OUT="STATUS_AUTH_ERROR"}(Wr||(Wr={}));const Kr=window.location.origin+window.location.pathname.replace(/\/$/,"");class Yr{editor;dialog;_settings;get settings(){return this._settings}set settings(t){this._settings=t,this.dialog&&(this.dialog.settings=t)}options;job=null;status=Wr.STATUS_NONE;constructor(t,e){this.editor=t,this.options={appendTo:"options",...e},t.on("storage:start:store",(t=>{t.publication=this.settings})),t.on("storage:end:load",(t=>{this.settings=t.publication??{},De({type:Pe.HOSTING,connectorId:this.settings.connector?.connectorId}).then((t=>{})).catch((t=>{this.status=Wr.STATUS_LOGGED_OUT,this.settings={},this.dialog&&this.dialog.displayError("Please login",this.job,this.status)}))})),t.Commands.add(Ur,(()=>this.startPublication())),t.Commands.add(Br,((t,e,n)=>this.goLogin(n))),t.Commands.add(zr,(()=>this.goLogout())),this.options.appendTo?this.dialog=new xr(t,{appendTo:this.options.appendTo}):console.info("PublicationUi is disabled because no appendTo option is set")}async goLogin(t){if(t.isLoggedIn)return this.settings={...this.settings,connector:t},this.status=Wr.STATUS_NONE,this.editor.store(null),void(this.dialog&&this.dialog.displayPending(this.job,this.status));this.settings={},this.status=Wr.STATUS_LOGGED_OUT,this.dialog&&this.dialog.displayPending(this.job,this.status);const e=t.connectorId,n=t.type;return window.open(t.oauthUrl||`${Kr}${rn}${on}${cn}?connectorId=${e}&type=${n}`,"_blank"),new Promise((e=>{const n=async e=>{const r=e.data;"login"===r?.type&&(window.removeEventListener("message",n),r.error?(this.status=Wr.STATUS_LOGGED_OUT,this.settings={},this.dialog&&this.dialog.displayError(r.message,this.job,this.status)):(this.editor.trigger(Cr.PUBLISH_LOGIN_END),this.settings.connector=t,this.settings.options=r.options,this.status=Wr.STATUS_NONE,this.editor.store(null),this.dialog&&this.dialog.displayPending(this.job,this.status)))};window.addEventListener("message",n,!1)}))}async goLogout(){try{await $e({type:Pe.HOSTING,connectorId:this.settings.connector.connectorId}),this.settings={},this.dialog&&this.dialog.displayPending(this.job,this.status)}catch(t){console.error("logout error",t),this.status=Wr.STATUS_ERROR,this.dialog&&this.dialog.displayError(t.message,this.job,this.status)}}async startPublication(){if(this.status===Wr.STATUS_PENDING)throw new Error("Publication is already in progress");this.status=Wr.STATUS_PENDING,this.job=null,this.dialog&&this.dialog.displayPending(this.job,this.status),this.editor.trigger(Cr.PUBLISH_START);const t=this.editor.getModel().get("user");if(!t)throw new Error("User not logged in to a storage connector");if(!this.settings.connector?.connectorId)throw new Error("User not logged in to a hosting connector");const e=this.options.websiteId,n=t.storage.connectorId;this.setPublicationTransformers();const r=this.editor.getProjectData(),o=this.editor.getModel().get("settings"),i=(await this.getHtmlFiles(o)).flatMap((t=>[{path:t.htmlPath,content:t.html,type:ke.HTML},{path:t.cssPath,content:t.css,type:ke.CSS}])).concat(r.assets.map((t=>{const e=Nr(this.editor,t.src,ke.ASSET),n=Rr(t.src).replace(/^\/assets\//,"");return{...t,path:e,src:n,type:ke.ASSET}}))),a={...r,assets:r.assets.map((t=>({...t,src:Rr(t.src)}))),settings:o,publication:this.settings,files:i};this.resetPublicationTransformers(),function(t,e){const n=t.getModel().get("config");e.files=n.publicationTransformers.reduce(((t,n)=>t.map(((t,r)=>{try{return e.pages[r],n.transformFile?n.transformFile(t)??t:t}catch(e){return console.error("Publication transformer: error transforming file",t,e),t}}))),e.files)}(this.editor,a),this.editor.trigger(Cr.PUBLISH_DATA,a);try{const[t,r]=await Re({websiteId:e,hostingId:this.settings.connector.connectorId,storageId:n,data:a,options:this.settings.options});this.job=r,this.status=Gr(this.job.status),this.trackProgress()}catch(t){return console.error("publish error",t),401===t.code||401===t.httpStatusCode?(this.status=Wr.STATUS_LOGGED_OUT,this.settings={},this.dialog&&this.dialog.displayError("Please login.",this.job,this.status)):(this.status=Wr.STATUS_ERROR,this.dialog&&this.dialog.displayError(`An error occured, your site is not published. ${t.message}`,this.job,this.status)),this.editor.trigger(Cr.PUBLISH_ERROR,{success:!1,message:t.message}),void this.editor.trigger(Cr.PUBLISH_END,{success:!1,message:t.message})}}async getHtmlFiles(t){return this.editor.Pages.getAll().map((e=>{const n=e.get("settings");function r(e){return(n||{})[e]||(t||[])[e]||""}const o=e.getMainComponent(),i=vr(e.get("name")),a=`/css/${i}.css`,s=`/${i}.html`,l=Lr(this.editor,a,ke.CSS,Ae.HTML),c=Nr(this.editor,a,ke.CSS),u=Nr(this.editor,s,ke.HTML),p=this.editor.getHtml({component:o});return{html:`<!DOCTYPE html>\n<html lang="${r("lang")}">\n<head>\n<link rel="stylesheet" href="${l}" />\n${t?.head||""}\n${n?.head||""}\n<title>${r("title")}</title>\n<link rel="icon" href="${r("favicon")}" />\n${["description","og:title","og:description","og:image"].map((t=>`<meta name="${t}" property="${t}" content="${r(t)}"/>`)).join("\n")}\n</head>\n${p}\n</html>`,css:this.editor.getCss({component:o}),cssPath:c,htmlPath:u}}))}async trackProgress(){try{this.job=await He({jobId:this.job.jobId}),this.status=Gr(this.job.status)}catch(t){return this.status=Wr.STATUS_ERROR,this.dialog&&this.dialog.displayError(`An error occured, your site is not published. ${t.message}`,this.job,this.status),this.editor.trigger(Cr.PUBLISH_END,{success:!1,message:t.message}),void this.editor.trigger(Cr.PUBLISH_ERROR,{success:!1,message:t.message})}this.job.status===je.IN_PROGRESS?setTimeout((()=>this.trackProgress()),2e3):this.editor.trigger(Cr.PUBLISH_END,{success:this.job.status===je.SUCCESS,message:this.job.message}),this.dialog&&this.dialog.displayPending(this.job,this.status)}setPublicationTransformers(){!function(t){const e=t.getModel().get("config");Sr(t,(n=>{if(n.get(Or))console.warn("Publication transformer: HTML transform already altered",n);else{const r=n.toHTML.bind(n);n[Or]=n.toHTML;const o=n.getStyle.bind(n);n[kr]=n.getStyle;const i=n.get("attributes").href;if(i?.startsWith("./")&&(n[Ar]=i,n.set("attributes",{...n.get("attributes"),href:Lr(t,i,ke.HTML,Ae.HTML)})),n.get("attributes").src){n[Tr]=n.get("attributes").src;const e=Lr(t,n.get("attributes").src,ke.ASSET,Ae.HTML);n.set("attributes",{...n.get("attributes"),src:e})}if(n.get("src")){n[Er]=n.get("src");const e=Lr(t,n.get("src"),ke.ASSET,Ae.HTML);n.set("src",e)}n.toHTML=()=>e.publicationTransformers.reduce(((t,e)=>{try{return e.renderComponent?e.renderComponent(n,(()=>t))??t:t}catch(e){return console.error("Publication transformer: error rendering component",n,e),t}}),r()),n.getStyle=()=>Mr(t,o())}}))}(this.editor),function(t){const e=t.getModel().get("config");t.Css.getAll().forEach((n=>{if(n[Pr])console.warn("Publication transformer: CSS transform already altered",n);else{const r=n.getStyle.bind(n);n[Pr]=n.getStyle,n.getStyle=()=>{try{const n=Mr(t,r()),o=e.publicationTransformers.reduce(((t,e)=>({...e.renderCssRule?e.renderCssRule(t,(()=>n))??t:t})),n);return o}catch(t){return console.error("Publication transformer: error rendering style",n,t),r()}}}}))}(this.editor)}resetPublicationTransformers(){!function(t){Sr(t,(t=>{t[Or]&&(t.toHTML=t[Or],delete t[Or]),t[kr]&&(t.getStyle=t[kr],delete t[kr]),t[Tr]&&(t.set("attributes",{...t.get("attributes"),src:t[Tr]}),delete t[Tr]),t[Er]&&(t.set("src",t[Er]),delete t[Er]),t[Ar]&&(t.set("attributes",{...t.get("attributes"),href:t[Ar]}),delete t[Ar])}))}(this.editor),function(t){t.Css.getAll().forEach((t=>{t[Pr]&&(t.getStyle=t[Pr],delete t[Pr])}))}(this.editor)}}const Xr=[{name:"./project-bar",value:nr},{name:"grapesjs-style-bg",value:zn()},{name:"./settings",value:(t,e)=>{try{sr="3.0.0-alpha.121"}catch(t){}console.info("Silex version:",sr),t.Commands.add(ar,{run:(e,n,{page:r})=>{ir=t.Modal.open({title:r?"Page settings":"Site Settings",content:"",attributes:{class:"settings-dialog"}}).onceClose((()=>{n?.set&&n.set("active",0),t.stopCommand(ar)})),function(t,e,n=t.getModel()){const r=n.get("settings")||{};n.set("settings",r),qt(Et`
|
|
231
|
+
`}}displayPending(t,e){this.errorMessage=null,this.renderDialog(t,e)}displayError(t,e,n){console.info(t),this.errorMessage=t,this.renderDialog(e,n)}async closeDialog(){this.isOpen=!1,this.renderDialog(null,null),this.sender&&this.sender.set("active",0),this.sender=null}async toggleDialog(){this.isOpen?this.closeDialog():this.openDialog()}async openDialog(){this.isOpen=!0;const t=this.editor.Panels.getPanel("options")?.view.el.querySelector(".publish-button");if(t){const e=t.getBoundingClientRect(),n=450,r=20,o=50;this.move({left:e.right-n-r,top:e.bottom+10,width:n,minHeight:o})}else console.error("Unable to find publish button");this.renderDialog(null,Wr.STATUS_NONE)}}var Cr;function Sr(t,e){t.Pages.getAll().forEach((t=>{t.getMainComponent().onAll((t=>e(t)))}))}!function(t){t.STARTUP_START="silex:startup:start",t.STARTUP_END="silex:startup:end",t.GRAPESJS_START="silex:grapesjs:start",t.GRAPESJS_END="silex:grapesjs:end",t.PUBLISH_START="silex:publish:start",t.PUBLISH_DATA="silex:publish:data",t.PUBLISH_END="silex:publish:end",t.PUBLISH_ERROR="silex:publish:error",t.PUBLISH_LOGIN_START="silex:publish:login:start",t.PUBLISH_LOGIN_END="silex:publish:login:end",t.ASSET_WRITE_END="silex:asset:write:end",t.WRITE_END="silex:write:end"}(Cr||(Cr={}));const Or="tmp-pre-publication-transformer-tohtml",Tr="tmp-pre-publication-transformer-src",Er="tmp-pre-publication-transformer-attributes-src",kr="tmp-pre-publication-transformer-inline-css",Ar="tmp-pre-publication-transformer-href",Pr="tmp-pre-publication-transformer-tocss",jr={renderComponent:(t,e)=>e(),renderCssRule:(t,e)=>e(),transformPath:(t,e)=>t,transformPermalink(t,e,n){switch(n){case Ae.HTML:return t;case Ae.CSS:return`../${t.replace(/^\//,"")}`;default:throw new Error(`Unknown initiator ${n}`)}},transformFile:t=>t};function Mr(t,e){const n=e["background-image"],r=n?.match(/url\(["']?(.*?)["']?\)/)?.pop();return r?{...e,"background-image":`url(${Lr(t,r,ke.ASSET,Ae.CSS)})`}:e}function Lr(t,e,n,r){return t.getModel().get("config").publicationTransformers.reduce(((t,e)=>{try{return e.transformPermalink?e.transformPermalink(t,n,r)??t:t}catch(e){return console.error("Publication transformer: error transforming path",t,e),t}}),e)}function Nr(t,e,n){return t.getModel().get("config").publicationTransformers.reduce(((t,e)=>{try{return e.transformPath?e.transformPath(t,n)??t:t}catch(e){return console.error("Publication transformer: error transforming path",t,e),t}}),e)}const Ir=window.location.pathname.replace(/\/$/,""),Dr=window.location.origin;function $r(t,e,n){if(t.startsWith("/assets")){const r=new URL(t,Dr);return r.pathname=r.pathname.replace(/^\/assets/,""),r.pathname=`${Ir}${rn}${gn}${xn}${r.pathname}`,r.searchParams.set("websiteId",e),r.searchParams.set("connectorId",n),`${decodeURIComponent(r.pathname)}${r.search}`}return console.warn("storedToDisplayed: path is not a stored path",t),t}function Rr(t){const e=`${Ir}${rn}${gn}${xn}`;if(t.startsWith(e)){const n=new URL(t,Dr);n.pathname=n.pathname.replace(new RegExp(`^${e}`),""),n.pathname=`${Ir}/assets${n.pathname}`,n.searchParams.delete("websiteId"),n.searchParams.delete("connectorId");const r="/"+n.toString().replace(new RegExp(`^${Dr}${Ir}`),"").replace(/^\//,"");return decodeURIComponent(r)}return console.warn("displayedToStored: path is not a displayed path",t),t}const Hr={transformPath(t,e){if(e===ke.ASSET)return Rr(t)},transformPermalink(t,e){if(e===ke.ASSET)return Rr(t)}};function Fr(t,e,n){const r=t.attributes?.src?{...t,attributes:{...t.attributes,src:$r(t.attributes.src,e,n)}}:t;return r.components&&(r.components=r.components.map((t=>Fr(t,e,n)))),r}function Vr(t){const e=t.attributes?.src?{...t,attributes:{...t.attributes,src:Rr(t.attributes.src)}}:t;return e.components&&(e.components=e.components.map((t=>Vr(t)))),e}const Ur="publish",Br="publish-login",zr="publish-logout";var Wr;function qr(t,e){t.PublicationManager=new Yr(t,e)}function Gr(t){switch(t){case je.IN_PROGRESS:return Wr.STATUS_PENDING;case je.ERROR:return Wr.STATUS_ERROR;case je.SUCCESS:return Wr.STATUS_SUCCESS}throw new Error(`Unknown job status ${t}`)}!function(t){t.STATUS_NONE="STATUS_NONE",t.STATUS_PENDING="STATUS_PENDING",t.STATUS_ERROR="STATUS_ERROR",t.STATUS_SUCCESS="STATUS_SUCCESS",t.STATUS_LOGGED_OUT="STATUS_AUTH_ERROR"}(Wr||(Wr={}));const Kr=window.location.origin+window.location.pathname.replace(/\/$/,"");class Yr{editor;dialog;_settings;get settings(){return this._settings}set settings(t){this._settings=t,this.dialog&&(this.dialog.settings=t)}options;job=null;status=Wr.STATUS_NONE;constructor(t,e){this.editor=t,this.options={appendTo:"options",...e},t.on("storage:start:store",(t=>{t.publication=this.settings})),t.on("storage:end:load",(t=>{this.settings=t.publication??{},De({type:Pe.HOSTING,connectorId:this.settings.connector?.connectorId}).then((t=>{})).catch((t=>{this.status=Wr.STATUS_LOGGED_OUT,this.settings={},this.dialog&&this.dialog.displayError("Please login",this.job,this.status)}))})),t.Commands.add(Ur,(()=>this.startPublication())),t.Commands.add(Br,((t,e,n)=>this.goLogin(n))),t.Commands.add(zr,(()=>this.goLogout())),this.options.appendTo?this.dialog=new xr(t,{appendTo:this.options.appendTo}):console.info("PublicationUi is disabled because no appendTo option is set")}async goLogin(t){if(t.isLoggedIn)return this.settings={...this.settings,connector:t},this.status=Wr.STATUS_NONE,this.editor.store(null),void(this.dialog&&this.dialog.displayPending(this.job,this.status));this.settings={},this.status=Wr.STATUS_LOGGED_OUT,this.dialog&&this.dialog.displayPending(this.job,this.status);const e=t.connectorId,n=t.type;return window.open(t.oauthUrl||`${Kr}${rn}${on}${cn}?connectorId=${e}&type=${n}`,"_blank"),new Promise((e=>{const n=async e=>{const r=e.data;"login"===r?.type&&(window.removeEventListener("message",n),r.error?(this.status=Wr.STATUS_LOGGED_OUT,this.settings={},this.dialog&&this.dialog.displayError(r.message,this.job,this.status)):(this.editor.trigger(Cr.PUBLISH_LOGIN_END),this.settings.connector=t,this.settings.options=r.options,this.status=Wr.STATUS_NONE,this.editor.store(null),this.dialog&&this.dialog.displayPending(this.job,this.status)))};window.addEventListener("message",n,!1)}))}async goLogout(){try{await $e({type:Pe.HOSTING,connectorId:this.settings.connector.connectorId}),this.settings={},this.dialog&&this.dialog.displayPending(this.job,this.status)}catch(t){console.error("logout error",t),this.status=Wr.STATUS_ERROR,this.dialog&&this.dialog.displayError(t.message,this.job,this.status)}}async startPublication(){if(this.status===Wr.STATUS_PENDING)throw new Error("Publication is already in progress");this.status=Wr.STATUS_PENDING,this.job=null,this.dialog&&this.dialog.displayPending(this.job,this.status),this.editor.trigger(Cr.PUBLISH_START);const t=this.editor.getModel().get("user");if(!t)throw new Error("User not logged in to a storage connector");if(!this.settings.connector?.connectorId)throw new Error("User not logged in to a hosting connector");const e=this.options.websiteId,n=t.storage.connectorId;this.setPublicationTransformers();const r=this.editor.getProjectData(),o=this.editor.getModel().get("settings"),i=(await this.getHtmlFiles(o)).flatMap((t=>[{path:t.htmlPath,content:t.html,type:ke.HTML},{path:t.cssPath,content:t.css,type:ke.CSS}])).concat(r.assets.map((t=>{const e=Nr(this.editor,t.src,ke.ASSET),n=Rr(t.src).replace(/^\/assets\//,"");return{...t,path:e,src:n,type:ke.ASSET}}))),a={...r,assets:r.assets.map((t=>({...t,src:Rr(t.src)}))),settings:o,publication:this.settings,files:i};this.resetPublicationTransformers(),function(t,e){const n=t.getModel().get("config");e.files=n.publicationTransformers.reduce(((t,n)=>t.map(((t,r)=>{try{return e.pages[r],n.transformFile?n.transformFile(t)??t:t}catch(e){return console.error("Publication transformer: error transforming file",t,e),t}}))),e.files)}(this.editor,a),this.editor.trigger(Cr.PUBLISH_DATA,a);try{const[t,r]=await Re({websiteId:e,hostingId:this.settings.connector.connectorId,storageId:n,data:a,options:this.settings.options});this.job=r,this.status=Gr(this.job.status),this.trackProgress()}catch(t){return console.error("publish error",t),401===t.code||401===t.httpStatusCode?(this.status=Wr.STATUS_LOGGED_OUT,this.settings={},this.dialog&&this.dialog.displayError("Please login.",this.job,this.status)):(this.status=Wr.STATUS_ERROR,this.dialog&&this.dialog.displayError(`An error occured, your site is not published. ${t.message}`,this.job,this.status)),this.editor.trigger(Cr.PUBLISH_ERROR,{success:!1,message:t.message}),void this.editor.trigger(Cr.PUBLISH_END,{success:!1,message:t.message})}}async getHtmlFiles(t){return this.editor.Pages.getAll().map((e=>{const n=e.get("settings");function r(e){return(n||{})[e]||(t||[])[e]||""}const o=e.getMainComponent(),i=vr(e.get("name")),a=`/css/${i}.css`,s=`/${i}.html`,l=Lr(this.editor,a,ke.CSS,Ae.HTML),c=Nr(this.editor,a,ke.CSS),u=Nr(this.editor,s,ke.HTML),p=this.editor.getHtml({component:o});return{html:`<!DOCTYPE html>\n<html lang="${r("lang")}">\n<head>\n<meta charset="UTF-8">\n<link rel="stylesheet" href="${l}" />\n${t?.head||""}\n${n?.head||""}\n<title>${r("title")}</title>\n<link rel="icon" href="${r("favicon")}" />\n${["description","og:title","og:description","og:image"].map((t=>`<meta name="${t}" property="${t}" content="${r(t)}"/>`)).join("\n")}\n</head>\n${p}\n</html>`,css:this.editor.getCss({component:o}),cssPath:c,htmlPath:u}}))}async trackProgress(){try{this.job=await He({jobId:this.job.jobId}),this.status=Gr(this.job.status)}catch(t){return this.status=Wr.STATUS_ERROR,this.dialog&&this.dialog.displayError(`An error occured, your site is not published. ${t.message}`,this.job,this.status),this.editor.trigger(Cr.PUBLISH_END,{success:!1,message:t.message}),void this.editor.trigger(Cr.PUBLISH_ERROR,{success:!1,message:t.message})}this.job.status===je.IN_PROGRESS?setTimeout((()=>this.trackProgress()),2e3):this.editor.trigger(Cr.PUBLISH_END,{success:this.job.status===je.SUCCESS,message:this.job.message}),this.dialog&&this.dialog.displayPending(this.job,this.status)}setPublicationTransformers(){!function(t){const e=t.getModel().get("config");Sr(t,(n=>{if(n.get(Or))console.warn("Publication transformer: HTML transform already altered",n);else{const r=n.toHTML.bind(n);n[Or]=n.toHTML;const o=n.getStyle.bind(n);n[kr]=n.getStyle;const i=n.get("attributes").href;if(i?.startsWith("./")&&(n[Ar]=i,n.set("attributes",{...n.get("attributes"),href:Lr(t,i,ke.HTML,Ae.HTML)})),n.get("attributes").src){n[Tr]=n.get("attributes").src;const e=Lr(t,n.get("attributes").src,ke.ASSET,Ae.HTML);n.set("attributes",{...n.get("attributes"),src:e})}if(n.get("src")){n[Er]=n.get("src");const e=Lr(t,n.get("src"),ke.ASSET,Ae.HTML);n.set("src",e)}n.toHTML=()=>e.publicationTransformers.reduce(((t,e)=>{try{return e.renderComponent?e.renderComponent(n,(()=>t))??t:t}catch(e){return console.error("Publication transformer: error rendering component",n,e),t}}),r()),n.getStyle=()=>Mr(t,o())}}))}(this.editor),function(t){const e=t.getModel().get("config");t.Css.getAll().forEach((n=>{if(n[Pr])console.warn("Publication transformer: CSS transform already altered",n);else{const r=n.getStyle.bind(n);n[Pr]=n.getStyle,n.getStyle=()=>{try{const n=Mr(t,r()),o=e.publicationTransformers.reduce(((t,e)=>({...e.renderCssRule?e.renderCssRule(t,(()=>n))??t:t})),n);return o}catch(t){return console.error("Publication transformer: error rendering style",n,t),r()}}}}))}(this.editor)}resetPublicationTransformers(){!function(t){Sr(t,(t=>{t[Or]&&(t.toHTML=t[Or],delete t[Or]),t[kr]&&(t.getStyle=t[kr],delete t[kr]),t[Tr]&&(t.set("attributes",{...t.get("attributes"),src:t[Tr]}),delete t[Tr]),t[Er]&&(t.set("src",t[Er]),delete t[Er]),t[Ar]&&(t.set("attributes",{...t.get("attributes"),href:t[Ar]}),delete t[Ar])}))}(this.editor),function(t){t.Css.getAll().forEach((t=>{t[Pr]&&(t.getStyle=t[Pr],delete t[Pr])}))}(this.editor)}}const Xr=[{name:"./project-bar",value:nr},{name:"grapesjs-style-bg",value:zn()},{name:"./settings",value:(t,e)=>{try{sr="3.0.0-alpha.123"}catch(t){}console.info("Silex version:",sr),t.Commands.add(ar,{run:(e,n,{page:r})=>{ir=t.Modal.open({title:r?"Page settings":"Site Settings",content:"",attributes:{class:"settings-dialog"}}).onceClose((()=>{n?.set&&n.set("active",0),t.stopCommand(ar)})),function(t,e,n=t.getModel()){const r=n.get("settings")||{};n.set("settings",r),qt(Et`
|
|
232
232
|
<p>The page settings will override site settings, <a href="https://github.com/silexlabs/Silex/wiki/Settings" target="_blank">more info about settings here</a>.</p>
|
|
233
233
|
<form class="silex-form">
|
|
234
234
|
<h2>General settings</h2>
|
|
@@ -318,6 +318,7 @@ export class PublicationManager {
|
|
|
318
318
|
html: `<!DOCTYPE html>
|
|
319
319
|
<html lang="${getSetting('lang')}">
|
|
320
320
|
<head>
|
|
321
|
+
<meta charset="UTF-8">
|
|
321
322
|
<link rel="stylesheet" href="${cssPermalink}" />
|
|
322
323
|
${siteSettings?.head || ''}
|
|
323
324
|
${pageSettings?.head || ''}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublicationManager.js","sourceRoot":"","sources":["../../../../../src/ts/client/grapesjs/PublicationManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAsG,kBAAkB,EAAiB,aAAa,EAAiB,SAAS,EAAE,SAAS,EAAkH,MAAM,aAAa,CAAA;AAEvU,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,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AO,EAAE,CAAC,CAAA;YACtF,OAAM;SACP;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,WAAW,EAAE;YAC7C,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,CAAC,CAAA;SAC7C;aAAM;YACL,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;SAC5H;QACD,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;IAClE,CAAC;IAEO,0BAA0B;QAChC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC7B,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC7B,CAAC;IAEO,4BAA4B;QAClC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAClC,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAClC,CAAC;CACF"}
|
|
@@ -48,7 +48,7 @@ class ServerConfig extends silex_plugins_1.Config {
|
|
|
48
48
|
port = process.env.SILEX_PORT;
|
|
49
49
|
debug = process.env.SILEX_DEBUG === 'true';
|
|
50
50
|
url = process.env.SILEX_URL?.replace(/\/$/, '') ?? `${process.env.SILEX_PROTOCOL}://${process.env.SILEX_HOST}:${process.env.SILEX_PORT}`;
|
|
51
|
-
userConfigPath = process.env.
|
|
51
|
+
userConfigPath = process.env.SILEX_SERVER_CONFIG;
|
|
52
52
|
configFilePath = (0, path_1.resolve)(__dirname, '../../../.silex.js');
|
|
53
53
|
// All connectors or just the storage or hosting connectors
|
|
54
54
|
getConnectors(type = null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/ts/server/config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH;;;GAGG;AAEH;;GAEG;AAEH,4DAAyD;AACzD,+BAA8B;AAC9B,4CAAsD;AAEtD,0CAAsC;AACtC,wDAA6F;AAC7F,sDAAkD;AAElD,oCAAwC;AACxC,sDAAkD;AAClD,2BAA2B;AAE3B;;GAEG;AACH,MAAa,YAAa,SAAQ,sBAAM;IAC/B,cAAc,GAAG;QACtB,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB;QAC/C,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB;QAC/C,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,8BAA8B;QAC3D,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB;QAC3C,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB;QAC/C,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;KACjC,CAAA;IACM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAA;IAC7B,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,MAAM,CAAA;IAC1C,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,MAAM,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,CAAA;IACxI,cAAc,GAAuB,OAAO,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/ts/server/config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH;;;GAGG;AAEH;;GAEG;AAEH,4DAAyD;AACzD,+BAA8B;AAC9B,4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AClC,IAAI,CAAC,mBAAmB,CAAC,IAAI,qBAAS,CAAC,IAAI,EAAE;gBAC3C,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,IAAA,WAAM,GAAE,GAAG,oBAAoB;aAC3E,CAAC,CAAC,CAAA;SACJ;IACH,CAAC;CACF;AApJD,oCAoJC"}
|
|
@@ -11,12 +11,12 @@ const options = (0, cli_1.parse)({
|
|
|
11
11
|
'host': ['', 'Sets the host param of the express module "cookie-session".', 'string'],
|
|
12
12
|
'port': ['p', 'Port to listen to', 'int'],
|
|
13
13
|
'protocol': ['', 'Sets the protocol param of the express module "cookie-session".', 'string'],
|
|
14
|
-
'config': ['
|
|
15
|
-
'client-config': ['', 'Path to client config file to be served on .silex-client.js', '
|
|
14
|
+
'server-config': ['s', 'Path for the server side config file to load at startup', 'file'],
|
|
15
|
+
'client-config': ['c', 'Path to client config file to be served on .silex-client.js', 'file'],
|
|
16
16
|
'fs-root': ['', 'Path to the root folder where to store websites. Used by the default storage connector (fs).', 'string'],
|
|
17
17
|
'fs-hosting-root': ['', 'Path to the root folder where to publish websites. Used by the default hosting connector (fs).', 'string'],
|
|
18
18
|
'session-name': ['', 'Sets the name param of the express module "cookie-session".', 'string'],
|
|
19
|
-
'session-secret': ['
|
|
19
|
+
'session-secret': ['', 'Session secret', 'string'],
|
|
20
20
|
'ssl-port': [false, 'Port to listen to for SSL/HTTPS', 'int'],
|
|
21
21
|
'force-https': [false, 'Force HTTPS', 'boolean'],
|
|
22
22
|
'ssl-private-key': [false, 'Path to private key for SSL', 'file'],
|
|
@@ -36,8 +36,8 @@ if (options.port)
|
|
|
36
36
|
process.env.SILEX_PORT = options.port;
|
|
37
37
|
if (options['protocol'])
|
|
38
38
|
process.env.SILEX_PROTOCOL = options['protocol'];
|
|
39
|
-
if (options
|
|
40
|
-
process.env.
|
|
39
|
+
if (options['server-config'])
|
|
40
|
+
process.env.SILEX_SERVER_CONFIG = options['server-config'];
|
|
41
41
|
if (options['client-config'])
|
|
42
42
|
process.env.SILEX_CLIENT_CONFIG = options['client-config'];
|
|
43
43
|
if (options['fs-root'])
|
|
@@ -22,7 +22,7 @@ class ServerConfig extends silex_plugins_1.Config {
|
|
|
22
22
|
port = process.env.SILEX_PORT;
|
|
23
23
|
debug = process.env.SILEX_DEBUG === 'true';
|
|
24
24
|
url = process.env.SILEX_URL?.replace(/\/$/, '') ?? `${process.env.SILEX_PROTOCOL}://${process.env.SILEX_HOST}:${process.env.SILEX_PORT}`;
|
|
25
|
-
userConfigPath = process.env.
|
|
25
|
+
userConfigPath = process.env.SILEX_SERVER_CONFIG;
|
|
26
26
|
configFilePath = (0, path_1.resolve)(__dirname, '../../../.silex.js');
|
|
27
27
|
getConnectors(type = null) {
|
|
28
28
|
if (!type) {
|
package/package.json
CHANGED
|
@@ -331,6 +331,7 @@ export class PublicationManager {
|
|
|
331
331
|
html: `<!DOCTYPE html>
|
|
332
332
|
<html lang="${getSetting('lang')}">
|
|
333
333
|
<head>
|
|
334
|
+
<meta charset="UTF-8">
|
|
334
335
|
<link rel="stylesheet" href="${cssPermalink}" />
|
|
335
336
|
${siteSettings?.head || ''}
|
|
336
337
|
${pageSettings?.head || ''}
|
package/src/ts/server/cli.ts
CHANGED
|
@@ -25,12 +25,12 @@ const options = parse({
|
|
|
25
25
|
'host': ['', 'Sets the host param of the express module "cookie-session".', 'string'],
|
|
26
26
|
'port': [ 'p', 'Port to listen to', 'int'],
|
|
27
27
|
'protocol': ['', 'Sets the protocol param of the express module "cookie-session".', 'string'],
|
|
28
|
-
'config': [ '
|
|
29
|
-
'client-config': ['', 'Path to client config file to be served on .silex-client.js', '
|
|
28
|
+
'server-config': [ 's', 'Path for the server side config file to load at startup', 'file'],
|
|
29
|
+
'client-config': ['c', 'Path to client config file to be served on .silex-client.js', 'file'],
|
|
30
30
|
'fs-root': ['', 'Path to the root folder where to store websites. Used by the default storage connector (fs).', 'string'],
|
|
31
31
|
'fs-hosting-root': ['', 'Path to the root folder where to publish websites. Used by the default hosting connector (fs).', 'string'],
|
|
32
32
|
'session-name': ['', 'Sets the name param of the express module "cookie-session".', 'string'],
|
|
33
|
-
'session-secret': ['
|
|
33
|
+
'session-secret': ['', 'Session secret', 'string'],
|
|
34
34
|
'ssl-port': [ false, 'Port to listen to for SSL/HTTPS', 'int'],
|
|
35
35
|
'force-https': [ false, 'Force HTTPS', 'boolean'],
|
|
36
36
|
'ssl-private-key': [ false, 'Path to private key for SSL', 'file'],
|
|
@@ -47,7 +47,7 @@ if(options['url']) process.env.SILEX_URL = options['url']
|
|
|
47
47
|
if(options['host']) process.env.SILEX_HOST = options['host']
|
|
48
48
|
if(options.port) process.env.SILEX_PORT = options.port
|
|
49
49
|
if(options['protocol']) process.env.SILEX_PROTOCOL = options['protocol']
|
|
50
|
-
if(options
|
|
50
|
+
if(options['server-config']) process.env.SILEX_SERVER_CONFIG = options['server-config']
|
|
51
51
|
if(options['client-config']) process.env.SILEX_CLIENT_CONFIG = options['client-config']
|
|
52
52
|
if(options['fs-root']) process.env.SILEX_FS_ROOT = options['fs-root']
|
|
53
53
|
if(options['fs-hosting-root']) process.env.SILEX_FS_HOSTING_ROOT = options['fs-hosting-root']
|
package/src/ts/server/config.ts
CHANGED
|
@@ -51,7 +51,7 @@ export class ServerConfig extends Config {
|
|
|
51
51
|
public port = process.env.SILEX_PORT
|
|
52
52
|
public debug = process.env.SILEX_DEBUG === 'true'
|
|
53
53
|
public url = process.env.SILEX_URL?.replace(/\/$/, '') ?? `${process.env.SILEX_PROTOCOL}://${process.env.SILEX_HOST}:${process.env.SILEX_PORT}`
|
|
54
|
-
public userConfigPath: Plugin | undefined = process.env.
|
|
54
|
+
public userConfigPath: Plugin | undefined = process.env.SILEX_SERVER_CONFIG
|
|
55
55
|
public configFilePath: Plugin = resolve(__dirname, '../../../.silex.js')
|
|
56
56
|
|
|
57
57
|
// All connectors or just the storage or hosting connectors
|