@silexlabs/silex 3.0.6 → 3.0.8
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/dist/client/client/grapesjs/upload-progress.d.ts +2 -0
- package/dist/client/constants.d.ts +1 -0
- package/dist/client/js/main.js +107 -110
- package/dist/client/silex-lib/src/ts/client/grapesjs/upload-progress.d.ts +2 -0
- package/dist/client/silex-lib/src/ts/constants.d.ts +1 -0
- package/dist/plugins/server/constants.d.ts +1 -0
- package/dist/plugins/server/constants.js +2 -1
- package/dist/plugins/server/constants.js.map +1 -1
- package/dist/plugins/server/page.d.ts +2 -0
- package/dist/plugins/server/page.js +35 -0
- package/dist/plugins/server/page.js.map +1 -0
- package/dist/plugins/server/plugins/server/GitlabConnector.d.ts +17 -7
- package/dist/plugins/server/plugins/server/GitlabConnector.js +255 -114
- package/dist/plugins/server/plugins/server/GitlabConnector.js.map +1 -1
- package/dist/plugins/server/plugins/server/GitlabHostingConnector.js +6 -0
- package/dist/plugins/server/plugins/server/GitlabHostingConnector.js.map +1 -1
- package/dist/server/constants.js +2 -1
- package/dist/server/server/api/publicationApi.js +2 -2
- package/package.json +1 -1
- package/src/ts/client/grapesjs/PublicationUi.ts +20 -23
- package/src/ts/client/grapesjs/index.ts +2 -0
- package/src/ts/client/grapesjs/storage.ts +8 -2
- package/src/ts/client/grapesjs/upload-progress.ts +48 -0
- package/src/ts/constants.ts +1 -0
- package/src/ts/plugins/server/GitlabConnector.ts +326 -140
- package/src/ts/plugins/server/GitlabHostingConnector.ts +6 -0
- package/src/ts/server/api/publicationApi.ts +2 -2
|
@@ -73,13 +73,19 @@ export default class GitlabHostingConnector extends GitlabConnector implements H
|
|
|
73
73
|
- if: '$CI_PIPELINE_SOURCE == "trigger"'
|
|
74
74
|
`
|
|
75
75
|
try {
|
|
76
|
+
job.message = `Checking if ${pathYml} needs to be created or updated...`
|
|
77
|
+
job.logs[0].push(job.message)
|
|
76
78
|
const originalCi = await this.readFile(session, websiteId, pathYml)
|
|
77
79
|
if(originalCi.toString().startsWith(SILEX_OVERWRITE_NOTICE)) {
|
|
80
|
+
job.message = `Updating ${pathYml}...`
|
|
81
|
+
job.logs[0].push(job.message)
|
|
78
82
|
await this.updateFile(session, websiteId, pathYml, contentYml)
|
|
79
83
|
}
|
|
80
84
|
} catch (e) {
|
|
81
85
|
// If the file .gitlab-ci.yml does not exist, create it, otherwise do nothing (do not overwriting existing one)
|
|
82
86
|
if (e.statusCode === 404 || e.httpStatusCode === 404 || e.message.endsWith('A file with this name doesn\'t exist')) {
|
|
87
|
+
job.message = `Creating ${pathYml}...`
|
|
88
|
+
job.logs[0].push(job.message)
|
|
83
89
|
await this.createFile(session, websiteId, pathYml, contentYml)
|
|
84
90
|
} else {
|
|
85
91
|
jobError(job.jobId, e.message)
|
|
@@ -127,12 +127,12 @@ export default function (config: ServerConfig): Router {
|
|
|
127
127
|
const fileWithContent = file as ClientSideFileWithContent
|
|
128
128
|
const fileWithSrc = file as ClientSideFileWithSrc
|
|
129
129
|
if(!fileWithContent.content && !fileWithSrc.src) throw new PublicationError('Missing content or src in file', 400)
|
|
130
|
-
const
|
|
130
|
+
const content = fileWithContent.content ?? await storage.readAsset(session, websiteId, fileWithSrc.src)
|
|
131
131
|
return {
|
|
132
132
|
// Destination
|
|
133
133
|
path: file.permalink ?? file.path,
|
|
134
134
|
// Content
|
|
135
|
-
content
|
|
135
|
+
content,
|
|
136
136
|
}
|
|
137
137
|
}))
|
|
138
138
|
|