@activepieces/piece-dashworks 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # pieces-dashworks
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build pieces-dashworks` to build the library.
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@activepieces/piece-dashworks",
3
+ "version": "0.0.1",
4
+ "type": "commonjs",
5
+ "main": "./src/index.js",
6
+ "types": "./src/index.d.ts",
7
+ "dependencies": {
8
+ "@sinclair/typebox": "0.34.11",
9
+ "axios": "1.13.1",
10
+ "axios-retry": "4.4.1",
11
+ "deepmerge-ts": "7.1.0",
12
+ "mime-types": "2.1.35",
13
+ "nanoid": "3.3.8",
14
+ "semver": "7.6.0",
15
+ "socket.io-client": "4.8.1",
16
+ "tslib": "^2.3.0",
17
+ "zod": "4.1.13",
18
+ "@activepieces/pieces-common": "0.10.1",
19
+ "@activepieces/pieces-framework": "0.22.2",
20
+ "@activepieces/shared": "0.30.1"
21
+ },
22
+ "resolutions": {
23
+ "rollup": "npm:@rollup/wasm-node"
24
+ }
25
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const dashworks: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dashworks = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const shared_1 = require("@activepieces/shared");
7
+ const generate_answer_1 = require("./lib/actions/generate-answer");
8
+ const pieces_common_1 = require("@activepieces/pieces-common");
9
+ const auth_1 = require("./lib/common/auth");
10
+ exports.dashworks = (0, pieces_framework_1.createPiece)({
11
+ displayName: "Dashworks",
12
+ categories: [shared_1.PieceCategory.PRODUCTIVITY],
13
+ auth: auth_1.dashworksAuth,
14
+ minimumSupportedRelease: '0.36.1',
15
+ logoUrl: "https://cdn.activepieces.com/pieces/dashworks.png",
16
+ authors: ["kishanprmr"],
17
+ actions: [generate_answer_1.generateAnswerAction,
18
+ (0, pieces_common_1.createCustomApiCallAction)({
19
+ auth: auth_1.dashworksAuth,
20
+ baseUrl: () => 'https://api.dashworks.ai/v1/',
21
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
22
+ return {
23
+ Authorization: `Bearer ${auth.secret_text}`
24
+ };
25
+ })
26
+ })
27
+ ],
28
+ triggers: [],
29
+ });
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/dashworks/src/index.ts"],"names":[],"mappings":";;;;AACA,qEAA6D;AAC7D,iDAAqD;AACrD,mEAAqE;AACrE,+DAAwE;AACxE,4CAAkD;AAErC,QAAA,SAAS,GAAG,IAAA,8BAAW,EAAC;IACnC,WAAW,EAAE,WAAW;IACxB,UAAU,EAAE,CAAC,sBAAa,CAAC,YAAY,CAAC;IACxC,IAAI,EAAE,oBAAa;IACnB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,mDAAmD;IAC5D,OAAO,EAAE,CAAC,YAAY,CAAC;IACvB,OAAO,EAAE,CAAC,sCAAoB;QAC5B,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,oBAAa;YACnB,OAAO,EAAE,GAAG,EAAE,CAAC,8BAA8B;YAC7C,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;iBAC5C,CAAA;YACH,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const generateAnswerAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ botId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ message: import("@activepieces/pieces-framework").LongTextProperty<true>;
4
+ inlineSources: import("@activepieces/pieces-framework").CheckboxProperty<false>;
5
+ }>;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateAnswerAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../common/auth");
7
+ const pieces_common_1 = require("@activepieces/pieces-common");
8
+ exports.generateAnswerAction = (0, pieces_framework_1.createAction)({
9
+ name: 'generate-answer',
10
+ auth: auth_1.dashworksAuth,
11
+ displayName: 'Generate Answer',
12
+ description: 'Generates an answer from a Dashworks bot.',
13
+ props: {
14
+ botId: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Bot ID',
16
+ required: true,
17
+ description: "You can find this by going to Dashworks > Bots, clicking on an existing Bot, and using the 'Copy Bot ID' button on the top right."
18
+ }),
19
+ message: pieces_framework_1.Property.LongText({
20
+ displayName: 'Message',
21
+ required: true,
22
+ description: 'The message (e.g., a question or prompt) that you want a response to.'
23
+ }),
24
+ inlineSources: pieces_framework_1.Property.Checkbox({
25
+ displayName: 'Inline Sources',
26
+ required: false,
27
+ description: 'When true (default), sources will be cited inline in markdown formatting within the answer text.When false, the answer will not contain inline citations.'
28
+ })
29
+ },
30
+ run(context) {
31
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
32
+ const { botId, message, inlineSources } = context.propsValue;
33
+ const response = yield pieces_common_1.httpClient.sendRequest({
34
+ method: pieces_common_1.HttpMethod.POST,
35
+ url: 'https://api.dashworks.ai/v1/answer',
36
+ authentication: {
37
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
38
+ token: context.auth.secret_text
39
+ },
40
+ body: {
41
+ message,
42
+ bot_id: botId,
43
+ inline_sources: inlineSources
44
+ }
45
+ });
46
+ return response.body;
47
+ });
48
+ }
49
+ });
50
+ //# sourceMappingURL=generate-answer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-answer.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/dashworks/src/lib/actions/generate-answer.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA+C;AAC/C,+DAAuF;AAE1E,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAC,iBAAiB;IACtB,IAAI,EAAC,oBAAa;IAClB,WAAW,EAAC,iBAAiB;IAC7B,WAAW,EAAC,2CAA2C;IACvD,KAAK,EAAC;QACF,KAAK,EAAC,2BAAQ,CAAC,SAAS,CAAC;YACrB,WAAW,EAAC,QAAQ;YACpB,QAAQ,EAAC,IAAI;YACb,WAAW,EAAC,mIAAmI;SAClJ,CAAC;QACF,OAAO,EAAC,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAC,SAAS;YACrB,QAAQ,EAAC,IAAI;YACb,WAAW,EAAC,uEAAuE;SACtF,CAAC;QACF,aAAa,EAAC,2BAAQ,CAAC,QAAQ,CAAC;YAC5B,WAAW,EAAC,gBAAgB;YAC5B,QAAQ,EAAC,KAAK;YACd,WAAW,EAAC,2JAA2J;SAC1K,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YAEb,MAAM,EAAC,KAAK,EAAC,OAAO,EAAC,aAAa,EAAC,GAAG,OAAO,CAAC,UAAU,CAAC;YAEzD,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC1C,MAAM,EAAC,0BAAU,CAAC,IAAI;gBACtB,GAAG,EAAC,oCAAoC;gBACxC,cAAc,EAAC;oBACX,IAAI,EAAC,kCAAkB,CAAC,YAAY;oBACpC,KAAK,EAAC,OAAO,CAAC,IAAI,CAAC,WAAW;iBACjC;gBACD,IAAI,EAAC;oBACD,OAAO;oBACP,MAAM,EAAC,KAAK;oBACZ,cAAc,EAAC,aAAa;iBAC/B;aACJ,CAAC,CAAA;YAEF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACzB,CAAC;KAAA;CACJ,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export declare const dashworksAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dashworksAuth = void 0;
4
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
5
+ exports.dashworksAuth = pieces_framework_1.PieceAuth.SecretText({
6
+ displayName: 'API Key',
7
+ required: true,
8
+ description: `You can obtain API key from [API Settings](https://web.dashworks.ai/admin/api-keys).`
9
+ });
10
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/dashworks/src/lib/common/auth.ts"],"names":[],"mappings":";;;AAAA,qEAA2D;AAE9C,QAAA,aAAa,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC9C,WAAW,EAAC,SAAS;IACrB,QAAQ,EAAC,IAAI;IACb,WAAW,EAAC,sFAAsF;CACrG,CAAC,CAAA"}