@silexlabs/silex 3.0.10-7 → 3.1.0

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 (47) hide show
  1. package/dist/client/js/main.js +1 -1
  2. package/dist/client/js/main.js.LICENSE.txt +2 -2
  3. package/dist/server/server/cli.js +0 -0
  4. package/package.json +11 -11
  5. package/dist/client/grapesjs-filter-styles/dist/index.d.ts +0 -4
  6. package/dist/client/grapesjs-fonts/dist/index.d.ts +0 -4
  7. package/dist/client/grapesjs-fonts/src/commands.d.ts +0 -3
  8. package/dist/client/grapesjs-fonts/src/fonts.d.ts +0 -4
  9. package/dist/client/grapesjs-storage-rate-limit/dist/index.d.ts +0 -4
  10. package/dist/client/grapesjs-ui-suggest-classes/dist/index.d.ts +0 -4
  11. package/dist/client/silex-lib/src/ts/client/api.d.ts +0 -90
  12. package/dist/client/silex-lib/src/ts/client/assetUrl.d.ts +0 -46
  13. package/dist/client/silex-lib/src/ts/client/config.d.ts +0 -102
  14. package/dist/client/silex-lib/src/ts/client/events.d.ts +0 -23
  15. package/dist/client/silex-lib/src/ts/client/expose.d.ts +0 -8
  16. package/dist/client/silex-lib/src/ts/client/grapesjs/LoginDialog.d.ts +0 -15
  17. package/dist/client/silex-lib/src/ts/client/grapesjs/PublicationManager.d.ts +0 -74
  18. package/dist/client/silex-lib/src/ts/client/grapesjs/PublicationUi.d.ts +0 -59
  19. package/dist/client/silex-lib/src/ts/client/grapesjs/blocks.d.ts +0 -1
  20. package/dist/client/silex-lib/src/ts/client/grapesjs/breadcrumbs.d.ts +0 -1
  21. package/dist/client/silex-lib/src/ts/client/grapesjs/css-props.d.ts +0 -6
  22. package/dist/client/silex-lib/src/ts/client/grapesjs/footer.d.ts +0 -2
  23. package/dist/client/silex-lib/src/ts/client/grapesjs/img.d.ts +0 -6
  24. package/dist/client/silex-lib/src/ts/client/grapesjs/index.d.ts +0 -9
  25. package/dist/client/silex-lib/src/ts/client/grapesjs/internal-links.d.ts +0 -1
  26. package/dist/client/silex-lib/src/ts/client/grapesjs/keymaps.d.ts +0 -123
  27. package/dist/client/silex-lib/src/ts/client/grapesjs/new-page-dialog.d.ts +0 -2
  28. package/dist/client/silex-lib/src/ts/client/grapesjs/openImport.d.ts +0 -9
  29. package/dist/client/silex-lib/src/ts/client/grapesjs/page-panel.d.ts +0 -9
  30. package/dist/client/silex-lib/src/ts/client/grapesjs/project-bar.d.ts +0 -21
  31. package/dist/client/silex-lib/src/ts/client/grapesjs/resize-panel.d.ts +0 -1
  32. package/dist/client/silex-lib/src/ts/client/grapesjs/rich-text.d.ts +0 -4
  33. package/dist/client/silex-lib/src/ts/client/grapesjs/semantic.d.ts +0 -1
  34. package/dist/client/silex-lib/src/ts/client/grapesjs/settings-sections.d.ts +0 -16
  35. package/dist/client/silex-lib/src/ts/client/grapesjs/settings.d.ts +0 -4
  36. package/dist/client/silex-lib/src/ts/client/grapesjs/storage.d.ts +0 -3
  37. package/dist/client/silex-lib/src/ts/client/grapesjs/symbolDialogs.d.ts +0 -3
  38. package/dist/client/silex-lib/src/ts/client/grapesjs/upload-progress.d.ts +0 -2
  39. package/dist/client/silex-lib/src/ts/client/grapesjs/view-buttons.d.ts +0 -1
  40. package/dist/client/silex-lib/src/ts/client/index.d.ts +0 -10
  41. package/dist/client/silex-lib/src/ts/client/publication-transformers.d.ts +0 -42
  42. package/dist/client/silex-lib/src/ts/client/publish-custom-code-block.d.ts +0 -4
  43. package/dist/client/silex-lib/src/ts/client/publish-fonts.d.ts +0 -4
  44. package/dist/client/silex-lib/src/ts/client/utils.d.ts +0 -22
  45. package/dist/client/silex-lib/src/ts/constants.d.ts +0 -33
  46. package/dist/client/silex-lib/src/ts/page.d.ts +0 -2
  47. package/dist/client/silex-lib/src/ts/types.d.ts +0 -341
