@activepieces/piece-messagebird 0.0.1 → 0.1.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 CHANGED
@@ -1,19 +1,36 @@
1
1
  {
2
2
  "name": "@activepieces/piece-messagebird",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
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",
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
- "@activepieces/pieces-common": "0.2.13",
13
- "@activepieces/pieces-framework": "0.7.31",
14
- "@activepieces/shared": "0.10.106",
15
+ "zod": "3.23.8",
16
+ "@activepieces/pieces-common": "0.4.3",
17
+ "@activepieces/pieces-framework": "0.7.46",
18
+ "@activepieces/shared": "0.10.164",
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 messageBirdAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
2
- export declare const messagebird: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
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 = exports.messageBirdAuth = void 0;
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
- exports.messageBirdAuth = pieces_framework_1.PieceAuth.SecretText({
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: 'MessageBird',
14
- description: 'Next generation CRM for Marketing, Services and Payments',
15
- auth: exports.messageBirdAuth,
16
- minimumSupportedRelease: '0.20.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;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"}
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,9 @@
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>;
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>;
8
9
  }>;
@@ -2,73 +2,55 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sendSMSAction = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const __1 = require("../..");
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: __1.messageBirdAuth,
9
+ auth: auth_1.birdAuth,
10
10
  name: 'send-sms',
11
11
  displayName: 'Send SMS',
12
- description: 'Sends an SMS message via MessageBird.',
12
+ description: 'Sends an SMS message via Bird Channels API.',
13
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.",
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
- body: pieces_framework_1.Property.LongText({
20
- displayName: 'Body',
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
- 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.',
24
+ reference: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Reference',
26
+ description: 'Your own identifier for the message (optional)',
50
27
  required: false,
51
28
  }),
52
29
  },
53
30
  run(context) {
54
31
  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;
32
+ const { recipient, message, reference } = context.propsValue;
33
+ const auth = context.auth;
34
+ // Format request for Bird Channels API
57
35
  const request = {
58
36
  method: pieces_common_1.HttpMethod.POST,
59
- url: 'https://rest.messagebird.com/messages',
37
+ url: `https://api.bird.com/workspaces/${auth.workspaceId}/channels/${auth.channelId}/messages`,
60
38
  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,
39
+ 'Authorization': `Bearer ${auth.apiKey}`,
40
+ 'Content-Type': 'application/json'
71
41
  },
42
+ body: Object.assign({ receiver: {
43
+ contacts: [
44
+ {
45
+ identifierValue: recipient
46
+ }
47
+ ]
48
+ }, body: {
49
+ type: 'text',
50
+ text: {
51
+ text: message
52
+ }
53
+ } }, (reference && { reference })),
72
54
  };
73
55
  return yield pieces_common_1.httpClient.sendRequest(request);
74
56
  });
@@ -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,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,MAAM,EAAE;oBAChC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;oBAClC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;iBACvC;aACF;SACF,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACvB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,iDAAiD;YAC9D,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACxB,WAAW,EAAE,UAAU;YACvB,WAAW,EACT,iIAAiI;YACnI,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,GACvD,OAAO,CAAC,UAAU,CAAC;YACrB,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,UAAsB,CAAC;YAE7D,MAAM,OAAO,GAAgB;gBAC3B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,uCAAuC;gBAC5C,OAAO,EAAE;oBACP,MAAM,EAAE,kBAAkB;oBAC1B,aAAa,EAAE,aAAa,OAAO,CAAC,IAAI,EAAE;iBAC3C;gBACD,IAAI,EAAE;oBACJ,UAAU;oBACV,IAAI;oBACJ,UAAU;oBACV,UAAU;oBACV,OAAO;oBACP,QAAQ;iBACT;aACF,CAAC;YAEF,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;KAAA;CACF,CAAC,CAAC"}
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,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,6DAA6D;YAC1E,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACzB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC7D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAkE,CAAC;YAExF,uCAAuC;YACvC,MAAM,OAAO,GAAgB;gBAC3B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,mCAAmC,IAAI,CAAC,WAAW,aAAa,IAAI,CAAC,SAAS,WAAW;gBAC9F,OAAO,EAAE;oBACP,eAAe,EAAE,UAAU,IAAI,CAAC,MAAM,EAAE;oBACxC,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,kBACF,QAAQ,EAAE;wBACR,QAAQ,EAAE;4BACR;gCACE,eAAe,EAAE,SAAS;6BAC3B;yBACF;qBACF,EACD,IAAI,EAAE;wBACJ,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;4BACJ,IAAI,EAAE,OAAO;yBACd;qBACF,IACE,CAAC,SAAS,IAAI,EAAE,SAAS,EAAE,CAAC,CAChC;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
+ }>;
@@ -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"}