feat: Convert all app files to JS
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import defineAction from '../../../../helpers/define-action';
|
||||
import defineAction from '../../../../helpers/define-action.js';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Copy board',
|
||||
@@ -8,7 +8,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Original board',
|
||||
key: 'originalBoard',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: 'The board that you want to copy.',
|
||||
variables: true,
|
||||
@@ -26,7 +26,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Title',
|
||||
key: 'title',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: 'Title for the board.',
|
||||
variables: true,
|
||||
@@ -34,7 +34,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Description',
|
||||
key: 'description',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: 'Description of the board.',
|
||||
variables: true,
|
||||
@@ -42,7 +42,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Team Access',
|
||||
key: 'teamAccess',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description:
|
||||
'Team access to the board. Can be private, view, comment or edit. Default: private.',
|
||||
@@ -69,7 +69,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Access Via Link',
|
||||
key: 'accessViaLink',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description:
|
||||
'Access to the board by link. Can be private, view, comment. Default: private.',
|
||||
@@ -1,4 +1,4 @@
|
||||
import defineAction from '../../../../helpers/define-action';
|
||||
import defineAction from '../../../../helpers/define-action.js';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Create board',
|
||||
@@ -8,7 +8,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Title',
|
||||
key: 'title',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: 'Title for the board.',
|
||||
variables: true,
|
||||
@@ -16,7 +16,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Description',
|
||||
key: 'description',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: 'Description of the board.',
|
||||
variables: true,
|
||||
@@ -24,7 +24,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Team Access',
|
||||
key: 'teamAccess',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description:
|
||||
'Team access to the board. Can be private, view, comment or edit. Default: private.',
|
||||
@@ -51,7 +51,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Access Via Link',
|
||||
key: 'accessViaLink',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description:
|
||||
'Access to the board by link. Can be private, view, comment. Default: private.',
|
||||
@@ -1,18 +1,4 @@
|
||||
import defineAction from '../../../../helpers/define-action';
|
||||
|
||||
type Body = {
|
||||
data: {
|
||||
title: string;
|
||||
description?: string;
|
||||
dueDate?: string;
|
||||
};
|
||||
style?: {
|
||||
cardTheme?: string;
|
||||
};
|
||||
parent: {
|
||||
id: string;
|
||||
};
|
||||
};
|
||||
import defineAction from '../../../../helpers/define-action.js';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Create card widget',
|
||||
@@ -22,7 +8,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Board',
|
||||
key: 'boardId',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: true,
|
||||
@@ -40,7 +26,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Frame',
|
||||
key: 'frameId',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
dependsOn: ['parameters.boardId'],
|
||||
description:
|
||||
@@ -64,7 +50,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Card Title',
|
||||
key: 'cardTitle',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: '',
|
||||
variables: true,
|
||||
@@ -72,7 +58,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Card Title Link',
|
||||
key: 'cardTitleLink',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
@@ -80,7 +66,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Card Description',
|
||||
key: 'cardDescription',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
@@ -88,7 +74,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Card Due Date',
|
||||
key: 'cardDueDate',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: false,
|
||||
description:
|
||||
'format: date-time. Example value: 2023-10-12 22:00:55+00:00',
|
||||
@@ -97,7 +83,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Card Border Color',
|
||||
key: 'cardBorderColor',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: 'In hex format. Default is blue (#2399F3).',
|
||||
variables: true,
|
||||
@@ -140,23 +126,23 @@ export default defineAction({
|
||||
title = cardTitle;
|
||||
}
|
||||
|
||||
const body: Body = {
|
||||
const body = {
|
||||
data: {
|
||||
title: title as string,
|
||||
description: cardDescription as string,
|
||||
title: title,
|
||||
description: cardDescription,
|
||||
},
|
||||
style: {},
|
||||
parent: {
|
||||
id: frameId as string,
|
||||
id: frameId,
|
||||
},
|
||||
};
|
||||
|
||||
if (cardBorderColor) {
|
||||
body.style.cardTheme = cardBorderColor as string;
|
||||
body.style.cardTheme = cardBorderColor;
|
||||
}
|
||||
|
||||
if (cardDueDate) {
|
||||
body.data.dueDate = cardDueDate as string;
|
||||
body.data.dueDate = cardDueDate;
|
||||
}
|
||||
|
||||
const response = await $.http.post(`/v2/boards/${boardId}/cards`, body);
|
||||
5
packages/backend/src/apps/miro/actions/index.js
Normal file
5
packages/backend/src/apps/miro/actions/index.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import copyBoard from './copy-board/index.js';
|
||||
import createBoard from './create-board/index.js';
|
||||
import createCardWidget from './create-card-widget/index.js';
|
||||
|
||||
export default [copyBoard, createBoard, createCardWidget];
|
||||
@@ -1,5 +0,0 @@
|
||||
import copyBoard from './copy-board';
|
||||
import createBoard from './create-board';
|
||||
import createCardWidget from './create-card-widget';
|
||||
|
||||
export default [copyBoard, createBoard, createCardWidget];
|
||||
Reference in New Issue
Block a user