@@ -1,123 +0,0 @@
1
- import { Editor, PluginOptions } from 'grapesjs';
2
- /**
3
- * Opens the Publish dialog and publishes the website.
4
- * @param editor The editor.
5
- */
6
- declare function publish(editor: Editor): void;
7
- /**
8
- * Escapes the current context in this order : modal, Publish dialog, left panel.
9
- * If none of these are open, it selects the body.
10
- * @param editor The editor.
11
- */
12
- declare function escapeContext(editor: Editor): void;
13
- export declare const cmdSelectBody = "select-body";
14
- export declare let prefixKey: string;
15
- export declare const defaultKms: {
16
- kmOpenSettings: {
17
- id: string;
18
- keys: string;
19
- handler: (editor: any) => void;
20
- };
21
- kmOpenPublish: {
22
- id: string;
23
- keys: string;
24
- handler: (editor: any) => void;
25
- };
26
- kmOpenFonts: {
27
- id: string;
28
- keys: string;
29
- handler: (editor: any) => void;
30
- };
31
- kmPreviewMode: {
32
- id: string;
33
- keys: string;
34
- handler: (editor: any) => void;
35
- };
36
- kmLayers: {
37
- id: string;
38
- keys: string;
39
- handler: (editor: any) => void;
40
- };
41
- kmBlocks: {
42
- id: string;
43
- keys: string;
44
- handler: (editor: any) => void;
45
- };
46
- kmNotifications: {
47
- id: string;
48
- keys: string;
49
- handler: (editor: any) => void;
50
- };
51
- kmPages: {
52
- id: string;
53
- keys: string;
54
- handler: (editor: any) => void;
55
- };
56
- kmSymbols: {
57
- id: string;
58
- keys: string;
59
- handler: (editor: any) => void;
60
- };
61
- kmStyleManager: {
62
- id: string;
63
- keys: string;
64
- handler: (editor: any) => void;
65
- };
66
- kmTraitsManager: {
67
- id: string;
68
- keys: string;
69
- handler: (editor: any) => void;
70
- };
71
- kmClosePanel: {
72
- id: string;
73
- keys: string;
74
- handler: typeof escapeContext;
75
- };
76
- kmSelectBody: {
77
- id: string;
78
- keys: string;
79
- handler: string;
80
- };
81
- kmDuplicateSelection: {
82
- id: string;
83
- keys: string;
84
- handler: string;
85
- };
86
- kmPublish: {
87
- id: string;
88
- keys: string;
89
- handler: typeof publish;
90
- };
91
- kmAddPage: {
92
- id: string;
93
- keys: string;
94
- handler: string;
95
- };
96
- kmRemovePage: {
97
- id: string;
98
- keys: string;
99
- handler: string;
100
- };
101
- kmClonePage: {
102
- id: string;
103
- keys: string;
104
- handler: string;
105
- };
106
- kmSelectNextPage: {
107
- id: string;
108
- keys: string;
109
- handler: string;
110
- };
111
- kmSelectPrevPage: {
112
- id: string;
113
- keys: string;
114
- handler: string;
115
- };
116
- kmSelectFirstPage: {
117
- id: string;
118
- keys: string;
119
- handler: string;
120
- };
121
- };
122
- export declare function keymapsPlugin(editor: Editor, opts: PluginOptions): void;
123
- export {};
@@ -1,2 +0,0 @@
1
- export declare const cmdOpenNewPageDialog = "new-page-dialog";
2
- export declare const newPageDialog: (editor: any, opts: any) => void;
@@ -1,9 +0,0 @@
1
- /**
2
- * @fileoverview Import feature
3
- * Let the user import HTML code when she creates a new page
4
- *
5
- */
6
- export default function openImport(editor: any, config: any): {
7
- run(_: any): void;
8
- stop(): void;
9
- };
@@ -1,9 +0,0 @@
1
- import { Editor } from 'grapesjs';
2
- export declare const cmdTogglePages = "pages:open-panel";
3
- export declare const cmdAddPage = "pages:add";
4
- export declare const cmdRemovePage = "pages:remove";
5
- export declare const cmdClonePage = "pages:clone";
6
- export declare const cmdSelectNextPage = "pages:select-next";
7
- export declare const cmdSelectPrevPage = "pages:select-prev";
8
- export declare const cmdSelectFirstPage = "pages:select-first";
9
- export declare const pagePanelPlugin: (editor: Editor, opts: any) => void;
@@ -1,21 +0,0 @@
1
- import { Editor } from 'grapesjs';
2
- export declare const PROJECT_BAR_PANEL_ID = "project-bar-panel";
3
- export declare const containerPanelId = "project-bar-container";
4
- export interface PanelObject {
5
- command: string | ((editor: Editor) => void);
6
- text: string;
7
- className: string;
8
- name?: string;
9
- attributes: {
10
- title?: string;
11
- containerClassName?: string;
12
- };
13
- buttons?: {
14
- command: string;
15
- text: string;
16
- className: string;
17
- }[];
18
- onClick?: (editor: Editor) => void;
19
- }
20
- export declare const projectBarPlugin: (editor: any, opts: any) => void;
21
- export declare function addButton(editor: Editor, panel: PanelObject): void;
@@ -1 +0,0 @@
1
- export default function (editor: any): void;
@@ -1,4 +0,0 @@
1
- import { RichTextEditorAction } from 'grapesjs';
2
- export declare const orderedList: RichTextEditorAction;
3
- export declare const unorderedList: RichTextEditorAction;
4
- export declare const richTextPlugin: (editor: any, opts: any) => void;
@@ -1 +0,0 @@
1
- export declare const semanticPlugin: (editor: any, opts: any) => void;
@@ -1,16 +0,0 @@
1
- import { TemplateResult } from 'lit-html';
2
- import { WebsiteSettings } from '../../types';
3
- export declare const idCodeWrapper = "settings-head-wrapper";
4
- export declare function isSite(model: any): boolean;
5
- export interface SettingsSection {
6
- id: string;
7
- label: string;
8
- render: (settings: WebsiteSettings, model: Backbone.Model) => TemplateResult;
9
- }
10
- /**
11
- * This is the settings dialog default sections
12
- * Each section has an entry in the sidebar
13
- * Each section render as part of the settings form
14
- * The form is submitted to save the settings with all FormData
15
- */
16
- export declare const defaultSections: SettingsSection[];
@@ -1,4 +0,0 @@
1
- export declare const cmdOpenSettings = "open-settings";
2
- export declare const settingsDialog: (editor: any, opts: any) => void;
3
- export declare function addSection(section: any, siteOrPage: 'site' | 'page', position: 'first' | 'last' | number): void;
4
- export declare function removeSection(id: any, siteOrPage: 'site' | 'page'): void;
@@ -1,3 +0,0 @@
1
- import { PublishableEditor } from './PublicationManager';
2
- export declare const cmdPauseAutoSave = "pause-auto-save";
3
- export declare const storagePlugin: (editor: PublishableEditor) => void;
@@ -1,3 +0,0 @@
1
- export declare const cmdPromptAddSymbol = "symbol-prompt-add";
2
- declare const _default: (editor: any, opts: any) => void;
3
- export default _default;
@@ -1,2 +0,0 @@
1
- import { Editor } from 'grapesjs';
2
- export default function pluginUploadProgress(editor: Editor): void;
@@ -1 +0,0 @@
1
- export default function (editor: any): void;
@@ -1,10 +0,0 @@
1
- import { ClientConfig } from './config';
2
- export * from './expose';
3
- /**
4
- * Expose the config object
5
- */
6
- export declare let config: ClientConfig;
7
- /**
8
- * Start Silex, called from host HTML page with window.silex.start()
9
- */
10
- export declare function start(options?: {}): Promise<void>;
@@ -1,42 +0,0 @@
1
- import { Component, CssRule, StyleProps, Editor } from 'grapesjs';
2
- import { ClientSideFile, ClientSideFileType, Initiator, PublicationData } from '../types';
3
- /**
4
- * Interface for publication transformers
5
- * They are added to the config object with config.addPublicationTransformer()
6
- */
7
- export interface PublicationTransformer {
8
- renderComponent?(component: Component, toHtml: () => string): string | undefined;
9
- renderCssRule?(rule: CssRule, initialRule: () => StyleProps): StyleProps | undefined;
10
- transformFile?(file: ClientSideFile): ClientSideFile;
11
- transformPermalink?(link: string, type: ClientSideFileType, initiator: Initiator): string;
12
- transformPath?(path: string, type: ClientSideFileType): string;
13
- }
14
- export declare const publicationTransformerDefault: PublicationTransformer;
15
- export declare function validatePublicationTransformer(transformer: PublicationTransformer): void;
16
- /**
17
- * Alter the components rendering
18
- * Exported for unit tests
19
- */
20
- export declare function renderComponents(editor: Editor): void;
21
- /**
22
- * Alter the styles rendering
23
- * Exported for unit tests
24
- */
25
- export declare function renderCssRules(editor: Editor): void;
26
- /**
27
- * Transform background image url according to the transformed path of assets
28
- */
29
- export declare function transformBgImage(editor: Editor, style: StyleProps): StyleProps;
30
- /**
31
- * Transform files
32
- * Exported for unit tests
33
- */
34
- export declare function transformFiles(editor: Editor, data: PublicationData): void;
35
- /**
36
- * Transform files paths
37
- * Exported for unit tests
38
- */
39
- export declare function transformPermalink(editor: Editor, path: string, type: ClientSideFileType, initiator: Initiator): string;
40
- export declare function transformPath(editor: Editor, path: string, type: ClientSideFileType): string;
41
- export declare function resetRenderComponents(editor: Editor): void;
42
- export declare function resetRenderCssRules(editor: Editor): void;
@@ -1,4 +0,0 @@
1
- /**
2
- * @fileoverview Make sure custom script blocks include script tags when published
3
- */
4
- export default function (config: any): Promise<void>;
@@ -1,4 +0,0 @@
1
- /**
2
- * @fileoverview Make sure custom script blocks include script tags when published
3
- */
4
- export default function (config: any): Promise<void>;
@@ -1,22 +0,0 @@
1
- import { Component, Editor } from 'grapesjs';
2
- export declare function onAll(editor: Editor, cbk: (c: Component) => void): void;
3
- /**
4
- * SHA256 hash a string
5
- */
6
- export declare function hashString(str: string): Promise<string>;
7
- /**
8
- * Select the <body> element in the editor.
9
- * @param editor The GrapesJS editor.
10
- */
11
- export declare function selectBody(editor: Editor): void;
12
- /**
13
- * Checks if an element is a text or input field.
14
- * @param element The element to check.
15
- */
16
- export declare function isTextOrInputField(element: HTMLElement): boolean;
17
- /**
18
- * Makes every word in a string start with an uppercase letter.
19
- * @param str The string to title-case.
20
- * @param sep The separator between words.
21
- */
22
- export declare function titleCase(str: string, sep?: string): string;
@@ -1,33 +0,0 @@
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 WEBSITE_PAGES_FOLDER = "src";
7
- export declare const DEFAULT_WEBSITE_ID = "default";
8
- export declare const DEFAULT_LANGUAGE = "en";
9
- export declare const CLIENT_CONFIG_FILE_NAME = "silex.js";
10
- export declare const API_PATH = "/api";
11
- export declare const API_CONNECTOR_PATH = "/connector";
12
- export declare const API_CONNECTOR_USER = "/user";
13
- export declare const API_CONNECTOR_LIST = "/";
14
- export declare const API_CONNECTOR_LOGOUT = "/logout";
15
- export declare const API_CONNECTOR_LOGIN = "/login";
16
- export declare const API_CONNECTOR_SETTINGS = "/settings";
17
- export declare const API_CONNECTOR_LOGIN_CALLBACK = "/login/callback";
18
- export declare const API_PUBLICATION_PATH = "/publication";
19
- export declare const API_PUBLICATION_PUBLISH = "/";
20
- export declare const API_PUBLICATION_STATUS = "/publication/status";
21
- export declare const API_WEBSITE_PATH = "/website";
22
- export declare const API_WEBSITE_READ = "/";
23
- export declare const API_WEBSITE_WRITE = "/";
24
- export declare const API_WEBSITE_CREATE = "/";
25
- export declare const API_WEBSITE_DELETE = "/";
26
- export declare const API_WEBSITE_DUPLICATE = "/duplicate";
27
- export declare const API_WEBSITE_LIST = "/";
28
- export declare const API_WEBSITE_ASSET_READ = "/assets";
29
- export declare const API_WEBSITE_ASSETS_WRITE = "/assets";
30
- export declare const API_WEBSITE_META_READ = "/meta";
31
- export declare const API_WEBSITE_META_WRITE = "/meta";
32
- export declare let SILEX_VERSION: any;
33
- export declare const DEV_MESSAGE: string;
@@ -1,2 +0,0 @@
1
- export declare function getPageSlug(pageName: any): any;
2
- export declare function getPageLink(pageName: any): string;
@@ -1,341 +0,0 @@
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 ApiWebsiteDuplicateQuery = {
65
- websiteId: WebsiteId;
66
- connectorId?: ConnectorId;
67
- };
68
- export type ApiWebsiteMetaReadQuery = {
69
- websiteId: WebsiteId;
70
- connectorId?: ConnectorId;
71
- };
72
- export type ApiWebsiteMetaReadResponse = WebsiteMeta;
73
- export type ApiWebsiteMetaWriteQuery = {
74
- websiteId: WebsiteId;
75
- connectorId?: ConnectorId;
76
- };
77
- export type ApiWebsiteMetaWriteBody = WebsiteMetaFileContent;
78
- export type ApiWebsiteMetaWriteResponse = {
79
- message: string;
80
- };
81
- export type ApiWebsiteAssetsReadQuery = {
82
- websiteId: WebsiteId;
83
- connectorId?: ConnectorId;
84
- };
85
- export type ApiWebsiteAssetsReadParams = {
86
- path: string;
87
- };
88
- export type ApiWebsiteAssetsReadResponse = string;
89
- export type ApiWebsiteAssetsWriteQuery = {
90
- websiteId: WebsiteId;
91
- connectorId?: ConnectorId;
92
- };
93
- export type ApiWebsiteAssetsWriteBody = ClientSideFile[];
94
- export type ApiWebsiteAssetsWriteResponse = {
95
- data: string[];
96
- };
97
- export type ApiConnectorListQuery = {
98
- type: ConnectorType;
99
- };
100
- export type ApiConnectorListResponse = ConnectorData[];
101
- export type ApiConnectorLoginQuery = {
102
- connectorId: ConnectorId;
103
- type: ConnectorType;
104
- };
105
- export type ApiConnectorLoggedInPostMessage = {
106
- type: string;
107
- error: boolean;
108
- message: string;
109
- connectorId: ConnectorId;
110
- options: ConnectorOptions;
111
- };
112
- export type ApiConnectorLoginCbkQuery = {
113
- connectorId?: ConnectorId;
114
- type: ConnectorType;
115
- error?: string;
116
- };
117
- export type ApiConnectorLoginCbkBody = object;
118
- export type ApiConnectorSettingsQuery = {
119
- connectorId?: ConnectorId;
120
- type: ConnectorType;
121
- };
122
- export type ApiConnectorSettingsResponse = string;
123
- export type ApiConnectorSettingsPostQuery = {
124
- connectorId?: ConnectorId;
125
- type: ConnectorType;
126
- };
127
- export type ApiConnectorSettingsPostBody = ConnectorUserSettings;
128
- export type ApiConnectorSettingsPostResponse = {
129
- message: string;
130
- };
131
- export type ApiConnectorLogoutQuery = {
132
- connectorId?: ConnectorId;
133
- type: ConnectorType;
134
- };
135
- export type ApiConnectorUserQuery = {
136
- connectorId?: ConnectorId;
137
- type: ConnectorType;
138
- };
139
- export type ApiConnectorUserResponse = ConnectorUser;
140
- export declare const defaultWebsiteData: WebsiteData;
141
- export interface Component {
142
- type: string;
143
- content?: string;
144
- attributes: {
145
- [key: string]: string;
146
- };
147
- components: Component[];
148
- }
149
- export interface Page {
150
- id: string;
151
- name: string;
152
- slug: string;
153
- settings: WebsiteSettings;
154
- frames: {
155
- component: Component;
156
- }[];
157
- }
158
- export interface WebsiteData {
159
- pages: Page[];
160
- assets: Asset[];
161
- styles: Style[];
162
- settings: WebsiteSettings;
163
- fonts: Font[];
164
- symbols: symbol[];
165
- publication: PublicationSettings;
166
- }
167
- export interface PublicationData extends WebsiteData {
168
- files?: ClientSideFile[];
169
- }
170
- export interface WebsiteSettings {
171
- description?: string;
172
- title?: string;
173
- lang?: string;
174
- head?: string;
175
- favicon?: string;
176
- 'og:title'?: string;
177
- 'og:description'?: string;
178
- 'og:image'?: string;
179
- }
180
- export interface Font {
181
- name: string;
182
- value: string;
183
- variants: string[];
184
- }
185
- export declare enum Unit {
186
- PX = "px"
187
- }
188
- export interface Asset {
189
- type: string;
190
- src: string;
191
- unitDim: Unit;
192
- height: number;
193
- width: number;
194
- name: string;
195
- path?: string;
196
- }
197
- export interface Style {
198
- selectors: Selector[];
199
- style: {
200
- [key: string]: string;
201
- };
202
- }
203
- export type Selector = string | {
204
- name: string;
205
- type: number;
206
- };
207
- /**
208
- * Type for a connector id
209
- */
210
- export type ConnectorId = string;
211
- export type ConnectorOptions = {
212
- websiteUrl?: string;
213
- [key: string]: any;
214
- };
215
- export declare enum ClientSideFileType {
216
- HTML = "html",
217
- ASSET = "asset",
218
- CSS = "css",
219
- OTHER = "other"
220
- }
221
- export declare enum Initiator {
222
- HTML = "html",
223
- CSS = "css"
224
- }
225
- /**
226
- * Type for a client side file when the content is not available, used to handle file names and paths and urls
227
- */
228
- export interface ClientSideFileWithPermalink {
229
- path: string;
230
- permalink?: string;
231
- type: ClientSideFileType;
232
- }
233
- /**
234
- * Type for a client side file when the content is available as a string
235
- */
236
- export interface ClientSideFileWithContent extends ClientSideFileWithPermalink {
237
- content: string;
238
- }
239
- /**
240
- * Type for a client side file when the content is in the connector
241
- */
242
- export interface ClientSideFileWithSrc extends ClientSideFileWithPermalink {
243
- src: string;
244
- }
245
- /**
246
- * Type for a client side file
247
- * @see connector/File
248
- */
249
- export type ClientSideFile = ClientSideFileWithContent | ClientSideFileWithSrc;
250
- /**
251
- * Type for file listing
252
- */
253
- export interface FileMeta {
254
- name: string;
255
- isDir: boolean;
256
- size: number;
257
- createdAt: Date;
258
- updatedAt: Date;
259
- metadata?: object;
260
- }
261
- /**
262
- * Enum to express if the connector is a storage or a hosting
263
- */
264
- export declare enum ConnectorType {
265
- STORAGE = "STORAGE",
266
- HOSTING = "HOSTING"
267
- }
268
- /**
269
- * Type for a website id
270
- */
271
- export type WebsiteId = string;
272
- /**
273
- * Back end data shared with the front end
274
- */
275
- export interface ConnectorData {
276
- connectorId: ConnectorId;
277
- type: ConnectorType;
278
- displayName: string;
279
- icon: string;
280
- disableLogout: boolean;
281
- isLoggedIn: boolean;
282
- oauthUrl: string | null;
283
- color: string;
284
- background: string;
285
- }
286
- /**
287
- * User settings for a connector and for a given website
288
- */
289
- export type ConnectorUserSettings = {
290
- [websiteId: string]: object;
291
- };
292
- /**
293
- * Back end data shared with the front end
294
- */
295
- export interface ConnectorUser {
296
- name: string;
297
- email?: string;
298
- picture?: string;
299
- storage: ConnectorData;
300
- }
301
- export interface WebsiteMetaFileContent {
302
- name: string;
303
- imageUrl?: string;
304
- connectorUserSettings: ConnectorUserSettings;
305
- }
306
- /**
307
- * Back end data sent to the front end
308
- * Meta data can be the root path of the websites, or the bucket name, etc.
309
- */
310
- export interface WebsiteMeta extends WebsiteMetaFileContent {
311
- websiteId: WebsiteId;
312
- createdAt?: Date;
313
- updatedAt?: Date;
314
- }
315
- /**
316
- * Enum to express if the job is in progress or finished or errored
317
- */
318
- export declare enum JobStatus {
319
- IN_PROGRESS = "IN_PROGRESS",
320
- SUCCESS = "SUCCESS",
321
- ERROR = "ERROR"
322
- }
323
- /**
324
- * Id used to track the progress of a publication
325
- */
326
- export type JobId = string;
327
- /**
328
- * Data structure which is sent to the client to display the progress of a job
329
- */
330
- export interface JobData {
331
- jobId: JobId;
332
- status: JobStatus;
333
- message: string;
334
- _timeout?: ReturnType<typeof setTimeout>;
335
- }
336
- export interface PublicationJobData extends JobData {
337
- logs: string[][];
338
- errors: string[][];
339
- startTime?: number;
340
- endTime?: number;
341
- }