Skip to content

Commit 722bb80

Browse files
authored
[Components] limitless_ai #17139 (#17242)
* Added actions * Added actions * Added actions
1 parent 90e7670 commit 722bb80

File tree

6 files changed

+251
-7
lines changed

6 files changed

+251
-7
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import app from "../../limitless_ai.app.mjs";
2+
3+
export default {
4+
key: "limitless_ai-get-lifelog",
5+
name: "Get Lifelog",
6+
description: "Returns a specific lifelog entry by ID. [See the documentation](https://www.limitless.ai/developers#get-lifelog)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
includeMarkdown: {
12+
propDefinition: [
13+
app,
14+
"includeMarkdown",
15+
],
16+
},
17+
includeHeadings: {
18+
propDefinition: [
19+
app,
20+
"includeHeadings",
21+
],
22+
},
23+
id: {
24+
propDefinition: [
25+
app,
26+
"id",
27+
],
28+
},
29+
},
30+
async run({ $ }) {
31+
const response = await this.app.getLifelog({
32+
$,
33+
id: this.id,
34+
params: {
35+
includeMarkdown: this.includeMarkdown,
36+
includeHeadings: this.includeHeadings,
37+
},
38+
});
39+
$.export("$summary", `Successfully sent the request and retrieved ${response.meta.lifelogs.count} Lifelog with the specified ID`);
40+
return response;
41+
},
42+
};
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
import app from "../../limitless_ai.app.mjs";
2+
3+
export default {
4+
key: "limitless_ai-get-lifelogs",
5+
name: "Get Lifelogs",
6+
description: "Returns a list of lifelog entries based on specified time range or date. [See the documentation](https://www.limitless.ai/developers#get-lifelogs)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
timezone: {
12+
propDefinition: [
13+
app,
14+
"timezone",
15+
],
16+
},
17+
date: {
18+
propDefinition: [
19+
app,
20+
"date",
21+
],
22+
},
23+
start: {
24+
propDefinition: [
25+
app,
26+
"start",
27+
],
28+
},
29+
end: {
30+
propDefinition: [
31+
app,
32+
"end",
33+
],
34+
},
35+
cursor: {
36+
propDefinition: [
37+
app,
38+
"cursor",
39+
],
40+
},
41+
direction: {
42+
propDefinition: [
43+
app,
44+
"direction",
45+
],
46+
},
47+
includeMarkdown: {
48+
propDefinition: [
49+
app,
50+
"includeMarkdown",
51+
],
52+
},
53+
includeHeadings: {
54+
propDefinition: [
55+
app,
56+
"includeHeadings",
57+
],
58+
},
59+
isStarred: {
60+
propDefinition: [
61+
app,
62+
"isStarred",
63+
],
64+
},
65+
limit: {
66+
propDefinition: [
67+
app,
68+
"limit",
69+
],
70+
},
71+
},
72+
async run({ $ }) {
73+
const response = await this.app.getLifelogs({
74+
$,
75+
params: {
76+
timezone: this.timezone,
77+
date: this.date,
78+
start: this.start,
79+
end: this.end,
80+
cursor: this.cursor,
81+
direction: this.direction,
82+
includeMarkdown: this.includeMarkdown,
83+
includeHeadings: this.includeHeadings,
84+
isStarred: this.isStarred,
85+
limit: this.limit,
86+
},
87+
});
88+
$.export("$summary", `Successfully retrieved ${response.meta.lifelogs.count} Lifelogs`);
89+
return response;
90+
},
91+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
DIRECTION_OPTIONS: [
3+
"asc",
4+
"desc",
5+
],
6+
};
Lines changed: 102 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,109 @@
1+
import { axios } from "@pipedream/platform";
2+
import constants from "./common/constants.mjs";
3+
14
export default {
25
type: "app",
36
app: "limitless_ai",
4-
propDefinitions: {},
7+
propDefinitions: {
8+
timezone: {
9+
type: "string",
10+
label: "Timezone",
11+
description: "Time zone identifier, e.g., UTC or America/New_York",
12+
optional: true,
13+
},
14+
date: {
15+
type: "string",
16+
label: "Date",
17+
description: "Specific date in ISO format: `YYYY-MM-DD`. If `start` or `end` are provided, `date` will be ignored",
18+
},
19+
start: {
20+
type: "string",
21+
label: "Start",
22+
description: "Start date or timestamp for the query range. ISO-8601 format: `YYYY-MM-DD` or `YYYY-MM-DD HH:mm:SS`",
23+
optional: true,
24+
},
25+
end: {
26+
type: "string",
27+
label: "End",
28+
description: "End date or timestamp for the query range. ISO-8601 format: `YYYY-MM-DD` or `YYYY-MM-DD HH:mm:SS`",
29+
optional: true,
30+
},
31+
cursor: {
32+
type: "string",
33+
label: "Cursor",
34+
description: "Pagination cursor to fetch the next set of results",
35+
optional: true,
36+
},
37+
direction: {
38+
type: "string",
39+
label: "Direction",
40+
description: "Order of results",
41+
options: constants.DIRECTION_OPTIONS,
42+
optional: true,
43+
},
44+
includeMarkdown: {
45+
type: "boolean",
46+
label: "Include Markdown",
47+
description: "Whether to include Markdown-formatted content",
48+
optional: true,
49+
},
50+
includeHeadings: {
51+
type: "boolean",
52+
label: "Include Headings",
53+
description: "Whether to include document headings in the result",
54+
optional: true,
55+
},
56+
isStarred: {
57+
type: "boolean",
58+
label: "Is Starred",
59+
description: "Filter results by starred status",
60+
optional: true,
61+
},
62+
limit: {
63+
type: "string",
64+
label: "Limit",
65+
description: "Maximum number of results to return",
66+
optional: true,
67+
},
68+
id: {
69+
type: "string",
70+
label: "ID",
71+
description: "The ID of the lifelog entry to retrieve, given in the URL",
72+
},
73+
},
574
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
75+
_baseUrl() {
76+
return "https://api.limitless.ai/v1";
77+
},
78+
async _makeRequest(opts = {}) {
79+
const {
80+
$ = this,
81+
path,
82+
headers,
83+
...otherOpts
84+
} = opts;
85+
return axios($, {
86+
...otherOpts,
87+
url: this._baseUrl() + path,
88+
headers: {
89+
"x-api-key": `${this.$auth.api_key}`,
90+
...headers,
91+
},
92+
});
93+
},
94+
async getLifelogs(args = {}) {
95+
return this._makeRequest({
96+
path: "/lifelogs",
97+
...args,
98+
});
99+
},
100+
async getLifelog({
101+
id, ...args
102+
}) {
103+
return this._makeRequest({
104+
path: `/lifelogs/${id}`,
105+
...args,
106+
});
9107
},
10108
},
11109
};

components/limitless_ai/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/limitless_ai",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream Limitless.ai Components",
55
"main": "limitless_ai.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.1.0"
1417
}
15-
}
18+
}

pnpm-lock.yaml

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)