@activepieces/piece-messagebird 0.0.1 → 0.1.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/package.json +28 -11
- package/src/index.d.ts +5 -2
- package/src/index.js +8 -12
- package/src/index.js.map +1 -1
- package/src/lib/actions/send-sms.action.d.ts +9 -7
- package/src/lib/actions/send-sms.action.js +33 -46
- package/src/lib/actions/send-sms.action.js.map +1 -1
- package/src/lib/auth.d.ts +10 -0
- package/src/lib/auth.js +25 -0
- package/src/lib/auth.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-messagebird",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
5
|
+
"@anthropic-ai/sdk": "0.33.1",
|
|
6
|
+
"@sinclair/typebox": "0.34.11",
|
|
7
|
+
"axios": "1.8.3",
|
|
8
|
+
"axios-retry": "4.4.1",
|
|
9
|
+
"deepmerge-ts": "7.1.0",
|
|
10
|
+
"mime-types": "2.1.35",
|
|
11
|
+
"nanoid": "3.3.8",
|
|
12
|
+
"openai": "4.67.1",
|
|
13
|
+
"replicate": "0.34.1",
|
|
11
14
|
"semver": "7.6.0",
|
|
12
|
-
"
|
|
13
|
-
"@activepieces/pieces-
|
|
14
|
-
"@activepieces/
|
|
15
|
+
"zod": "3.24.2",
|
|
16
|
+
"@activepieces/pieces-common": "0.4.4",
|
|
17
|
+
"@activepieces/pieces-framework": "0.8.0",
|
|
18
|
+
"@activepieces/shared": "0.10.171",
|
|
15
19
|
"tslib": "1.14.1"
|
|
16
20
|
},
|
|
21
|
+
"overrides": {
|
|
22
|
+
"cross-spawn": "7.0.6",
|
|
23
|
+
"@tryfabric/martian": {
|
|
24
|
+
"@notionhq/client": "$@notionhq/client"
|
|
25
|
+
},
|
|
26
|
+
"vite": {
|
|
27
|
+
"rollup": "npm:@rollup/wasm-node"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"resolutions": {
|
|
31
|
+
"rollup": "npm:@rollup/wasm-node"
|
|
32
|
+
},
|
|
17
33
|
"main": "./src/index.js",
|
|
18
|
-
"type": "commonjs"
|
|
34
|
+
"type": "commonjs",
|
|
35
|
+
"types": "./src/index.d.ts"
|
|
19
36
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
|
|
1
|
+
export declare const messagebird: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
workspaceId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
channelId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
}>>;
|
package/src/index.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.messagebird =
|
|
3
|
+
exports.messagebird = void 0;
|
|
4
4
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
5
|
const send_sms_action_1 = require("./lib/actions/send-sms.action");
|
|
6
6
|
const shared_1 = require("@activepieces/shared");
|
|
7
|
-
|
|
8
|
-
displayName: 'API Key',
|
|
9
|
-
description: '',
|
|
10
|
-
required: true,
|
|
11
|
-
});
|
|
7
|
+
const auth_1 = require("./lib/auth");
|
|
12
8
|
exports.messagebird = (0, pieces_framework_1.createPiece)({
|
|
13
|
-
displayName: '
|
|
14
|
-
description: '
|
|
15
|
-
auth:
|
|
16
|
-
minimumSupportedRelease: '0.
|
|
9
|
+
displayName: 'Bird',
|
|
10
|
+
description: 'Unified CRM for Marketing, Service & Payments',
|
|
11
|
+
auth: auth_1.birdAuth,
|
|
12
|
+
minimumSupportedRelease: '0.30.0',
|
|
17
13
|
logoUrl: 'https://cdn.activepieces.com/pieces/messagebird.png',
|
|
18
|
-
categories: [shared_1.PieceCategory.MARKETING],
|
|
19
|
-
authors: ['kishanprmr'],
|
|
14
|
+
categories: [shared_1.PieceCategory.MARKETING, shared_1.PieceCategory.COMMUNICATION],
|
|
15
|
+
authors: ['kishanprmr', 'geekyme'],
|
|
20
16
|
actions: [send_sms_action_1.sendSMSAction],
|
|
21
17
|
triggers: [],
|
|
22
18
|
});
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/messagebird/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,mEAA8D;AAC9D,iDAAqD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/messagebird/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,mEAA8D;AAC9D,iDAAqD;AACrD,qCAAsC;AAEzB,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC;IACrC,WAAW,EAAE,MAAM;IACnB,WAAW,EAAE,+CAA+C;IAC5D,IAAI,EAAE,eAAQ;IACd,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,qDAAqD;IAC9D,UAAU,EAAE,CAAC,sBAAa,CAAC,SAAS,EAAE,sBAAa,CAAC,aAAa,CAAC;IAClE,OAAO,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;IAClC,OAAO,EAAE,CAAC,+BAAa,CAAC;IACxB,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export declare const sendSMSAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
export declare const sendSMSAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
+
workspaceId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
channelId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
}>, {
|
|
6
|
+
recipient: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
+
message: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
8
|
+
reference: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
+
scheduledFor: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
8
10
|
}>;
|
|
@@ -2,73 +2,60 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sendSMSAction = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const auth_1 = require("../auth");
|
|
6
6
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
7
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
8
8
|
exports.sendSMSAction = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth:
|
|
9
|
+
auth: auth_1.birdAuth,
|
|
10
10
|
name: 'send-sms',
|
|
11
11
|
displayName: 'Send SMS',
|
|
12
|
-
description: 'Sends an SMS message via
|
|
12
|
+
description: 'Sends an SMS message via Bird Channels API.',
|
|
13
13
|
props: {
|
|
14
|
-
|
|
15
|
-
displayName: '
|
|
16
|
-
description:
|
|
14
|
+
recipient: pieces_framework_1.Property.ShortText({
|
|
15
|
+
displayName: 'Recipient',
|
|
16
|
+
description: 'The phone number to send the message to (with country code)',
|
|
17
17
|
required: true,
|
|
18
18
|
}),
|
|
19
|
-
|
|
20
|
-
displayName: '
|
|
21
|
-
description: 'The body of the SMS message
|
|
19
|
+
message: pieces_framework_1.Property.LongText({
|
|
20
|
+
displayName: 'Message',
|
|
21
|
+
description: 'The body of the SMS message',
|
|
22
22
|
required: true,
|
|
23
23
|
}),
|
|
24
|
-
|
|
25
|
-
displayName: '
|
|
26
|
-
description: '
|
|
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.',
|
|
24
|
+
reference: pieces_framework_1.Property.ShortText({
|
|
25
|
+
displayName: 'Reference',
|
|
26
|
+
description: 'Your own identifier for the message (optional)',
|
|
32
27
|
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
28
|
}),
|
|
42
|
-
|
|
43
|
-
displayName: '
|
|
44
|
-
description: '
|
|
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.',
|
|
29
|
+
scheduledFor: pieces_framework_1.Property.DateTime({
|
|
30
|
+
displayName: 'Scheduled For (UTC timestamp)',
|
|
31
|
+
description: 'Message to be sent at a specific datetime eg. 2025-04-27T15:08:18.613Z. If not set, the message will be sent immediately.',
|
|
50
32
|
required: false,
|
|
51
33
|
}),
|
|
52
34
|
},
|
|
53
35
|
run(context) {
|
|
54
36
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
const {
|
|
56
|
-
const
|
|
37
|
+
const { recipient, message, reference, scheduledFor } = context.propsValue;
|
|
38
|
+
const auth = context.auth;
|
|
39
|
+
// Format request for Bird Channels API
|
|
57
40
|
const request = {
|
|
58
41
|
method: pieces_common_1.HttpMethod.POST,
|
|
59
|
-
url:
|
|
42
|
+
url: `https://api.bird.com/workspaces/${auth.workspaceId}/channels/${auth.channelId}/messages`,
|
|
60
43
|
headers: {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
body: {
|
|
65
|
-
originator,
|
|
66
|
-
body,
|
|
67
|
-
recipients,
|
|
68
|
-
datacoding,
|
|
69
|
-
gateway,
|
|
70
|
-
validity,
|
|
44
|
+
'Authorization': `Bearer ${auth.apiKey}`,
|
|
45
|
+
'Content-Type': 'application/json'
|
|
71
46
|
},
|
|
47
|
+
body: Object.assign(Object.assign({ receiver: {
|
|
48
|
+
contacts: [
|
|
49
|
+
{
|
|
50
|
+
identifierValue: recipient
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}, body: {
|
|
54
|
+
type: 'text',
|
|
55
|
+
text: {
|
|
56
|
+
text: message
|
|
57
|
+
}
|
|
58
|
+
} }, (reference && { reference })), (scheduledFor && { scheduledFor })),
|
|
72
59
|
};
|
|
73
60
|
return yield pieces_common_1.httpClient.sendRequest(request);
|
|
74
61
|
});
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"send-sms.action.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/messagebird/src/lib/actions/send-sms.action.ts"],"names":[],"mappings":";;;;AAAA,kCAAmC;AACnC,qEAAwE;AACxE,+DAIqC;AAExB,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,eAAQ;IACd,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,6CAA6C;IAC1D,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SA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ACtC;aACF,CAAC;YAEF,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface BirdAuthValue {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
workspaceId: string;
|
|
4
|
+
channelId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const birdAuth: import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
+
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
+
workspaceId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
9
|
+
channelId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
10
|
+
}>;
|
package/src/lib/auth.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.birdAuth = void 0;
|
|
4
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
+
exports.birdAuth = pieces_framework_1.PieceAuth.CustomAuth({
|
|
6
|
+
props: {
|
|
7
|
+
apiKey: pieces_framework_1.PieceAuth.SecretText({
|
|
8
|
+
displayName: 'API Key',
|
|
9
|
+
description: 'Bird API Access Key from Settings > Security > Access Keys',
|
|
10
|
+
required: true,
|
|
11
|
+
}),
|
|
12
|
+
workspaceId: pieces_framework_1.PieceAuth.SecretText({
|
|
13
|
+
displayName: 'Workspace ID',
|
|
14
|
+
description: 'Bird Workspace ID found in your workspace URL',
|
|
15
|
+
required: true,
|
|
16
|
+
}),
|
|
17
|
+
channelId: pieces_framework_1.PieceAuth.SecretText({
|
|
18
|
+
displayName: 'Channel ID',
|
|
19
|
+
description: 'Your SMS channel ID from Bird dashboard',
|
|
20
|
+
required: true,
|
|
21
|
+
}),
|
|
22
|
+
},
|
|
23
|
+
required: true,
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/community/messagebird/src/lib/auth.ts"],"names":[],"mappings":";;;AAAA,qEAA2D;AAQ9C,QAAA,QAAQ,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC3C,KAAK,EAAE;QACL,MAAM,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC3B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,4DAA4D;YACzE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,WAAW,EAAE,4BAAS,CAAC,UAAU,CAAC;YAChC,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC9B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC"}
|