@pipedream/mem 0.0.1 → 0.1.0
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.
|
@@ -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,15 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/mem",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
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": {
|