@activepieces/piece-messagebird 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-messagebird
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build pieces-messagebird` to build the library.
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@activepieces/piece-messagebird",
3
+ "version": "0.0.1",
4
+ "dependencies": {
5
+ "@sinclair/typebox": "0.26.8",
6
+ "axios": "1.6.7",
7
+ "dayjs": "1.11.9",
8
+ "is-base64": "1.1.0",
9
+ "lodash": "4.17.21",
10
+ "nanoid": "3.3.6",
11
+ "semver": "7.6.0",
12
+ "@activepieces/pieces-common": "0.2.13",
13
+ "@activepieces/pieces-framework": "0.7.31",
14
+ "@activepieces/shared": "0.10.106",
15
+ "tslib": "1.14.1"
16
+ },
17
+ "main": "./src/index.js",
18
+ "type": "commonjs"
19
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare const messageBirdAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
2
+ export declare const messagebird: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.messagebird = exports.messageBirdAuth = void 0;
4
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
5
+ const send_sms_action_1 = require("./lib/actions/send-sms.action");
6
+ const shared_1 = require("@activepieces/shared");
7
+ exports.messageBirdAuth = pieces_framework_1.PieceAuth.SecretText({
8
+ displayName: 'API Key',
9
+ description: '',
10
+ required: true,
11
+ });
12
+ exports.messagebird = (0, pieces_framework_1.createPiece)({
13
+ displayName: 'MessageBird',
14
+ description: 'Next generation CRM for Marketing, Services and Payments',
15
+ auth: exports.messageBirdAuth,
16
+ minimumSupportedRelease: '0.20.0',
17
+ logoUrl: 'https://cdn.activepieces.com/pieces/messagebird.png',
18
+ categories: [shared_1.PieceCategory.MARKETING],
19
+ authors: ['kishanprmr'],
20
+ actions: [send_sms_action_1.sendSMSAction],
21
+ triggers: [],
22
+ });
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/messagebird/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,mEAA8D;AAC9D,iDAAqD;AAExC,QAAA,eAAe,GAAG,4BAAS,CAAC,UAAU,CAAC;IAClD,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,EAAE;IACf,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEU,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC;IACrC,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,0DAA0D;IACvE,IAAI,EAAE,uBAAe;IACrB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,qDAAqD;IAC9D,UAAU,EAAE,CAAC,sBAAa,CAAC,SAAS,CAAC;IACrC,OAAO,EAAE,CAAC,YAAY,CAAC;IACvB,OAAO,EAAE,CAAC,+BAAa,CAAC;IACxB,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const sendSMSAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ originator: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
+ body: import("@activepieces/pieces-framework").LongTextProperty<true>;
4
+ recipients: import("@activepieces/pieces-framework").ArrayProperty<true>;
5
+ datacoding: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
6
+ gateway: import("@activepieces/pieces-framework").NumberProperty<false>;
7
+ validity: import("@activepieces/pieces-framework").NumberProperty<false>;
8
+ }>;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sendSMSAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const __1 = require("../..");
6
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
7
+ const pieces_common_1 = require("@activepieces/pieces-common");
8
+ exports.sendSMSAction = (0, pieces_framework_1.createAction)({
9
+ auth: __1.messageBirdAuth,
10
+ name: 'send-sms',
11
+ displayName: 'Send SMS',
12
+ description: 'Sends an SMS message via MessageBird.',
13
+ props: {
14
+ originator: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Originator',
16
+ description: "Enter the sender details. You can either enter the sender's phone number with country code or name or text that is alphanumeric.",
17
+ required: true,
18
+ }),
19
+ body: pieces_framework_1.Property.LongText({
20
+ displayName: 'Body',
21
+ description: 'The body of the SMS message.',
22
+ required: true,
23
+ }),
24
+ recipients: pieces_framework_1.Property.Array({
25
+ displayName: 'Recipients',
26
+ description: 'Enter the recipient number to whom you want to send the message.',
27
+ required: true,
28
+ }),
29
+ datacoding: pieces_framework_1.Property.StaticDropdown({
30
+ displayName: 'Data Coding',
31
+ description: 'Using unicode will limit the maximum number of characters to 70 instead of 160.',
32
+ required: false,
33
+ options: {
34
+ disabled: false,
35
+ options: [
36
+ { label: 'Auto', value: 'auto' },
37
+ { label: 'Plain', value: 'plain' },
38
+ { label: 'Unicode', value: 'unicode' },
39
+ ],
40
+ },
41
+ }),
42
+ gateway: pieces_framework_1.Property.Number({
43
+ displayName: 'Gateway',
44
+ description: 'The SMS route that is used to send the message.',
45
+ required: false,
46
+ }),
47
+ validity: pieces_framework_1.Property.Number({
48
+ displayName: 'Validity',
49
+ description: 'The amount of seconds that the message is valid. If a message is not delivered within this time, the message will be discarded.',
50
+ required: false,
51
+ }),
52
+ },
53
+ run(context) {
54
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
55
+ const { originator, body, datacoding, gateway, validity } = context.propsValue;
56
+ const recipients = context.propsValue.recipients;
57
+ const request = {
58
+ method: pieces_common_1.HttpMethod.POST,
59
+ url: 'https://rest.messagebird.com/messages',
60
+ headers: {
61
+ Accept: 'application/json',
62
+ Authorization: `AccessKey ${context.auth}`,
63
+ },
64
+ body: {
65
+ originator,
66
+ body,
67
+ recipients,
68
+ datacoding,
69
+ gateway,
70
+ validity,
71
+ },
72
+ };
73
+ return yield pieces_common_1.httpClient.sendRequest(request);
74
+ });
75
+ },
76
+ });
77
+ //# sourceMappingURL=send-sms.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-sms.action.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/messagebird/src/lib/actions/send-sms.action.ts"],"names":[],"mappings":";;;;AAAA,6BAAwC;AACxC,qEAAwE;AACxE,+DAIqC;AAExB,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,mBAAe;IACrB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,uCAAuC;IACpD,KAAK,EAAE;QACL,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EACT,kIAAkI;YACpI,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACzB,WAAW,EAAE,YAAY;YACzB,WAAW,EACT,kEAAkE;YACpE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAClC,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,iFAAiF;YACnF,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,M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