@activepieces/piece-forms 0.3.5 → 0.4.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.
- package/package.json +4 -4
- package/src/index.js +4 -11
- package/src/index.js.map +1 -1
- package/src/lib/actions/{return-markdown.d.ts → return-response.d.ts} +3 -2
- package/src/lib/actions/return-response.js +63 -0
- package/src/lib/actions/return-response.js.map +1 -0
- package/src/lib/triggers/chat-trigger.d.ts +3 -0
- package/src/lib/triggers/chat-trigger.js +34 -11
- package/src/lib/triggers/chat-trigger.js.map +1 -1
- package/src/lib/triggers/form-trigger.d.ts +3 -3
- package/src/lib/triggers/form-trigger.js +7 -5
- package/src/lib/triggers/form-trigger.js.map +1 -1
- package/src/lib/actions/return-file.d.ts +0 -3
- package/src/lib/actions/return-file.js +0 -53
- package/src/lib/actions/return-file.js.map +0 -1
- package/src/lib/actions/return-markdown.js +0 -42
- package/src/lib/actions/return-markdown.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-forms",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@sinclair/typebox": "0.
|
|
5
|
+
"@sinclair/typebox": "0.33.18",
|
|
6
6
|
"dayjs": "1.11.9",
|
|
7
7
|
"deepmerge": "4.3.1",
|
|
8
8
|
"http-status-codes": "2.2.0",
|
|
9
9
|
"mime-types": "2.1.35",
|
|
10
10
|
"nanoid": "3.3.6",
|
|
11
11
|
"semver": "7.6.0",
|
|
12
|
-
"@activepieces/pieces-framework": "0.7.
|
|
13
|
-
"@activepieces/shared": "0.10.
|
|
12
|
+
"@activepieces/pieces-framework": "0.7.39",
|
|
13
|
+
"@activepieces/shared": "0.10.124",
|
|
14
14
|
"tslib": "2.6.2"
|
|
15
15
|
},
|
|
16
16
|
"overrides": {
|
package/src/index.js
CHANGED
|
@@ -3,10 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.forms = void 0;
|
|
4
4
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
5
|
const shared_1 = require("@activepieces/shared");
|
|
6
|
-
const return_file_1 = require("./lib/actions/return-file");
|
|
7
|
-
const return_markdown_1 = require("./lib/actions/return-markdown");
|
|
8
6
|
const chat_trigger_1 = require("./lib/triggers/chat-trigger");
|
|
9
7
|
const form_trigger_1 = require("./lib/triggers/form-trigger");
|
|
8
|
+
const return_response_1 = require("./lib/actions/return-response");
|
|
10
9
|
exports.forms = (0, pieces_framework_1.createPiece)({
|
|
11
10
|
displayName: 'Human Input',
|
|
12
11
|
description: 'Trigger a flow through human input.',
|
|
@@ -14,14 +13,8 @@ exports.forms = (0, pieces_framework_1.createPiece)({
|
|
|
14
13
|
minimumSupportedRelease: '0.34.3',
|
|
15
14
|
categories: [shared_1.PieceCategory.CORE],
|
|
16
15
|
logoUrl: 'https://cdn.activepieces.com/pieces/human-input.svg',
|
|
17
|
-
authors: [
|
|
18
|
-
actions: [
|
|
19
|
-
|
|
20
|
-
return_markdown_1.returnMarkdown,
|
|
21
|
-
],
|
|
22
|
-
triggers: [
|
|
23
|
-
form_trigger_1.onFormSubmission,
|
|
24
|
-
chat_trigger_1.onChatSubmission,
|
|
25
|
-
],
|
|
16
|
+
authors: ['anasbarg', 'MoShizzle', 'abuaboud'],
|
|
17
|
+
actions: [return_response_1.returnResponse],
|
|
18
|
+
triggers: [form_trigger_1.onFormSubmission, chat_trigger_1.onChatSubmission],
|
|
26
19
|
});
|
|
27
20
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/forms/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,iDAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/forms/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,iDAAqD;AACrD,8DAA+D;AAC/D,8DAA+D;AAC/D,mEAA+D;AAElD,QAAA,KAAK,GAAG,IAAA,8BAAW,EAAC;IAC/B,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,qCAAqC;IAClD,IAAI,EAAE,4BAAS,CAAC,IAAI,EAAE;IACtB,uBAAuB,EAAE,QAAQ;IACjC,UAAU,EAAE,CAAC,sBAAa,CAAC,IAAI,CAAC;IAChC,OAAO,EAAE,qDAAqD;IAC9D,OAAO,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC;IAC9C,OAAO,EAAE,CAAC,gCAAc,CAAC;IACzB,QAAQ,EAAE,CAAC,+BAAgB,EAAE,+BAAgB,CAAC;CAC/C,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
markdown: import("@activepieces/pieces-framework").LongTextProperty<
|
|
1
|
+
export declare const returnResponse: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
|
+
markdown: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
3
|
+
file: import("@activepieces/pieces-framework").FileProperty<false>;
|
|
3
4
|
}>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.returnResponse = 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 http_status_codes_1 = require("http-status-codes");
|
|
8
|
+
const mime_types_1 = tslib_1.__importDefault(require("mime-types"));
|
|
9
|
+
exports.returnResponse = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'return_response',
|
|
11
|
+
displayName: 'Respond on UI',
|
|
12
|
+
description: 'Return a file or text (markdown) as a response.',
|
|
13
|
+
props: {
|
|
14
|
+
markdown: pieces_framework_1.Property.LongText({
|
|
15
|
+
displayName: 'Text (Markdown)',
|
|
16
|
+
required: false,
|
|
17
|
+
}),
|
|
18
|
+
file: pieces_framework_1.Property.File({
|
|
19
|
+
displayName: 'Attachment',
|
|
20
|
+
required: false,
|
|
21
|
+
}),
|
|
22
|
+
},
|
|
23
|
+
errorHandlingOptions: {
|
|
24
|
+
retryOnFailure: {
|
|
25
|
+
hide: true,
|
|
26
|
+
},
|
|
27
|
+
continueOnFailure: {
|
|
28
|
+
hide: true,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
run(_a) {
|
|
32
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue, run, files }) {
|
|
33
|
+
var _b;
|
|
34
|
+
const responseFiles = [];
|
|
35
|
+
if (propsValue.file) {
|
|
36
|
+
const fileName = propsValue.file.filename;
|
|
37
|
+
const fileBase64 = propsValue.file.base64;
|
|
38
|
+
const mimeType = mime_types_1.default.lookup(fileName);
|
|
39
|
+
responseFiles.push({
|
|
40
|
+
url: yield files.write({
|
|
41
|
+
fileName,
|
|
42
|
+
data: Buffer.from(fileBase64, 'base64'),
|
|
43
|
+
}),
|
|
44
|
+
mimeType: mimeType || '',
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
const markdownResponseBody = {
|
|
48
|
+
type: shared_1.HumanInputFormResultTypes.MARKDOWN,
|
|
49
|
+
value: (_b = propsValue.markdown) !== null && _b !== void 0 ? _b : '',
|
|
50
|
+
files: responseFiles,
|
|
51
|
+
};
|
|
52
|
+
run.stop({
|
|
53
|
+
response: {
|
|
54
|
+
status: http_status_codes_1.StatusCodes.OK,
|
|
55
|
+
body: markdownResponseBody,
|
|
56
|
+
headers: {},
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
return markdownResponseBody;
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=return-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"return-response.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/forms/src/lib/actions/return-response.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,iDAA8G;AAC9G,yDAAgD;AAChD,oEAA8B;AAEjB,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,iDAAiD;IAC9D,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,WAAW,EAAE,iBAAiB;YAC9B,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACD,oBAAoB,EAAE;QACpB,cAAc,EAAE;YACd,IAAI,EAAE,IAAI;SACX;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,IAAI;SACX;KACF;IACK,GAAG;qEAAC,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE;;YAClC,MAAM,aAAa,GAA4B,EAAE,CAAA;YACjD,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;gBACpB,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC;gBAC1C,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;gBAC1C,MAAM,QAAQ,GAAG,oBAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBACvC,aAAa,CAAC,IAAI,CAAC;oBACjB,GAAG,EAAE,MAAM,KAAK,CAAC,KAAK,CAAC;wBACrB,QAAQ;wBACR,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC;qBACxC,CAAC;oBACF,QAAQ,EAAE,QAAQ,IAAI,EAAE;iBACzB,CAAC,CAAC;YACL,CAAC;YACD,MAAM,oBAAoB,GAAyB;gBACjD,IAAI,EAAE,kCAAyB,CAAC,QAAQ;gBACxC,KAAK,EAAE,MAAA,UAAU,CAAC,QAAQ,mCAAI,EAAE;gBAChC,KAAK,EAAE,aAAa;aACrB,CAAA;YACD,GAAG,CAAC,IAAI,CAAC;gBACP,QAAQ,EAAE;oBACR,MAAM,EAAE,+BAAW,CAAC,EAAE;oBACtB,IAAI,EAAE,oBAAoB;oBAC1B,OAAO,EAAE,EAAE;iBACZ;aACF,CAAC,CAAC;YACH,OAAO,oBAAoB,CAAC;QAC9B,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
2
|
export declare const onChatSubmission: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
3
3
|
about: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
4
|
+
responseMarkdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
4
5
|
botName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
6
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
6
7
|
about: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
8
|
+
responseMarkdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
7
9
|
botName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
8
10
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
9
11
|
about: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
12
|
+
responseMarkdown: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
10
13
|
botName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
14
|
}>;
|
|
@@ -3,14 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.onChatSubmission = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const shared_1 = require("@activepieces/shared");
|
|
7
|
+
const responseMarkdown = `
|
|
8
|
+
This trigger sets up a chat interface. Ensure that **Respond on UI** is used in your flow`;
|
|
6
9
|
const markdown = `
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
**Your Chat URL:**
|
|
10
|
+
**Published Chat URL:**
|
|
10
11
|
\`\`\`text
|
|
11
12
|
{{chatUrl}}
|
|
12
13
|
\`\`\`
|
|
13
|
-
|
|
14
|
+
Use this for production, views the published version of the chat flow.
|
|
15
|
+
<br>
|
|
16
|
+
<br>
|
|
17
|
+
**Draft Chat URL:**
|
|
18
|
+
\`\`\`text
|
|
19
|
+
{{chatUrl}}?${shared_1.USE_DRAFT_QUERY_PARAM_NAME}=true
|
|
20
|
+
\`\`\`
|
|
21
|
+
Use this to generate sample data, views the draft version of the chat flow (the one you are editing now).
|
|
14
22
|
`;
|
|
15
23
|
exports.onChatSubmission = (0, pieces_framework_1.createTrigger)({
|
|
16
24
|
name: 'chat_submission',
|
|
@@ -19,6 +27,11 @@ exports.onChatSubmission = (0, pieces_framework_1.createTrigger)({
|
|
|
19
27
|
props: {
|
|
20
28
|
about: pieces_framework_1.Property.MarkDown({
|
|
21
29
|
value: markdown,
|
|
30
|
+
variant: shared_1.MarkdownVariant.BORDERLESS,
|
|
31
|
+
}),
|
|
32
|
+
responseMarkdown: pieces_framework_1.Property.MarkDown({
|
|
33
|
+
value: responseMarkdown,
|
|
34
|
+
variant: shared_1.MarkdownVariant.WARNING,
|
|
22
35
|
}),
|
|
23
36
|
botName: pieces_framework_1.Property.ShortText({
|
|
24
37
|
displayName: 'Bot Name',
|
|
@@ -28,8 +41,8 @@ exports.onChatSubmission = (0, pieces_framework_1.createTrigger)({
|
|
|
28
41
|
}),
|
|
29
42
|
},
|
|
30
43
|
sampleData: {
|
|
31
|
-
chatId:
|
|
32
|
-
message:
|
|
44
|
+
chatId: 'MOCK_CHAT_ID',
|
|
45
|
+
message: 'Hello, how are you?',
|
|
33
46
|
},
|
|
34
47
|
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
35
48
|
onEnable() {
|
|
@@ -51,11 +64,21 @@ exports.onChatSubmission = (0, pieces_framework_1.createTrigger)({
|
|
|
51
64
|
if (!item.message) {
|
|
52
65
|
throw new Error('Message is required');
|
|
53
66
|
}
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
67
|
+
const files = Object.entries(item)
|
|
68
|
+
.filter(([key]) => key.startsWith('file'))
|
|
69
|
+
.map(([key, value]) => {
|
|
70
|
+
const index = Number(key.split('[')[1].split(']')[0]);
|
|
71
|
+
return [index, value];
|
|
72
|
+
})
|
|
73
|
+
.sort(([indexA], [indexB]) => indexA - indexB)
|
|
74
|
+
.map(([_, value]) => value);
|
|
75
|
+
return [
|
|
76
|
+
{
|
|
77
|
+
chatId: item.chatId,
|
|
78
|
+
message: item.message,
|
|
79
|
+
files,
|
|
80
|
+
},
|
|
81
|
+
];
|
|
59
82
|
});
|
|
60
83
|
},
|
|
61
84
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-trigger.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/forms/src/lib/triggers/chat-trigger.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;
|
|
1
|
+
{"version":3,"file":"chat-trigger.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/forms/src/lib/triggers/chat-trigger.ts"],"names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AO,CAAC,IAAI,CAAC;iBAC/B,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;iBACzC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;gBACpB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACtD,OAAO,CAAC,KAAK,EAAE,KAAK,CAAU,CAAC;YACjC,CAAC,CAAC;iBACD,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC;iBAC7C,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;YAE9B,OAAO;gBACL;oBACE,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,KAAK;iBACN;aACF,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
2
|
export declare const onFormSubmission: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
3
3
|
about: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
4
|
-
waitForResponse: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
5
4
|
response: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
5
|
+
waitForResponse: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
6
6
|
inputs: import("@activepieces/pieces-framework").ArrayProperty<true> | import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
7
7
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
8
8
|
about: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
9
|
-
waitForResponse: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
10
9
|
response: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
10
|
+
waitForResponse: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
11
11
|
inputs: import("@activepieces/pieces-framework").ArrayProperty<true> | import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
12
12
|
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
13
13
|
about: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
14
|
-
waitForResponse: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
15
14
|
response: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
15
|
+
waitForResponse: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
16
16
|
inputs: import("@activepieces/pieces-framework").ArrayProperty<true> | import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
17
17
|
}>;
|
|
@@ -15,10 +15,10 @@ Use this for production, views the published version of the form.
|
|
|
15
15
|
\`\`\`text
|
|
16
16
|
{{formUrl}}?${shared_1.USE_DRAFT_QUERY_PARAM_NAME}=true
|
|
17
17
|
\`\`\`
|
|
18
|
-
Use this to generate sample data, views the draft version of the
|
|
18
|
+
Use this to generate sample data, views the draft version of the form (the one you are editing now).
|
|
19
19
|
`;
|
|
20
20
|
const responseMarkdown = `
|
|
21
|
-
If **Wait for Response** is enabled,
|
|
21
|
+
If **Wait for Response** is enabled, use **Respond on UI** in your flow to provide a response back to the form.
|
|
22
22
|
`;
|
|
23
23
|
exports.onFormSubmission = (0, pieces_framework_1.createTrigger)({
|
|
24
24
|
name: 'form_submission',
|
|
@@ -27,15 +27,17 @@ exports.onFormSubmission = (0, pieces_framework_1.createTrigger)({
|
|
|
27
27
|
props: {
|
|
28
28
|
about: pieces_framework_1.Property.MarkDown({
|
|
29
29
|
value: markdown,
|
|
30
|
+
variant: shared_1.MarkdownVariant.BORDERLESS,
|
|
31
|
+
}),
|
|
32
|
+
response: pieces_framework_1.Property.MarkDown({
|
|
33
|
+
value: responseMarkdown,
|
|
34
|
+
variant: shared_1.MarkdownVariant.WARNING,
|
|
30
35
|
}),
|
|
31
36
|
waitForResponse: pieces_framework_1.Property.Checkbox({
|
|
32
37
|
displayName: 'Wait for Response',
|
|
33
38
|
defaultValue: false,
|
|
34
39
|
required: true,
|
|
35
40
|
}),
|
|
36
|
-
response: pieces_framework_1.Property.MarkDown({
|
|
37
|
-
value: responseMarkdown,
|
|
38
|
-
}),
|
|
39
41
|
inputs: pieces_framework_1.Property.Array({
|
|
40
42
|
displayName: 'Inputs',
|
|
41
43
|
required: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-trigger.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/forms/src/lib/triggers/form-trigger.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,
|
|
1
|
+
{"version":3,"file":"form-trigger.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/forms/src/lib/triggers/form-trigger.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,iDAG8B;AAE9B,MAAM,QAAQ,GAAG;;;;;;;;;cASH,mCAA0B;;;CAGvC,CAAC;AACF,MAAM,gBAAgB,GAAG;;CAExB,CAAC;AAEW,QAAA,gBAAgB,GAAG,IAAA,gCAAa,EAAC;IAC5C,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,wCAAwC;IACrD,KAAK,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H;SACF,CAAC;KACH;IACD,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ;;YACZ,OAAO;QACT,CAAC;KAAA;IACK,SAAS;;YACb,OAAO;QACT,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.returnFile = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const http_status_codes_1 = require("http-status-codes");
|
|
7
|
-
const mime_types_1 = tslib_1.__importDefault(require("mime-types"));
|
|
8
|
-
exports.returnFile = (0, pieces_framework_1.createAction)({
|
|
9
|
-
name: 'return_file',
|
|
10
|
-
displayName: 'Respond on UI (File)',
|
|
11
|
-
description: 'Return a file as a response.',
|
|
12
|
-
props: {
|
|
13
|
-
file: pieces_framework_1.Property.File({
|
|
14
|
-
displayName: 'File',
|
|
15
|
-
required: true,
|
|
16
|
-
}),
|
|
17
|
-
},
|
|
18
|
-
errorHandlingOptions: {
|
|
19
|
-
retryOnFailure: {
|
|
20
|
-
hide: true,
|
|
21
|
-
},
|
|
22
|
-
continueOnFailure: {
|
|
23
|
-
hide: true,
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
run(_a) {
|
|
27
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue, run, files }) {
|
|
28
|
-
const fileName = propsValue.file.filename;
|
|
29
|
-
const fileBase64 = propsValue.file.base64;
|
|
30
|
-
const mimeType = mime_types_1.default.lookup(fileName);
|
|
31
|
-
const value = {
|
|
32
|
-
url: yield files.write({
|
|
33
|
-
fileName,
|
|
34
|
-
data: Buffer.from(fileBase64, 'base64'),
|
|
35
|
-
}),
|
|
36
|
-
mimeType: mimeType || '',
|
|
37
|
-
};
|
|
38
|
-
const response = {
|
|
39
|
-
status: http_status_codes_1.StatusCodes.OK,
|
|
40
|
-
body: {
|
|
41
|
-
type: 'file',
|
|
42
|
-
value,
|
|
43
|
-
},
|
|
44
|
-
headers: {},
|
|
45
|
-
};
|
|
46
|
-
run.stop({
|
|
47
|
-
response: response,
|
|
48
|
-
});
|
|
49
|
-
return response;
|
|
50
|
-
});
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
//# sourceMappingURL=return-file.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"return-file.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/forms/src/lib/actions/return-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAExE,yDAAgD;AAChD,oEAA8B;AAEjB,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,8BAA8B;IAC3C,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,oBAAoB,EAAE;QACpB,cAAc,EAAE;YACd,IAAI,EAAE,IAAI;SACX;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,IAAI;SACX;KACF;IACK,GAAG;qEAAC,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE;YAClC,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC;YAC1C,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;YAC1C,MAAM,QAAQ,GAAG,oBAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACvC,MAAM,KAAK,GAA0B;gBACnC,GAAG,EAAE,MAAM,KAAK,CAAC,KAAK,CAAC;oBACrB,QAAQ;oBACR,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC;iBACxC,CAAC;gBACF,QAAQ,EAAE,QAAQ,IAAI,EAAE;aACzB,CAAA;YACD,MAAM,QAAQ,GAAG;gBACf,MAAM,EAAE,+BAAW,CAAC,EAAE;gBACtB,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;oBACZ,KAAK;iBACN;gBACD,OAAO,EAAE,EAAE;aACZ,CAAC;YAEF,GAAG,CAAC,IAAI,CAAC;gBACP,QAAQ,EAAE,QAAQ;aACnB,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.returnMarkdown = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const http_status_codes_1 = require("http-status-codes");
|
|
7
|
-
exports.returnMarkdown = (0, pieces_framework_1.createAction)({
|
|
8
|
-
name: 'return_markdown',
|
|
9
|
-
displayName: 'Respond on UI (Markdown)',
|
|
10
|
-
description: 'Return a markdown as a response.',
|
|
11
|
-
props: {
|
|
12
|
-
markdown: pieces_framework_1.Property.LongText({
|
|
13
|
-
displayName: 'Markdown',
|
|
14
|
-
required: true,
|
|
15
|
-
}),
|
|
16
|
-
},
|
|
17
|
-
errorHandlingOptions: {
|
|
18
|
-
retryOnFailure: {
|
|
19
|
-
hide: true,
|
|
20
|
-
},
|
|
21
|
-
continueOnFailure: {
|
|
22
|
-
hide: true,
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
run(_a) {
|
|
26
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue, run }) {
|
|
27
|
-
const response = {
|
|
28
|
-
status: http_status_codes_1.StatusCodes.OK,
|
|
29
|
-
body: {
|
|
30
|
-
type: 'markdown',
|
|
31
|
-
value: propsValue.markdown,
|
|
32
|
-
},
|
|
33
|
-
headers: {},
|
|
34
|
-
};
|
|
35
|
-
run.stop({
|
|
36
|
-
response: response,
|
|
37
|
-
});
|
|
38
|
-
return response;
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
//# sourceMappingURL=return-markdown.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"return-markdown.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/forms/src/lib/actions/return-markdown.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yDAAgD;AAEnC,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,kCAAkC;IAC/C,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,WAAW,EAAE,UAAU;YACvB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,oBAAoB,EAAE;QACpB,cAAc,EAAE;YACd,IAAI,EAAE,IAAI;SACX;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,IAAI;SACX;KACF;IACK,GAAG;qEAAC,EAAE,UAAU,EAAE,GAAG,EAAE;YAE3B,MAAM,QAAQ,GAAG;gBACf,MAAM,EAAE,+BAAW,CAAC,EAAE;gBACtB,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU;oBAChB,KAAK,EAAE,UAAU,CAAC,QAAQ;iBAC3B;gBACD,OAAO,EAAE,EAAE;aACZ,CAAC;YAEF,GAAG,CAAC,IAAI,CAAC;gBACP,QAAQ,EAAE,QAAQ;aACnB,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|