0.0.25 • Published 3 months ago

@dandori/ui v0.0.25

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

dandori/ui

This repository is responsible for viewing your tasks which are generated by @dandori/core .

Installation

npm install @dandori/core @dandori/ui
yarn add @dandori/core @dandori/ui
pnpm add @dandori/core @dandori/ui

Usage

import generateDandoriTasks from '@dandori/core';
import { generateDandoriMiroCards } from "@dandori/ui";

const text = `
Today's My Tasks
* Send Email to John
* Send Email to Mary
* Report to Boss after sending emails
`;

const tasks = await generateDandoriTasks(text);
await generateDandoriMiroCards(tasks, {
  boardId: '1234567890',
});

Requirements

  • Please see @dandori/core before using @dandori/ui.
  • @dandori/ui depends on external APIs. You need to set EXTERNALAPP_API_KEY environment variables like MIRO_API_KEY .
  • @dandori/ui supports to load .env file. Please create .env file and set environment variables.

Supported External APIs

API

generateDandoriMiroCards

async function generateDandoriMiroCards(
  tasks: DandoriTask[],
  options?: GenerateDandoriMiroCardsOptions,
): Promise<void> {}

generateDandoriMiroCards creates miro cards from generateDandoriTasks result.

Parameters

tasks

The tasks which are generated by generateDandoriTasks of @dandori/core.

options
interface GenerateDandoriMiroCardsOptions {
  boardId?: string;
  isAppCard?: boolean;
  apiKey?: string;
}
  • boardId

The existing board id of miro.

You can get the board id from the miro url of the board.

For example, if the url is https://miro.com/app/board/1234567890/, the board id is 1234567890.

If not set, the new board is created.

  • isAppCard

default is false

If you set true , the cards are created as App cards.

  • apiKey

The api key of miro. You can also set MIRO_API_KEY environment variable instead of this option.

generateDandoriNotionPages

async function generateDandoriNotionPages(
  tasks: DandoriTask[],
  options?: GenerateDandoriNotionPagesOptions,
): Promise<void> {}

generateDandoriNotionTasks creates notion pages from generateDandoriTasks result.

Parameters

tasks

The tasks which are generated by generateDandoriTasks of @dandori/core.

options
interface GenerateDandoriNotionPagesOptions {
  databaseId: string;
  databasePropertiesMap?: DatabasePropertiesMap;
  apiKey?: string;
}
  • databaseId

The existing database id of notion.

You can get the database id from the notion url of the database.

For example, if the url is https://www.notion.so/myworkspace/1234567890?v=123, the database id is 1234567890.

  • databasePropertiesMap

default is { name: 'title' }

The map which key is defined by dandori and value is your notion database properties.

You can set the key like belows.

const databasePropertiesMap = {
  name: "",
  deadline: "",
  description: "",
  status: "",
  "status.todo": "",
  "status.doing": "",
  "status.done": "",
};
import generateDandoriTasks from '@dandori/core';
import { generateDandoriNotionPages } from "@dandori/ui";

const text = `
Today's My Tasks
* Send Email to John
* Send Email to Mary
* Report to Boss after sending emails
`;

const databasePropertiesMap = {
  status: "Status",
  "status.todo": "ToDo",
  "status.doing": "Doing",
  "status.done": "Done 🙌",
};

const tasks = await generateDandoriTasks(text);
await generateDandoriNotionPages(tasks, {
  databaseId: '1234567890',
  databasePropertiesMap,
});

This is an example. In this case, the output is like belows.

For more details about database properties, please see Notion API.

  • apiKey

The api key of notion. You can also set NOTION_API_KEY environment variable instead of this option.

generateDandoriTrelloCards

async function generateDandoriTrelloCards(
  tasks: DandoriTask[],
  options?: GenerateDandoriTrelloCardsOptions,
): Promise<void> {}

generateDandoriTrelloCards creates trello cards from generateDandoriTasks result.

Parameters

tasks

The tasks which are generated by generateDandoriTasks of @dandori/core.

options
interface GenerateDandoriTrelloCardsOptions {
  boardId: string;
  trelloListPropertiesMap?: TrelloListPropertiesMap;
  apiKey?: string;
  apiToken?: string;
}
  • boardId

The existing board id of trello.

You can get the board id from your trello url.

For example, if the url is https://trello.com/b/ABCDE/boardTitle, the board id is ABCDE.

  • trelloListPropertiesMap

The map which key is defined by dandori and value is your trello list properties.

You can set the key like belows.

const trelloListPropertiesMap = {
  "status.todo": "",
  "status.doing": "",
  "status.done": "",
};
import generateDandoriTasks from '@dandori/core';
import { generateDandoriTrelloCards } from "@dandori/ui";

const text = `
Today's My Tasks
* Send Email to John
* Send Email to Mary
* Report to Boss after sending emails
`;

const trelloListPropertiesMap = {
  "status.todo": "Todo",
  "status.doing": "Doing",
  "status.done": "Done",
};

const tasks = await generateDandoriTasks(text);
await generateDandoriNotionPages(tasks, {
  boardId: 'ABCDE',
  trelloListPropertiesMap,
});

This is an example. In this case, the output is like belows.

For more details about database properties, please see Notion API.

  • apiKey

The api key of trello. You can also set TRELLO_API_KEY environment variable instead of this option.

  • apiToken

The api token of trello which you can get through OAuth. You can also set TRELLO_API_TOKEN environment variable instead of this option.

0.0.25

3 months ago

0.0.24

4 months ago

0.0.23

4 months ago

0.0.22

5 months ago

0.0.20

5 months ago

0.0.21

5 months ago

0.0.16

5 months ago

0.0.17

5 months ago

0.0.15

5 months ago

0.0.14

5 months ago

0.0.13

6 months ago

0.0.12

6 months ago

0.0.11

6 months ago

0.0.10

7 months ago

0.0.9

7 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago