@activepieces/piece-raindrop 0.0.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/package.json +16 -0
- package/src/i18n/fr.json +46 -0
- package/src/i18n/translation.json +46 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +41 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/create-raindrop.d.ts +9 -0
- package/src/lib/actions/create-raindrop.js +99 -0
- package/src/lib/actions/create-raindrop.js.map +1 -0
- package/src/lib/actions/delete-raindrop.d.ts +3 -0
- package/src/lib/actions/delete-raindrop.js +34 -0
- package/src/lib/actions/delete-raindrop.js.map +1 -0
- package/src/lib/actions/find-raindrops.d.ts +5 -0
- package/src/lib/actions/find-raindrops.js +67 -0
- package/src/lib/actions/find-raindrops.js.map +1 -0
- package/src/lib/actions/get-raindrop.d.ts +3 -0
- package/src/lib/actions/get-raindrop.js +51 -0
- package/src/lib/actions/get-raindrop.js.map +1 -0
- package/src/lib/actions/update-raindrop.d.ts +9 -0
- package/src/lib/actions/update-raindrop.js +95 -0
- package/src/lib/actions/update-raindrop.js.map +1 -0
- package/src/lib/auth.d.ts +1 -0
- package/src/lib/auth.js +12 -0
- package/src/lib/auth.js.map +1 -0
- package/src/lib/common/index.d.ts +39 -0
- package/src/lib/common/index.js +80 -0
- package/src/lib/common/index.js.map +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@activepieces/piece-raindrop",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "./src/index.js",
|
|
5
|
+
"types": "./src/index.d.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc -p tsconfig.lib.json && cp package.json dist/",
|
|
8
|
+
"lint": "eslint 'src/**/*.ts'"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@activepieces/pieces-common": "0.12.3",
|
|
12
|
+
"@activepieces/pieces-framework": "0.29.1",
|
|
13
|
+
"@activepieces/shared": "0.83.0",
|
|
14
|
+
"tslib": "2.6.2"
|
|
15
|
+
}
|
|
16
|
+
}
|
package/src/i18n/fr.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Raindrop": "Raindrop",
|
|
3
|
+
"Bookmark manager to save, search, and organize content from the web": "Gestionnaire de marque-pages pour sauvegarder, rechercher et organiser du contenu web",
|
|
4
|
+
"Create Bookmark": "Créer un marque-page",
|
|
5
|
+
"Saves a new bookmark to your Raindrop.io account": "Enregistre un nouveau marque-page dans votre compte Raindrop",
|
|
6
|
+
"Get Bookmark": "Obtenir un marque-page",
|
|
7
|
+
"Retrieves the details of a bookmark by its ID": "Récupère les détails d'un marque-page par son identifiant",
|
|
8
|
+
"Update Bookmark": "Mettre à jour un marque-page",
|
|
9
|
+
"Updates the details of an existing bookmark": "Met à jour les détails d'un marque-page existant",
|
|
10
|
+
"Delete Bookmark": "Supprimer un marque-page",
|
|
11
|
+
"Moves a bookmark to the trash. To permanently delete it, empty the trash in Raindrop.io.": "Déplace un marque-page vers la corbeille. Pour le supprimer définitivement, videz la corbeille dans Raindrop.",
|
|
12
|
+
"Find Bookmarks": "Rechercher des marque-pages",
|
|
13
|
+
"Lists bookmarks from a collection, with optional keyword search": "Liste les marque-pages d'une collection, avec recherche optionnelle par mot-clé",
|
|
14
|
+
"URL": "URL",
|
|
15
|
+
"The URL of the page to bookmark": "L'URL de la page à enregistrer en marque-page",
|
|
16
|
+
"Title": "Titre",
|
|
17
|
+
"Custom title for the bookmark. If left empty, Raindrop will extract it from the URL automatically.": "Titre personnalisé du marque-page. Si vide, Raindrop l'extraira automatiquement depuis l'URL.",
|
|
18
|
+
"Excerpt": "Extrait",
|
|
19
|
+
"Short description or summary of the page": "Courte description ou résumé de la page",
|
|
20
|
+
"Note": "Note",
|
|
21
|
+
"Personal note to attach to this bookmark": "Note personnelle à attacher à ce marque-page",
|
|
22
|
+
"Collection": "Collection",
|
|
23
|
+
"Select the collection to use. Leave empty to use \"Unsorted\" (default inbox).": "Choisissez la collection à utiliser. Laissez vide pour utiliser « Non classés » (dossier par défaut).",
|
|
24
|
+
"Select the collection to save the bookmark in. Leave empty to save to Unsorted.": "Choisissez la collection où enregistrer le marque-page. Laissez vide pour enregistrer dans Non classés.",
|
|
25
|
+
"Tags": "Tags",
|
|
26
|
+
"List of tags to organize the bookmark (press Enter to add each tag)": "Liste de tags pour organiser le marque-page (appuyez sur Entrée pour ajouter chaque tag)",
|
|
27
|
+
"Mark as Favourite": "Marquer comme favori",
|
|
28
|
+
"Mark this bookmark as important / favourite": "Marquer ce marque-page comme important / favori",
|
|
29
|
+
"Bookmark ID": "ID du marque-page",
|
|
30
|
+
"The numeric ID of the bookmark. You can find it in the URL when viewing the bookmark in Raindrop.io (e.g. raindrop.io/app/raindrop/123456789).": "L'identifiant numérique du marque-page. Vous le trouvez dans l'URL quand vous consultez le marque-page dans Raindrop (ex : raindrop.io/app/raindrop/123456789).",
|
|
31
|
+
"The numeric ID of the bookmark to update. You can find it in the URL when viewing the bookmark in Raindrop.io (e.g. raindrop.io/app/raindrop/123456789).": "L'identifiant numérique du marque-page à mettre à jour. Vous le trouvez dans l'URL quand vous consultez le marque-page dans Raindrop (ex : raindrop.io/app/raindrop/123456789).",
|
|
32
|
+
"The numeric ID of the bookmark to delete. You can find it in the URL when viewing the bookmark in Raindrop.io (e.g. raindrop.io/app/raindrop/123456789).": "L'identifiant numérique du marque-page à supprimer. Vous le trouvez dans l'URL quand vous consultez le marque-page dans Raindrop (ex : raindrop.io/app/raindrop/123456789).",
|
|
33
|
+
"New Title": "Nouveau titre",
|
|
34
|
+
"Updated title for the bookmark": "Nouveau titre du marque-page",
|
|
35
|
+
"New Excerpt": "Nouvel extrait",
|
|
36
|
+
"Updated short description or summary of the page": "Nouvelle courte description ou résumé de la page",
|
|
37
|
+
"New Note": "Nouvelle note",
|
|
38
|
+
"Updated personal note attached to the bookmark": "Nouvelle note personnelle attachée au marque-page",
|
|
39
|
+
"New list of tags (replaces existing tags). Leave empty to keep existing tags unchanged.": "Nouvelle liste de tags (remplace les tags existants). Laissez vide pour conserver les tags actuels.",
|
|
40
|
+
"Mark or unmark this bookmark as important / favourite": "Marquer ou démarquer ce marque-page comme important / favori",
|
|
41
|
+
"Search Query": "Requête de recherche",
|
|
42
|
+
"Filter bookmarks by keyword. Supports operators like #tag or type:article. Leave empty to list all bookmarks.": "Filtrer les marque-pages par mot-clé. Supporte les opérateurs comme #tag ou type:article. Laissez vide pour lister tous les marque-pages.",
|
|
43
|
+
"Limit": "Limite",
|
|
44
|
+
"Maximum number of bookmarks to return (max 50)": "Nombre maximum de marque-pages à retourner (max 50)",
|
|
45
|
+
"Custom API Call": "Appel API personnalisé"
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Raindrop": "Raindrop",
|
|
3
|
+
"Bookmark manager to save, search, and organize content from the web": "Bookmark manager to save, search, and organize content from the web",
|
|
4
|
+
"Create Bookmark": "Create Bookmark",
|
|
5
|
+
"Saves a new bookmark to your Raindrop.io account": "Saves a new bookmark to your Raindrop.io account",
|
|
6
|
+
"Get Bookmark": "Get Bookmark",
|
|
7
|
+
"Retrieves the details of a bookmark by its ID": "Retrieves the details of a bookmark by its ID",
|
|
8
|
+
"Update Bookmark": "Update Bookmark",
|
|
9
|
+
"Updates the details of an existing bookmark": "Updates the details of an existing bookmark",
|
|
10
|
+
"Delete Bookmark": "Delete Bookmark",
|
|
11
|
+
"Moves a bookmark to the trash. To permanently delete it, empty the trash in Raindrop.io.": "Moves a bookmark to the trash. To permanently delete it, empty the trash in Raindrop.io.",
|
|
12
|
+
"Find Bookmarks": "Find Bookmarks",
|
|
13
|
+
"Lists bookmarks from a collection, with optional keyword search": "Lists bookmarks from a collection, with optional keyword search",
|
|
14
|
+
"URL": "URL",
|
|
15
|
+
"The URL of the page to bookmark": "The URL of the page to bookmark",
|
|
16
|
+
"Title": "Title",
|
|
17
|
+
"Custom title for the bookmark. If left empty, Raindrop will extract it from the URL automatically.": "Custom title for the bookmark. If left empty, Raindrop will extract it from the URL automatically.",
|
|
18
|
+
"Excerpt": "Excerpt",
|
|
19
|
+
"Short description or summary of the page": "Short description or summary of the page",
|
|
20
|
+
"Note": "Note",
|
|
21
|
+
"Personal note to attach to this bookmark": "Personal note to attach to this bookmark",
|
|
22
|
+
"Collection": "Collection",
|
|
23
|
+
"Select the collection to use. Leave empty to use \"Unsorted\" (default inbox).": "Select the collection to use. Leave empty to use \"Unsorted\" (default inbox).",
|
|
24
|
+
"Select the collection to save the bookmark in. Leave empty to save to Unsorted.": "Select the collection to save the bookmark in. Leave empty to save to Unsorted.",
|
|
25
|
+
"Tags": "Tags",
|
|
26
|
+
"List of tags to organize the bookmark (press Enter to add each tag)": "List of tags to organize the bookmark (press Enter to add each tag)",
|
|
27
|
+
"Mark as Favourite": "Mark as Favourite",
|
|
28
|
+
"Mark this bookmark as important / favourite": "Mark this bookmark as important / favourite",
|
|
29
|
+
"Bookmark ID": "Bookmark ID",
|
|
30
|
+
"The numeric ID of the bookmark. You can find it in the URL when viewing the bookmark in Raindrop.io (e.g. raindrop.io/app/raindrop/123456789).": "The numeric ID of the bookmark. You can find it in the URL when viewing the bookmark in Raindrop.io (e.g. raindrop.io/app/raindrop/123456789).",
|
|
31
|
+
"The numeric ID of the bookmark to update. You can find it in the URL when viewing the bookmark in Raindrop.io (e.g. raindrop.io/app/raindrop/123456789).": "The numeric ID of the bookmark to update. You can find it in the URL when viewing the bookmark in Raindrop.io (e.g. raindrop.io/app/raindrop/123456789).",
|
|
32
|
+
"The numeric ID of the bookmark to delete. You can find it in the URL when viewing the bookmark in Raindrop.io (e.g. raindrop.io/app/raindrop/123456789).": "The numeric ID of the bookmark to delete. You can find it in the URL when viewing the bookmark in Raindrop.io (e.g. raindrop.io/app/raindrop/123456789).",
|
|
33
|
+
"New Title": "New Title",
|
|
34
|
+
"Updated title for the bookmark": "Updated title for the bookmark",
|
|
35
|
+
"New Excerpt": "New Excerpt",
|
|
36
|
+
"Updated short description or summary of the page": "Updated short description or summary of the page",
|
|
37
|
+
"New Note": "New Note",
|
|
38
|
+
"Updated personal note attached to the bookmark": "Updated personal note attached to the bookmark",
|
|
39
|
+
"New list of tags (replaces existing tags). Leave empty to keep existing tags unchanged.": "New list of tags (replaces existing tags). Leave empty to keep existing tags unchanged.",
|
|
40
|
+
"Mark or unmark this bookmark as important / favourite": "Mark or unmark this bookmark as important / favourite",
|
|
41
|
+
"Search Query": "Search Query",
|
|
42
|
+
"Filter bookmarks by keyword. Supports operators like #tag or type:article. Leave empty to list all bookmarks.": "Filter bookmarks by keyword. Supports operators like #tag or type:article. Leave empty to list all bookmarks.",
|
|
43
|
+
"Limit": "Limit",
|
|
44
|
+
"Maximum number of bookmarks to return (max 50)": "Maximum number of bookmarks to return (max 50)",
|
|
45
|
+
"Custom API Call": "Custom API Call"
|
|
46
|
+
}
|
package/src/index.d.ts
ADDED
package/src/index.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.raindrop = exports.raindropAuth = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const shared_1 = require("@activepieces/shared");
|
|
8
|
+
const auth_1 = require("./lib/auth");
|
|
9
|
+
Object.defineProperty(exports, "raindropAuth", { enumerable: true, get: function () { return auth_1.raindropAuth; } });
|
|
10
|
+
const create_raindrop_1 = require("./lib/actions/create-raindrop");
|
|
11
|
+
const get_raindrop_1 = require("./lib/actions/get-raindrop");
|
|
12
|
+
const update_raindrop_1 = require("./lib/actions/update-raindrop");
|
|
13
|
+
const delete_raindrop_1 = require("./lib/actions/delete-raindrop");
|
|
14
|
+
const find_raindrops_1 = require("./lib/actions/find-raindrops");
|
|
15
|
+
exports.raindrop = (0, pieces_framework_1.createPiece)({
|
|
16
|
+
displayName: 'Raindrop',
|
|
17
|
+
description: 'Bookmark manager to save, search, and organize content from the web',
|
|
18
|
+
minimumSupportedRelease: '0.36.1',
|
|
19
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/raindrop.png',
|
|
20
|
+
categories: [shared_1.PieceCategory.PRODUCTIVITY, shared_1.PieceCategory.CONTENT_AND_FILES],
|
|
21
|
+
auth: auth_1.raindropAuth,
|
|
22
|
+
authors: ['bs1tn'],
|
|
23
|
+
actions: [
|
|
24
|
+
create_raindrop_1.createRaindropAction,
|
|
25
|
+
get_raindrop_1.getRaindropAction,
|
|
26
|
+
update_raindrop_1.updateRaindropAction,
|
|
27
|
+
delete_raindrop_1.deleteRaindropAction,
|
|
28
|
+
find_raindrops_1.findRaindropsAction,
|
|
29
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
30
|
+
baseUrl: () => 'https://api.raindrop.io/rest/v1',
|
|
31
|
+
auth: auth_1.raindropAuth,
|
|
32
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
+
return ({
|
|
34
|
+
Authorization: `Bearer ${auth.access_token}`,
|
|
35
|
+
});
|
|
36
|
+
}),
|
|
37
|
+
}),
|
|
38
|
+
],
|
|
39
|
+
triggers: [],
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAA6D;AAC7D,iDAAqD;AACrD,qCAA0C;AAMjC,6FANA,mBAAY,OAMA;AALrB,mEAAqE;AACrE,6DAA+D;AAC/D,mEAAqE;AACrE,mEAAqE;AACrE,iEAAmE;AAGtD,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC;IAClC,WAAW,EAAE,UAAU;IACvB,WAAW,EACT,qEAAqE;IACvE,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,kDAAkD;IAC3D,UAAU,EAAE,CAAC,sBAAa,CAAC,YAAY,EAAE,sBAAa,CAAC,iBAAiB,CAAC;IACzE,IAAI,EAAE,mBAAY;IAClB,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,OAAO,EAAE;QACP,sCAAoB;QACpB,gCAAiB;QACjB,sCAAoB;QACpB,sCAAoB;QACpB,oCAAmB;QACnB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,iCAAiC;YAChD,IAAI,EAAE,mBAAY;YAClB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,IAAI,CAAC,YAAY,EAAE;iBAC7C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const createRaindropAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
link: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
excerpt: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
5
|
+
note: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
6
|
+
collection_id: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
7
|
+
tags: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
8
|
+
important: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRaindropAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.createRaindropAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.raindropAuth,
|
|
11
|
+
name: 'create_raindrop',
|
|
12
|
+
displayName: 'Create Bookmark',
|
|
13
|
+
description: 'Saves a new bookmark to your Raindrop.io account',
|
|
14
|
+
props: {
|
|
15
|
+
link: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'URL',
|
|
17
|
+
description: 'The URL of the page to bookmark',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
title: pieces_framework_1.Property.ShortText({
|
|
21
|
+
displayName: 'Title',
|
|
22
|
+
description: 'Custom title for the bookmark. If left empty, Raindrop will extract it from the URL automatically.',
|
|
23
|
+
required: false,
|
|
24
|
+
}),
|
|
25
|
+
excerpt: pieces_framework_1.Property.LongText({
|
|
26
|
+
displayName: 'Excerpt',
|
|
27
|
+
description: 'Short description or summary of the page',
|
|
28
|
+
required: false,
|
|
29
|
+
}),
|
|
30
|
+
note: pieces_framework_1.Property.LongText({
|
|
31
|
+
displayName: 'Note',
|
|
32
|
+
description: 'Personal note to attach to this bookmark',
|
|
33
|
+
required: false,
|
|
34
|
+
}),
|
|
35
|
+
collection_id: common_1.raindropCommons.collectionDropdown,
|
|
36
|
+
tags: pieces_framework_1.Property.Array({
|
|
37
|
+
displayName: 'Tags',
|
|
38
|
+
description: 'List of tags to organize the bookmark (press Enter to add each tag)',
|
|
39
|
+
required: false,
|
|
40
|
+
}),
|
|
41
|
+
important: pieces_framework_1.Property.Checkbox({
|
|
42
|
+
displayName: 'Mark as Favourite',
|
|
43
|
+
description: 'Mark this bookmark as important / favourite',
|
|
44
|
+
required: false,
|
|
45
|
+
defaultValue: false,
|
|
46
|
+
}),
|
|
47
|
+
},
|
|
48
|
+
run(context) {
|
|
49
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const { link, title, excerpt, note, collection_id, tags, important } = context.propsValue;
|
|
51
|
+
const accessToken = context.auth.access_token;
|
|
52
|
+
const body = {
|
|
53
|
+
link,
|
|
54
|
+
pleaseParse: {},
|
|
55
|
+
};
|
|
56
|
+
if (title)
|
|
57
|
+
body['title'] = title;
|
|
58
|
+
if (excerpt)
|
|
59
|
+
body['excerpt'] = excerpt;
|
|
60
|
+
if (note)
|
|
61
|
+
body['note'] = note;
|
|
62
|
+
if (collection_id !== null && collection_id !== undefined) {
|
|
63
|
+
body['collection'] = { $id: collection_id };
|
|
64
|
+
}
|
|
65
|
+
if (tags && tags.length > 0)
|
|
66
|
+
body['tags'] = tags;
|
|
67
|
+
if (important)
|
|
68
|
+
body['important'] = important;
|
|
69
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
70
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
71
|
+
url: `${common_1.raindropCommons.BASE_URL}/raindrop`,
|
|
72
|
+
headers: {
|
|
73
|
+
Authorization: `Bearer ${accessToken}`,
|
|
74
|
+
'Content-Type': 'application/json',
|
|
75
|
+
},
|
|
76
|
+
body,
|
|
77
|
+
});
|
|
78
|
+
return flattenResponse(response.body.item);
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
function flattenResponse(item) {
|
|
83
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
84
|
+
return {
|
|
85
|
+
id: item._id,
|
|
86
|
+
title: (_a = item.title) !== null && _a !== void 0 ? _a : null,
|
|
87
|
+
excerpt: (_b = item.excerpt) !== null && _b !== void 0 ? _b : null,
|
|
88
|
+
note: (_c = item.note) !== null && _c !== void 0 ? _c : null,
|
|
89
|
+
link: (_d = item.link) !== null && _d !== void 0 ? _d : null,
|
|
90
|
+
type: (_e = item.type) !== null && _e !== void 0 ? _e : null,
|
|
91
|
+
tags: Array.isArray(item.tags) ? item.tags.join(', ') : null,
|
|
92
|
+
important: (_f = item.important) !== null && _f !== void 0 ? _f : false,
|
|
93
|
+
collection_id: (_h = (_g = item.collection) === null || _g === void 0 ? void 0 : _g.$id) !== null && _h !== void 0 ? _h : null,
|
|
94
|
+
cover: (_j = item.cover) !== null && _j !== void 0 ? _j : null,
|
|
95
|
+
created_at: (_k = item.created) !== null && _k !== void 0 ? _k : null,
|
|
96
|
+
updated_at: (_l = item.lastUpdate) !== null && _l !== void 0 ? _l : null,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=create-raindrop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-raindrop.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-raindrop.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AACrE,qEAAwE;AACxE,kCAAuC;AACvC,sCAA4C;AAE/B,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,kDAAkD;IAC/D,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,KAAK;YAClB,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EACT,oGAAoG;YACtG,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACzB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,0CAA0C;YACvD,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,I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AI;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const deleteRaindropAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
raindrop_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
}>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteRaindropAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.deleteRaindropAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.raindropAuth,
|
|
11
|
+
name: 'delete_raindrop',
|
|
12
|
+
displayName: 'Delete Bookmark',
|
|
13
|
+
description: 'Moves a bookmark to the trash. To permanently delete it, empty the trash in Raindrop.io.',
|
|
14
|
+
props: {
|
|
15
|
+
raindrop_id: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Bookmark ID',
|
|
17
|
+
description: 'The numeric ID of the bookmark to delete. You can find it in the URL when viewing the bookmark in Raindrop.io (e.g. raindrop.io/app/raindrop/123456789).',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
run(context) {
|
|
22
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const { raindrop_id } = context.propsValue;
|
|
24
|
+
const accessToken = context.auth.access_token;
|
|
25
|
+
yield pieces_common_1.httpClient.sendRequest({
|
|
26
|
+
method: pieces_common_1.HttpMethod.DELETE,
|
|
27
|
+
url: `${common_1.raindropCommons.BASE_URL}/raindrop/${raindrop_id}`,
|
|
28
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
29
|
+
});
|
|
30
|
+
return { success: true, deleted_id: raindrop_id };
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=delete-raindrop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-raindrop.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-raindrop.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AACrE,qEAAwE;AACxE,kCAAuC;AACvC,sCAA4C;AAE/B,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EACT,0FAA0F;IAC5F,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,0JAA0J;YAC5J,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC3C,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC;YAE9C,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC3B,MAAM,EAAE,0BAAU,CAAC,MAAM;gBACzB,GAAG,EAAE,GAAG,wBAAe,CAAC,QAAQ,aAAa,WAAW,EAAE;gBAC1D,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,WAAW,EAAE,EAAE;aACpD,CAAC,CAAC;YAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;QACpD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const findRaindropsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
collection_id: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
3
|
+
search: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findRaindropsAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.findRaindropsAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.raindropAuth,
|
|
11
|
+
name: 'find_raindrops',
|
|
12
|
+
displayName: 'Find Bookmarks',
|
|
13
|
+
description: 'Lists bookmarks from a collection, with optional keyword search',
|
|
14
|
+
props: {
|
|
15
|
+
collection_id: common_1.raindropCommons.collectionDropdown,
|
|
16
|
+
search: pieces_framework_1.Property.ShortText({
|
|
17
|
+
displayName: 'Search Query',
|
|
18
|
+
description: 'Filter bookmarks by keyword. Supports operators like #tag or type:article. Leave empty to list all bookmarks.',
|
|
19
|
+
required: false,
|
|
20
|
+
}),
|
|
21
|
+
limit: pieces_framework_1.Property.Number({
|
|
22
|
+
displayName: 'Limit',
|
|
23
|
+
description: 'Maximum number of bookmarks to return (max 50)',
|
|
24
|
+
required: false,
|
|
25
|
+
defaultValue: 25,
|
|
26
|
+
}),
|
|
27
|
+
},
|
|
28
|
+
run(context) {
|
|
29
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
const { collection_id, search, limit } = context.propsValue;
|
|
31
|
+
const accessToken = context.auth.access_token;
|
|
32
|
+
const collectionIdToUse = collection_id !== null && collection_id !== void 0 ? collection_id : 0;
|
|
33
|
+
const perpage = Math.min(limit !== null && limit !== void 0 ? limit : 25, 50);
|
|
34
|
+
const queryParams = {
|
|
35
|
+
sort: '-created',
|
|
36
|
+
perpage: String(perpage),
|
|
37
|
+
page: '0',
|
|
38
|
+
};
|
|
39
|
+
if (search)
|
|
40
|
+
queryParams['search'] = search;
|
|
41
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
42
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
43
|
+
url: `${common_1.raindropCommons.BASE_URL}/raindrops/${collectionIdToUse}`,
|
|
44
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
45
|
+
queryParams,
|
|
46
|
+
});
|
|
47
|
+
return response.body.items.map((item) => {
|
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
49
|
+
return ({
|
|
50
|
+
id: item._id,
|
|
51
|
+
title: (_a = item.title) !== null && _a !== void 0 ? _a : null,
|
|
52
|
+
excerpt: (_b = item.excerpt) !== null && _b !== void 0 ? _b : null,
|
|
53
|
+
note: (_c = item.note) !== null && _c !== void 0 ? _c : null,
|
|
54
|
+
link: (_d = item.link) !== null && _d !== void 0 ? _d : null,
|
|
55
|
+
type: (_e = item.type) !== null && _e !== void 0 ? _e : null,
|
|
56
|
+
tags: Array.isArray(item.tags) ? item.tags.join(', ') : null,
|
|
57
|
+
important: (_f = item.important) !== null && _f !== void 0 ? _f : false,
|
|
58
|
+
collection_id: (_h = (_g = item.collection) === null || _g === void 0 ? void 0 : _g.$id) !== null && _h !== void 0 ? _h : null,
|
|
59
|
+
cover: (_j = item.cover) !== null && _j !== void 0 ? _j : null,
|
|
60
|
+
created_at: (_k = item.created) !== null && _k !== void 0 ? _k : null,
|
|
61
|
+
updated_at: (_l = item.lastUpdate) !== null && _l !== void 0 ? _l : null,
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=find-raindrops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-raindrops.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-raindrops.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AACrE,qEAAwE;AACxE,kCAAuC;AACvC,sCAA4C;AAE/B,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,iEAAiE;IAC9E,KAAK,EAAE;QACL,aAAa,EAAE,wBAAe,CAAC,kBAAkB;QACjD,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,cAAc;YAC3B,WAAW,EACT,+GAA+G;YACjH,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,EAAE;SACjB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC;YAE9C,MAAM,iBAAiB,GAAG,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,CAAC,CAAC;YAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,EAAE,EAAE,CAAC,CAAC;YAE1C,MAAM,WAAW,GAA2B;gBAC1C,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,MAAM,CAAC,OAAO,C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AC,UAAU,mCAAI,IAAI;iBACpC,CAAC,CAAA;aAAA,CAAC,CAAC;QACN,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const getRaindropAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
raindrop_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
}>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRaindropAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.getRaindropAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.raindropAuth,
|
|
11
|
+
name: 'get_raindrop',
|
|
12
|
+
displayName: 'Get Bookmark',
|
|
13
|
+
description: 'Retrieves the details of a bookmark by its ID',
|
|
14
|
+
props: {
|
|
15
|
+
raindrop_id: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Bookmark ID',
|
|
17
|
+
description: 'The numeric ID of the bookmark. You can find it in the URL when viewing the bookmark in Raindrop.io (e.g. raindrop.io/app/raindrop/123456789).',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
run(context) {
|
|
22
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const { raindrop_id } = context.propsValue;
|
|
24
|
+
const accessToken = context.auth.access_token;
|
|
25
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
26
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
27
|
+
url: `${common_1.raindropCommons.BASE_URL}/raindrop/${raindrop_id}`,
|
|
28
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
29
|
+
});
|
|
30
|
+
return flattenResponse(response.body.item);
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
function flattenResponse(item) {
|
|
35
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
36
|
+
return {
|
|
37
|
+
id: item._id,
|
|
38
|
+
title: (_a = item.title) !== null && _a !== void 0 ? _a : null,
|
|
39
|
+
excerpt: (_b = item.excerpt) !== null && _b !== void 0 ? _b : null,
|
|
40
|
+
note: (_c = item.note) !== null && _c !== void 0 ? _c : null,
|
|
41
|
+
link: (_d = item.link) !== null && _d !== void 0 ? _d : null,
|
|
42
|
+
type: (_e = item.type) !== null && _e !== void 0 ? _e : null,
|
|
43
|
+
tags: Array.isArray(item.tags) ? item.tags.join(', ') : null,
|
|
44
|
+
important: (_f = item.important) !== null && _f !== void 0 ? _f : false,
|
|
45
|
+
collection_id: (_h = (_g = item.collection) === null || _g === void 0 ? void 0 : _g.$id) !== null && _h !== void 0 ? _h : null,
|
|
46
|
+
cover: (_j = item.cover) !== null && _j !== void 0 ? _j : null,
|
|
47
|
+
created_at: (_k = item.created) !== null && _k !== void 0 ? _k : null,
|
|
48
|
+
updated_at: (_l = item.lastUpdate) !== null && _l !== void 0 ? _l : null,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=get-raindrop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-raindrop.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-raindrop.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AACrE,qEAAwE;AACxE,kCAAuC;AACvC,sCAA4C;AAE/B,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc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S,mCAAI,KAAK;QAClC,aAAa,EAAE,MAAA,MAAA,IAAI,CAAC,UAAU,0CAAE,GAAG,mCAAI,IAAI;QAC3C,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,mCAAI,IAAI;QACzB,UAAU,EAAE,MAAA,IAAI,CAAC,OAAO,mCAAI,IAAI;QAChC,UAAU,EAAE,MAAA,IAAI,CAAC,UAAU,mCAAI,IAAI;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const updateRaindropAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
raindrop_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
+
excerpt: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
5
|
+
note: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
6
|
+
collection_id: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
7
|
+
tags: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
8
|
+
important: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateRaindropAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.updateRaindropAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: auth_1.raindropAuth,
|
|
11
|
+
name: 'update_raindrop',
|
|
12
|
+
displayName: 'Update Bookmark',
|
|
13
|
+
description: 'Updates the details of an existing bookmark',
|
|
14
|
+
props: {
|
|
15
|
+
raindrop_id: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Bookmark ID',
|
|
17
|
+
description: 'The numeric ID of the bookmark to update. You can find it in the URL when viewing the bookmark in Raindrop.io (e.g. raindrop.io/app/raindrop/123456789).',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
title: pieces_framework_1.Property.ShortText({
|
|
21
|
+
displayName: 'New Title',
|
|
22
|
+
description: 'Updated title for the bookmark',
|
|
23
|
+
required: false,
|
|
24
|
+
}),
|
|
25
|
+
excerpt: pieces_framework_1.Property.LongText({
|
|
26
|
+
displayName: 'New Excerpt',
|
|
27
|
+
description: 'Updated short description or summary of the page',
|
|
28
|
+
required: false,
|
|
29
|
+
}),
|
|
30
|
+
note: pieces_framework_1.Property.LongText({
|
|
31
|
+
displayName: 'New Note',
|
|
32
|
+
description: 'Updated personal note attached to the bookmark',
|
|
33
|
+
required: false,
|
|
34
|
+
}),
|
|
35
|
+
collection_id: common_1.raindropCommons.collectionDropdown,
|
|
36
|
+
tags: pieces_framework_1.Property.Array({
|
|
37
|
+
displayName: 'Tags',
|
|
38
|
+
description: 'New list of tags (replaces existing tags). Leave empty to keep existing tags unchanged.',
|
|
39
|
+
required: false,
|
|
40
|
+
}),
|
|
41
|
+
important: pieces_framework_1.Property.Checkbox({
|
|
42
|
+
displayName: 'Mark as Favourite',
|
|
43
|
+
description: 'Mark or unmark this bookmark as important / favourite',
|
|
44
|
+
required: false,
|
|
45
|
+
}),
|
|
46
|
+
},
|
|
47
|
+
run(context) {
|
|
48
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
const { raindrop_id, title, excerpt, note, collection_id, tags, important } = context.propsValue;
|
|
50
|
+
const accessToken = context.auth.access_token;
|
|
51
|
+
const body = {};
|
|
52
|
+
if (title !== undefined && title !== null)
|
|
53
|
+
body['title'] = title;
|
|
54
|
+
if (excerpt !== undefined && excerpt !== null)
|
|
55
|
+
body['excerpt'] = excerpt;
|
|
56
|
+
if (note !== undefined && note !== null)
|
|
57
|
+
body['note'] = note;
|
|
58
|
+
if (collection_id !== null && collection_id !== undefined) {
|
|
59
|
+
body['collection'] = { $id: collection_id };
|
|
60
|
+
}
|
|
61
|
+
if (tags && tags.length > 0)
|
|
62
|
+
body['tags'] = tags;
|
|
63
|
+
if (important !== undefined && important !== null)
|
|
64
|
+
body['important'] = important;
|
|
65
|
+
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
66
|
+
method: pieces_common_1.HttpMethod.PUT,
|
|
67
|
+
url: `${common_1.raindropCommons.BASE_URL}/raindrop/${raindrop_id}`,
|
|
68
|
+
headers: {
|
|
69
|
+
Authorization: `Bearer ${accessToken}`,
|
|
70
|
+
'Content-Type': 'application/json',
|
|
71
|
+
},
|
|
72
|
+
body,
|
|
73
|
+
});
|
|
74
|
+
return flattenResponse(response.body.item);
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
function flattenResponse(item) {
|
|
79
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
80
|
+
return {
|
|
81
|
+
id: item._id,
|
|
82
|
+
title: (_a = item.title) !== null && _a !== void 0 ? _a : null,
|
|
83
|
+
excerpt: (_b = item.excerpt) !== null && _b !== void 0 ? _b : null,
|
|
84
|
+
note: (_c = item.note) !== null && _c !== void 0 ? _c : null,
|
|
85
|
+
link: (_d = item.link) !== null && _d !== void 0 ? _d : null,
|
|
86
|
+
type: (_e = item.type) !== null && _e !== void 0 ? _e : null,
|
|
87
|
+
tags: Array.isArray(item.tags) ? item.tags.join(', ') : null,
|
|
88
|
+
important: (_f = item.important) !== null && _f !== void 0 ? _f : false,
|
|
89
|
+
collection_id: (_h = (_g = item.collection) === null || _g === void 0 ? void 0 : _g.$id) !== null && _h !== void 0 ? _h : null,
|
|
90
|
+
cover: (_j = item.cover) !== null && _j !== void 0 ? _j : null,
|
|
91
|
+
created_at: (_k = item.created) !== null && _k !== void 0 ? _k : null,
|
|
92
|
+
updated_at: (_l = item.lastUpdate) !== null && _l !== void 0 ? _l : null,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=update-raindrop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-raindrop.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-raindrop.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AACrE,qEAAwE;AACxE,kCAAuC;AACvC,sCAA4C;AAE/B,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,6CAA6C;IAC1D,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,0JAA0J;YAC5J,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACzB,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,kDAAkD;YAC/D,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,aAAa,EAAE,wBAAe,CAAC,kBAAkB;QACjD,IAAI,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACnB,WAAW,EAAE,MAAM;YACnB,WAAW,EACT,yFAAyF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wBAAe,CAAC,QAAQ,aAAa,WAAW,EAAE;gBAC1D,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,WAAW,EAAE;oBACtC,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI;aACL,CAAC,CAAC;YAEH,OAAO,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7C,CAAC;KAAA;CACF,CAAC,CAAC;AAEH,SAAS,eAAe,CAAC,IAAyB;;IAChD,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,GAAG;QACZ,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,mCAAI,IAAI;QACzB,OAAO,EAAE,MAAA,IAAI,CAAC,OAAO,mCAAI,IAAI;QAC7B,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,mCAAI,IAAI;QACvB,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,mCAAI,IAAI;QACvB,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,mCAAI,IAAI;QACvB,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;QAC5D,SAAS,EAAE,MAAA,IAAI,CAAC,SAAS,mCAAI,KAAK;QAClC,aAAa,EAAE,MAAA,MAAA,IAAI,CAAC,UAAU,0CAAE,GAAG,mCAAI,IAAI;QAC3C,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,mCAAI,IAAI;QACzB,UAAU,EAAE,MAAA,IAAI,CAAC,OAAO,mCAAI,IAAI;QAChC,UAAU,EAAE,MAAA,IAAI,CAAC,UAAU,mCAAI,IAAI;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const raindropAuth: import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>;
|
package/src/lib/auth.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.raindropAuth = void 0;
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
+
exports.raindropAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
6
|
+
required: true,
|
|
7
|
+
authUrl: 'https://raindrop.io/oauth/authorize',
|
|
8
|
+
tokenUrl: 'https://raindrop.io/oauth/access_token',
|
|
9
|
+
scope: [],
|
|
10
|
+
extra: {},
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;AAAA,qEAA2D;AAE9C,QAAA,YAAY,GAAG,4BAAS,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,qCAAqC;IAC9C,QAAQ,EAAE,wCAAwC;IAClD,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;CACV,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const raindropCommons: {
|
|
2
|
+
BASE_URL: string;
|
|
3
|
+
collectionDropdown: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
4
|
+
flattenRaindrop: typeof flattenRaindrop;
|
|
5
|
+
};
|
|
6
|
+
declare function flattenRaindrop({ raindrop, }: {
|
|
7
|
+
raindrop: RaindropApiItem;
|
|
8
|
+
}): FlatRaindrop;
|
|
9
|
+
type RaindropApiItem = {
|
|
10
|
+
_id: number;
|
|
11
|
+
title?: string;
|
|
12
|
+
excerpt?: string;
|
|
13
|
+
note?: string;
|
|
14
|
+
link?: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
tags?: string[];
|
|
17
|
+
important?: boolean;
|
|
18
|
+
collection?: {
|
|
19
|
+
$id: number;
|
|
20
|
+
};
|
|
21
|
+
cover?: string;
|
|
22
|
+
created?: string;
|
|
23
|
+
lastUpdate?: string;
|
|
24
|
+
};
|
|
25
|
+
type FlatRaindrop = {
|
|
26
|
+
id: number;
|
|
27
|
+
title: string | null;
|
|
28
|
+
excerpt: string | null;
|
|
29
|
+
note: string | null;
|
|
30
|
+
link: string | null;
|
|
31
|
+
type: string | null;
|
|
32
|
+
tags: string | null;
|
|
33
|
+
important: boolean;
|
|
34
|
+
collection_id: number | null;
|
|
35
|
+
cover: string | null;
|
|
36
|
+
created_at: string | null;
|
|
37
|
+
updated_at: string | null;
|
|
38
|
+
};
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.raindropCommons = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
+
const auth_1 = require("../auth");
|
|
8
|
+
const BASE_URL = 'https://api.raindrop.io/rest/v1';
|
|
9
|
+
const collectionDropdown = pieces_framework_1.Property.Dropdown({
|
|
10
|
+
displayName: 'Collection',
|
|
11
|
+
description: 'Select the collection to use. Leave empty to use "Unsorted" (default inbox).',
|
|
12
|
+
refreshers: [],
|
|
13
|
+
required: false,
|
|
14
|
+
auth: auth_1.raindropAuth,
|
|
15
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
16
|
+
if (!auth) {
|
|
17
|
+
return {
|
|
18
|
+
disabled: true,
|
|
19
|
+
options: [],
|
|
20
|
+
placeholder: 'Please connect your account first',
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const accessToken = auth.access_token;
|
|
24
|
+
try {
|
|
25
|
+
const [rootResp, childResp] = yield Promise.all([
|
|
26
|
+
pieces_common_1.httpClient.sendRequest({
|
|
27
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
28
|
+
url: `${BASE_URL}/collections`,
|
|
29
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
30
|
+
}),
|
|
31
|
+
pieces_common_1.httpClient.sendRequest({
|
|
32
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
33
|
+
url: `${BASE_URL}/collections/childrens`,
|
|
34
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
35
|
+
}),
|
|
36
|
+
]);
|
|
37
|
+
const allCollections = [
|
|
38
|
+
...rootResp.body.items,
|
|
39
|
+
...childResp.body.items,
|
|
40
|
+
];
|
|
41
|
+
return {
|
|
42
|
+
disabled: false,
|
|
43
|
+
options: [
|
|
44
|
+
{ label: 'Unsorted', value: -1 },
|
|
45
|
+
...allCollections.map((c) => ({ label: c.title, value: c._id })),
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
catch (_b) {
|
|
50
|
+
return {
|
|
51
|
+
disabled: true,
|
|
52
|
+
options: [],
|
|
53
|
+
placeholder: 'Failed to load collections. Check your connection.',
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}),
|
|
57
|
+
});
|
|
58
|
+
exports.raindropCommons = {
|
|
59
|
+
BASE_URL,
|
|
60
|
+
collectionDropdown,
|
|
61
|
+
flattenRaindrop,
|
|
62
|
+
};
|
|
63
|
+
function flattenRaindrop({ raindrop, }) {
|
|
64
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
65
|
+
return {
|
|
66
|
+
id: raindrop._id,
|
|
67
|
+
title: (_a = raindrop.title) !== null && _a !== void 0 ? _a : null,
|
|
68
|
+
excerpt: (_b = raindrop.excerpt) !== null && _b !== void 0 ? _b : null,
|
|
69
|
+
note: (_c = raindrop.note) !== null && _c !== void 0 ? _c : null,
|
|
70
|
+
link: (_d = raindrop.link) !== null && _d !== void 0 ? _d : null,
|
|
71
|
+
type: (_e = raindrop.type) !== null && _e !== void 0 ? _e : null,
|
|
72
|
+
tags: Array.isArray(raindrop.tags) ? raindrop.tags.join(', ') : null,
|
|
73
|
+
important: (_f = raindrop.important) !== null && _f !== void 0 ? _f : false,
|
|
74
|
+
collection_id: (_h = (_g = raindrop.collection) === null || _g === void 0 ? void 0 : _g.$id) !== null && _h !== void 0 ? _h : null,
|
|
75
|
+
cover: (_j = raindrop.cover) !== null && _j !== void 0 ? _j : null,
|
|
76
|
+
created_at: (_k = raindrop.created) !== null && _k !== void 0 ? _k : null,
|
|
77
|
+
updated_at: (_l = raindrop.lastUpdate) !== null && _l !== void 0 ? _l : null,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AACrE,qEAAyD;AACzD,kCAAuC;AAEvC,MAAM,QAAQ,GAAG,iCAAiC,CAAC;AAEnD,MAAM,kBAAkB,GAAG,2BAAQ,CAAC,QAAQ,CAAC;IAC3C,WAAW,EAAE,YAAY;IACzB,WAAW,EACT,8EAA8E;IAChF,UAAU,EAAE,EAAE;IACd,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,mBAAY;IAClB,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACtB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,mCAAmC;aACjD,CAAC;QACJ,CAAC;QACD,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC;QACtC,IAAI,CAAC;YACH,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;gBAC9C,0BAAU,CAAC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