@activepieces/piece-granola 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 +25 -0
- package/src/i18n/translation.json +25 -0
- package/src/index.d.ts +3 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +60 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/get-note.d.ts +5 -0
- package/src/lib/actions/get-note.d.ts.map +1 -0
- package/src/lib/actions/get-note.js +43 -0
- package/src/lib/actions/get-note.js.map +1 -0
- package/src/lib/actions/list-notes.d.ts +7 -0
- package/src/lib/actions/list-notes.d.ts.map +1 -0
- package/src/lib/actions/list-notes.js +66 -0
- package/src/lib/actions/list-notes.js.map +1 -0
- package/src/lib/common/index.d.ts +92 -0
- package/src/lib/common/index.d.ts.map +1 -0
- package/src/lib/common/index.js +57 -0
- package/src/lib/common/index.js.map +1 -0
- package/src/lib/triggers/new-note.d.ts +3 -0
- package/src/lib/triggers/new-note.d.ts.map +1 -0
- package/src/lib/triggers/new-note.js +73 -0
- package/src/lib/triggers/new-note.js.map +1 -0
- package/src/lib/triggers/updated-note.d.ts +3 -0
- package/src/lib/triggers/updated-note.d.ts.map +1 -0
- package/src/lib/triggers/updated-note.js +75 -0
- package/src/lib/triggers/updated-note.js.map +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@activepieces/piece-granola",
|
|
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.0",
|
|
12
|
+
"@activepieces/pieces-framework": "0.26.0",
|
|
13
|
+
"@activepieces/shared": "0.51.0",
|
|
14
|
+
"tslib": "2.6.2"
|
|
15
|
+
}
|
|
16
|
+
}
|
package/src/i18n/fr.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"AI-powered meeting notes — automatically captures and summarizes your meetings.": "Notes de réunion propulsées par l'IA — capture et résume automatiquement vos réunions.",
|
|
3
|
+
"API Key": "Clé API",
|
|
4
|
+
"To get your API key:\n1. Open the **Granola desktop app**\n2. Go to **Settings > API**\n3. Click **Create API Key**\n4. Copy the key and paste it here\n\n**Note:** You need a Business or Enterprise plan to use API keys.": "Pour obtenir votre clé API :\n1. Ouvrez l'**application Granola**\n2. Allez dans **Paramètres > API**\n3. Cliquez sur **Créer une clé API**\n4. Copiez la clé et collez-la ici\n\n**Remarque :** Un abonnement Business ou Enterprise est nécessaire pour utiliser les clés API.",
|
|
5
|
+
"List Notes": "Lister les notes",
|
|
6
|
+
"List your meeting notes with optional date filters.": "Liste vos notes de réunion avec des filtres de date optionnels.",
|
|
7
|
+
"Created After": "Créée après",
|
|
8
|
+
"Only return notes created after this date. Leave empty to return all notes.": "Ne retourner que les notes créées après cette date. Laisser vide pour retourner toutes les notes.",
|
|
9
|
+
"Created Before": "Créée avant",
|
|
10
|
+
"Only return notes created before this date. Leave empty for no upper limit.": "Ne retourner que les notes créées avant cette date. Laisser vide pour ne pas fixer de limite.",
|
|
11
|
+
"Updated After": "Modifiée après",
|
|
12
|
+
"Only return notes updated after this date. Useful to find recently modified notes.": "Ne retourner que les notes modifiées après cette date. Utile pour trouver les notes récemment modifiées.",
|
|
13
|
+
"Page Size": "Taille de page",
|
|
14
|
+
"Number of notes to return per page (1–30).": "Nombre de notes à retourner par page (1–30).",
|
|
15
|
+
"Get Note": "Obtenir une note",
|
|
16
|
+
"Retrieve a single meeting note by its ID, with optional transcript.": "Récupère une note de réunion par son identifiant, avec transcription optionnelle.",
|
|
17
|
+
"Note ID": "Identifiant de la note",
|
|
18
|
+
"The ID of the note to retrieve. Starts with `not_` followed by 14 characters (e.g. `not_1d3tmYTlCICgjy`). You can get this from the **List Notes** action.": "L'identifiant de la note à récupérer. Commence par `not_` suivi de 14 caractères (ex. `not_1d3tmYTlCICgjy`). Vous pouvez l'obtenir via l'action **Lister les notes**.",
|
|
19
|
+
"Include Transcript": "Inclure la transcription",
|
|
20
|
+
"Include the full meeting transcript in the response. The transcript shows who said what and when.": "Inclure la transcription complète de la réunion dans la réponse. La transcription indique qui a dit quoi et quand.",
|
|
21
|
+
"New Note": "Nouvelle note",
|
|
22
|
+
"Triggers when a new meeting note is created in Granola.": "Se déclenche lorsqu'une nouvelle note de réunion est créée dans Granola.",
|
|
23
|
+
"Updated Note": "Note modifiée",
|
|
24
|
+
"Triggers when an existing meeting note is updated in Granola (e.g. summary edited, attendees changed).": "Se déclenche lorsqu'une note de réunion existante est modifiée dans Granola (ex. résumé édité, participants modifiés)."
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"AI-powered meeting notes — automatically captures and summarizes your meetings.": "AI-powered meeting notes — automatically captures and summarizes your meetings.",
|
|
3
|
+
"API Key": "API Key",
|
|
4
|
+
"To get your API key:\n1. Open the **Granola desktop app**\n2. Go to **Settings > API**\n3. Click **Create API Key**\n4. Copy the key and paste it here\n\n**Note:** You need a Business or Enterprise plan to use API keys.": "To get your API key:\n1. Open the **Granola desktop app**\n2. Go to **Settings > API**\n3. Click **Create API Key**\n4. Copy the key and paste it here\n\n**Note:** You need a Business or Enterprise plan to use API keys.",
|
|
5
|
+
"List Notes": "List Notes",
|
|
6
|
+
"List your meeting notes with optional date filters.": "List your meeting notes with optional date filters.",
|
|
7
|
+
"Created After": "Created After",
|
|
8
|
+
"Only return notes created after this date. Leave empty to return all notes.": "Only return notes created after this date. Leave empty to return all notes.",
|
|
9
|
+
"Created Before": "Created Before",
|
|
10
|
+
"Only return notes created before this date. Leave empty for no upper limit.": "Only return notes created before this date. Leave empty for no upper limit.",
|
|
11
|
+
"Updated After": "Updated After",
|
|
12
|
+
"Only return notes updated after this date. Useful to find recently modified notes.": "Only return notes updated after this date. Useful to find recently modified notes.",
|
|
13
|
+
"Page Size": "Page Size",
|
|
14
|
+
"Number of notes to return per page (1–30).": "Number of notes to return per page (1–30).",
|
|
15
|
+
"Get Note": "Get Note",
|
|
16
|
+
"Retrieve a single meeting note by its ID, with optional transcript.": "Retrieve a single meeting note by its ID, with optional transcript.",
|
|
17
|
+
"Note ID": "Note ID",
|
|
18
|
+
"The ID of the note to retrieve. Starts with `not_` followed by 14 characters (e.g. `not_1d3tmYTlCICgjy`). You can get this from the **List Notes** action.": "The ID of the note to retrieve. Starts with `not_` followed by 14 characters (e.g. `not_1d3tmYTlCICgjy`). You can get this from the **List Notes** action.",
|
|
19
|
+
"Include Transcript": "Include Transcript",
|
|
20
|
+
"Include the full meeting transcript in the response. The transcript shows who said what and when.": "Include the full meeting transcript in the response. The transcript shows who said what and when.",
|
|
21
|
+
"New Note": "New Note",
|
|
22
|
+
"Triggers when a new meeting note is created in Granola.": "Triggers when a new meeting note is created in Granola.",
|
|
23
|
+
"Updated Note": "Updated Note",
|
|
24
|
+
"Triggers when an existing meeting note is updated in Granola (e.g. summary edited, attendees changed).": "Triggers when an existing meeting note is updated in Granola (e.g. summary edited, attendees changed)."
|
|
25
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const granolaAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
2
|
+
export declare const granola: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,WAAW,mEAsBtB,CAAC;AAEH,eAAO,MAAM,OAAO,mHAqBlB,CAAC"}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.granola = exports.granolaAuth = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const shared_1 = require("@activepieces/shared");
|
|
8
|
+
const list_notes_1 = require("./lib/actions/list-notes");
|
|
9
|
+
const get_note_1 = require("./lib/actions/get-note");
|
|
10
|
+
const new_note_1 = require("./lib/triggers/new-note");
|
|
11
|
+
const updated_note_1 = require("./lib/triggers/updated-note");
|
|
12
|
+
const common_1 = require("./lib/common");
|
|
13
|
+
exports.granolaAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
14
|
+
displayName: 'API Key',
|
|
15
|
+
description: `To get your API key:
|
|
16
|
+
1. Open the **Granola desktop app**.
|
|
17
|
+
2. Go to **Settings > API**.
|
|
18
|
+
3. Click **Create API Key**.
|
|
19
|
+
4. Copy the key and paste it here.
|
|
20
|
+
|
|
21
|
+
**Note:** You need a Business or Enterprise plan to use API keys.`,
|
|
22
|
+
required: true,
|
|
23
|
+
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
24
|
+
try {
|
|
25
|
+
yield (0, common_1.granolaApiCall)({
|
|
26
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
27
|
+
path: '/notes?page_size=1',
|
|
28
|
+
token: auth
|
|
29
|
+
});
|
|
30
|
+
return { valid: true };
|
|
31
|
+
}
|
|
32
|
+
catch (_b) {
|
|
33
|
+
return { valid: false, error: 'Invalid API key' };
|
|
34
|
+
}
|
|
35
|
+
}),
|
|
36
|
+
});
|
|
37
|
+
exports.granola = (0, pieces_framework_1.createPiece)({
|
|
38
|
+
displayName: 'Granola',
|
|
39
|
+
description: 'AI-powered meeting notes — automatically captures and summarizes your meetings.',
|
|
40
|
+
minimumSupportedRelease: '0.36.1',
|
|
41
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/granola.png',
|
|
42
|
+
categories: [shared_1.PieceCategory.PRODUCTIVITY],
|
|
43
|
+
auth: exports.granolaAuth,
|
|
44
|
+
authors: ['bst1n'],
|
|
45
|
+
actions: [
|
|
46
|
+
list_notes_1.listNotesAction,
|
|
47
|
+
get_note_1.getNoteAction,
|
|
48
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
49
|
+
baseUrl: () => common_1.BASE_URL,
|
|
50
|
+
auth: exports.granolaAuth,
|
|
51
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
52
|
+
return ({
|
|
53
|
+
Authorization: `Bearer ${auth.secret_text}`,
|
|
54
|
+
});
|
|
55
|
+
}),
|
|
56
|
+
}),
|
|
57
|
+
],
|
|
58
|
+
triggers: [new_note_1.newNoteTrigger, updated_note_1.updatedNoteTrigger],
|
|
59
|
+
});
|
|
60
|
+
//# 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,qEAAwE;AACxE,+DAGqC;AACrC,iDAAqD;AACrD,yDAA2D;AAC3D,qDAAuD;AACvD,sDAAyD;AACzD,8DAAiE;AACjE,yCAAwD;AAE3C,QAAA,WAAW,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC9C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE;;;;;;kEAMmD;IAChE,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,IAAA,uBAAc,EAAC;gBACnB,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,oBAAoB;gBAC1B,KAAK,EAAE,IAAI;aACZ,CAAC,CAAC;YACH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;QACpD,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC;AAEU,QAAA,OAAO,GAAG,IAAA,8BAAW,EAAC;IACjC,WAAW,EAAE,SAAS;IACtB,WAAW,EACT,iFAAiF;IACnF,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,iDAAiD;IAC1D,UAAU,EAAE,CAAC,sBAAa,CAAC,YAAY,CAAC;IACxC,IAAI,EAAE,mBAAW;IACjB,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,OAAO,EAAE;QACP,4BAAe;QACf,wBAAa;QACb,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAQ;YACvB,IAAI,EAAE,mBAAW;YACjB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;iBAC5C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,yBAAc,EAAE,iCAAkB,CAAC;CAC/C,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const getNoteAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
note_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
include_transcript: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
4
|
+
}>;
|
|
5
|
+
//# sourceMappingURL=get-note.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-note.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-note.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,aAAa;;;EAmCxB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNoteAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const __1 = require("../../");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.getNoteAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.granolaAuth,
|
|
11
|
+
name: 'get_note',
|
|
12
|
+
displayName: 'Get Note',
|
|
13
|
+
description: 'Retrieve a single meeting note by its ID, with optional transcript.',
|
|
14
|
+
props: {
|
|
15
|
+
note_id: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Note ID',
|
|
17
|
+
description: 'The ID of the note to retrieve. Starts with `not_` followed by 14 characters (e.g. `not_1d3tmYTlCICgjy`). You can get this from the **List Notes** action.',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
include_transcript: pieces_framework_1.Property.Checkbox({
|
|
21
|
+
displayName: 'Include Transcript',
|
|
22
|
+
description: 'Include the full meeting transcript in the response. The transcript shows who said what and when.',
|
|
23
|
+
required: false,
|
|
24
|
+
defaultValue: false,
|
|
25
|
+
}),
|
|
26
|
+
},
|
|
27
|
+
run(context) {
|
|
28
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const queryParams = {};
|
|
30
|
+
if (context.propsValue.include_transcript) {
|
|
31
|
+
queryParams['include'] = 'transcript';
|
|
32
|
+
}
|
|
33
|
+
const response = yield (0, common_1.granolaApiCall)({
|
|
34
|
+
token: context.auth.secret_text,
|
|
35
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
36
|
+
path: `/notes/${context.propsValue.note_id}`,
|
|
37
|
+
queryParams,
|
|
38
|
+
});
|
|
39
|
+
return (0, common_1.flattenNoteWithTranscript)(response.body);
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=get-note.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-note.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-note.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,8BAAqC;AACrC,sCAImB;AAEN,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,eAAW;IACjB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,qEAAqE;IAClF,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EACT,4JAA4J;YAC9J,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,kBAAkB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACpC,WAAW,EAAE,oBAAoB;YACjC,WAAW,EACT,mGAAmG;YACrG,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACpB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,WAAW,GAA2B,EAAE,CAAC;YAC/C,IAAI,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAC;gBAC1C,WAAW,CAAC,SAAS,CAAC,GAAG,YAAY,CAAC;YACxC,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,uBAAc,EAAc;gBACjD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,UAAU,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE;gBAC5C,WAAW;aACZ,CAAC,CAAC;YAEH,OAAO,IAAA,kCAAyB,EAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAClD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const listNotesAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
created_after: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
3
|
+
created_before: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
4
|
+
updated_after: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
5
|
+
page_size: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=list-notes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-notes.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-notes.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,eAAe;;;;;EA2D1B,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listNotesAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const __1 = require("../../");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.listNotesAction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.granolaAuth,
|
|
11
|
+
name: 'list_notes',
|
|
12
|
+
displayName: 'List Notes',
|
|
13
|
+
description: 'List your meeting notes with optional date filters.',
|
|
14
|
+
props: {
|
|
15
|
+
created_after: pieces_framework_1.Property.DateTime({
|
|
16
|
+
displayName: 'Created After',
|
|
17
|
+
description: 'Only return notes created after this date. Leave empty to return all notes.',
|
|
18
|
+
required: false,
|
|
19
|
+
}),
|
|
20
|
+
created_before: pieces_framework_1.Property.DateTime({
|
|
21
|
+
displayName: 'Created Before',
|
|
22
|
+
description: 'Only return notes created before this date. Leave empty for no upper limit.',
|
|
23
|
+
required: false,
|
|
24
|
+
}),
|
|
25
|
+
updated_after: pieces_framework_1.Property.DateTime({
|
|
26
|
+
displayName: 'Updated After',
|
|
27
|
+
description: 'Only return notes updated after this date. Useful to find recently modified notes.',
|
|
28
|
+
required: false,
|
|
29
|
+
}),
|
|
30
|
+
page_size: pieces_framework_1.Property.Number({
|
|
31
|
+
displayName: 'Page Size',
|
|
32
|
+
description: 'Number of notes to return per page (1–30).',
|
|
33
|
+
required: false,
|
|
34
|
+
defaultValue: 10,
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
run(context) {
|
|
38
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
const queryParams = {};
|
|
41
|
+
if (context.propsValue.created_after) {
|
|
42
|
+
queryParams['created_after'] = context.propsValue.created_after;
|
|
43
|
+
}
|
|
44
|
+
if (context.propsValue.created_before) {
|
|
45
|
+
queryParams['created_before'] = context.propsValue.created_before;
|
|
46
|
+
}
|
|
47
|
+
if (context.propsValue.updated_after) {
|
|
48
|
+
queryParams['updated_after'] = context.propsValue.updated_after;
|
|
49
|
+
}
|
|
50
|
+
const pageSize = Math.min(Math.max((_a = context.propsValue.page_size) !== null && _a !== void 0 ? _a : 10, 1), 30);
|
|
51
|
+
queryParams['page_size'] = String(pageSize);
|
|
52
|
+
const response = yield (0, common_1.granolaApiCall)({
|
|
53
|
+
token: context.auth.secret_text,
|
|
54
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
55
|
+
path: '/notes',
|
|
56
|
+
queryParams,
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
notes: response.body.notes.map(common_1.flattenNote),
|
|
60
|
+
hasMore: response.body.hasMore,
|
|
61
|
+
cursor: (_b = response.body.cursor) !== null && _b !== void 0 ? _b : null,
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=list-notes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-notes.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-notes.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,8BAAqC;AACrC,sCAImB;AAEN,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,eAAW;IACjB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,qDAAqD;IAClE,KAAK,EAAE;QACL,aAAa,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC/B,WAAW,EAAE,eAAe;YAC5B,WAAW,EACT,6EAA6E;YAC/E,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,cAAc,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAChC,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EACT,6EAA6E;YAC/E,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,aAAa,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC/B,WAAW,EAAE,eAAe;YAC5B,WAAW,EACT,oFAAoF;YACtF,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACzB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,4CAA4C;YACzD,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,EAAE;SACjB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,WAAW,GAA2B,EAAE,CAAC;YAE/C,IAAI,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;gBACrC,WAAW,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC;YAClE,CAAC;YACD,IAAI,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;gBACtC,WAAW,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC;YACpE,CAAC;YACD,IAAI,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;gBACrC,WAAW,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC;YAClE,CAAC;YACD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAA,OAAO,CAAC,UAAU,CAAC,SAAS,mCAAI,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC/E,WAAW,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;YAE5C,MAAM,QAAQ,GAAG,MAAM,IAAA,uBAAc,EAAsB;gBACzD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,QAAQ;gBACd,WAAW;aACZ,CAAC,CAAC;YAEH,OAAO;gBACL,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,oBAAW,CAAC;gBAC3C,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO;gBAC9B,MAAM,EAAE,MAAA,QAAQ,CAAC,IAAI,CAAC,MAAM,mCAAI,IAAI;aACrC,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { HttpMethod, HttpMessageBody, HttpResponse } from '@activepieces/pieces-common';
|
|
2
|
+
export declare const BASE_URL = "https://public-api.granola.ai/v1";
|
|
3
|
+
export declare function granolaApiCall<T extends HttpMessageBody>({ token, method, path, queryParams, }: {
|
|
4
|
+
token: string;
|
|
5
|
+
method: HttpMethod;
|
|
6
|
+
path: string;
|
|
7
|
+
queryParams?: Record<string, string>;
|
|
8
|
+
}): Promise<HttpResponse<T>>;
|
|
9
|
+
interface GranolaNote {
|
|
10
|
+
id: string;
|
|
11
|
+
object: string;
|
|
12
|
+
title: string;
|
|
13
|
+
owner: {
|
|
14
|
+
name: string | null;
|
|
15
|
+
email: string;
|
|
16
|
+
};
|
|
17
|
+
created_at: string;
|
|
18
|
+
updated_at: string;
|
|
19
|
+
calendar_event?: {
|
|
20
|
+
event_title: string;
|
|
21
|
+
organiser: string;
|
|
22
|
+
calendar_event_id: string;
|
|
23
|
+
scheduled_start_time: string;
|
|
24
|
+
scheduled_end_time: string;
|
|
25
|
+
invitees?: {
|
|
26
|
+
name: string | null;
|
|
27
|
+
email: string;
|
|
28
|
+
}[];
|
|
29
|
+
};
|
|
30
|
+
attendees?: {
|
|
31
|
+
name: string | null;
|
|
32
|
+
email: string;
|
|
33
|
+
}[];
|
|
34
|
+
folder_membership?: {
|
|
35
|
+
id: string;
|
|
36
|
+
object: string;
|
|
37
|
+
name: string;
|
|
38
|
+
}[];
|
|
39
|
+
summary_text?: string;
|
|
40
|
+
summary_markdown?: string | null;
|
|
41
|
+
transcript?: {
|
|
42
|
+
speaker: {
|
|
43
|
+
source: string;
|
|
44
|
+
};
|
|
45
|
+
text: string;
|
|
46
|
+
start_time: string;
|
|
47
|
+
end_time: string;
|
|
48
|
+
}[];
|
|
49
|
+
}
|
|
50
|
+
interface GranolaListResponse {
|
|
51
|
+
notes: GranolaNote[];
|
|
52
|
+
hasMore: boolean;
|
|
53
|
+
cursor?: string;
|
|
54
|
+
}
|
|
55
|
+
declare function flattenNote(note: GranolaNote): {
|
|
56
|
+
id: string;
|
|
57
|
+
title: string;
|
|
58
|
+
owner_name: string | null;
|
|
59
|
+
owner_email: string;
|
|
60
|
+
created_at: string;
|
|
61
|
+
updated_at: string;
|
|
62
|
+
calendar_event_title: string | null;
|
|
63
|
+
calendar_organiser: string | null;
|
|
64
|
+
calendar_event_id: string | null;
|
|
65
|
+
scheduled_start_time: string | null;
|
|
66
|
+
scheduled_end_time: string | null;
|
|
67
|
+
attendees: string | null;
|
|
68
|
+
folders: string | null;
|
|
69
|
+
summary_text: string | null;
|
|
70
|
+
summary_markdown: string | null;
|
|
71
|
+
};
|
|
72
|
+
declare function flattenNoteWithTranscript(note: GranolaNote): {
|
|
73
|
+
transcript: string | null;
|
|
74
|
+
id: string;
|
|
75
|
+
title: string;
|
|
76
|
+
owner_name: string | null;
|
|
77
|
+
owner_email: string;
|
|
78
|
+
created_at: string;
|
|
79
|
+
updated_at: string;
|
|
80
|
+
calendar_event_title: string | null;
|
|
81
|
+
calendar_organiser: string | null;
|
|
82
|
+
calendar_event_id: string | null;
|
|
83
|
+
scheduled_start_time: string | null;
|
|
84
|
+
scheduled_end_time: string | null;
|
|
85
|
+
attendees: string | null;
|
|
86
|
+
folders: string | null;
|
|
87
|
+
summary_text: string | null;
|
|
88
|
+
summary_markdown: string | null;
|
|
89
|
+
};
|
|
90
|
+
export { flattenNote, flattenNoteWithTranscript };
|
|
91
|
+
export type { GranolaNote, GranolaListResponse };
|
|
92
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,eAAe,EACf,YAAY,EAEb,MAAM,6BAA6B,CAAC;AAErC,eAAO,MAAM,QAAQ,qCAAqC,CAAC;AAE3D,wBAAsB,cAAc,CAAC,CAAC,SAAS,eAAe,EAAE,EAC9D,KAAK,EACL,MAAM,EACN,IAAI,EACJ,WAAW,GACZ,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAU3B;AAED,UAAU,WAAW;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAA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AAyB,CAAC,IAAI,EAAE,WAAW;;;;;;;;;;;;;;;;;EAUnD;AAED,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;AAClD,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BASE_URL = void 0;
|
|
4
|
+
exports.granolaApiCall = granolaApiCall;
|
|
5
|
+
exports.flattenNote = flattenNote;
|
|
6
|
+
exports.flattenNoteWithTranscript = flattenNoteWithTranscript;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
+
exports.BASE_URL = 'https://public-api.granola.ai/v1';
|
|
10
|
+
function granolaApiCall(_a) {
|
|
11
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ token, method, path, queryParams, }) {
|
|
12
|
+
return yield pieces_common_1.httpClient.sendRequest({
|
|
13
|
+
method,
|
|
14
|
+
url: `${exports.BASE_URL}${path}`,
|
|
15
|
+
authentication: {
|
|
16
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
17
|
+
token,
|
|
18
|
+
},
|
|
19
|
+
queryParams,
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function flattenNote(note) {
|
|
24
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
25
|
+
return {
|
|
26
|
+
id: note.id,
|
|
27
|
+
title: note.title,
|
|
28
|
+
owner_name: (_b = (_a = note.owner) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : null,
|
|
29
|
+
owner_email: (_d = (_c = note.owner) === null || _c === void 0 ? void 0 : _c.email) !== null && _d !== void 0 ? _d : null,
|
|
30
|
+
created_at: note.created_at,
|
|
31
|
+
updated_at: note.updated_at,
|
|
32
|
+
calendar_event_title: (_f = (_e = note.calendar_event) === null || _e === void 0 ? void 0 : _e.event_title) !== null && _f !== void 0 ? _f : null,
|
|
33
|
+
calendar_organiser: (_h = (_g = note.calendar_event) === null || _g === void 0 ? void 0 : _g.organiser) !== null && _h !== void 0 ? _h : null,
|
|
34
|
+
calendar_event_id: (_k = (_j = note.calendar_event) === null || _j === void 0 ? void 0 : _j.calendar_event_id) !== null && _k !== void 0 ? _k : null,
|
|
35
|
+
scheduled_start_time: (_m = (_l = note.calendar_event) === null || _l === void 0 ? void 0 : _l.scheduled_start_time) !== null && _m !== void 0 ? _m : null,
|
|
36
|
+
scheduled_end_time: (_p = (_o = note.calendar_event) === null || _o === void 0 ? void 0 : _o.scheduled_end_time) !== null && _p !== void 0 ? _p : null,
|
|
37
|
+
attendees: note.attendees
|
|
38
|
+
? note.attendees
|
|
39
|
+
.map((a) => { var _a; return (_a = a.name) !== null && _a !== void 0 ? _a : a.email; })
|
|
40
|
+
.join(', ')
|
|
41
|
+
: null,
|
|
42
|
+
folders: note.folder_membership
|
|
43
|
+
? note.folder_membership.map((f) => f.name).join(', ')
|
|
44
|
+
: null,
|
|
45
|
+
summary_text: (_q = note.summary_text) !== null && _q !== void 0 ? _q : null,
|
|
46
|
+
summary_markdown: (_r = note.summary_markdown) !== null && _r !== void 0 ? _r : null,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function flattenNoteWithTranscript(note) {
|
|
50
|
+
const flat = flattenNote(note);
|
|
51
|
+
return Object.assign(Object.assign({}, flat), { transcript: note.transcript
|
|
52
|
+
? note.transcript
|
|
53
|
+
.map((t) => `[${t.speaker.source}] ${t.text}`)
|
|
54
|
+
.join('\n')
|
|
55
|
+
: null });
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":";;;AAUA,wCAoB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,EAAE,EAAE,WAAC,OAAA,MAAA,CAAC,CAAC,IAAI,mCAAI,CAAC,CAAC,KAAK,CAAA,EAAA,CAAC;iBAC7B,IAAI,CAAC,IAAI,CAAC;YACb,CAAC,CAAC,IAAI;QACR,OAAO,EAAE,IAAI,CAAC,iBAAiB;YAC7B,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YACtD,CAAC,CAAC,IAAI;QACR,YAAY,EAAE,MAAA,IAAI,CAAC,YAAY,mCAAI,IAAI;QACvC,gBAAgB,EAAE,MAAA,IAAI,CAAC,gBAAgB,mCAAI,IAAI;KAChD,CAAC;AACJ,CAAC;AAED,SAAS,yBAAyB,CAAC,IAAiB;IAClD,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAC/B,uCACK,IAAI,KACP,UAAU,EAAE,IAAI,CAAC,UAAU;YACzB,CAAC,CAAC,IAAI,CAAC,UAAU;iBACd,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;iBAC7C,IAAI,CAAC,IAAI,CAAC;YACb,CAAC,CAAC,IAAI,IACR;AACJ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const newNoteTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}>;
|
|
3
|
+
//# sourceMappingURL=new-note.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-note.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-note.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EAChB,MAAM,gCAAgC,CAAC;AAsCxC,eAAO,MAAM,cAAc,klBAoCzB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newNoteTrigger = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const __1 = require("../../");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
const polling = {
|
|
10
|
+
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
11
|
+
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS }) {
|
|
12
|
+
const queryParams = { page_size: '30' };
|
|
13
|
+
if (lastFetchEpochMS > 0) {
|
|
14
|
+
queryParams['created_after'] = new Date(lastFetchEpochMS).toISOString();
|
|
15
|
+
}
|
|
16
|
+
const response = yield (0, common_1.granolaApiCall)({
|
|
17
|
+
token: auth.secret_text,
|
|
18
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
19
|
+
path: '/notes',
|
|
20
|
+
queryParams,
|
|
21
|
+
});
|
|
22
|
+
return response.body.notes.map((note) => ({
|
|
23
|
+
epochMilliSeconds: new Date(note.created_at).getTime(),
|
|
24
|
+
data: (0, common_1.flattenNote)(note),
|
|
25
|
+
}));
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
28
|
+
exports.newNoteTrigger = (0, pieces_framework_1.createTrigger)({
|
|
29
|
+
auth: __1.granolaAuth,
|
|
30
|
+
name: 'new_note',
|
|
31
|
+
displayName: 'New Note',
|
|
32
|
+
description: 'Triggers when a new meeting note is created in Granola.',
|
|
33
|
+
props: {},
|
|
34
|
+
sampleData: {
|
|
35
|
+
id: 'not_1d3tmYTlCICgjy',
|
|
36
|
+
title: 'Quarterly budget review',
|
|
37
|
+
owner_name: 'Jane Doe',
|
|
38
|
+
owner_email: 'jane@example.com',
|
|
39
|
+
created_at: '2026-03-27T10:00:00Z',
|
|
40
|
+
updated_at: '2026-03-27T10:30:00Z',
|
|
41
|
+
calendar_event_title: 'Quarterly budget review',
|
|
42
|
+
calendar_organiser: 'jane@example.com',
|
|
43
|
+
calendar_event_id: 'cal_abc123',
|
|
44
|
+
scheduled_start_time: '2026-03-27T10:00:00Z',
|
|
45
|
+
scheduled_end_time: '2026-03-27T11:00:00Z',
|
|
46
|
+
attendees: 'Jane Doe, John Smith',
|
|
47
|
+
folders: 'Finance',
|
|
48
|
+
summary_text: 'Discussed Q1 budget allocation and projections.',
|
|
49
|
+
summary_markdown: null,
|
|
50
|
+
},
|
|
51
|
+
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
52
|
+
test(context) {
|
|
53
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
onEnable(context) {
|
|
58
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
yield pieces_common_1.pollingHelper.onEnable(polling, context);
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
onDisable(context) {
|
|
63
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
yield pieces_common_1.pollingHelper.onDisable(polling, context);
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
run(context) {
|
|
68
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=new-note.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-note.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-note.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,8BAAqC;AACrC,sCAImB;AAEnB,MAAM,OAAO,GAGT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAAmC,EAAE,oDAA9B,EAAE,IAAI,EAAE,gBAAgB,EAAE;QACtC,MAAM,WAAW,GAA2B,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAChE,IAAI,gBAAgB,GAAG,CAAC,EAAE,CAAC;YACzB,WAAW,CAAC,eAAe,CAAC,GAAG,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC;QAC1E,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,IAAA,uBAAc,EAAsB;YACzD,KAAK,EAAE,IAAI,CAAC,WAAW;YACvB,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW;SACZ,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACxC,iBAAiB,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;YACtD,IAAI,EAAE,IAAA,oBAAW,EAAC,IAAI,CAAC;SACxB,CAAC,CAAC,CAAC;IACN,CAAC,CAAA;CACF,CAAC;AAEW,QAAA,cAAc,GAAG,IAAA,gCAAa,EAAC;IAC1C,IAAI,EAAE,eAAW;IACjB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,yDAAyD;IACtE,KAAK,EAAE,EAAE;IACT,UAAU,EAAE;QACV,EAAE,EAAE,oBAAoB;QACxB,KAAK,EAAE,yBAAyB;QAChC,UAAU,EAAE,UAAU;QACtB,WAAW,EAAE,kBAAkB;QAC/B,UAAU,EAAE,sBAAsB;QAClC,UAAU,EAAE,sBAAsB;QAClC,oBAAoB,EAAE,yBAAyB;QAC/C,kBAAkB,EAAE,kBAAkB;QACtC,iBAAiB,EAAE,YAAY;QAC/B,oBAAoB,EAAE,sBAAsB;QAC5C,kBAAkB,EAAE,sBAAsB;QAC1C,SAAS,EAAE,sBAAsB;QACjC,OAAO,EAAE,SAAS;QAClB,YAAY,EAAE,iDAAiD;QAC/D,gBAAgB,EAAE,IAAI;KACvB;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,IAAI,CAAC,OAAO;;YAChB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;IACK,QAAQ,CAAC,OAAO;;YACpB,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const updatedNoteTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}>;
|
|
3
|
+
//# sourceMappingURL=updated-note.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updated-note.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/updated-note.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EAChB,MAAM,gCAAgC,CAAC;AAwCxC,eAAO,MAAM,kBAAkB,klBAqC7B,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updatedNoteTrigger = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const __1 = require("../../");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
const polling = {
|
|
10
|
+
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
11
|
+
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, lastFetchEpochMS }) {
|
|
12
|
+
const queryParams = { page_size: '30' };
|
|
13
|
+
if (lastFetchEpochMS > 0) {
|
|
14
|
+
queryParams['updated_after'] = new Date(lastFetchEpochMS).toISOString();
|
|
15
|
+
}
|
|
16
|
+
const response = yield (0, common_1.granolaApiCall)({
|
|
17
|
+
token: auth.secret_text,
|
|
18
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
19
|
+
path: '/notes',
|
|
20
|
+
queryParams,
|
|
21
|
+
});
|
|
22
|
+
return response.body.notes
|
|
23
|
+
.filter((note) => note.updated_at !== note.created_at)
|
|
24
|
+
.map((note) => ({
|
|
25
|
+
epochMilliSeconds: new Date(note.updated_at).getTime(),
|
|
26
|
+
data: (0, common_1.flattenNote)(note),
|
|
27
|
+
}));
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
exports.updatedNoteTrigger = (0, pieces_framework_1.createTrigger)({
|
|
31
|
+
auth: __1.granolaAuth,
|
|
32
|
+
name: 'updated_note',
|
|
33
|
+
displayName: 'Updated Note',
|
|
34
|
+
description: 'Triggers when an existing meeting note is updated in Granola (e.g. summary edited, attendees changed).',
|
|
35
|
+
props: {},
|
|
36
|
+
sampleData: {
|
|
37
|
+
id: 'not_1d3tmYTlCICgjy',
|
|
38
|
+
title: 'Quarterly budget review',
|
|
39
|
+
owner_name: 'Jane Doe',
|
|
40
|
+
owner_email: 'jane@example.com',
|
|
41
|
+
created_at: '2026-03-27T10:00:00Z',
|
|
42
|
+
updated_at: '2026-03-27T14:00:00Z',
|
|
43
|
+
calendar_event_title: 'Quarterly budget review',
|
|
44
|
+
calendar_organiser: 'jane@example.com',
|
|
45
|
+
calendar_event_id: 'cal_abc123',
|
|
46
|
+
scheduled_start_time: '2026-03-27T10:00:00Z',
|
|
47
|
+
scheduled_end_time: '2026-03-27T11:00:00Z',
|
|
48
|
+
attendees: 'Jane Doe, John Smith',
|
|
49
|
+
folders: 'Finance',
|
|
50
|
+
summary_text: 'Discussed Q1 budget allocation and projections.',
|
|
51
|
+
summary_markdown: null,
|
|
52
|
+
},
|
|
53
|
+
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
54
|
+
test(context) {
|
|
55
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
onEnable(context) {
|
|
60
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
yield pieces_common_1.pollingHelper.onEnable(polling, context);
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
onDisable(context) {
|
|
65
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
yield pieces_common_1.pollingHelper.onDisable(polling, context);
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
run(context) {
|
|
70
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=updated-note.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updated-note.js","sourceRoot":"","sources":["../../../../src/lib/triggers/updated-note.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,8BAAqC;AACrC,sCAImB;AAEnB,MAAM,OAAO,GAGT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAAmC,EAAE,oDAA9B,EAAE,IAAI,EAAE,gBAAgB,EAAE;QACtC,MAAM,WAAW,GAA2B,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAChE,IAAI,gBAAgB,GAAG,CAAC,EAAE,CAAC;YACzB,WAAW,CAAC,eAAe,CAAC,GAAG,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC;QAC1E,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,IAAA,uBAAc,EAAsB;YACzD,KAAK,EAAE,IAAI,CAAC,WAAW;YACvB,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,IAAI,EAAE,QAAQ;YACd,WAAW;SACZ,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK;aACvB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,CAAC;aACrD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACd,iBAAiB,EAAE,IAAI,IAAI,CAAC,IAAI,CAA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