@builderbot/provider-twilio 1.2.2 → 1.2.3-alpha.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/dist/index.cjs CHANGED
@@ -11148,8 +11148,12 @@ class TwilioProvider extends bot.ProviderClass {
11148
11148
  */
11149
11149
  this.saveFile = async (ctx, options) => {
11150
11150
  try {
11151
+ const basicAuthToken = Buffer.from(`${this.globalVendorArgs.accountSid}:${this.globalVendorArgs.authToken}`).toString('base64');
11152
+ const twilioHeaders = {
11153
+ Authorization: `Basic ${basicAuthToken}`,
11154
+ };
11151
11155
  const pathFile = require$$1.join(options?.path ?? os.tmpdir());
11152
- const localPath = await bot.utils.generalDownload(`${ctx?.MediaUrl0}`, pathFile);
11156
+ const localPath = await bot.utils.generalDownload(`${ctx?.MediaUrl0}`, pathFile, twilioHeaders);
11153
11157
  return localPath;
11154
11158
  }
11155
11159
  catch (err) {
@@ -1,4 +1,5 @@
1
1
  import type { SendOptions, BotContext } from '@builderbot/bot/dist/types';
2
+
2
3
  import type { TwilioRequestBody } from '../types';
3
4
  export interface TwilioInterface {
4
5
  sendMedia: (number: string, message: string, mediaInput: string) => Promise<any>;
@@ -1,6 +1,7 @@
1
1
  import EventEmitter from 'node:events';
2
2
  import type polka from 'polka';
3
3
  import twilio from 'twilio';
4
+
4
5
  import type { ITwilioProviderARgs } from '../types';
5
6
  /**
6
7
  * Class representing TwilioCoreVendor, a vendor class for meta core functionality.
@@ -1,6 +1,7 @@
1
1
  import { ProviderClass } from '@builderbot/bot';
2
2
  import type { BotContext, SendOptions } from '@builderbot/bot/dist/types';
3
3
  import type { MessageListInstanceCreateOptions } from 'twilio/lib/rest/api/v2010/account/message';
4
+
4
5
  import { TwilioCoreVendor } from './core';
5
6
  import type { TwilioInterface } from '../interface/twilio';
6
7
  import type { ITwilioProviderARgs, TwilioRequestBody } from '../types';
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["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AiB,GAAG,UAAU,CAAC,YAAY;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO,CAAC,MAAM,CAAC,CAe3G;CACJ;AAED,OAAO,EAAE,cAAc,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builderbot/provider-twilio",
3
- "version": "1.2.2",
3
+ "version": "1.2.3-alpha.1",
4
4
  "description": "> TODO: description",
5
5
  "author": "Leifer Mendez <leifer33@gmail.com>",
6
6
  "homepage": "https://github.com/codigoencasa/bot-whatsapp#readme",
@@ -29,7 +29,7 @@
29
29
  "url": "https://github.com/codigoencasa/bot-whatsapp/issues"
30
30
  },
31
31
  "devDependencies": {
32
- "@builderbot/bot": "^1.2.2",
32
+ "@builderbot/bot": "^1.2.3-alpha.1",
33
33
  "@jest/globals": "^29.7.0",
34
34
  "@rollup/plugin-commonjs": "^25.0.7",
35
35
  "@rollup/plugin-json": "^6.1.0",
@@ -56,5 +56,5 @@
56
56
  "polka": "^0.5.2",
57
57
  "twilio": "~4.20.0"
58
58
  },
59
- "gitHead": "48f0284556c8cf640c81632d38b539472fd2366e"
59
+ "gitHead": "8176614084918416522f94641b69236a2e044631"
60
60
  }