@activepieces/piece-send-it 0.1.0

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.
Files changed (40) hide show
  1. package/package.json +16 -0
  2. package/src/index.d.ts +1 -0
  3. package/src/index.js +48 -0
  4. package/src/index.js.map +1 -0
  5. package/src/lib/actions/cancel-scheduled-post.d.ts +3 -0
  6. package/src/lib/actions/cancel-scheduled-post.js +24 -0
  7. package/src/lib/actions/cancel-scheduled-post.js.map +1 -0
  8. package/src/lib/actions/list-accounts.d.ts +1 -0
  9. package/src/lib/actions/list-accounts.js +21 -0
  10. package/src/lib/actions/list-accounts.js.map +1 -0
  11. package/src/lib/actions/list-scheduled-posts.d.ts +3 -0
  12. package/src/lib/actions/list-scheduled-posts.js +25 -0
  13. package/src/lib/actions/list-scheduled-posts.js.map +1 -0
  14. package/src/lib/actions/publish-post.d.ts +7 -0
  15. package/src/lib/actions/publish-post.js +36 -0
  16. package/src/lib/actions/publish-post.js.map +1 -0
  17. package/src/lib/actions/schedule-post.d.ts +6 -0
  18. package/src/lib/actions/schedule-post.js +34 -0
  19. package/src/lib/actions/schedule-post.js.map +1 -0
  20. package/src/lib/actions/trigger-scheduled-post.d.ts +3 -0
  21. package/src/lib/actions/trigger-scheduled-post.js +24 -0
  22. package/src/lib/actions/trigger-scheduled-post.js.map +1 -0
  23. package/src/lib/actions/validate-content.d.ts +7 -0
  24. package/src/lib/actions/validate-content.js +36 -0
  25. package/src/lib/actions/validate-content.js.map +1 -0
  26. package/src/lib/auth.d.ts +1 -0
  27. package/src/lib/auth.js +33 -0
  28. package/src/lib/auth.js.map +1 -0
  29. package/src/lib/common.d.ts +11 -0
  30. package/src/lib/common.js +168 -0
  31. package/src/lib/common.js.map +1 -0
  32. package/src/lib/triggers/post-failed.d.ts +2 -0
  33. package/src/lib/triggers/post-failed.js +60 -0
  34. package/src/lib/triggers/post-failed.js.map +1 -0
  35. package/src/lib/triggers/post-published.d.ts +2 -0
  36. package/src/lib/triggers/post-published.js +62 -0
  37. package/src/lib/triggers/post-published.js.map +1 -0
  38. package/src/lib/triggers/post-scheduled.d.ts +2 -0
  39. package/src/lib/triggers/post-scheduled.js +62 -0
  40. package/src/lib/triggers/post-scheduled.js.map +1 -0
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@activepieces/piece-send-it",
3
+ "version": "0.1.0",
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.43.0",
14
+ "tslib": "2.6.2"
15
+ }
16
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const sendIt: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendIt = 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 auth_1 = require("./lib/auth");
9
+ const publish_post_1 = require("./lib/actions/publish-post");
10
+ const schedule_post_1 = require("./lib/actions/schedule-post");
11
+ const cancel_scheduled_post_1 = require("./lib/actions/cancel-scheduled-post");
12
+ const trigger_scheduled_post_1 = require("./lib/actions/trigger-scheduled-post");
13
+ const validate_content_1 = require("./lib/actions/validate-content");
14
+ const list_accounts_1 = require("./lib/actions/list-accounts");
15
+ const list_scheduled_posts_1 = require("./lib/actions/list-scheduled-posts");
16
+ const post_published_1 = require("./lib/triggers/post-published");
17
+ const post_scheduled_1 = require("./lib/triggers/post-scheduled");
18
+ const post_failed_1 = require("./lib/triggers/post-failed");
19
+ const common_1 = require("./lib/common");
20
+ exports.sendIt = (0, pieces_framework_1.createPiece)({
21
+ displayName: 'SendIt',
22
+ description: 'Multi-platform social media publishing. Schedule and publish content to LinkedIn, Instagram, Threads, TikTok, X, and 30+ more platforms.',
23
+ auth: auth_1.sendItAuth,
24
+ minimumSupportedRelease: '0.20.0',
25
+ logoUrl: 'https://cdn.activepieces.com/pieces/send-it.png',
26
+ categories: [shared_1.PieceCategory.MARKETING],
27
+ authors: ['infiniteappsai', 'sanket-a11y'],
28
+ actions: [
29
+ publish_post_1.publishPost,
30
+ schedule_post_1.schedulePost,
31
+ cancel_scheduled_post_1.cancelScheduledPost,
32
+ trigger_scheduled_post_1.triggerScheduledPost,
33
+ validate_content_1.validateContent,
34
+ list_accounts_1.listAccounts,
35
+ list_scheduled_posts_1.listScheduledPosts,
36
+ (0, pieces_common_1.createCustomApiCallAction)({
37
+ baseUrl: () => common_1.BASE_URL,
38
+ auth: auth_1.sendItAuth,
39
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
40
+ return ({
41
+ Authorization: `Bearer ${auth.secret_text}`,
42
+ });
43
+ }),
44
+ }),
45
+ ],
46
+ triggers: [post_published_1.postPublished, post_scheduled_1.postScheduled, post_failed_1.postFailed],
47
+ });
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,+DAAwE;AACxE,iDAAqD;AACrD,qCAAwC;AACxC,6DAAyD;AACzD,+DAA2D;AAC3D,+EAA0E;AAC1E,iFAA4E;AAC5E,qEAAiE;AACjE,+DAA2D;AAC3D,6EAAwE;AACxE,kEAA8D;AAC9D,kEAA8D;AAC9D,4DAAwD;AACxD,yCAAwC;AAE3B,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,QAAQ;IACrB,WAAW,EACT,0IAA0I;IAC5I,IAAI,EAAE,iBAAU;IAChB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,iDAAiD;IAC1D,UAAU,EAAE,CAAC,sBAAa,CAAC,SAAS,CAAC;IACrC,OAAO,EAAE,CAAC,gBAAgB,EAAE,aAAa,CAAC;IAC1C,OAAO,EAAE;QACP,0BAAW;QACX,4BAAY;QACZ,2CAAmB;QACnB,6CAAoB;QACpB,kCAAe;QACf,4BAAY;QACZ,yCAAkB;QAClB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAQ;YACvB,IAAI,EAAE,iBAAU;YAChB,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,8BAAa,EAAE,8BAAa,EAAE,wBAAU,CAAC;CACrD,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const cancelScheduledPost: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ scheduleId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
+ }>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cancelScheduledPost = 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 auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ exports.cancelScheduledPost = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.sendItAuth,
11
+ name: 'cancel_scheduled_post',
12
+ displayName: 'Cancel Scheduled Post',
13
+ description: 'Cancel a scheduled post before it is published',
14
+ props: {
15
+ scheduleId: common_1.scheduleIdProperty,
16
+ },
17
+ run(context) {
18
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
19
+ const { scheduleId } = context.propsValue;
20
+ return yield (0, common_1.sendItRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.DELETE, `/scheduled/${scheduleId}`);
21
+ });
22
+ },
23
+ });
24
+ //# sourceMappingURL=cancel-scheduled-post.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancel-scheduled-post.js","sourceRoot":"","sources":["../../../../src/lib/actions/cancel-scheduled-post.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,kCAAqC;AACrC,sCAA8D;AAEjD,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,gDAAgD;IAC7D,KAAK,EAAE;QACL,UAAU,EAAE,2BAAkB;KAC/B;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE1C,OAAO,MAAM,IAAA,sBAAa,EACxB,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,MAAM,EACjB,cAAc,UAAU,EAAE,CAC3B,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const listAccounts: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {}>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listAccounts = 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 auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ exports.listAccounts = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.sendItAuth,
11
+ name: 'list_accounts',
12
+ displayName: 'List Connected Accounts',
13
+ description: 'Get a list of connected social media accounts',
14
+ props: {},
15
+ run(context) {
16
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
17
+ return yield (0, common_1.sendItRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.GET, '/accounts');
18
+ });
19
+ },
20
+ });
21
+ //# sourceMappingURL=list-accounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-accounts.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-accounts.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,kCAAqC;AACrC,sCAA0C;AAE7B,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,+CAA+C;IAC5D,KAAK,EAAE,EAAE;IACH,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,IAAA,sBAAa,EACxB,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,GAAG,EACd,WAAW,CACZ,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const listScheduledPosts: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ platformFilter: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
3
+ }>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listScheduledPosts = 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 auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ exports.listScheduledPosts = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.sendItAuth,
11
+ name: 'list_scheduled_posts',
12
+ displayName: 'List Scheduled Posts',
13
+ description: 'Get a list of pending scheduled posts',
14
+ props: {
15
+ platformFilter: common_1.platformFilterProperty,
16
+ },
17
+ run(context) {
18
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
19
+ const { platformFilter } = context.propsValue;
20
+ const params = platformFilter ? { platform: platformFilter } : undefined;
21
+ return yield (0, common_1.sendItRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.GET, '/scheduled', undefined, params);
22
+ });
23
+ },
24
+ });
25
+ //# sourceMappingURL=list-scheduled-posts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-scheduled-posts.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-scheduled-posts.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,kCAAqC;AACrC,sCAAkE;AAErD,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,uCAAuC;IACpD,KAAK,EAAE;QACL,cAAc,EAAE,+BAAsB;KACvC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC9C,MAAM,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;YAEzE,OAAO,MAAM,IAAA,sBAAa,EACxB,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,GAAG,EACd,YAAY,EACZ,SAAS,EACT,MAAM,CACP,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const publishPost: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ platforms: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, true>;
3
+ text: import("@activepieces/pieces-framework").LongTextProperty<true>;
4
+ mediaUrl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
+ mediaUrls: import("@activepieces/pieces-framework").ArrayProperty<false>;
6
+ mediaType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
7
+ }>;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.publishPost = 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 auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ exports.publishPost = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.sendItAuth,
11
+ name: 'publish_post',
12
+ displayName: 'Publish Post',
13
+ description: 'Publish content to social media platforms immediately',
14
+ props: {
15
+ platforms: common_1.platformProperty,
16
+ text: common_1.textProperty,
17
+ mediaUrl: common_1.mediaUrlProperty,
18
+ mediaUrls: common_1.mediaUrlsProperty,
19
+ mediaType: common_1.mediaTypeProperty,
20
+ },
21
+ run(context) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ const { platforms, text, mediaUrl, mediaUrls, mediaType } = context.propsValue;
24
+ return yield (0, common_1.sendItRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.POST, '/publish', {
25
+ platforms,
26
+ content: {
27
+ text,
28
+ mediaUrl,
29
+ mediaUrls,
30
+ mediaType,
31
+ },
32
+ });
33
+ });
34
+ },
35
+ });
36
+ //# sourceMappingURL=publish-post.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish-post.js","sourceRoot":"","sources":["../../../../src/lib/actions/publish-post.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,kCAAqC;AACrC,sCAOmB;AAEN,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,uDAAuD;IACpE,KAAK,EAAE;QACL,SAAS,EAAE,yBAAgB;QAC3B,IAAI,EAAE,qBAAY;QAClB,QAAQ,EAAE,yBAAgB;QAC1B,SAAS,EAAE,0BAAiB;QAC5B,SAAS,EAAE,0BAAiB;KAC7B;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,GACvD,OAAO,CAAC,UAAU,CAAC;YAErB,OAAO,MAAM,IAAA,sBAAa,EACxB,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,IAAI,EACf,UAAU,EACV;gBACE,SAAS;gBACT,OAAO,EAAE;oBACP,IAAI;oBACJ,QAAQ;oBACR,SAAS;oBACT,SAAS;iBACV;aACF,CACF,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const schedulePost: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ platforms: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, true>;
3
+ text: import("@activepieces/pieces-framework").LongTextProperty<true>;
4
+ mediaUrl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
+ scheduledTime: import("@activepieces/pieces-framework").DateTimeProperty<true>;
6
+ }>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.schedulePost = 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 auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ exports.schedulePost = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.sendItAuth,
11
+ name: 'schedule_post',
12
+ displayName: 'Schedule Post',
13
+ description: 'Schedule content to be published at a future time',
14
+ props: {
15
+ platforms: common_1.platformProperty,
16
+ text: common_1.textProperty,
17
+ mediaUrl: common_1.mediaUrlProperty,
18
+ scheduledTime: common_1.scheduledTimeProperty,
19
+ },
20
+ run(context) {
21
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
22
+ const { platforms, text, mediaUrl, scheduledTime } = context.propsValue;
23
+ return yield (0, common_1.sendItRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.POST, '/schedule', {
24
+ platforms,
25
+ content: {
26
+ text,
27
+ mediaUrl,
28
+ },
29
+ scheduledTime,
30
+ });
31
+ });
32
+ },
33
+ });
34
+ //# sourceMappingURL=schedule-post.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-post.js","sourceRoot":"","sources":["../../../../src/lib/actions/schedule-post.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,kCAAqC;AACrC,sCAMmB;AAEN,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,mDAAmD;IAChE,KAAK,EAAE;QACL,SAAS,EAAE,yBAAgB;QAC3B,IAAI,EAAE,qBAAY;QAClB,QAAQ,EAAE,yBAAgB;QAC1B,aAAa,EAAE,8BAAqB;KACrC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAExE,OAAO,MAAM,IAAA,sBAAa,EACxB,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,IAAI,EACf,WAAW,EACX;gBACE,SAAS;gBACT,OAAO,EAAE;oBACP,IAAI;oBACJ,QAAQ;iBACT;gBACD,aAAa;aACd,CACF,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const triggerScheduledPost: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ scheduleId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
+ }>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.triggerScheduledPost = 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 auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ exports.triggerScheduledPost = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.sendItAuth,
11
+ name: 'trigger_scheduled_post',
12
+ displayName: 'Trigger Scheduled Post Now',
13
+ description: 'Immediately publish a scheduled post',
14
+ props: {
15
+ scheduleId: common_1.scheduleIdProperty,
16
+ },
17
+ run(context) {
18
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
19
+ const { scheduleId } = context.propsValue;
20
+ return yield (0, common_1.sendItRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.POST, `/scheduled/${scheduleId}/trigger`);
21
+ });
22
+ },
23
+ });
24
+ //# sourceMappingURL=trigger-scheduled-post.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trigger-scheduled-post.js","sourceRoot":"","sources":["../../../../src/lib/actions/trigger-scheduled-post.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,kCAAqC;AACrC,sCAA8D;AAEjD,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,4BAA4B;IACzC,WAAW,EAAE,sCAAsC;IACnD,KAAK,EAAE;QACL,UAAU,EAAE,2BAAkB;KAC/B;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE1C,OAAO,MAAM,IAAA,sBAAa,EACxB,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,IAAI,EACf,cAAc,UAAU,UAAU,CACnC,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const validateContent: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ platforms: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, true>;
3
+ text: import("@activepieces/pieces-framework").LongTextProperty<true>;
4
+ mediaUrl: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
+ mediaUrls: import("@activepieces/pieces-framework").ArrayProperty<false>;
6
+ mediaType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
7
+ }>;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateContent = 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 auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ exports.validateContent = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.sendItAuth,
11
+ name: 'validate_content',
12
+ displayName: 'Validate Content',
13
+ description: 'Check if content meets platform requirements before publishing',
14
+ props: {
15
+ platforms: common_1.platformProperty,
16
+ text: common_1.textProperty,
17
+ mediaUrl: common_1.mediaUrlProperty,
18
+ mediaUrls: common_1.mediaUrlsProperty,
19
+ mediaType: common_1.mediaTypeProperty,
20
+ },
21
+ run(context) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ const { platforms, text, mediaUrl, mediaUrls, mediaType } = context.propsValue;
24
+ return yield (0, common_1.sendItRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.POST, '/validate', {
25
+ platforms,
26
+ content: {
27
+ text,
28
+ mediaUrl,
29
+ mediaUrls,
30
+ mediaType,
31
+ },
32
+ });
33
+ });
34
+ },
35
+ });
36
+ //# sourceMappingURL=validate-content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-content.js","sourceRoot":"","sources":["../../../../src/lib/actions/validate-content.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,kCAAqC;AACrC,sCAOmB;AAEN,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,gEAAgE;IAC7E,KAAK,EAAE;QACL,SAAS,EAAE,yBAAgB;QAC3B,IAAI,EAAE,qBAAY;QAClB,QAAQ,EAAE,yBAAgB;QAC1B,SAAS,EAAE,0BAAiB;QAC5B,SAAS,EAAE,0BAAiB;KAC7B;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,GACvD,OAAO,CAAC,UAAU,CAAC;YAErB,OAAO,MAAM,IAAA,sBAAa,EACxB,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,IAAI,EACf,WAAW,EACX;gBACE,SAAS;gBACT,OAAO,EAAE;oBACP,IAAI;oBACJ,QAAQ;oBACR,SAAS;oBACT,SAAS;iBACV;aACF,CACF,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const sendItAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendItAuth = 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 BASE_URL = 'https://sendit.infiniteappsai.com/api/v1';
8
+ exports.sendItAuth = pieces_framework_1.PieceAuth.SecretText({
9
+ displayName: 'API Key',
10
+ description: `To get your SendIt API key:
11
+ 1. Log in to your [SendIt dashboard](https://sendit.infiniteappsai.com/dashboard)
12
+ 2. Go to **Settings > API Keys**
13
+ 3. Click **Create API Key** — the key is only shown once, so copy it immediately
14
+ 4. Paste the key below (it starts with \`sk_live_\`)`,
15
+ required: true,
16
+ validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
17
+ try {
18
+ yield pieces_common_1.httpClient.sendRequest({
19
+ method: pieces_common_1.HttpMethod.GET,
20
+ url: `${BASE_URL}/accounts`,
21
+ headers: { Authorization: `Bearer ${auth}` },
22
+ });
23
+ return { valid: true };
24
+ }
25
+ catch (_b) {
26
+ return {
27
+ valid: false,
28
+ error: 'Invalid API key. Make sure you copied the full key starting with sk_live_.',
29
+ };
30
+ }
31
+ }),
32
+ });
33
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAA2D;AAC3D,+DAAqE;AAErE,MAAM,QAAQ,GAAG,0CAA0C,CAAC;AAE/C,QAAA,UAAU,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC7C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE;;;;qDAIsC;IACnD,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,QAAQ,WAAW;gBAC3B,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,IAAI,EAAE,EAAE;aAC7C,CAAC,CAAC;YACH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,WAAM,CAAC;YACP,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EACH,4EAA4E;aAC/E,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { HttpMethod } from '@activepieces/pieces-common';
2
+ export declare function sendItRequest(apiKey: string, method: HttpMethod, path: string, body?: unknown, params?: Record<string, string>): Promise<any>;
3
+ export declare const BASE_URL = "https://sendit.infiniteappsai.com/api/v1";
4
+ export declare const platformProperty: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, true>;
5
+ export declare const textProperty: import("@activepieces/pieces-framework").LongTextProperty<true>;
6
+ export declare const mediaUrlProperty: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
+ export declare const mediaUrlsProperty: import("@activepieces/pieces-framework").ArrayProperty<false>;
8
+ export declare const mediaTypeProperty: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
9
+ export declare const scheduleIdProperty: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
10
+ export declare const scheduledTimeProperty: import("@activepieces/pieces-framework").DateTimeProperty<true>;
11
+ export declare const platformFilterProperty: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.platformFilterProperty = exports.scheduledTimeProperty = exports.scheduleIdProperty = exports.mediaTypeProperty = exports.mediaUrlsProperty = exports.mediaUrlProperty = exports.textProperty = exports.platformProperty = exports.BASE_URL = void 0;
4
+ exports.sendItRequest = sendItRequest;
5
+ const tslib_1 = require("tslib");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
8
+ const auth_1 = require("./auth");
9
+ const API_BASE = 'https://sendit.infiniteappsai.com/api/v1';
10
+ const options = [
11
+ { label: 'X (Twitter)', value: 'x' },
12
+ { label: 'LinkedIn', value: 'linkedin' },
13
+ { label: 'LinkedIn Page', value: 'linkedin-page' },
14
+ { label: 'Facebook', value: 'facebook' },
15
+ { label: 'Instagram', value: 'instagram' },
16
+ { label: 'Instagram Standalone', value: 'instagram-standalone' },
17
+ { label: 'Threads', value: 'threads' },
18
+ { label: 'Bluesky', value: 'bluesky' },
19
+ { label: 'Mastodon', value: 'mastodon' },
20
+ { label: 'Warpcast', value: 'warpcast' },
21
+ { label: 'Nostr', value: 'nostr' },
22
+ { label: 'VK', value: 'vk' },
23
+ { label: 'YouTube', value: 'youtube' },
24
+ { label: 'TikTok', value: 'tiktok' },
25
+ { label: 'Reddit', value: 'reddit' },
26
+ { label: 'Lemmy', value: 'lemmy' },
27
+ { label: 'Discord', value: 'discord' },
28
+ { label: 'Slack', value: 'slack' },
29
+ { label: 'Telegram', value: 'telegram' },
30
+ { label: 'Pinterest', value: 'pinterest' },
31
+ { label: 'Dribbble', value: 'dribbble' },
32
+ { label: 'Medium', value: 'medium' },
33
+ { label: 'DEV.to', value: 'devto' },
34
+ { label: 'Hashnode', value: 'hashnode' },
35
+ { label: 'WordPress', value: 'wordpress' },
36
+ { label: 'Google My Business', value: 'gmb' },
37
+ { label: 'Listmonk', value: 'listmonk' },
38
+ { label: 'Skool', value: 'skool' },
39
+ { label: 'Whop', value: 'whop' },
40
+ { label: 'Kick', value: 'kick' },
41
+ { label: 'Twitch', value: 'twitch' },
42
+ { label: 'Product Hunt', value: 'producthunt' },
43
+ ];
44
+ function sendItRequest(apiKey, method, path, body, params) {
45
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
46
+ const response = yield pieces_common_1.httpClient.sendRequest({
47
+ method,
48
+ url: `${API_BASE}${path}`,
49
+ headers: {
50
+ Authorization: `Bearer ${apiKey}`,
51
+ 'Content-Type': 'application/json',
52
+ },
53
+ body,
54
+ queryParams: params,
55
+ });
56
+ return response.body;
57
+ });
58
+ }
59
+ exports.BASE_URL = API_BASE;
60
+ exports.platformProperty = pieces_framework_1.Property.StaticMultiSelectDropdown({
61
+ displayName: 'Platforms',
62
+ description: 'Select one or more social media platforms to publish to. Make sure your accounts are connected in the SendIt dashboard under **Settings > Connected Accounts**.',
63
+ required: true,
64
+ options: {
65
+ options,
66
+ },
67
+ });
68
+ exports.textProperty = pieces_framework_1.Property.LongText({
69
+ displayName: 'Post Text',
70
+ description: 'The text content of your post. Character limits vary by platform (e.g. X/Twitter: 280, LinkedIn: 3000, Instagram: 2200).',
71
+ required: true,
72
+ });
73
+ exports.mediaUrlProperty = pieces_framework_1.Property.ShortText({
74
+ displayName: 'Media URL',
75
+ description: 'A publicly accessible URL to an image (JPG, PNG, GIF) or video (MP4). **Required for Instagram and TikTok.** Images must be under 10 MB and videos under 100 MB.',
76
+ required: false,
77
+ });
78
+ exports.mediaUrlsProperty = pieces_framework_1.Property.Array({
79
+ displayName: 'Media URLs (Carousel)',
80
+ description: 'Add multiple publicly accessible image URLs to create a carousel post. Supported on Instagram and Threads. Add one URL per item.',
81
+ required: false,
82
+ });
83
+ exports.mediaTypeProperty = pieces_framework_1.Property.StaticDropdown({
84
+ displayName: 'Media Type',
85
+ description: 'Leave as **Auto-detect** unless SendIt misidentifies your media. Choose **Image** or **Video** to force a specific type.',
86
+ required: false,
87
+ defaultValue: 'auto',
88
+ options: {
89
+ options: [
90
+ { label: 'Auto-detect (recommended)', value: 'auto' },
91
+ { label: 'Image', value: 'image' },
92
+ { label: 'Video', value: 'video' },
93
+ ],
94
+ },
95
+ });
96
+ exports.scheduleIdProperty = pieces_framework_1.Property.Dropdown({
97
+ displayName: 'Scheduled Post',
98
+ description: 'Select the scheduled post you want to act on. Only posts with a **Pending** status are listed.',
99
+ refreshers: [],
100
+ required: true,
101
+ auth: auth_1.sendItAuth,
102
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
103
+ var _b, _c;
104
+ if (!auth) {
105
+ return {
106
+ disabled: true,
107
+ options: [],
108
+ placeholder: 'Please connect your SendIt account first',
109
+ };
110
+ }
111
+ try {
112
+ const response = (yield sendItRequest(auth.secret_text, pieces_common_1.HttpMethod.GET, '/scheduled'));
113
+ const posts = ((_c = (_b = response['posts']) !== null && _b !== void 0 ? _b : response['data']) !== null && _c !== void 0 ? _c : response);
114
+ if (!Array.isArray(posts) || posts.length === 0) {
115
+ return {
116
+ disabled: false,
117
+ options: [],
118
+ placeholder: 'No scheduled posts found. Create one first.',
119
+ };
120
+ }
121
+ return {
122
+ disabled: false,
123
+ options: posts
124
+ .map((post) => {
125
+ var _a, _b, _c, _d;
126
+ const platforms = Array.isArray(post['platforms'])
127
+ ? post['platforms'].join(', ')
128
+ : String((_a = post['platform']) !== null && _a !== void 0 ? _a : 'Unknown');
129
+ const content = post['content'];
130
+ const rawText = String((_b = content === null || content === void 0 ? void 0 : content['text']) !== null && _b !== void 0 ? _b : '');
131
+ const snippet = rawText.length > 40
132
+ ? rawText.substring(0, 40) + '…'
133
+ : rawText || 'No text';
134
+ const scheduledTime = post['scheduledTime']
135
+ ? new Date(String(post['scheduledTime'])).toLocaleString()
136
+ : '';
137
+ const id = String((_d = (_c = post['id']) !== null && _c !== void 0 ? _c : post['scheduleId']) !== null && _d !== void 0 ? _d : '');
138
+ return {
139
+ label: `${platforms} — ${snippet}${scheduledTime ? ` (${scheduledTime})` : ''}`,
140
+ value: id,
141
+ };
142
+ })
143
+ .filter((opt) => opt.value !== ''),
144
+ };
145
+ }
146
+ catch (_d) {
147
+ return {
148
+ disabled: true,
149
+ options: [],
150
+ placeholder: 'Failed to load scheduled posts. Check your API key.',
151
+ };
152
+ }
153
+ }),
154
+ });
155
+ exports.scheduledTimeProperty = pieces_framework_1.Property.DateTime({
156
+ displayName: 'Scheduled Time',
157
+ description: 'When to publish the post. Must be in the future. Times are interpreted in UTC — convert your local time if needed.',
158
+ required: true,
159
+ });
160
+ exports.platformFilterProperty = pieces_framework_1.Property.StaticDropdown({
161
+ displayName: 'Platform Filter',
162
+ description: 'Only return scheduled posts for a specific platform. Leave empty to see all platforms.',
163
+ required: false,
164
+ options: {
165
+ options,
166
+ },
167
+ });
168
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/lib/common.ts"],"names":[],"mappings":";;;AAwCA,sCAkBC;;AA1DD,+DAAqE;AACrE,qEAA0D;AAC1D,iCAAoC;AAEpC,MAAM,QAAQ,GAAG,0CAA0C,CAAC;AAE5D,MAAM,OAAO,GAAG;IACd,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,EAAE;IACpC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACxC,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;IAClD,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACxC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;IAC1C,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,sBAAsB,EAAE;IAChE,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACtC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACtC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACxC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACxC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAClC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;IAC5B,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACtC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IACpC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK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AAE,gBAAgB;IAC7B,WAAW,EACT,oHAAoH;IACtH,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEU,QAAA,sBAAsB,GAAG,2BAAQ,CAAC,cAAc,CAAC;IAC5D,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EACT,wFAAwF;IAC1F,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE;QACP,OAAO;KACR;CACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const postFailed: 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>, {}>;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.postFailed = 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 auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ exports.postFailed = (0, pieces_framework_1.createTrigger)({
10
+ auth: auth_1.sendItAuth,
11
+ name: 'post_failed',
12
+ displayName: 'Post Failed',
13
+ description: 'Triggers when a post fails to publish to a platform',
14
+ props: {},
15
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
16
+ onEnable(context) {
17
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
18
+ const response = (yield (0, common_1.sendItRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.POST, '/webhooks', {
19
+ url: context.webhookUrl,
20
+ events: ['post.failed'],
21
+ }));
22
+ yield context.store.put('webhookId', response.webhook.id);
23
+ });
24
+ },
25
+ onDisable(context) {
26
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
+ const webhookId = yield context.store.get('webhookId');
28
+ if (webhookId) {
29
+ yield (0, common_1.sendItRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.DELETE, `/webhooks/${webhookId}`);
30
+ }
31
+ });
32
+ },
33
+ run(context) {
34
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
35
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
36
+ const payload = context.payload.body;
37
+ return [
38
+ {
39
+ delivery_id: (_a = payload.deliveryId) !== null && _a !== void 0 ? _a : null,
40
+ event: (_b = payload.event) !== null && _b !== void 0 ? _b : null,
41
+ timestamp: (_c = payload.timestamp) !== null && _c !== void 0 ? _c : null,
42
+ platform: (_e = (_d = payload.data) === null || _d === void 0 ? void 0 : _d.platform) !== null && _e !== void 0 ? _e : null,
43
+ content_text: (_h = (_g = (_f = payload.data) === null || _f === void 0 ? void 0 : _f.content) === null || _g === void 0 ? void 0 : _g.text) !== null && _h !== void 0 ? _h : null,
44
+ error: (_k = (_j = payload.data) === null || _j === void 0 ? void 0 : _j.error) !== null && _k !== void 0 ? _k : null,
45
+ failed_at: (_m = (_l = payload.data) === null || _l === void 0 ? void 0 : _l.failedAt) !== null && _m !== void 0 ? _m : null,
46
+ },
47
+ ];
48
+ });
49
+ },
50
+ sampleData: {
51
+ delivery_id: 'dlv_sample789',
52
+ event: 'post.failed',
53
+ timestamp: '2025-01-14T12:00:00.000Z',
54
+ platform: 'instagram',
55
+ content_text: 'Failed post content',
56
+ error: 'Instagram API rate limit exceeded',
57
+ failed_at: '2025-01-14T12:00:00.000Z',
58
+ },
59
+ });
60
+ //# sourceMappingURL=post-failed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post-failed.js","sourceRoot":"","sources":["../../../../src/lib/triggers/post-failed.ts"],"names":[],"m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AAA,MAAA,OAAO,CAAC,IAAI,0CAAE,QAAQ,mCAAI,IAAI;oBACxC,YAAY,EAAE,MAAA,MAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,OAAO,0CAAE,IAAI,mCAAI,IAAI;oBACjD,KAAK,EAAE,MAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,KAAK,mCAAI,IAAI;oBAClC,SAAS,EAAE,MAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,QAAQ,mCAAI,IAAI;iBAC1C;aACF,CAAC;QACJ,CAAC;KAAA;IACD,UAAU,EAAE;QACV,WAAW,EAAE,eAAe;QAC5B,KAAK,EAAE,aAAa;QACpB,SAAS,EAAE,0BAA0B;QACrC,QAAQ,EAAE,WAAW;QACrB,YAAY,EAAE,qBAAqB;QACnC,KAAK,EAAE,mCAAmC;QAC1C,SAAS,EAAE,0BAA0B;KACtC;CACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const postPublished: 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>, {}>;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.postPublished = 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 auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ exports.postPublished = (0, pieces_framework_1.createTrigger)({
10
+ auth: auth_1.sendItAuth,
11
+ name: 'post_published',
12
+ displayName: 'Post Published',
13
+ description: 'Triggers when a post is successfully published to a platform',
14
+ props: {},
15
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
16
+ onEnable(context) {
17
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
18
+ const response = (yield (0, common_1.sendItRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.POST, '/webhooks', {
19
+ url: context.webhookUrl,
20
+ events: ['post.published'],
21
+ }));
22
+ yield context.store.put('webhookId', response.webhook.id);
23
+ });
24
+ },
25
+ onDisable(context) {
26
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
+ const webhookId = yield context.store.get('webhookId');
28
+ if (webhookId) {
29
+ yield (0, common_1.sendItRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.DELETE, `/webhooks/${webhookId}`);
30
+ }
31
+ });
32
+ },
33
+ run(context) {
34
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
35
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
36
+ const payload = context.payload.body;
37
+ return [
38
+ {
39
+ delivery_id: (_a = payload.deliveryId) !== null && _a !== void 0 ? _a : null,
40
+ event: (_b = payload.event) !== null && _b !== void 0 ? _b : null,
41
+ timestamp: (_c = payload.timestamp) !== null && _c !== void 0 ? _c : null,
42
+ platform: (_e = (_d = payload.data) === null || _d === void 0 ? void 0 : _d.platform) !== null && _e !== void 0 ? _e : null,
43
+ post_id: (_g = (_f = payload.data) === null || _f === void 0 ? void 0 : _f.postId) !== null && _g !== void 0 ? _g : null,
44
+ post_url: (_j = (_h = payload.data) === null || _h === void 0 ? void 0 : _h.postUrl) !== null && _j !== void 0 ? _j : null,
45
+ content_text: (_m = (_l = (_k = payload.data) === null || _k === void 0 ? void 0 : _k.content) === null || _l === void 0 ? void 0 : _l.text) !== null && _m !== void 0 ? _m : null,
46
+ published_at: (_p = (_o = payload.data) === null || _o === void 0 ? void 0 : _o.publishedAt) !== null && _p !== void 0 ? _p : null,
47
+ },
48
+ ];
49
+ });
50
+ },
51
+ sampleData: {
52
+ delivery_id: 'dlv_sample123',
53
+ event: 'post.published',
54
+ timestamp: '2025-01-14T12:00:00.000Z',
55
+ platform: 'linkedin',
56
+ post_id: 'urn:li:share:1234567890',
57
+ post_url: 'https://www.linkedin.com/feed/update/urn:li:share:1234567890',
58
+ content_text: 'Sample post content',
59
+ published_at: '2025-01-14T12:00:00.000Z',
60
+ },
61
+ });
62
+ //# sourceMappingURL=post-published.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post-published.js","sourceRoot":"","sources":["../../../../src/lib/triggers/post-published.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,+DAAyD;AACzD,kCAAqC;AACrC,sCAA0C;AAe7B,QAAA,aAAa,GAAG,IAAA,gCAAa,EAAC;IACzC,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,8DAA8D;IAC3E,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ,CAAC,OAAO;;YACpB,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAA,sBAAa,EACnC,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,IAAI,EACf,WAAW,EACX;gBACE,GAAG,EAAE,OAAO,CAAC,UAAU;gBACvB,MAAM,EAAE,CAAC,gBAAgB,CAAC;aAC3B,CACF,CAAgD,CAAC;YAElD,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5D,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAS,WAAW,CAAC,CAAC;YAC/D,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,IAAA,sBAAa,EACjB,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,MAAM,EACjB,aAAa,SAAS,EAAE,CACzB,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAwB,CAAC;YACzD,OAAO;gBACL;oBACE,WAAW,EAAE,MAAA,OAAO,CAAC,UAAU,mCAAI,IAAI;oBACvC,KAAK,EAAE,MAAA,OAAO,CAAC,KAAK,mCAAI,IAAI;oBAC5B,SAAS,EAAE,MAAA,OAAO,CAAC,SAAS,mCAAI,IAAI;oBACpC,QAAQ,EAAE,MAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,QAAQ,mCAAI,IAAI;oBACxC,OAAO,EAAE,MAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,MAAM,mCAAI,IAAI;oBACrC,QAAQ,EAAE,MAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,OAAO,mCAAI,IAAI;oBACvC,YAAY,EAAE,MAAA,MAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,OAAO,0CAAE,IAAI,mCAAI,IAAI;oBACjD,YAAY,EAAE,MAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,WAAW,mCAAI,IAAI;iBAChD;aACF,CAAC;QACJ,CAAC;KAAA;IACD,UAAU,EAAE;QACV,WAAW,EAAE,eAAe;QAC5B,KAAK,EAAE,gBAAgB;QACvB,SAAS,EAAE,0BAA0B;QACrC,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,yBAAyB;QAClC,QAAQ,EAAE,8DAA8D;QACxE,YAAY,EAAE,qBAAqB;QACnC,YAAY,EAAE,0BAA0B;KACzC;CACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const postScheduled: 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>, {}>;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.postScheduled = 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 auth_1 = require("../auth");
8
+ const common_1 = require("../common");
9
+ exports.postScheduled = (0, pieces_framework_1.createTrigger)({
10
+ auth: auth_1.sendItAuth,
11
+ name: 'post_scheduled',
12
+ displayName: 'Post Scheduled',
13
+ description: 'Triggers when a post is scheduled for future publishing',
14
+ props: {},
15
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
16
+ onEnable(context) {
17
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
18
+ const response = (yield (0, common_1.sendItRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.POST, '/webhooks', {
19
+ url: context.webhookUrl,
20
+ events: ['post.scheduled'],
21
+ }));
22
+ yield context.store.put('webhookId', response.webhook.id);
23
+ });
24
+ },
25
+ onDisable(context) {
26
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
+ const webhookId = yield context.store.get('webhookId');
28
+ if (webhookId) {
29
+ yield (0, common_1.sendItRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.DELETE, `/webhooks/${webhookId}`);
30
+ }
31
+ });
32
+ },
33
+ run(context) {
34
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
35
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
36
+ const payload = context.payload.body;
37
+ return [
38
+ {
39
+ delivery_id: (_a = payload.deliveryId) !== null && _a !== void 0 ? _a : null,
40
+ event: (_b = payload.event) !== null && _b !== void 0 ? _b : null,
41
+ timestamp: (_c = payload.timestamp) !== null && _c !== void 0 ? _c : null,
42
+ schedule_id: (_e = (_d = payload.data) === null || _d === void 0 ? void 0 : _d.scheduleId) !== null && _e !== void 0 ? _e : null,
43
+ platforms: Array.isArray((_f = payload.data) === null || _f === void 0 ? void 0 : _f.platforms)
44
+ ? payload.data.platforms.join(', ')
45
+ : null,
46
+ content_text: (_j = (_h = (_g = payload.data) === null || _g === void 0 ? void 0 : _g.content) === null || _h === void 0 ? void 0 : _h.text) !== null && _j !== void 0 ? _j : null,
47
+ scheduled_time: (_l = (_k = payload.data) === null || _k === void 0 ? void 0 : _k.scheduledTime) !== null && _l !== void 0 ? _l : null,
48
+ },
49
+ ];
50
+ });
51
+ },
52
+ sampleData: {
53
+ delivery_id: 'dlv_sample456',
54
+ event: 'post.scheduled',
55
+ timestamp: '2025-01-14T12:00:00.000Z',
56
+ schedule_id: 'sch_abc123',
57
+ platforms: 'linkedin, instagram',
58
+ content_text: 'Scheduled post content',
59
+ scheduled_time: '2025-01-15T12:00:00.000Z',
60
+ },
61
+ });
62
+ //# sourceMappingURL=post-scheduled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post-scheduled.js","sourceRoot":"","sources":["../../../../src/lib/triggers/post-scheduled.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,+DAAyD;AACzD,kCAAqC;AACrC,sCAA0C;AAc7B,QAAA,aAAa,GAAG,IAAA,gCAAa,EAAC;IACzC,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,yDAAyD;IACtE,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ,CAAC,OAAO;;YACpB,MAAM,QAAQ,GAAG,CAAC,MAA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