@skillful-ai/piece-skai-adapters 0.0.26 → 0.0.28
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 +3 -3
- package/src/index.js +19 -1
- package/src/index.js.map +1 -1
- package/src/lib/actions/complete-scheduled-post.d.ts +20 -0
- package/src/lib/actions/complete-scheduled-post.js +89 -0
- package/src/lib/actions/complete-scheduled-post.js.map +1 -0
- package/src/lib/actions/normalize-comments.d.ts +8 -0
- package/src/lib/actions/normalize-comments.js +306 -0
- package/src/lib/actions/normalize-comments.js.map +1 -0
- package/src/lib/actions/normalize-mentions.d.ts +5 -0
- package/src/lib/actions/normalize-mentions.js +158 -0
- package/src/lib/actions/normalize-mentions.js.map +1 -0
- package/src/lib/actions/normalize-posts.d.ts +7 -0
- package/src/lib/actions/normalize-posts.js +217 -0
- package/src/lib/actions/normalize-posts.js.map +1 -0
- package/src/lib/actions/prepare-reply.d.ts +5 -0
- package/src/lib/actions/prepare-reply.js +117 -0
- package/src/lib/actions/prepare-reply.js.map +1 -0
- package/src/lib/actions/store-interaction.d.ts +31 -0
- package/src/lib/actions/store-interaction.js +172 -0
- package/src/lib/actions/store-interaction.js.map +1 -0
- package/src/lib/common/skai-client.d.ts +46 -0
- package/src/lib/common/skai-client.js +93 -0
- package/src/lib/common/skai-client.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skillful-ai/piece-skai-adapters",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@activepieces/pieces-framework": "^0.20.1",
|
|
9
9
|
"@sinclair/typebox": "0.34.11",
|
|
10
|
-
"@skillful-ai/skai-sdk": "*",
|
|
11
10
|
"axios": "1.8.3",
|
|
12
11
|
"axios-retry": "4.4.1",
|
|
13
12
|
"deepmerge-ts": "7.1.0",
|
|
@@ -18,7 +17,8 @@
|
|
|
18
17
|
"tslib": "^2.3.0",
|
|
19
18
|
"zod": "3.25.76",
|
|
20
19
|
"@activepieces/pieces-common": "0.7.0",
|
|
21
|
-
"@activepieces/shared": "0.22.0"
|
|
20
|
+
"@activepieces/shared": "0.22.0",
|
|
21
|
+
"@skillful-ai/skai-sdk": "1.0.7"
|
|
22
22
|
},
|
|
23
23
|
"overrides": {
|
|
24
24
|
"@tryfabric/martian": {
|
package/src/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.skaiAdapters = void 0;
|
|
4
4
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
+
// Existing messaging adapters (Chat/DM platforms)
|
|
5
6
|
const skai_to_whatsapp_1 = require("./lib/actions/skai-to-whatsapp");
|
|
6
7
|
const skai_to_telegram_1 = require("./lib/actions/skai-to-telegram");
|
|
7
8
|
const skai_to_whapi_1 = require("./lib/actions/skai-to-whapi");
|
|
@@ -12,14 +13,24 @@ const whapi_to_skai_1 = require("./lib/actions/whapi-to-skai");
|
|
|
12
13
|
const instagram_to_skai_1 = require("./lib/actions/instagram-to-skai");
|
|
13
14
|
const update_chat_message_reference_1 = require("./lib/actions/update-chat-message-reference");
|
|
14
15
|
const skai_response_webhook_1 = require("./lib/triggers/skai-response-webhook");
|
|
16
|
+
// Social media adapters - Inbound (Platform -> SKAI Contract)
|
|
17
|
+
const normalize_posts_1 = require("./lib/actions/normalize-posts");
|
|
18
|
+
const normalize_comments_1 = require("./lib/actions/normalize-comments");
|
|
19
|
+
const normalize_mentions_1 = require("./lib/actions/normalize-mentions");
|
|
20
|
+
// Social media adapters - Outbound (SKAI Contract -> Platform)
|
|
21
|
+
const prepare_reply_1 = require("./lib/actions/prepare-reply");
|
|
22
|
+
// Social media adapters - Storage (Store interactions in SKAI backend)
|
|
23
|
+
const store_interaction_1 = require("./lib/actions/store-interaction");
|
|
24
|
+
const complete_scheduled_post_1 = require("./lib/actions/complete-scheduled-post");
|
|
15
25
|
exports.skaiAdapters = (0, pieces_framework_1.createPiece)({
|
|
16
26
|
displayName: 'SKAI Adapters',
|
|
17
|
-
description: 'Transform messages between
|
|
27
|
+
description: 'Transform messages between platforms and SKAI - supports both messaging (WhatsApp, Telegram) and social media (X, Instagram, Facebook, YouTube)',
|
|
18
28
|
auth: pieces_framework_1.PieceAuth.None(),
|
|
19
29
|
minimumSupportedRelease: '0.36.1',
|
|
20
30
|
logoUrl: 'https://agents-hub.s3.us-west-2.amazonaws.com/media/activepieces/skai-adapters.svg',
|
|
21
31
|
authors: ['Skillful AI'],
|
|
22
32
|
actions: [
|
|
33
|
+
// Messaging adapters
|
|
23
34
|
skai_to_whatsapp_1.skaiToWhatsApp,
|
|
24
35
|
skai_to_telegram_1.skaiToTelegram,
|
|
25
36
|
skai_to_whapi_1.skaiToWhapi,
|
|
@@ -29,6 +40,13 @@ exports.skaiAdapters = (0, pieces_framework_1.createPiece)({
|
|
|
29
40
|
whapi_to_skai_1.whapiToSkai,
|
|
30
41
|
instagram_to_skai_1.instagramToSkai,
|
|
31
42
|
update_chat_message_reference_1.updateChatMessageReference,
|
|
43
|
+
// Social media adapters
|
|
44
|
+
normalize_posts_1.normalizePosts,
|
|
45
|
+
normalize_comments_1.normalizeComments,
|
|
46
|
+
normalize_mentions_1.normalizeMentions,
|
|
47
|
+
prepare_reply_1.prepareReply,
|
|
48
|
+
store_interaction_1.storeInteraction,
|
|
49
|
+
complete_scheduled_post_1.completeScheduledPost,
|
|
32
50
|
],
|
|
33
51
|
triggers: [skai_response_webhook_1.skaiResponseWebhook],
|
|
34
52
|
});
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/custom/skai-adapters/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/custom/skai-adapters/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AAExE,kDAAkD;AAClD,qEAAgE;AAChE,qEAAgE;AAChE,+DAA0D;AAC1D,uEAAkE;AAClE,qEAAgE;AAChE,qEAAgE;AAChE,+DAA0D;AAC1D,uEAAkE;AAClE,+FAAyF;AACzF,gFAA2E;AAE3E,8DAA8D;AAC9D,mEAA+D;AAC/D,yEAAqE;AACrE,yEAAqE;AAErE,+DAA+D;AAC/D,+DAA2D;AAE3D,uEAAuE;AACvE,uEAAmE;AACnE,mFAA8E;AAEjE,QAAA,YAAY,GAAG,IAAA,8BAAW,EAAC;IACpC,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,iJAAiJ;IAC9J,IAAI,EAAE,4BAAS,CAAC,IAAI,EAAE;IACtB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,oFAAoF;IAC7F,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,OAAO,EAAE;QACL,qBAAqB;QACrB,iCAAc;QACd,iCAAc;QACd,2BAAW;QACX,mCAAe;QACf,iCAAc;QACd,iCAAc;QACd,2BAAW;QACX,mCAAe;QACf,0DAA0B;QAC1B,wBAAwB;QACxB,gCAAc;QACd,sCAAiB;QACjB,sCAAiB;QACjB,4BAAY;QACZ,oCAAgB;QAChB,+CAAqB;KACxB;IACD,QAAQ,EAAE,CAAC,2CAAmB,CAAC;CAClC,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Complete a scheduled post in the SKAI backend.
|
|
3
|
+
*
|
|
4
|
+
* This action is used by scheduled_posting flows to:
|
|
5
|
+
* - Mark the post as published or failed
|
|
6
|
+
* - Record the external post ID from the platform
|
|
7
|
+
* - Optionally disable the one-time flow after completion
|
|
8
|
+
*
|
|
9
|
+
* Features:
|
|
10
|
+
* - Auth: Uses user's SKAI API key from ActivePieces
|
|
11
|
+
* - Dynamic URL: Gets backend URL from /v1/skai-agents/config
|
|
12
|
+
*/
|
|
13
|
+
export declare const completeScheduledPost: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
14
|
+
interactionId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
15
|
+
status: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
16
|
+
externalPostId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
17
|
+
platform: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
18
|
+
scheduledTime: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
19
|
+
disableFlow: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.completeScheduledPost = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const skai_client_1 = require("../common/skai-client");
|
|
7
|
+
/**
|
|
8
|
+
* Complete a scheduled post in the SKAI backend.
|
|
9
|
+
*
|
|
10
|
+
* This action is used by scheduled_posting flows to:
|
|
11
|
+
* - Mark the post as published or failed
|
|
12
|
+
* - Record the external post ID from the platform
|
|
13
|
+
* - Optionally disable the one-time flow after completion
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - Auth: Uses user's SKAI API key from ActivePieces
|
|
17
|
+
* - Dynamic URL: Gets backend URL from /v1/skai-agents/config
|
|
18
|
+
*/
|
|
19
|
+
exports.completeScheduledPost = (0, pieces_framework_1.createAction)({
|
|
20
|
+
name: 'complete_scheduled_post',
|
|
21
|
+
displayName: 'Complete Scheduled Post',
|
|
22
|
+
description: 'Mark a scheduled post as published and optionally disable the flow',
|
|
23
|
+
props: {
|
|
24
|
+
interactionId: pieces_framework_1.Property.ShortText({
|
|
25
|
+
displayName: 'Interaction ID',
|
|
26
|
+
description: 'The ID of the scheduled post interaction to complete',
|
|
27
|
+
required: true,
|
|
28
|
+
}),
|
|
29
|
+
status: pieces_framework_1.Property.StaticDropdown({
|
|
30
|
+
displayName: 'Status',
|
|
31
|
+
description: 'The result status of the post',
|
|
32
|
+
required: true,
|
|
33
|
+
options: {
|
|
34
|
+
options: [
|
|
35
|
+
{ label: 'Published', value: 'published' },
|
|
36
|
+
{ label: 'Failed', value: 'failed' },
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
}),
|
|
40
|
+
externalPostId: pieces_framework_1.Property.ShortText({
|
|
41
|
+
displayName: 'External Post ID',
|
|
42
|
+
description: 'The platform-specific ID of the published post',
|
|
43
|
+
required: false,
|
|
44
|
+
}),
|
|
45
|
+
platform: pieces_framework_1.Property.ShortText({
|
|
46
|
+
displayName: 'Platform',
|
|
47
|
+
description: 'The platform where the post was published',
|
|
48
|
+
required: false,
|
|
49
|
+
}),
|
|
50
|
+
scheduledTime: pieces_framework_1.Property.ShortText({
|
|
51
|
+
displayName: 'Scheduled Time',
|
|
52
|
+
description: 'The original scheduled time for the post',
|
|
53
|
+
required: false,
|
|
54
|
+
}),
|
|
55
|
+
disableFlow: pieces_framework_1.Property.Checkbox({
|
|
56
|
+
displayName: 'Disable Flow',
|
|
57
|
+
description: 'Disable this one-time flow after completion',
|
|
58
|
+
required: false,
|
|
59
|
+
defaultValue: true,
|
|
60
|
+
}),
|
|
61
|
+
},
|
|
62
|
+
run(context) {
|
|
63
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
var _a;
|
|
65
|
+
const { interactionId, status, externalPostId, platform, scheduledTime, disableFlow, } = context.propsValue;
|
|
66
|
+
// Get server context for API calls
|
|
67
|
+
const serverUrl = context.server.publicUrl;
|
|
68
|
+
const token = context.server.token;
|
|
69
|
+
const result = yield skai_client_1.skaiClient.completeScheduledPost({
|
|
70
|
+
serverUrl,
|
|
71
|
+
token,
|
|
72
|
+
interactionId,
|
|
73
|
+
status: status,
|
|
74
|
+
externalPostId: externalPostId || undefined,
|
|
75
|
+
postedAt: new Date().toISOString(),
|
|
76
|
+
disableFlow: disableFlow !== null && disableFlow !== void 0 ? disableFlow : true,
|
|
77
|
+
});
|
|
78
|
+
return {
|
|
79
|
+
success: result.success,
|
|
80
|
+
interactionId,
|
|
81
|
+
platform: platform || undefined,
|
|
82
|
+
scheduledTime: scheduledTime || undefined,
|
|
83
|
+
postedAt: new Date().toISOString(),
|
|
84
|
+
flowDisabled: (_a = result.flow_disabled) !== null && _a !== void 0 ? _a : false,
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
//# sourceMappingURL=complete-scheduled-post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complete-scheduled-post.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/skai-adapters/src/lib/actions/complete-scheduled-post.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,uDAAmD;AAEnD;;;;;;;;;;;GAWG;AACU,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,oEAAoE;IACjF,KAAK,EAAE;QACH,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,sDAAsD;YACnE,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC5B,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,+BAA+B;YAC5C,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACL,OAAO,EAAE;oBACL,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE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AEH,OAAO;gBACH,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,aAAa;gBACb,QAAQ,EAAE,QAAQ,IAAI,SAAS;gBAC/B,aAAa,EAAE,aAAa,IAAI,SAAS;gBACzC,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBAClC,YAAY,EAAE,MAAA,MAAM,CAAC,aAAa,mCAAI,KAAK;aAC9C,CAAC;QACN,CAAC;KAAA;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const normalizeComments: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
|
+
platform: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
3
|
+
apiSource: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
4
|
+
rawData: import("@activepieces/pieces-framework").JsonProperty<true>;
|
|
5
|
+
parentPostId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
6
|
+
parentPostUrl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
|
+
accountUsername: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeComments = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
exports.normalizeComments = (0, pieces_framework_1.createAction)({
|
|
7
|
+
name: 'normalize_comments',
|
|
8
|
+
displayName: 'Normalize Comments',
|
|
9
|
+
description: 'Normalize comments from any platform (X, Instagram, Facebook, YouTube) to SKAI contract format',
|
|
10
|
+
props: {
|
|
11
|
+
platform: pieces_framework_1.Property.StaticDropdown({
|
|
12
|
+
displayName: 'Platform',
|
|
13
|
+
description: 'The source platform of the data',
|
|
14
|
+
required: true,
|
|
15
|
+
options: {
|
|
16
|
+
options: [
|
|
17
|
+
{ label: 'X (Twitter)', value: 'twitter' },
|
|
18
|
+
{ label: 'Instagram', value: 'instagram' },
|
|
19
|
+
{ label: 'Facebook', value: 'facebook' },
|
|
20
|
+
{ label: 'YouTube', value: 'youtube' },
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
apiSource: pieces_framework_1.Property.StaticDropdown({
|
|
25
|
+
displayName: 'API Source',
|
|
26
|
+
description: 'Which piece/API provided this data (different APIs have different response formats)',
|
|
27
|
+
required: true,
|
|
28
|
+
options: {
|
|
29
|
+
options: [
|
|
30
|
+
{ label: 'X Piece (Twitter API v2)', value: 'x_direct' },
|
|
31
|
+
{ label: 'Instagram Business Piece (Meta Graph API)', value: 'instagram_direct' },
|
|
32
|
+
{ label: 'Facebook Pages Piece (Meta Graph API)', value: 'facebook_direct' },
|
|
33
|
+
{ label: 'YouTube Piece (YouTube Data API v3)', value: 'youtube_direct' },
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
rawData: pieces_framework_1.Property.Json({
|
|
38
|
+
displayName: 'Raw Data',
|
|
39
|
+
description: 'The raw output from the platform piece action',
|
|
40
|
+
required: true,
|
|
41
|
+
}),
|
|
42
|
+
parentPostId: pieces_framework_1.Property.ShortText({
|
|
43
|
+
displayName: 'Parent Post ID',
|
|
44
|
+
description: 'The ID of the post these comments are on',
|
|
45
|
+
required: true,
|
|
46
|
+
}),
|
|
47
|
+
parentPostUrl: pieces_framework_1.Property.ShortText({
|
|
48
|
+
displayName: 'Parent Post URL',
|
|
49
|
+
description: 'The URL of the post these comments are on',
|
|
50
|
+
required: false,
|
|
51
|
+
}),
|
|
52
|
+
accountUsername: pieces_framework_1.Property.ShortText({
|
|
53
|
+
displayName: 'Account Username',
|
|
54
|
+
description: 'Our account username (to filter out our own comments)',
|
|
55
|
+
required: false,
|
|
56
|
+
}),
|
|
57
|
+
},
|
|
58
|
+
run(ctx) {
|
|
59
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
const { platform, apiSource, rawData, parentPostId, parentPostUrl, accountUsername } = ctx.propsValue;
|
|
61
|
+
let comments = [];
|
|
62
|
+
const normalizeKey = `${platform}_${apiSource}`;
|
|
63
|
+
switch (normalizeKey) {
|
|
64
|
+
// X (Twitter) - direct API
|
|
65
|
+
case 'twitter_x_direct':
|
|
66
|
+
comments = normalizeXDirectComments(rawData, parentPostId, parentPostUrl);
|
|
67
|
+
break;
|
|
68
|
+
// Instagram - Meta Graph API (skai-instagram-business piece)
|
|
69
|
+
case 'instagram_instagram_direct':
|
|
70
|
+
comments = normalizeInstagramMetaComments(rawData, parentPostId, parentPostUrl);
|
|
71
|
+
break;
|
|
72
|
+
// Facebook - Meta Graph API (skai-facebook-pages piece)
|
|
73
|
+
case 'facebook_facebook_direct':
|
|
74
|
+
comments = normalizeFacebookMetaComments(rawData, parentPostId, parentPostUrl);
|
|
75
|
+
break;
|
|
76
|
+
// YouTube - YouTube Data API v3 (skai-youtube piece)
|
|
77
|
+
case 'youtube_youtube_direct':
|
|
78
|
+
comments = normalizeYouTubeComments(rawData, parentPostId, parentPostUrl);
|
|
79
|
+
break;
|
|
80
|
+
default:
|
|
81
|
+
throw new Error(`Unsupported platform/apiSource combination: ${platform}/${apiSource}`);
|
|
82
|
+
}
|
|
83
|
+
// Filter out our own comments if accountUsername is provided
|
|
84
|
+
if (accountUsername) {
|
|
85
|
+
comments = comments.filter(c => c.author_username.toLowerCase() !== accountUsername.toLowerCase());
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
success: true,
|
|
89
|
+
comments,
|
|
90
|
+
count: comments.length,
|
|
91
|
+
platform,
|
|
92
|
+
apiSource,
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
/**
|
|
98
|
+
* Normalize X (Twitter) replies from Twitter API v2 (x piece)
|
|
99
|
+
* X doesn't have "comments" - they have replies which are tweets in a conversation
|
|
100
|
+
* Input: Array of reply tweets [{ id, text, created_at, author_id, conversation_id, author: { username, name, profile_image_url } }]
|
|
101
|
+
*/
|
|
102
|
+
function normalizeXDirectComments(rawData, parentPostId, parentPostUrl) {
|
|
103
|
+
// X piece returns array directly from get_replies action
|
|
104
|
+
const replies = Array.isArray(rawData) ? rawData : [];
|
|
105
|
+
return replies.map((reply) => {
|
|
106
|
+
var _a, _b, _c;
|
|
107
|
+
return ({
|
|
108
|
+
external_id: reply.id,
|
|
109
|
+
platform: 'twitter',
|
|
110
|
+
interaction_type: 'comment',
|
|
111
|
+
content: reply.text || '',
|
|
112
|
+
author_id: reply.author_id || '',
|
|
113
|
+
author_username: ((_a = reply.author) === null || _a === void 0 ? void 0 : _a.username) || reply.username || '',
|
|
114
|
+
author_display_name: ((_b = reply.author) === null || _b === void 0 ? void 0 : _b.name) || reply.name || null,
|
|
115
|
+
author_avatar_url: ((_c = reply.author) === null || _c === void 0 ? void 0 : _c.profile_image_url) || null,
|
|
116
|
+
parent_post_id: parentPostId,
|
|
117
|
+
parent_post_url: parentPostUrl || `https://x.com/i/status/${parentPostId}`,
|
|
118
|
+
conversation_id: reply.conversation_id || parentPostId,
|
|
119
|
+
platform_created_at: reply.created_at || null,
|
|
120
|
+
metadata: {
|
|
121
|
+
api_source: 'x_direct',
|
|
122
|
+
in_reply_to_user_id: reply.in_reply_to_user_id,
|
|
123
|
+
referenced_tweets: reply.referenced_tweets,
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Normalize Instagram comments from Meta Graph API (skai-instagram-business piece)
|
|
130
|
+
* Input: { data: [{ id, text, from: { id, username, name, profile_pic_url }, timestamp, like_count, replies: { data: [...] } }] }
|
|
131
|
+
*/
|
|
132
|
+
function normalizeInstagramMetaComments(rawData, parentPostId, parentPostUrl) {
|
|
133
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
134
|
+
const data = rawData;
|
|
135
|
+
// Meta Graph API returns { data: [...] } structure
|
|
136
|
+
const comments = (data === null || data === void 0 ? void 0 : data.data) || (Array.isArray(data) ? data : []);
|
|
137
|
+
const normalized = [];
|
|
138
|
+
for (const comment of comments) {
|
|
139
|
+
// Add main comment
|
|
140
|
+
normalized.push({
|
|
141
|
+
external_id: comment.id,
|
|
142
|
+
platform: 'instagram',
|
|
143
|
+
interaction_type: 'comment',
|
|
144
|
+
content: comment.text || '',
|
|
145
|
+
author_id: ((_a = comment.from) === null || _a === void 0 ? void 0 : _a.id) || '',
|
|
146
|
+
author_username: ((_b = comment.from) === null || _b === void 0 ? void 0 : _b.username) || comment.username || '',
|
|
147
|
+
author_display_name: ((_c = comment.from) === null || _c === void 0 ? void 0 : _c.name) || null,
|
|
148
|
+
author_avatar_url: ((_d = comment.from) === null || _d === void 0 ? void 0 : _d.profile_pic_url) || null,
|
|
149
|
+
parent_post_id: parentPostId,
|
|
150
|
+
parent_post_url: parentPostUrl || null,
|
|
151
|
+
conversation_id: comment.id, // Comment ID is the conversation root
|
|
152
|
+
platform_created_at: comment.timestamp || null,
|
|
153
|
+
metadata: {
|
|
154
|
+
api_source: 'instagram_direct',
|
|
155
|
+
like_count: comment.like_count,
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
// Add nested replies if present (Meta API includes replies.data)
|
|
159
|
+
if ((_e = comment.replies) === null || _e === void 0 ? void 0 : _e.data) {
|
|
160
|
+
for (const reply of comment.replies.data) {
|
|
161
|
+
normalized.push({
|
|
162
|
+
external_id: reply.id,
|
|
163
|
+
platform: 'instagram',
|
|
164
|
+
interaction_type: 'comment',
|
|
165
|
+
content: reply.text || '',
|
|
166
|
+
author_id: ((_f = reply.from) === null || _f === void 0 ? void 0 : _f.id) || '',
|
|
167
|
+
author_username: ((_g = reply.from) === null || _g === void 0 ? void 0 : _g.username) || reply.username || '',
|
|
168
|
+
author_display_name: ((_h = reply.from) === null || _h === void 0 ? void 0 : _h.name) || null,
|
|
169
|
+
author_avatar_url: ((_j = reply.from) === null || _j === void 0 ? void 0 : _j.profile_pic_url) || null,
|
|
170
|
+
parent_post_id: parentPostId,
|
|
171
|
+
parent_post_url: parentPostUrl || null,
|
|
172
|
+
conversation_id: comment.id, // Parent comment is conversation root
|
|
173
|
+
platform_created_at: reply.timestamp || null,
|
|
174
|
+
metadata: {
|
|
175
|
+
api_source: 'instagram_direct',
|
|
176
|
+
like_count: reply.like_count,
|
|
177
|
+
is_reply_to_comment: comment.id,
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return normalized;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Normalize Facebook comments from Meta Graph API (skai-facebook-pages piece)
|
|
187
|
+
* Input: { comments: [{ id, message, from: { id, name }, created_time, like_count, comment_count }] }
|
|
188
|
+
*/
|
|
189
|
+
function normalizeFacebookMetaComments(rawData, parentPostId, parentPostUrl) {
|
|
190
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
191
|
+
const data = rawData;
|
|
192
|
+
// Facebook piece returns { comments: [...] } structure
|
|
193
|
+
const comments = (data === null || data === void 0 ? void 0 : data.comments) || (data === null || data === void 0 ? void 0 : data.data) || (Array.isArray(data) ? data : []);
|
|
194
|
+
const normalized = [];
|
|
195
|
+
for (const comment of comments) {
|
|
196
|
+
// Add main comment
|
|
197
|
+
normalized.push({
|
|
198
|
+
external_id: comment.id,
|
|
199
|
+
platform: 'facebook',
|
|
200
|
+
interaction_type: 'comment',
|
|
201
|
+
content: comment.message || '',
|
|
202
|
+
author_id: ((_a = comment.from) === null || _a === void 0 ? void 0 : _a.id) || '',
|
|
203
|
+
author_username: ((_b = comment.from) === null || _b === void 0 ? void 0 : _b.name) || '', // Facebook uses names, not usernames
|
|
204
|
+
author_display_name: ((_c = comment.from) === null || _c === void 0 ? void 0 : _c.name) || null,
|
|
205
|
+
author_avatar_url: null, // Facebook doesn't provide avatar in comment API
|
|
206
|
+
parent_post_id: parentPostId,
|
|
207
|
+
parent_post_url: parentPostUrl || null,
|
|
208
|
+
conversation_id: comment.id, // Comment ID is the conversation root
|
|
209
|
+
platform_created_at: comment.created_time || null,
|
|
210
|
+
metadata: {
|
|
211
|
+
api_source: 'facebook_direct',
|
|
212
|
+
like_count: comment.like_count,
|
|
213
|
+
comment_count: comment.comment_count,
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
// Add nested replies if present (Facebook API includes comments.data for replies)
|
|
217
|
+
const replies = ((_d = comment.comments) === null || _d === void 0 ? void 0 : _d.data) || [];
|
|
218
|
+
for (const reply of replies) {
|
|
219
|
+
normalized.push({
|
|
220
|
+
external_id: reply.id,
|
|
221
|
+
platform: 'facebook',
|
|
222
|
+
interaction_type: 'comment',
|
|
223
|
+
content: reply.message || '',
|
|
224
|
+
author_id: ((_e = reply.from) === null || _e === void 0 ? void 0 : _e.id) || '',
|
|
225
|
+
author_username: ((_f = reply.from) === null || _f === void 0 ? void 0 : _f.name) || '',
|
|
226
|
+
author_display_name: ((_g = reply.from) === null || _g === void 0 ? void 0 : _g.name) || null,
|
|
227
|
+
author_avatar_url: null,
|
|
228
|
+
parent_post_id: parentPostId,
|
|
229
|
+
parent_post_url: parentPostUrl || null,
|
|
230
|
+
conversation_id: comment.id, // Parent comment is conversation root
|
|
231
|
+
platform_created_at: reply.created_time || null,
|
|
232
|
+
metadata: {
|
|
233
|
+
api_source: 'facebook_direct',
|
|
234
|
+
like_count: reply.like_count,
|
|
235
|
+
is_reply_to_comment: comment.id,
|
|
236
|
+
},
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return normalized;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Normalize YouTube comments from YouTube Data API v3 (skai-youtube piece)
|
|
244
|
+
* Input: { commentThreads: [{ id, snippet: { topLevelComment: { id, snippet: { textDisplay, authorDisplayName, authorChannelId, authorProfileImageUrl, publishedAt, likeCount } }, totalReplyCount } }] }
|
|
245
|
+
*/
|
|
246
|
+
function normalizeYouTubeComments(rawData, parentPostId, parentPostUrl) {
|
|
247
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
248
|
+
const data = rawData;
|
|
249
|
+
// YouTube piece returns { commentThreads: [...] } structure
|
|
250
|
+
const threads = (data === null || data === void 0 ? void 0 : data.commentThreads) || (data === null || data === void 0 ? void 0 : data.items) || (Array.isArray(data) ? data : []);
|
|
251
|
+
const normalized = [];
|
|
252
|
+
for (const thread of threads) {
|
|
253
|
+
const topLevelComment = ((_a = thread.snippet) === null || _a === void 0 ? void 0 : _a.topLevelComment) || thread;
|
|
254
|
+
const snippet = topLevelComment.snippet || topLevelComment;
|
|
255
|
+
// Add main comment
|
|
256
|
+
normalized.push({
|
|
257
|
+
external_id: topLevelComment.id || thread.id,
|
|
258
|
+
platform: 'youtube',
|
|
259
|
+
interaction_type: 'comment',
|
|
260
|
+
content: snippet.textDisplay || snippet.textOriginal || '',
|
|
261
|
+
author_id: ((_b = snippet.authorChannelId) === null || _b === void 0 ? void 0 : _b.value) || snippet.authorChannelId || '',
|
|
262
|
+
author_username: snippet.authorDisplayName || '',
|
|
263
|
+
author_display_name: snippet.authorDisplayName || null,
|
|
264
|
+
author_avatar_url: snippet.authorProfileImageUrl || null,
|
|
265
|
+
parent_post_id: parentPostId,
|
|
266
|
+
parent_post_url: parentPostUrl || `https://www.youtube.com/watch?v=${parentPostId}`,
|
|
267
|
+
conversation_id: thread.id || topLevelComment.id, // Thread ID is the conversation root
|
|
268
|
+
platform_created_at: snippet.publishedAt || null,
|
|
269
|
+
metadata: {
|
|
270
|
+
api_source: 'youtube_direct',
|
|
271
|
+
like_count: snippet.likeCount,
|
|
272
|
+
total_reply_count: (_c = thread.snippet) === null || _c === void 0 ? void 0 : _c.totalReplyCount,
|
|
273
|
+
can_reply: (_d = thread.snippet) === null || _d === void 0 ? void 0 : _d.canReply,
|
|
274
|
+
is_public: (_e = thread.snippet) === null || _e === void 0 ? void 0 : _e.isPublic,
|
|
275
|
+
},
|
|
276
|
+
});
|
|
277
|
+
// Add replies if present
|
|
278
|
+
if ((_f = thread.replies) === null || _f === void 0 ? void 0 : _f.comments) {
|
|
279
|
+
for (const reply of thread.replies.comments) {
|
|
280
|
+
const replySnippet = reply.snippet || reply;
|
|
281
|
+
normalized.push({
|
|
282
|
+
external_id: reply.id,
|
|
283
|
+
platform: 'youtube',
|
|
284
|
+
interaction_type: 'comment',
|
|
285
|
+
content: replySnippet.textDisplay || replySnippet.textOriginal || '',
|
|
286
|
+
author_id: ((_g = replySnippet.authorChannelId) === null || _g === void 0 ? void 0 : _g.value) || replySnippet.authorChannelId || '',
|
|
287
|
+
author_username: replySnippet.authorDisplayName || '',
|
|
288
|
+
author_display_name: replySnippet.authorDisplayName || null,
|
|
289
|
+
author_avatar_url: replySnippet.authorProfileImageUrl || null,
|
|
290
|
+
parent_post_id: parentPostId,
|
|
291
|
+
parent_post_url: parentPostUrl || `https://www.youtube.com/watch?v=${parentPostId}`,
|
|
292
|
+
conversation_id: thread.id, // Parent thread is conversation root
|
|
293
|
+
platform_created_at: replySnippet.publishedAt || null,
|
|
294
|
+
metadata: {
|
|
295
|
+
api_source: 'youtube_direct',
|
|
296
|
+
like_count: replySnippet.likeCount,
|
|
297
|
+
is_reply_to_comment: topLevelComment.id,
|
|
298
|
+
parent_id: replySnippet.parentId,
|
|
299
|
+
},
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return normalized;
|
|
305
|
+
}
|
|
306
|
+
//# sourceMappingURL=normalize-comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-comments.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/skai-adapters/src/lib/actions/normalize-comments.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AA8B3D,QAAA,iBAAiB,GAAG,IAAA,+BAAY,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framework").PieceAuthProperty, {
|
|
2
|
+
platform: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
3
|
+
apiSource: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
4
|
+
rawData: import("@activepieces/pieces-framework").JsonProperty<true>;
|
|
5
|
+
}>;
|