@ariary/notification 1.0.5 → 1.0.7

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.js CHANGED
@@ -106,10 +106,10 @@ var AriariBridge = class _AriariBridge {
106
106
  setConfig(cfg);
107
107
  }
108
108
  async send(...data) {
109
- const messages = data.reduce((old, item) => {
110
- old.push(...Array.isArray(item.phone) ? item.phone.map((phone) => ({ phone, message: item.message })) : [item]);
111
- return old;
112
- }, []);
109
+ const messages = data.map((item) => ({
110
+ phones: Array.isArray(item.phone) ? item.phone : [item.phone],
111
+ message: item.message
112
+ }));
113
113
  const one = await httpPost("/api/sms/bulk", { messages });
114
114
  return new Task(one.id);
115
115
  }
package/dist/index.mjs CHANGED
@@ -80,10 +80,10 @@ var AriariBridge = class _AriariBridge {
80
80
  setConfig(cfg);
81
81
  }
82
82
  async send(...data) {
83
- const messages = data.reduce((old, item) => {
84
- old.push(...Array.isArray(item.phone) ? item.phone.map((phone) => ({ phone, message: item.message })) : [item]);
85
- return old;
86
- }, []);
83
+ const messages = data.map((item) => ({
84
+ phones: Array.isArray(item.phone) ? item.phone : [item.phone],
85
+ message: item.message
86
+ }));
87
87
  const one = await httpPost("/api/sms/bulk", { messages });
88
88
  return new Task(one.id);
89
89
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ariary/notification",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "SMS et Notification Task SDK pour l'API Ariary",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",