Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/configcat/configcat.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
50 changes: 50 additions & 0 deletions components/dart/actions/create-doc/create-doc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import dart from "../../dart.app.mjs";

export default {
key: "dart-create-doc",
name: "Create Doc",
description: "Record a new doc that the user intends to write down. This will save the doc in Dart for later access, search, etc. By default the created doc will be in the Docs folder. More information can be included in the text. [See the documentation](https://app.dartai.com/api/v0/public/docs/#/Doc/createDoc)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
dart,
title: {
propDefinition: [
dart,
"title",
],
},
folder: {
propDefinition: [
dart,
"folder",
],
},
text: {
propDefinition: [
dart,
"text",
],
},
},
async run({ $ }) {
const response = await this.dart.createDoc({
$,
data: {
item: {
title: this.title,
folder: this.folder,
text: this.text,
},
},
});

$.export("$summary", `New doc successfully created with ID: ${response.item.id}`);
return response;
},
};
130 changes: 91 additions & 39 deletions components/dart/actions/create-task/create-task.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { parseObject } from "../../common/utils.mjs";
import dart from "../../dart.app.mjs";

export default {
key: "dart-create-task",
name: "Create Task",
description: "Creates a new task within a dartboard. [See the documentation](https://app.itsdart.com/api/v0/docs/)",
version: "0.0.2",
description: "Creates a new task within a dartboard. [See the documentation](https://app.dartai.com/api/v0/public/docs/#/Task/createTask)",
version: "1.0.0",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand All @@ -13,77 +14,128 @@ export default {
type: "action",
props: {
dart,
dartboardId: {
title: {
propDefinition: [
dart,
"dartboardId",
"title",
],
},
duid: {
type: "string",
label: "Task DUID",
description: "A unique identifier for the task. Must contain at least 12 characters.",
parentId: {
propDefinition: [
dart,
"taskId",
],
label: "Parent Task ID",
description: "The universal, unique ID of the parent task. These tasks have a parent-child relationship where the current task is the child and this task ID corresponds to the parent. Subtasks inherit context from their parent and are typically smaller units of work",
},
title: {
dartboard: {
propDefinition: [
dart,
"taskName",
"dartboard",
],
label: "Dartboard",
description: "The full title of the dartboard, which is a project or list of tasks",
},
description: {
type: {
propDefinition: [
dart,
"taskDescription",
"type",
],
},
dueAt: {
status: {
propDefinition: [
dart,
"dueAt",
"status",
],
label: "Status",
description: "The status from the list of available statuses",
},
description: {
type: "string",
label: "Description",
description: "A longer description of the task, which can include markdown formatting",
},
assignees: {
propDefinition: [
dart,
"assigneeIds",
],
label: "Assignees",
description: "The names or emails of the users that the task is assigned to. Either this or assignee must be included, depending on whether the workspaces allows multiple assignees or not",
},
assigneeIds: {
assignee: {
propDefinition: [
dart,
"assigneeIds",
],
type: "string",
label: "Assignee",
description: "The name or email of the user that the task is assigned to. Either this or assignees must be included, depending on whether the workspaces allows multiple assignees or not",
},
tags: {
propDefinition: [
dart,
"tags",
],
label: "Tags",
description: "Any tags that should be applied to the task, which can be used to filter and search for tasks. Tags are also known as labels or components and are strings that can be anything, but should be short and descriptive",
},
priority: {
propDefinition: [
dart,
"priority",
],
label: "Priority",
description: "The priority, which is a string that can be one of the specified options. This is used to sort tasks and determine which tasks should be done first",
},
startAt: {
propDefinition: [
dart,
"startAt",
],
},
dueAt: {
propDefinition: [
dart,
"dueAt",
],
},
size: {
propDefinition: [
dart,
"size",
],
},
customProperties: {
propDefinition: [
dart,
"customProperties",
],
},
},
async run({ $ }) {
const response = await this.dart.createTransaction({
const { item: response } = await this.dart.createTask({
$,
data: {
clientDuid: this.duid,
items: [
{
duid: this.duid,
operations: [
{
model: "task",
kind: "create",
data: {
duid: this.duid,
dartboardDuid: this.dartboardId,
title: this.title,
description: this.description,
dueAt: this.dueAt,
assigneeDuids: this.assigneeIds,
priority: this.priority,
},
},
],
kind: "task_create",
},
],
item: {
title: this.title,
parentId: this.parentId,
dartboard: this.dartboard,
type: this.type,
status: this.status,
description: this.description,
assignees: parseObject(this.assignees),
assignee: this.assignee,
tags: parseObject(this.tags),
priority: this.priority,
startAt: this.startAt,
dueAt: this.dueAt,
size: this.size,
customProperties: parseObject(this.customProperties),
},
},
});
$.export("$summary", `Created task "${this.title}"`);
$.export("$summary", `Successfully created task with ID: ${response.id}`);
return response;
},
};
32 changes: 32 additions & 0 deletions components/dart/actions/delete-doc/delete-doc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import dart from "../../dart.app.mjs";

export default {
key: "dart-delete-doc",
name: "Delete Doc",
description: "Move an existing doc to the trash, where it can be recovered if needed. Nothing else about the doc will be changed. [See the documentation](https://app.dartai.com/api/v0/public/docs/#/Doc/deleteDoc)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
dart,
docId: {
propDefinition: [
dart,
"docId",
],
},
},
async run({ $ }) {
const response = await this.dart.deleteDoc({
$,
docId: this.docId,
});

$.export("$summary", `Successfully deleted doc with ID: ${this.docId}`);
return response;
},
};
Loading
Loading