@agnocon/piece-bursty-ai 0.1.7

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/LICENSE.MIT-AP ADDED
@@ -0,0 +1,24 @@
1
+ MIT License
2
+
3
+ Copyright (c) Activepieces AB
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ Derived helpers in this folder are adapted from Activepieces (MIT) for use
24
+ inside CX without depending on @activepieces/* packages at runtime.
@@ -0,0 +1,2 @@
1
+ export declare const burstyAi: import("@agnocon/pieces-framework").Piece<import("@agnocon/pieces-framework").SecretTextProperty<true>>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,QAAQ,yGAWnB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.burstyAi = void 0;
4
+ // Vendored from Activepieces packages/pieces/community/bursty-ai/src/index.ts (MIT).
5
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
6
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
7
+ const run_workflow_1 = require("./lib/actions/run-workflow");
8
+ const auth_1 = require("./lib/common/auth");
9
+ const pieces_framework_2 = require("@agnocon/pieces-framework");
10
+ exports.burstyAi = (0, pieces_framework_1.createPiece)({
11
+ displayName: 'BurstyAI',
12
+ auth: auth_1.burstyAiAuth,
13
+ minimumSupportedRelease: '0.36.1',
14
+ logoUrl: 'https://cdn.activepieces.com/pieces/bursty-ai.png',
15
+ categories: [pieces_framework_2.PieceCategory.ARTIFICIAL_INTELLIGENCE],
16
+ description: "Automate content creation, SEO optimization, email outreach, and influencer partnerships with BurstyAI's no-code AI workflows.",
17
+ authors: ['sanket-a11y'],
18
+ actions: [run_workflow_1.runWorkflow],
19
+ triggers: [],
20
+ });
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qFAAqF;AACrF,qEAAqE;AACrE,gEAAmE;AACnE,6DAAyD;AACzD,4CAAiD;AACjD,gEAA0D;AAE7C,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC;IAClC,WAAW,EAAE,UAAU;IACvB,IAAI,EAAE,mBAAY;IAClB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,mDAAmD;IAC5D,UAAU,EAAE,CAAC,gCAAa,CAAC,uBAAuB,CAAC;IACnD,WAAW,EACT,gIAAgI;IAClI,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,OAAO,EAAE,CAAC,0BAAW,CAAC;IACtB,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const runWorkflow: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").SecretTextProperty<true>, {
2
+ workflow_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ get_result: import("@agnocon/pieces-framework").CheckboxProperty<false>;
4
+ }>;
5
+ //# sourceMappingURL=run-workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-workflow.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/run-workflow.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW;;;EA4EtB,CAAC"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runWorkflow = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bursty-ai/src/lib/actions/run-workflow.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../common/auth");
10
+ exports.runWorkflow = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.burstyAiAuth,
12
+ name: 'runWorkflow',
13
+ displayName: 'Run Workflow',
14
+ description: 'Run a Bursty AI workflow and optionally wait for and return the results',
15
+ audience: 'both',
16
+ aiMetadata: {
17
+ description: 'Starts (triggers) a BurstyAI no-code AI workflow by its workflow ID, launching a new asynchronous execution. Use to kick off a BurstyAI content/SEO/outreach automation; enable "Wait for Result" to block and poll until the job completes (returns the result, times out after ~10 minutes), or leave it off to fire-and-return the job handle immediately. Not idempotent: each call starts a separate workflow run.',
18
+ idempotent: false,
19
+ },
20
+ props: {
21
+ workflow_id: pieces_framework_1.Property.ShortText({
22
+ displayName: 'Workflow ID',
23
+ description: 'The ID of the Bursty AI workflow to run',
24
+ required: true,
25
+ }),
26
+ get_result: pieces_framework_1.Property.Checkbox({
27
+ displayName: 'Wait for Result',
28
+ description: 'Wait for the workflow to complete and return the results (default: false)',
29
+ required: false,
30
+ defaultValue: false,
31
+ }),
32
+ },
33
+ run(context) {
34
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
35
+ const runResponse = yield pieces_common_1.httpClient.sendRequest({
36
+ method: pieces_common_1.HttpMethod.POST,
37
+ url: `https://app.burstyai.com/burstyai/aiflows/${context.propsValue.workflow_id}/async_run`,
38
+ headers: {
39
+ Authorization: `Bearer ${context.auth}`,
40
+ 'content-type': 'application/json',
41
+ },
42
+ body: {},
43
+ });
44
+ const jobData = runResponse.body;
45
+ if (!context.propsValue.get_result) {
46
+ return jobData;
47
+ }
48
+ const jobId = jobData.jobId || jobData.id;
49
+ if (!jobId) {
50
+ throw new Error('No job ID returned from workflow execution');
51
+ }
52
+ const maxAttempts = 30;
53
+ let attempts = 0;
54
+ while (attempts < maxAttempts) {
55
+ const resultResponse = yield pieces_common_1.httpClient.sendRequest({
56
+ method: pieces_common_1.HttpMethod.GET,
57
+ url: `https://app.burstyai.com/burstyai/aiflowjobs/${jobId}/result`,
58
+ headers: {
59
+ Authorization: `Bearer ${context.auth}`,
60
+ },
61
+ });
62
+ const result = resultResponse.body;
63
+ if (result.status === 'END' ||
64
+ result.status === 'ERROR' ||
65
+ result.status === 'DONE') {
66
+ return result;
67
+ }
68
+ yield new Promise((resolve) => setTimeout(resolve, 5000));
69
+ attempts++;
70
+ }
71
+ throw new Error('Workflow execution timed out after 10 minutes');
72
+ });
73
+ },
74
+ });
75
+ //# sourceMappingURL=run-workflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-workflow.js","sourceRoot":"","sources":["../../../src/lib/actions/run-workflow.ts"],"names":[],"mappings":";;;;AAAA,wGAAwG;AACxG,qEAAqE;AACrE,gEAAmE;AACnE,0DAAgE;AAChE,yCAA8C;AAEjC,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,cAAc;IAC3B,WAAW,EACT,yEAAyE;IAC3E,QA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MAAM,EAAE,0BAAU,CAAC,GAAG;oBACtB,GAAG,EAAE,gDAAgD,KAAK,SAAS;oBACnE,OAAO,EAAE;wBACP,aAAa,EAAE,UAAU,OAAO,CAAC,IAAI,EAAE;qBACxC;iBACF,CAAC,CAAC;gBAEH,MAAM,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC;gBAEnC,IACE,MAAM,CAAC,MAAM,KAAK,KAAK;oBACvB,MAAM,CAAC,MAAM,KAAK,OAAO;oBACzB,MAAM,CAAC,MAAM,KAAK,MAAM,EACxB,CAAC;oBACD,OAAO,MAAM,CAAC;gBAChB,CAAC;gBAED,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;gBAC1D,QAAQ,EAAE,CAAC;YACb,CAAC;YAED,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACnE,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const burstyAiAuth: import("@agnocon/pieces-framework").SecretTextProperty<true>;
2
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/common/auth.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,8DAIvB,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.burstyAiAuth = void 0;
4
+ // Vendored from Activepieces packages/pieces/community/bursty-ai/src/lib/common/auth.ts (MIT).
5
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
6
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
7
+ exports.burstyAiAuth = pieces_framework_1.PieceAuth.SecretText({
8
+ displayName: "API Key",
9
+ description: "API Key for Bursty-ai",
10
+ required: true,
11
+ });
12
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/common/auth.ts"],"names":[],"mappings":";;;AAAA,+FAA+F;AAC/F,qEAAqE;AACrE,gEAAsD;AAEzC,QAAA,YAAY,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC/C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,uBAAuB;IACpC,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@agnocon/piece-bursty-ai",
3
+ "version": "0.1.7",
4
+ "description": "AgnoCon bursty ai connector",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "require": "./dist/index.js",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "src",
17
+ "LICENSE.MIT-AP"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc -p tsconfig.json",
21
+ "vendor": "node ../scripts/vendor-ap.mjs piece-bursty-ai"
22
+ },
23
+ "dependencies": {
24
+ "@agnocon/core-utils": "0.2.0",
25
+ "@agnocon/piece-types": "0.3.1",
26
+ "@agnocon/pieces-common": "0.12.8",
27
+ "@agnocon/pieces-framework": "0.36.0",
28
+ "tslib": "2.6.2"
29
+ },
30
+ "devDependencies": {
31
+ "@types/node": "20.17.6",
32
+ "typescript": "5.5.4"
33
+ },
34
+ "license": "MIT",
35
+ "agnocon": {
36
+ "originVersion": "0.1.7"
37
+ },
38
+ "publishConfig": {
39
+ "access": "restricted",
40
+ "tag": "latest"
41
+ },
42
+ "keywords": [
43
+ "agnocon",
44
+ "connector"
45
+ ]
46
+ }
package/src/index.ts ADDED
@@ -0,0 +1,17 @@
1
+ import { createPiece, PieceAuth } from '@agnocon/pieces-framework';
2
+ import { runWorkflow } from './lib/actions/run-workflow';
3
+ import { burstyAiAuth } from './lib/common/auth';
4
+ import { PieceCategory } from '@agnocon/pieces-framework';
5
+
6
+ export const burstyAi = createPiece({
7
+ displayName: 'BurstyAI',
8
+ auth: burstyAiAuth,
9
+ minimumSupportedRelease: '0.36.1',
10
+ logoUrl: 'https://cdn.activepieces.com/pieces/bursty-ai.png',
11
+ categories: [PieceCategory.ARTIFICIAL_INTELLIGENCE],
12
+ description:
13
+ "Automate content creation, SEO optimization, email outreach, and influencer partnerships with BurstyAI's no-code AI workflows.",
14
+ authors: ['sanket-a11y'],
15
+ actions: [runWorkflow],
16
+ triggers: [],
17
+ });
@@ -0,0 +1,81 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import { HttpMethod, httpClient } from '@agnocon/pieces-common';
3
+ import { burstyAiAuth } from '../common/auth';
4
+
5
+ export const runWorkflow = createAction({
6
+ auth: burstyAiAuth,
7
+ name: 'runWorkflow',
8
+ displayName: 'Run Workflow',
9
+ description:
10
+ 'Run a Bursty AI workflow and optionally wait for and return the results',
11
+ audience: 'both',
12
+ aiMetadata: {
13
+ description:
14
+ 'Starts (triggers) a BurstyAI no-code AI workflow by its workflow ID, launching a new asynchronous execution. Use to kick off a BurstyAI content/SEO/outreach automation; enable "Wait for Result" to block and poll until the job completes (returns the result, times out after ~10 minutes), or leave it off to fire-and-return the job handle immediately. Not idempotent: each call starts a separate workflow run.',
15
+ idempotent: false,
16
+ },
17
+ props: {
18
+ workflow_id: Property.ShortText({
19
+ displayName: 'Workflow ID',
20
+ description: 'The ID of the Bursty AI workflow to run',
21
+ required: true,
22
+ }),
23
+ get_result: Property.Checkbox({
24
+ displayName: 'Wait for Result',
25
+ description:
26
+ 'Wait for the workflow to complete and return the results (default: false)',
27
+ required: false,
28
+ defaultValue: false,
29
+ }),
30
+ },
31
+ async run(context) {
32
+ const runResponse = await httpClient.sendRequest({
33
+ method: HttpMethod.POST,
34
+ url: `https://app.burstyai.com/burstyai/aiflows/${context.propsValue.workflow_id}/async_run`,
35
+ headers: {
36
+ Authorization: `Bearer ${context.auth}`,
37
+ 'content-type': 'application/json',
38
+ },
39
+ body: {},
40
+ });
41
+
42
+ const jobData = runResponse.body;
43
+
44
+ if (!context.propsValue.get_result) {
45
+ return jobData;
46
+ }
47
+
48
+ const jobId = jobData.jobId || jobData.id;
49
+ if (!jobId) {
50
+ throw new Error('No job ID returned from workflow execution');
51
+ }
52
+
53
+ const maxAttempts = 30;
54
+ let attempts = 0;
55
+
56
+ while (attempts < maxAttempts) {
57
+ const resultResponse = await httpClient.sendRequest({
58
+ method: HttpMethod.GET,
59
+ url: `https://app.burstyai.com/burstyai/aiflowjobs/${jobId}/result`,
60
+ headers: {
61
+ Authorization: `Bearer ${context.auth}`,
62
+ },
63
+ });
64
+
65
+ const result = resultResponse.body;
66
+
67
+ if (
68
+ result.status === 'END' ||
69
+ result.status === 'ERROR' ||
70
+ result.status === 'DONE'
71
+ ) {
72
+ return result;
73
+ }
74
+
75
+ await new Promise((resolve) => setTimeout(resolve, 5000));
76
+ attempts++;
77
+ }
78
+
79
+ throw new Error('Workflow execution timed out after 10 minutes');
80
+ },
81
+ });
@@ -0,0 +1,7 @@
1
+ import { PieceAuth } from "@agnocon/pieces-framework";
2
+
3
+ export const burstyAiAuth = PieceAuth.SecretText({
4
+ displayName: "API Key",
5
+ description: "API Key for Bursty-ai",
6
+ required: true,
7
+ });