@pipedream/mem 0.0.1 → 0.1.1
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.
- package/README.md +11 -0
- package/actions/append-mem/append-mem.mjs +40 -0
- package/actions/create-mem/create-mem.mjs +62 -0
- package/mem.app.mjs +51 -0
- package/package.json +5 -5
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Overview
|
|
2
|
+
|
|
3
|
+
The Mem API lets you interact with a unique knowledge base that adapts to your needs. Using Pipedream, you can automate tasks, sync information across apps, and trigger actions based on events in Mem. Think of pulling in tasks, pushing notifications, or archiving ideas - Pipedream serves as a superhighway for your Mem data to connect with over 800 apps.
|
|
4
|
+
|
|
5
|
+
# Example Use Cases
|
|
6
|
+
|
|
7
|
+
- **Sync Mem tasks with Google Calendar**: Create events in Google Calendar whenever a new task is added in Mem. Keep your schedule aligned without manual updates.
|
|
8
|
+
|
|
9
|
+
- **Archive Mem notes to Dropbox**: Every time you mark a note as 'Completed' in Mem, automatically save a backup to a specified Dropbox folder. Ideal for maintaining records and freeing up space.
|
|
10
|
+
|
|
11
|
+
- **Send Slack notifications for Mem reminders**: Set up a workflow that sends a message to your Slack when a reminder is due in Mem. Stay on top of your to-dos without leaving your team's communication hub.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import mem from "../../mem.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "mem-append-mem",
|
|
5
|
+
name: "Append Mem",
|
|
6
|
+
version: "0.0.1",
|
|
7
|
+
description: "Create a new mem. [See the documentation](https://docs.mem.ai/docs/api/mems/create)",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
mem,
|
|
11
|
+
memId: {
|
|
12
|
+
type: "string",
|
|
13
|
+
label: "Mem ID",
|
|
14
|
+
description: "The Id of the mem you want to append.",
|
|
15
|
+
},
|
|
16
|
+
content: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
mem,
|
|
19
|
+
"content",
|
|
20
|
+
],
|
|
21
|
+
description: "The content which will be appended to the end of the existing mem. The string should be in a markdown-compatible format. For more details, see the [Mem Markdown Format](https://docs.mem.ai/docs/general/mem-markdown-format).",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
async run({ $ }) {
|
|
25
|
+
const {
|
|
26
|
+
mem,
|
|
27
|
+
memId,
|
|
28
|
+
...data
|
|
29
|
+
} = this;
|
|
30
|
+
|
|
31
|
+
const response = await mem.appendMem({
|
|
32
|
+
$,
|
|
33
|
+
memId,
|
|
34
|
+
data,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
$.export("$summary", `The mem with Id: ${response.id} was successfully updated!`);
|
|
38
|
+
return response;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import mem from "../../mem.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "mem-create-mem",
|
|
5
|
+
name: "Create Mem",
|
|
6
|
+
version: "0.0.1",
|
|
7
|
+
description: "Create a new mem. [See the documentation](https://docs.mem.ai/docs/api/mems/create)",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
mem,
|
|
11
|
+
content: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
mem,
|
|
14
|
+
"content",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
isRead: {
|
|
18
|
+
type: "boolean",
|
|
19
|
+
label: "Is Read",
|
|
20
|
+
description: "Indicates whether the mem should be automatically marked as \"read\" (unread mems are highlighted within the default views in the product UI). Defaults to `false`.",
|
|
21
|
+
optional: true,
|
|
22
|
+
},
|
|
23
|
+
isAchived: {
|
|
24
|
+
type: "boolean",
|
|
25
|
+
label: "Is Archived",
|
|
26
|
+
description: "Indicates whether the mem should be automatically marked as \"archived\" (archived mems are hidden from the default views in the product UI). Defaults to `false`.",
|
|
27
|
+
optional: true,
|
|
28
|
+
},
|
|
29
|
+
scheduledFor: {
|
|
30
|
+
type: "string",
|
|
31
|
+
label: "Scheduled For",
|
|
32
|
+
description: "Specify a time that this mem will resurface at (similar to the \"snooze\" button in the product UI). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`",
|
|
33
|
+
optional: true,
|
|
34
|
+
},
|
|
35
|
+
createdAt: {
|
|
36
|
+
type: "string",
|
|
37
|
+
label: "Created At",
|
|
38
|
+
description: "Specify the time that the mem was created at. Defaults to the current time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`",
|
|
39
|
+
optional: true,
|
|
40
|
+
},
|
|
41
|
+
memId: {
|
|
42
|
+
type: "string",
|
|
43
|
+
label: "Mem ID",
|
|
44
|
+
description: "Specify the ID which should be assigned to the new mem. Defaults to a randomly-generated id. The IDs must be in the [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) format.",
|
|
45
|
+
optional: true,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
async run({ $ }) {
|
|
49
|
+
const {
|
|
50
|
+
mem,
|
|
51
|
+
...data
|
|
52
|
+
} = this;
|
|
53
|
+
|
|
54
|
+
const response = await mem.createMem({
|
|
55
|
+
$,
|
|
56
|
+
data,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
$.export("$summary", `A new mem with Id: ${response.id} was successfully created!`);
|
|
60
|
+
return response;
|
|
61
|
+
},
|
|
62
|
+
};
|
package/mem.app.mjs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { axios } from "@pipedream/platform";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
type: "app",
|
|
5
|
+
app: "mem",
|
|
6
|
+
propDefinitions: {
|
|
7
|
+
content: {
|
|
8
|
+
type: "string",
|
|
9
|
+
label: "Content",
|
|
10
|
+
description: "The contents of the mem. The string should be in a markdown-compatible format. For more details, see the [Mem Markdown Format](https://docs.mem.ai/docs/general/mem-markdown-format).",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
methods: {
|
|
14
|
+
_apiUrl() {
|
|
15
|
+
return "https://api.mem.ai/v0";
|
|
16
|
+
},
|
|
17
|
+
_getHeaders() {
|
|
18
|
+
return {
|
|
19
|
+
"Content-Type": "application/json",
|
|
20
|
+
"Authorization": `ApiAccessToken ${this.$auth.api_key}`,
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
async _makeRequest({
|
|
24
|
+
$ = this, path, ...opts
|
|
25
|
+
}) {
|
|
26
|
+
const config = {
|
|
27
|
+
url: `${this._apiUrl()}/${path}`,
|
|
28
|
+
headers: this._getHeaders(),
|
|
29
|
+
...opts,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return axios($, config);
|
|
33
|
+
},
|
|
34
|
+
createMem(args = {}) {
|
|
35
|
+
return this._makeRequest({
|
|
36
|
+
path: "mems",
|
|
37
|
+
method: "POST",
|
|
38
|
+
...args,
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
appendMem({
|
|
42
|
+
memId, ...args
|
|
43
|
+
}) {
|
|
44
|
+
return this._makeRequest({
|
|
45
|
+
path: `mems/${memId}/append`,
|
|
46
|
+
method: "POST",
|
|
47
|
+
...args,
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/mem",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Pipedream Mem Components",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "mem.app.mjs",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"pipedream",
|
|
8
8
|
"mem"
|
|
9
9
|
],
|
|
10
|
-
"files": [
|
|
11
|
-
"dist"
|
|
12
|
-
],
|
|
13
10
|
"homepage": "https://pipedream.com/apps/mem",
|
|
14
11
|
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
|
15
12
|
"publishConfig": {
|
|
16
13
|
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@pipedream/platform": "^3.1.0"
|
|
17
17
|
}
|
|
18
18
|
}
|