-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change addTool to multipart data
- Loading branch information
Showing
16 changed files
with
244 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,3 +141,5 @@ dist | |
.pnp.* | ||
|
||
*.code-workspace | ||
|
||
s3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- Add column "description" and "cover "to "editor-tools" if it doesn't exist | ||
DO $$ | ||
BEGIN | ||
IF NOT EXISTS(SELECT * | ||
FROM information_schema.columns | ||
WHERE table_name='editor_tools' AND column_name='description') | ||
THEN | ||
ALTER TABLE "editor_tools" ADD COLUMN "description" VARCHAR(255); -- Adjust the data type and size as needed | ||
END IF; | ||
IF NOT EXISTS(SELECT * | ||
FROM information_schema.columns | ||
WHERE table_name='editor_tools' AND column_name='cover') | ||
THEN | ||
ALTER TABLE "editor_tools" ADD COLUMN "cover" VARCHAR(255); -- Adjust the data type and size as needed | ||
END IF; | ||
END $$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import EditorTool from '@domain/entities/editorTools.js'; | ||
import type { MultipartFields, MultipartFile, MultipartValue } from '@fastify/multipart'; | ||
import { Multipart } from '@fastify/multipart'; | ||
|
||
export interface AddEditorToolDto extends MultipartFields { | ||
name: MultipartValue; | ||
title: MultipartValue; | ||
exportName: MultipartValue; | ||
description: MultipartValue; | ||
isDefault?: MultipartValue; | ||
userId: MultipartValue; | ||
source: MultipartValue; | ||
cover: MultipartFile; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
export const AddEditorToolSchema = { | ||
$id: 'AddEditorToolSchema', | ||
type: 'object', | ||
required: [ | ||
'name', | ||
'title', | ||
'exportName', | ||
'source', | ||
], | ||
properties: { | ||
id: { | ||
type: 'string', | ||
readOnly: true, | ||
description: 'Unique tool id', | ||
}, | ||
name: { | ||
type: 'string', | ||
description: 'Plugin id that editor will use, e.g. "warning", "list", "linkTool"', | ||
}, | ||
title: { | ||
type: 'string', | ||
description: 'User-friendly name that will be shown in marketplace, .e.g "Warning tool 3000"', | ||
}, | ||
exportName: { | ||
type: 'string', | ||
description: 'Name of the plugin\'s class, e.g. "LinkTool", "Checklist", "Header"', | ||
}, | ||
description: { | ||
type: 'string', | ||
description: 'Plugin description that will be shown in the marketplace', | ||
}, | ||
cover: { | ||
type: 'string', | ||
description: 'Multipart data', | ||
}, | ||
isDefault: { | ||
type: 'boolean', | ||
description: 'Is plugin included by default in the editor', | ||
default: false, | ||
}, | ||
userId: { | ||
type: ['number', 'null'], | ||
description: 'User id that added the tool to the marketplace', | ||
}, | ||
source: { | ||
type: 'object', | ||
properties: { | ||
cdn: { | ||
type: 'string', | ||
description: 'Tool URL in content delivery network', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.