@silexlabs/silex 3.0.10-5 → 3.0.10-7
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/js/main.js +1 -1
- package/dist/client/silex-lib/src/ts/types.d.ts +2 -0
- package/dist/client/types.d.ts +2 -0
- package/dist/plugins/client/types.d.ts +2 -0
- package/dist/plugins/server/plugins/server/GitlabConnector.d.ts +21 -2
- package/dist/plugins/server/plugins/server/GitlabConnector.js +361 -173
- package/dist/plugins/server/plugins/server/GitlabConnector.js.map +1 -1
- package/dist/plugins/server/plugins/server/GitlabHostingConnector.js +63 -8
- package/dist/plugins/server/plugins/server/GitlabHostingConnector.js.map +1 -1
- package/dist/plugins/server/types.d.ts +2 -0
- package/dist/server/server/cli.js +0 -0
- package/package.json +6 -6
- package/src/ts/plugins/server/GitlabConnector.ts +378 -176
- package/src/ts/plugins/server/GitlabHostingConnector.ts +66 -8
- package/src/ts/types.ts +2 -0
package/dist/client/types.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ interface GitlabAction {
|
|
|
33
33
|
file_path?: string;
|
|
34
34
|
content?: string;
|
|
35
35
|
commit_id?: string;
|
|
36
|
+
encoding?: 'base64' | 'text';
|
|
36
37
|
}
|
|
37
38
|
interface GitlabWriteFile {
|
|
38
39
|
branch: string;
|
|
@@ -70,6 +71,7 @@ interface GitlabFetchCommits {
|
|
|
70
71
|
ref_name: string;
|
|
71
72
|
since: string;
|
|
72
73
|
}
|
|
74
|
+
export declare function computeGitBlobSha(content: string, binary: boolean): string;
|
|
73
75
|
export default class GitlabConnector implements StorageConnector {
|
|
74
76
|
private config;
|
|
75
77
|
connectorId: string;
|
|
@@ -89,7 +91,14 @@ export default class GitlabConnector implements StorageConnector {
|
|
|
89
91
|
/**
|
|
90
92
|
* Call the Gitlab API with the user's token and handle errors
|
|
91
93
|
*/
|
|
92
|
-
callApi(session
|
|
94
|
+
callApi({ session, path, method, requestBody, params, responseHeaders, }: {
|
|
95
|
+
session: GitlabSession;
|
|
96
|
+
path: string;
|
|
97
|
+
method?: 'POST' | 'GET' | 'PUT' | 'DELETE';
|
|
98
|
+
requestBody?: GitlabWriteFile | GitlabGetToken | GitlabWebsiteName | GitlabCreateBranch | GitlabGetTags | GitlabCreateTag | GitlabFetchCommits | null;
|
|
99
|
+
params?: any;
|
|
100
|
+
responseHeaders?: any;
|
|
101
|
+
}): Promise<any>;
|
|
93
102
|
downloadRawFile(session: GitlabSession, projectId: string, filePath: string): Promise<Buffer>;
|
|
94
103
|
private generateCodeVerifier;
|
|
95
104
|
private generateCodeChallenge;
|
|
@@ -138,8 +147,18 @@ export default class GitlabConnector implements StorageConnector {
|
|
|
138
147
|
duplicateWebsite(session: GitlabSession, websiteId: string): Promise<void>;
|
|
139
148
|
getWebsiteMeta(session: GitlabSession, websiteId: WebsiteId): Promise<WebsiteMeta>;
|
|
140
149
|
setWebsiteMeta(session: GitlabSession, websiteId: WebsiteId, websiteMeta: WebsiteMetaFileContent): Promise<void>;
|
|
141
|
-
writeAssets(session: GitlabSession, websiteId: string, files: ConnectorFile[], status?: StatusCallback): Promise<void>;
|
|
150
|
+
writeAssets(session: GitlabSession, websiteId: string, files: ConnectorFile[], status?: StatusCallback, removeUnlisted?: boolean): Promise<void>;
|
|
142
151
|
readAsset(session: GitlabSession, websiteId: string, fileName: string): Promise<ConnectorFileContent>;
|
|
143
152
|
deleteAssets(session: GitlabSession, websiteId: string, fileNames: string[]): Promise<void>;
|
|
153
|
+
/**
|
|
154
|
+
* List all the files in a folder
|
|
155
|
+
* The result is a map of file paths to their SHA
|
|
156
|
+
*/
|
|
157
|
+
protected ls({ session, websiteId, recursive, path, }: {
|
|
158
|
+
session: GitlabSession;
|
|
159
|
+
websiteId: string;
|
|
160
|
+
recursive?: boolean;
|
|
161
|
+
path?: string;
|
|
162
|
+
}): Promise<Map<string, string>>;
|
|
144
163
|
}
|
|
145
164
|
export {};
|