@skillful-ai/piece-x 0.0.2 → 0.0.4
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 +1 -1
- package/skillful-ai-piece-x-0.0.4.tgz +0 -0
- package/src/lib/common/auth.js +2 -1
- package/src/lib/common/auth.js.map +1 -1
- package/src/lib/common/triggers/new-mention.d.ts +3 -0
- package/src/lib/common/triggers/new-mention.js +86 -25
- package/src/lib/common/triggers/new-mention.js.map +1 -1
- package/src/lib/common/triggers/new-posts-from-me.d.ts +3 -0
- package/src/lib/common/triggers/new-posts-from-me.js +91 -29
- package/src/lib/common/triggers/new-posts-from-me.js.map +1 -1
- package/src/lib/common/triggers/new-search-match.d.ts +3 -0
- package/src/lib/common/triggers/new-search-match.js +65 -20
- package/src/lib/common/triggers/new-search-match.js.map +1 -1
- package/skillful-ai-piece-x-0.0.2.tgz +0 -0
package/package.json
CHANGED
|
Binary file
|
package/src/lib/common/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/x/src/lib/common/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAA2G;AAC3G,iDAAuD;AACvD,mDAA4C;AAG5C,MAAM,mBAAmB,GAAG;;;CAG3B,CAAC;AAEW,QAAA,WAAW,GAAG,4BAAS,CAAC,MAAM,CAAC;IAC1C,WAAW,EAAE,mBAAmB;IAChC,SAAS,EAAE,wBAAe,CAAC,kBAAkB;IAC7C,mBAAmB,EAAE,4CAAyB,CAAC,MAAM;IACrD,OAAO,EAAE,kCAAkC;IAC3C,QAAQ,EAAE,kCAAkC;IAC5C,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACL,YAAY;QACZ,aAAa;QACb,YAAY;QACZ,gBAAgB,EAAE,4BAA4B;QAC9C,aAAa,EAAK,6BAA6B;KAChD;IACD,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IA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,EAAE,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,mDAAmD,EAAE,CAAC;QACtF,CAAC;IACH,CAAC,CAAA;IACD,IAAI,EAAE,IAAI;IACV,UAAU,EAAE,MAAM;CACnB,CAAC,CAAC"}
|
|
@@ -2,10 +2,13 @@ import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
|
2
2
|
export declare const newMentionTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
3
3
|
handle: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
4
|
maxResults: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
5
|
+
seedOnEnable: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
5
6
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
6
7
|
handle: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
8
|
maxResults: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
9
|
+
seedOnEnable: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
8
10
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
9
11
|
handle: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
12
|
maxResults: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
13
|
+
seedOnEnable: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
11
14
|
}>;
|
|
@@ -2,28 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.newMentionTrigger = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
// src/lib/triggers/new-mention.ts
|
|
5
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
7
|
const auth_1 = require("../auth");
|
|
8
8
|
const __1 = require("..");
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
max_results: (0, __1.clamp)((_b = propsValue.maxResults) !== null && _b !== void 0 ? _b : 20, 10, 100),
|
|
18
|
-
'tweet.fields': ['id', 'text', 'created_at', 'author_id', 'conversation_id'],
|
|
19
|
-
});
|
|
20
|
-
const data = (_c = res.data.data) !== null && _c !== void 0 ? _c : [];
|
|
21
|
-
return data.map((d) => ({
|
|
22
|
-
id: d.id,
|
|
23
|
-
data: Object.assign(Object.assign({}, d), { [pieces_framework_1.DEDUPE_KEY_PROPERTY]: d.id }),
|
|
24
|
-
}));
|
|
25
|
-
});
|
|
26
|
-
const polling = { strategy: pieces_common_1.DedupeStrategy.LAST_ITEM, items };
|
|
9
|
+
const storeKey = (targetId) => `x:last_mention_id:${targetId}`;
|
|
10
|
+
const maxId = (a, b) => {
|
|
11
|
+
if (!a)
|
|
12
|
+
return b;
|
|
13
|
+
if (!b)
|
|
14
|
+
return a;
|
|
15
|
+
return BigInt(a) >= BigInt(b) ? a : b;
|
|
16
|
+
};
|
|
27
17
|
exports.newMentionTrigger = (0, pieces_framework_1.createTrigger)({
|
|
28
18
|
auth: auth_1.twitterAuth,
|
|
29
19
|
name: 'twitter-new-mention',
|
|
@@ -32,27 +22,98 @@ exports.newMentionTrigger = (0, pieces_framework_1.createTrigger)({
|
|
|
32
22
|
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
33
23
|
props: {
|
|
34
24
|
handle: pieces_framework_1.Property.ShortText({ displayName: 'Handle (optional)', required: false }),
|
|
35
|
-
maxResults: pieces_framework_1.Property.Number({ displayName: 'Max per poll', defaultValue:
|
|
25
|
+
maxResults: pieces_framework_1.Property.Number({ displayName: 'Max per poll', defaultValue: 50, required: false }),
|
|
26
|
+
seedOnEnable: pieces_framework_1.Property.Checkbox({
|
|
27
|
+
displayName: 'Seed checkpoint on enable',
|
|
28
|
+
description: 'If ON, start from the latest mention (avoids historical backlog).',
|
|
29
|
+
defaultValue: true,
|
|
30
|
+
required: false,
|
|
31
|
+
}),
|
|
32
|
+
},
|
|
33
|
+
sampleData: {
|
|
34
|
+
id: '1234567890123456789',
|
|
35
|
+
text: 'Hey @yourhandle',
|
|
36
|
+
author_id: '1111',
|
|
37
|
+
conversation_id: '1234567890123456789',
|
|
38
|
+
created_at: '2025-09-03T22:19:40.000Z',
|
|
36
39
|
},
|
|
37
|
-
sampleData: {},
|
|
38
40
|
onEnable(ctx) {
|
|
39
41
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
|
|
42
|
+
var _a, _b, _c;
|
|
43
|
+
if (!ctx.propsValue.seedOnEnable)
|
|
44
|
+
return;
|
|
45
|
+
const client = (0, __1.twitterClient)(ctx.auth);
|
|
46
|
+
const me = yield client.v2.me();
|
|
47
|
+
const targetId = ctx.propsValue.handle
|
|
48
|
+
? (yield client.v2.userByUsername(String(ctx.propsValue.handle).replace(/^@/, ''))).data.id
|
|
49
|
+
: me.data.id;
|
|
50
|
+
const res = yield client.v2.userMentionTimeline(targetId, {
|
|
51
|
+
max_results: 5,
|
|
52
|
+
'tweet.fields': ['id'],
|
|
53
|
+
});
|
|
54
|
+
const latest = (_c = (_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.id;
|
|
55
|
+
if (latest)
|
|
56
|
+
yield ctx.store.put(storeKey(targetId), latest);
|
|
41
57
|
});
|
|
42
58
|
},
|
|
43
59
|
onDisable(ctx) {
|
|
44
60
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
|
|
61
|
+
const client = (0, __1.twitterClient)(ctx.auth);
|
|
62
|
+
const me = yield client.v2.me();
|
|
63
|
+
const targetId = ctx.propsValue.handle
|
|
64
|
+
? (yield client.v2.userByUsername(String(ctx.propsValue.handle).replace(/^@/, ''))).data.id
|
|
65
|
+
: me.data.id;
|
|
66
|
+
// delete if available; overwrite otherwise
|
|
67
|
+
if (typeof ctx.store.delete === 'function') {
|
|
68
|
+
yield ctx.store.delete(storeKey(targetId));
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
yield ctx.store.put(storeKey(targetId), undefined);
|
|
72
|
+
}
|
|
46
73
|
});
|
|
47
74
|
},
|
|
75
|
+
// Just return a couple of latest mentions for Test; don’t touch checkpoint
|
|
48
76
|
test(ctx) {
|
|
49
77
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
|
|
78
|
+
var _a, _b, _c;
|
|
79
|
+
const client = (0, __1.twitterClient)(ctx.auth);
|
|
80
|
+
const me = yield client.v2.me();
|
|
81
|
+
const targetId = ctx.propsValue.handle
|
|
82
|
+
? (yield client.v2.userByUsername(String(ctx.propsValue.handle).replace(/^@/, ''))).data.id
|
|
83
|
+
: me.data.id;
|
|
84
|
+
const res = yield client.v2.userMentionTimeline(targetId, {
|
|
85
|
+
max_results: (0, __1.clamp)((_a = ctx.propsValue.maxResults) !== null && _a !== void 0 ? _a : 10, 10, 100),
|
|
86
|
+
'tweet.fields': ['id', 'text', 'created_at', 'author_id', 'conversation_id'],
|
|
87
|
+
});
|
|
88
|
+
const data = (_c = (_b = res.data) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : [];
|
|
89
|
+
return data.slice(0, 2).map(d => ({ id: d.id, data: d }));
|
|
51
90
|
});
|
|
52
91
|
},
|
|
53
92
|
run(ctx) {
|
|
54
93
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
|
|
94
|
+
var _a, _b, _c;
|
|
95
|
+
const client = (0, __1.twitterClient)(ctx.auth);
|
|
96
|
+
const me = yield client.v2.me();
|
|
97
|
+
const targetId = ctx.propsValue.handle
|
|
98
|
+
? (yield client.v2.userByUsername(String(ctx.propsValue.handle).replace(/^@/, ''))).data.id
|
|
99
|
+
: me.data.id;
|
|
100
|
+
const key = storeKey(targetId);
|
|
101
|
+
const sinceIdRaw = yield ctx.store.get(key);
|
|
102
|
+
const since_id = sinceIdRaw !== null && sinceIdRaw !== void 0 ? sinceIdRaw : undefined;
|
|
103
|
+
const res = yield client.v2.userMentionTimeline(targetId, Object.assign(Object.assign({ max_results: (0, __1.clamp)((_a = ctx.propsValue.maxResults) !== null && _a !== void 0 ? _a : 50, 10, 100) }, (since_id ? { since_id } : {})), { 'tweet.fields': ['id', 'text', 'created_at', 'author_id', 'conversation_id'] }));
|
|
104
|
+
const mentions = (_c = (_b = res.data) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : [];
|
|
105
|
+
if (!mentions.length)
|
|
106
|
+
return [];
|
|
107
|
+
// Track newest ID and emit everything as-is
|
|
108
|
+
let newest = since_id;
|
|
109
|
+
const out = mentions.map((m) => {
|
|
110
|
+
newest = maxId(newest, m.id);
|
|
111
|
+
return { id: m.id, data: Object.assign(Object.assign({}, m), { [pieces_framework_1.DEDUPE_KEY_PROPERTY]: m.id }) };
|
|
112
|
+
});
|
|
113
|
+
// Move the checkpoint forward even if nothing is emitted for some reason
|
|
114
|
+
if (newest)
|
|
115
|
+
yield ctx.store.put(key, newest);
|
|
116
|
+
return out;
|
|
56
117
|
});
|
|
57
118
|
},
|
|
58
119
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-mention.js","sourceRoot":"","sources":["../../../../../../../../../packages/pieces/custom/x/src/lib/common/triggers/new-mention.ts"],"names":[],"mappings":";;;;AAAA,qEAM0C;AACxC
|
|
1
|
+
{"version":3,"file":"new-mention.js","sourceRoot":"","sources":["../../../../../../../../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AK,EAAC,MAAA,GAAG,CAAC,UAAU,CAAC,UAAU,mCAAI,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,IACzD,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KACjC,cAAc,EAAE,CAAC,IAAI,EAAC,MAAM,EAAC,YAAY,EAAC,WAAW,EAAC,iBAAiB,CAAC,GAClE,CAAC,CAAC;YAEV,MAAM,QAAQ,GAAG,MAAA,MAAA,GAAG,CAAC,IAAI,0CAAE,IAAI,mCAAI,EAAE,CAAC;YACtC,IAAI,CAAC,QAAQ,CAAC,MAAM;gBAAE,OAAO,EAAE,CAAC;YAEhC,4CAA4C;YAC5C,IAAI,MAAM,GAAuB,QAAQ,CAAC;YAC1C,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE;gBAClC,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;gBAC7B,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,kCAAO,CAAC,KAAE,CAAC,sCAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,GAAE,EAAE,CAAC;YACnE,CAAC,CAAC,CAAC;YAEH,yEAAyE;YACzE,IAAI,MAAM;gBAAE,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YAE7C,OAAO,GAAG,CAAC;QACb,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -3,12 +3,15 @@ export declare const newPostsFromMeTrigger: import("@activepieces/pieces-framewo
|
|
|
3
3
|
includeRetweets: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
4
4
|
includeReplies: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
5
5
|
maxResults: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
6
|
+
seedOnEnable: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
6
7
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
7
8
|
includeRetweets: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
8
9
|
includeReplies: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
9
10
|
maxResults: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
11
|
+
seedOnEnable: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
10
12
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
11
13
|
includeRetweets: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
12
14
|
includeReplies: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
13
15
|
maxResults: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
16
|
+
seedOnEnable: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
14
17
|
}>;
|
|
@@ -2,33 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.newPostsFromMeTrigger = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
// src/lib/triggers/new-posts-from-me.ts
|
|
5
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
7
|
const auth_1 = require("../auth");
|
|
8
8
|
const __1 = require("..");
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (!propsValue.includeRetweets)
|
|
16
|
-
excludeArr.push('retweets');
|
|
17
|
-
if (!propsValue.includeReplies)
|
|
18
|
-
excludeArr.push('replies');
|
|
19
|
-
const excludeParam = excludeArr.length === 0 ? undefined : excludeArr.length === 1 ? excludeArr[0] : excludeArr;
|
|
20
|
-
const res = yield client.v2.userTimeline(me.data.id, {
|
|
21
|
-
max_results: (0, __1.clamp)((_b = propsValue.maxResults) !== null && _b !== void 0 ? _b : 20, 10, 100),
|
|
22
|
-
exclude: excludeParam,
|
|
23
|
-
'tweet.fields': ['id', 'text', 'created_at', 'referenced_tweets'],
|
|
24
|
-
});
|
|
25
|
-
const data = (_c = res.data.data) !== null && _c !== void 0 ? _c : [];
|
|
26
|
-
return data.map((d) => ({
|
|
27
|
-
id: d.id,
|
|
28
|
-
data: Object.assign(Object.assign({}, d), { [pieces_framework_1.DEDUPE_KEY_PROPERTY]: d.id }),
|
|
29
|
-
}));
|
|
9
|
+
const storeKey = (userId, includeRT, includeRep) => `x:last_my_tweet_id:${userId}:rt=${includeRT ? '1' : '0'}:repl=${includeRep ? '1' : '0'}`;
|
|
10
|
+
const clearStoreKey = (store, key) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
+
if (typeof store.delete === 'function')
|
|
12
|
+
yield store.delete(key);
|
|
13
|
+
else
|
|
14
|
+
yield store.put(key, undefined);
|
|
30
15
|
});
|
|
31
|
-
const
|
|
16
|
+
const maxId = (a, b) => {
|
|
17
|
+
if (!a)
|
|
18
|
+
return b;
|
|
19
|
+
if (!b)
|
|
20
|
+
return a;
|
|
21
|
+
return BigInt(a) >= BigInt(b) ? a : b;
|
|
22
|
+
};
|
|
32
23
|
exports.newPostsFromMeTrigger = (0, pieces_framework_1.createTrigger)({
|
|
33
24
|
auth: auth_1.twitterAuth,
|
|
34
25
|
name: 'twitter-new-posts-from-me',
|
|
@@ -38,27 +29,98 @@ exports.newPostsFromMeTrigger = (0, pieces_framework_1.createTrigger)({
|
|
|
38
29
|
props: {
|
|
39
30
|
includeRetweets: pieces_framework_1.Property.Checkbox({ displayName: 'Include Retweets', defaultValue: false, required: false }),
|
|
40
31
|
includeReplies: pieces_framework_1.Property.Checkbox({ displayName: 'Include Replies', defaultValue: false, required: false }),
|
|
41
|
-
maxResults: pieces_framework_1.Property.Number({ displayName: 'Max per poll', defaultValue:
|
|
32
|
+
maxResults: pieces_framework_1.Property.Number({ displayName: 'Max per poll', defaultValue: 50, required: false }),
|
|
33
|
+
seedOnEnable: pieces_framework_1.Property.Checkbox({
|
|
34
|
+
displayName: 'Seed checkpoint on enable',
|
|
35
|
+
description: 'If ON, start from the latest post (no backlog).',
|
|
36
|
+
defaultValue: true,
|
|
37
|
+
required: false,
|
|
38
|
+
}),
|
|
39
|
+
},
|
|
40
|
+
sampleData: {
|
|
41
|
+
id: '1234567890123456789',
|
|
42
|
+
text: 'Hello world',
|
|
43
|
+
created_at: '2025-09-03T22:19:40.000Z',
|
|
44
|
+
referenced_tweets: [],
|
|
42
45
|
},
|
|
43
|
-
sampleData: {},
|
|
44
46
|
onEnable(ctx) {
|
|
45
47
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
|
|
48
|
+
var _a, _b, _c;
|
|
49
|
+
if (!ctx.propsValue.seedOnEnable)
|
|
50
|
+
return;
|
|
51
|
+
const client = (0, __1.twitterClient)(ctx.auth);
|
|
52
|
+
const me = yield client.v2.me();
|
|
53
|
+
const excludeArr = [];
|
|
54
|
+
if (!ctx.propsValue.includeRetweets)
|
|
55
|
+
excludeArr.push('retweets');
|
|
56
|
+
if (!ctx.propsValue.includeReplies)
|
|
57
|
+
excludeArr.push('replies');
|
|
58
|
+
const excludeParam = excludeArr.length === 0 ? undefined : excludeArr.length === 1 ? excludeArr[0] : excludeArr;
|
|
59
|
+
const res = yield client.v2.userTimeline(me.data.id, {
|
|
60
|
+
max_results: 5,
|
|
61
|
+
exclude: excludeParam,
|
|
62
|
+
'tweet.fields': ['id'],
|
|
63
|
+
});
|
|
64
|
+
const latest = (_c = (_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.id;
|
|
65
|
+
if (latest) {
|
|
66
|
+
yield ctx.store.put(storeKey(me.data.id, !!ctx.propsValue.includeRetweets, !!ctx.propsValue.includeReplies), latest);
|
|
67
|
+
}
|
|
47
68
|
});
|
|
48
69
|
},
|
|
49
70
|
onDisable(ctx) {
|
|
50
71
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
|
|
72
|
+
const client = (0, __1.twitterClient)(ctx.auth);
|
|
73
|
+
const me = yield client.v2.me();
|
|
74
|
+
yield clearStoreKey(ctx.store, storeKey(me.data.id, !!ctx.propsValue.includeRetweets, !!ctx.propsValue.includeReplies));
|
|
52
75
|
});
|
|
53
76
|
},
|
|
77
|
+
// Test: show a couple of recent posts, don’t touch checkpoint.
|
|
54
78
|
test(ctx) {
|
|
55
79
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
|
|
80
|
+
var _a, _b, _c;
|
|
81
|
+
const client = (0, __1.twitterClient)(ctx.auth);
|
|
82
|
+
const me = yield client.v2.me();
|
|
83
|
+
const excludeArr = [];
|
|
84
|
+
if (!ctx.propsValue.includeRetweets)
|
|
85
|
+
excludeArr.push('retweets');
|
|
86
|
+
if (!ctx.propsValue.includeReplies)
|
|
87
|
+
excludeArr.push('replies');
|
|
88
|
+
const excludeParam = excludeArr.length === 0 ? undefined : excludeArr.length === 1 ? excludeArr[0] : excludeArr;
|
|
89
|
+
const res = yield client.v2.userTimeline(me.data.id, {
|
|
90
|
+
max_results: (0, __1.clamp)((_a = ctx.propsValue.maxResults) !== null && _a !== void 0 ? _a : 10, 10, 100),
|
|
91
|
+
exclude: excludeParam,
|
|
92
|
+
'tweet.fields': ['id', 'text', 'created_at', 'referenced_tweets'],
|
|
93
|
+
});
|
|
94
|
+
const data = (_c = (_b = res.data) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : [];
|
|
95
|
+
return data.slice(0, 2).map((d) => ({ id: d.id, data: d }));
|
|
57
96
|
});
|
|
58
97
|
},
|
|
59
98
|
run(ctx) {
|
|
60
99
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
|
|
100
|
+
var _a, _b, _c;
|
|
101
|
+
const client = (0, __1.twitterClient)(ctx.auth);
|
|
102
|
+
const me = yield client.v2.me();
|
|
103
|
+
const excludeArr = [];
|
|
104
|
+
if (!ctx.propsValue.includeRetweets)
|
|
105
|
+
excludeArr.push('retweets');
|
|
106
|
+
if (!ctx.propsValue.includeReplies)
|
|
107
|
+
excludeArr.push('replies');
|
|
108
|
+
const excludeParam = excludeArr.length === 0 ? undefined : excludeArr.length === 1 ? excludeArr[0] : excludeArr;
|
|
109
|
+
const key = storeKey(me.data.id, !!ctx.propsValue.includeRetweets, !!ctx.propsValue.includeReplies);
|
|
110
|
+
const sinceIdRaw = yield ctx.store.get(key);
|
|
111
|
+
const since_id = sinceIdRaw !== null && sinceIdRaw !== void 0 ? sinceIdRaw : undefined;
|
|
112
|
+
const res = yield client.v2.userTimeline(me.data.id, Object.assign(Object.assign({ max_results: (0, __1.clamp)((_a = ctx.propsValue.maxResults) !== null && _a !== void 0 ? _a : 50, 10, 100) }, (since_id ? { since_id } : {})), { exclude: excludeParam, 'tweet.fields': ['id', 'text', 'created_at', 'referenced_tweets'] }));
|
|
113
|
+
const tweets = (_c = (_b = res.data) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : [];
|
|
114
|
+
if (!tweets.length)
|
|
115
|
+
return [];
|
|
116
|
+
let newest = since_id;
|
|
117
|
+
const out = tweets.map((t) => {
|
|
118
|
+
newest = maxId(newest, t.id);
|
|
119
|
+
return { id: t.id, data: Object.assign(Object.assign({}, t), { [pieces_framework_1.DEDUPE_KEY_PROPERTY]: t.id }) };
|
|
120
|
+
});
|
|
121
|
+
if (newest)
|
|
122
|
+
yield ctx.store.put(key, newest);
|
|
123
|
+
return out;
|
|
62
124
|
});
|
|
63
125
|
},
|
|
64
126
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-posts-from-me.js","sourceRoot":"","sources":["../../../../../../../../../packages/pieces/custom/x/src/lib/common/triggers/new-posts-from-me.ts"],"names":[],"mappings":";;;;AAAA,qEAM0C;AACxC
|
|
1
|
+
{"version":3,"file":"new-posts-from-me.js","sourceRoot":"","sources":["../../../../../../../../../packages/pieces/custom/x/src/lib/common/triggers/new-posts-from-me.ts"],"names":[],"mappings":";;;;AAAA,wCAAwC;AACxC,qEAM0C;AACxC,kCAAsC;AACtC,0BAA0C;AAE1C,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAE,SAAkB,EAAE,UAAmB,EAAE,EAAE,CAC3E,sBAAsB,MAAM,OAAO,SAAS,CAAA,CAAC,CAAA,GAAG,CAAA,CAAC,CAAA,GAAG,SAAS,UAAU,CAAA,CAAC,CAAA,GAAG,CAAA,CAAC,CAAA,GAAG,EAAE,CAAC;AAEpF,MAAM,aAAa,GAAG,CAAO,KAAU,EAAE,GAAW,EAAE,EAAE;IACtD,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,UAAU;QAAE,MAAM,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;;QAC3D,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,SAAgB,CAAC,CAAC;AAC9C,CAAC,CAAA,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,CAAU,EAAE,CAAU,EAAE,EAAE;IACvC,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IACjB,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IACjB,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC;AAEW,QAAA,qBAAqB,GAAG,IAAA,gCAAa,EAAC;IACjD,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE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AE,CAAC,KACjC,OAAO,EAAE,YAAY,EACrB,cAAc,EAAE,CAAC,IAAI,EAAC,MAAM,EAAC,YAAY,EAAC,mBAAmB,CAAC,GACxD,CAAC,CAAC;YAEV,MAAM,MAAM,GAAU,MAAA,MAAA,GAAG,CAAC,IAAI,0CAAE,IAAI,mCAAI,EAAE,CAAC;YAC3C,IAAI,CAAC,MAAM,CAAC,MAAM;gBAAE,OAAO,EAAE,CAAC;YAE9B,IAAI,MAAM,GAAuB,QAAQ,CAAC;YAC1C,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE;gBAChC,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;gBAC7B,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,kCAAO,CAAC,KAAE,CAAC,sCAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,GAAE,EAAE,CAAC;YACnE,CAAC,CAAC,CAAC;YAEH,IAAI,MAAM;gBAAE,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YAC7C,OAAO,GAAG,CAAC;QACb,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -2,10 +2,13 @@ import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
|
2
2
|
export declare const newSearchMatchTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
3
3
|
query: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
4
|
maxResults: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
5
|
+
seedOnEnable: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
5
6
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
6
7
|
query: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
8
|
maxResults: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
9
|
+
seedOnEnable: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
8
10
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
9
11
|
query: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
12
|
maxResults: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
13
|
+
seedOnEnable: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
11
14
|
}>;
|
|
@@ -2,24 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.newSearchMatchTrigger = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
// src/lib/triggers/new-search-match.ts
|
|
5
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
7
|
const auth_1 = require("../auth");
|
|
8
8
|
const __1 = require("..");
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const data = (_c = res.data.data) !== null && _c !== void 0 ? _c : [];
|
|
17
|
-
return data.map((d) => ({
|
|
18
|
-
id: d.id,
|
|
19
|
-
data: Object.assign(Object.assign({}, d), { [pieces_framework_1.DEDUPE_KEY_PROPERTY]: d.id }),
|
|
20
|
-
}));
|
|
9
|
+
const crypto_1 = tslib_1.__importDefault(require("crypto"));
|
|
10
|
+
const queryKey = (q) => `x:last_search_id:${crypto_1.default.createHash('sha1').update(q).digest('hex')}`;
|
|
11
|
+
const clearStoreKey = (store, key) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
12
|
+
if (typeof store.delete === 'function')
|
|
13
|
+
yield store.delete(key);
|
|
14
|
+
else
|
|
15
|
+
yield store.put(key, undefined);
|
|
21
16
|
});
|
|
22
|
-
const
|
|
17
|
+
const maxId = (a, b) => {
|
|
18
|
+
if (!a)
|
|
19
|
+
return b;
|
|
20
|
+
if (!b)
|
|
21
|
+
return a;
|
|
22
|
+
return BigInt(a) >= BigInt(b) ? a : b;
|
|
23
|
+
};
|
|
23
24
|
exports.newSearchMatchTrigger = (0, pieces_framework_1.createTrigger)({
|
|
24
25
|
auth: auth_1.twitterAuth,
|
|
25
26
|
name: 'twitter-new-search-match',
|
|
@@ -28,27 +29,71 @@ exports.newSearchMatchTrigger = (0, pieces_framework_1.createTrigger)({
|
|
|
28
29
|
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
29
30
|
props: {
|
|
30
31
|
query: pieces_framework_1.Property.ShortText({ displayName: 'Query', required: true }),
|
|
31
|
-
maxResults: pieces_framework_1.Property.Number({ displayName: 'Max per poll', defaultValue:
|
|
32
|
+
maxResults: pieces_framework_1.Property.Number({ displayName: 'Max per poll', defaultValue: 50, required: false }),
|
|
33
|
+
seedOnEnable: pieces_framework_1.Property.Checkbox({
|
|
34
|
+
displayName: 'Seed checkpoint on enable',
|
|
35
|
+
description: 'If ON, start from the latest match (no backlog).',
|
|
36
|
+
defaultValue: true,
|
|
37
|
+
required: false,
|
|
38
|
+
}),
|
|
39
|
+
},
|
|
40
|
+
sampleData: {
|
|
41
|
+
id: '1234567890123456789',
|
|
42
|
+
text: 'Example match',
|
|
43
|
+
created_at: '2025-09-03T22:19:40.000Z',
|
|
32
44
|
},
|
|
33
|
-
sampleData: {},
|
|
34
45
|
onEnable(ctx) {
|
|
35
46
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
|
|
47
|
+
var _a, _b, _c;
|
|
48
|
+
if (!ctx.propsValue.seedOnEnable)
|
|
49
|
+
return;
|
|
50
|
+
const client = (0, __1.twitterClient)(ctx.auth);
|
|
51
|
+
const res = yield client.v2.search(ctx.propsValue.query, {
|
|
52
|
+
max_results: 5,
|
|
53
|
+
'tweet.fields': ['id'],
|
|
54
|
+
});
|
|
55
|
+
const latest = (_c = (_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.id;
|
|
56
|
+
if (latest)
|
|
57
|
+
yield ctx.store.put(queryKey(ctx.propsValue.query), latest);
|
|
37
58
|
});
|
|
38
59
|
},
|
|
39
60
|
onDisable(ctx) {
|
|
40
61
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
yield
|
|
62
|
+
yield clearStoreKey(ctx.store, queryKey(ctx.propsValue.query));
|
|
42
63
|
});
|
|
43
64
|
},
|
|
65
|
+
// Test: show a couple of recent matches, don’t touch checkpoint
|
|
44
66
|
test(ctx) {
|
|
45
67
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
|
|
68
|
+
var _a, _b, _c;
|
|
69
|
+
const client = (0, __1.twitterClient)(ctx.auth);
|
|
70
|
+
const res = yield client.v2.search(ctx.propsValue.query, {
|
|
71
|
+
max_results: (0, __1.clamp)((_a = ctx.propsValue.maxResults) !== null && _a !== void 0 ? _a : 10, 10, 100),
|
|
72
|
+
'tweet.fields': ['id', 'text', 'created_at'],
|
|
73
|
+
});
|
|
74
|
+
const data = (_c = (_b = res.data) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : [];
|
|
75
|
+
return data.slice(0, 2).map((d) => ({ id: d.id, data: d }));
|
|
47
76
|
});
|
|
48
77
|
},
|
|
49
78
|
run(ctx) {
|
|
50
79
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
|
|
80
|
+
var _a, _b, _c;
|
|
81
|
+
const client = (0, __1.twitterClient)(ctx.auth);
|
|
82
|
+
const key = queryKey(ctx.propsValue.query);
|
|
83
|
+
const sinceIdRaw = yield ctx.store.get(key);
|
|
84
|
+
const since_id = sinceIdRaw !== null && sinceIdRaw !== void 0 ? sinceIdRaw : undefined;
|
|
85
|
+
const res = yield client.v2.search(ctx.propsValue.query, Object.assign(Object.assign({ max_results: (0, __1.clamp)((_a = ctx.propsValue.maxResults) !== null && _a !== void 0 ? _a : 50, 10, 100) }, (since_id ? { since_id } : {})), { 'tweet.fields': ['id', 'text', 'created_at'] }));
|
|
86
|
+
const hits = (_c = (_b = res.data) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : [];
|
|
87
|
+
if (!hits.length)
|
|
88
|
+
return [];
|
|
89
|
+
let newest = since_id;
|
|
90
|
+
const out = hits.map((t) => {
|
|
91
|
+
newest = maxId(newest, t.id);
|
|
92
|
+
return { id: t.id, data: Object.assign(Object.assign({}, t), { [pieces_framework_1.DEDUPE_KEY_PROPERTY]: t.id }) };
|
|
93
|
+
});
|
|
94
|
+
if (newest)
|
|
95
|
+
yield ctx.store.put(key, newest);
|
|
96
|
+
return out;
|
|
52
97
|
});
|
|
53
98
|
},
|
|
54
99
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-search-match.js","sourceRoot":"","sources":["../../../../../../../../../packages/pieces/custom/x/src/lib/common/triggers/new-search-match.ts"],"names":[],"mappings":";;;;AAAA,qEAM0C;AACxC
|
|
1
|
+
{"version":3,"file":"new-search-match.js","sourceRoot":"","sources":["../../../../../../../../../packages/pieces/custom/x/src/lib/common/triggers/new-search-match.ts"],"names":[],"mappings":";;;;AAAA,uCAAuC;AACvC,qEAM0C;AACxC,kCAAsC;AACtC,0BAA0C;AAC1C,4DAA4B;AAE5B,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,oBAAoB,gBAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAExG,MAAM,aAAa,GAAG,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