@nimee/inforu 1.0.3

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.
@@ -0,0 +1,6 @@
1
+ export declare function triggerEventToStartAutomation(params: {
2
+ apiKey: string;
3
+ username: string;
4
+ eventName: string;
5
+ data: any;
6
+ }): Promise<any>;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.triggerEventToStartAutomation = void 0;
16
+ const error_handler_1 = require("@nimee/error-handler");
17
+ const logger_1 = __importDefault(require("@nimee/logger"));
18
+ const axios_1 = __importDefault(require("axios"));
19
+ function triggerEventToStartAutomation(params) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ try {
22
+ const { apiKey, username, eventName, data } = params;
23
+ if (!apiKey || !eventName || !data || !username) {
24
+ throw new error_handler_1.CustomError("Missing_API_KEY_TRIGGER_EVENT", 400, "Missing API key or event name or data or username");
25
+ }
26
+ const json = {
27
+ User: {
28
+ Username: username,
29
+ Token: apiKey,
30
+ },
31
+ Data: {
32
+ ApiEventName: eventName,
33
+ Contacts: data,
34
+ },
35
+ };
36
+ const apiUrl = `https://capi.inforu.co.il/api/Automation/Trigger?json=${json}`;
37
+ const response = yield axios_1.default.post(`${apiUrl}`);
38
+ logger_1.default.debug("trigger sent successfully:", response.data);
39
+ return response.data;
40
+ }
41
+ catch (error) {
42
+ throw new error_handler_1.CustomError("Failed to create group", 450, error);
43
+ }
44
+ });
45
+ }
46
+ exports.triggerEventToStartAutomation = triggerEventToStartAutomation;
47
+ // json example:
48
+ // {
49
+ // "User": {
50
+ // "Username": " USER ",
51
+ // "Token": " TOKEN "
52
+ // },
53
+ // "Data": {
54
+ // "ApiEventName": "CustomerPurchase",
55
+ // "Contacts": [{
56
+ // "FirstName": "David",
57
+ // "LastName": "Levi",
58
+ // "Email": "automation@test.com",
59
+ // "PhoneNumber": "0509876543"
60
+ // },
61
+ // {
62
+ // "Email": "SimpleContact@test.com "
63
+ // }]
64
+ // }
65
+ // }
66
+ //# sourceMappingURL=automations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"automations.js","sourceRoot":"","sources":["../src/automations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wDAAiE;AACjE,2DAAmC;AACnC,kDAA0B;AAC1B,SAAsB,6BAA6B,CAAC,MAA0E;;QAC5H,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;YACrD,IAAI,CAAC,MAAM,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChD,MAAM,IAAI,2BAAW,CAAC,+BAA+B,EAAE,GAAG,EAAE,mDAAmD,CAAC,CAAC;YACnH,CAAC;YACD,MAAM,IAAI,GAAG;gBACX,IAAI,EAAE;oBACJ,QAAQ,EAAE,QAAQ;oBAClB,KAAK,EAAE,MAAM;iBACd;gBACD,IAAI,EAAE;oBACJ,YAAY,EAAE,SAAS;oBACvB,QAAQ,EAAE,IAAI;iBACf;aACF,CAAC;YACF,MAAM,MAAM,GAAG,yDAAyD,IAAI,EAAE,CAAC;YAC/E,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC;YAC/C,gBAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC1D,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,2BAAW,CAAC,wBAAwB,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;CAAA;AAvBD,sEAuBC;AACD,gBAAgB;AAChB,IAAI;AACJ,YAAY;AACZ,wBAAwB;AACxB,qBAAqB;AACrB,KAAK;AACL,YAAY;AACZ,sCAAsC;AACtC,iBAAiB;AACjB,wBAAwB;AACxB,sBAAsB;AACtB,kCAAkC;AAClC,8BAA8B;AAC9B,KAAK;AACL,IAAI;AACJ,qCAAqC;AACrC,KAAK;AACL,IAAI;AACJ,IAAI"}
@@ -0,0 +1,4 @@
1
+ export declare function createGroup(params: {
2
+ apiKey: string;
3
+ name: string;
4
+ }): Promise<any>;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.createGroup = void 0;
16
+ const error_handler_1 = require("@nimee/error-handler");
17
+ const logger_1 = __importDefault(require("@nimee/logger"));
18
+ const axios_1 = __importDefault(require("axios"));
19
+ function createGroup(params) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ try {
22
+ const { apiKey, name } = params;
23
+ if (!apiKey)
24
+ throw new error_handler_1.CustomError("Missing_API_KEY_CREATE_GROUP", 400, "Missing API key");
25
+ const apiUrl = "https://capi.inforu.co.il/api/Automation/Trigger?json=";
26
+ const response = yield axios_1.default.post(`${apiUrl}`, { name });
27
+ logger_1.default.debug("Group created successfully:", response.data);
28
+ return response.data;
29
+ }
30
+ catch (error) {
31
+ throw new error_handler_1.CustomError("Failed to create group", 500, error);
32
+ }
33
+ });
34
+ }
35
+ exports.createGroup = createGroup;
36
+ //# sourceMappingURL=createGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGroup.js","sourceRoot":"","sources":["../src/createGroup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wDAAiE;AACjE,2DAAmC;AACnC,kDAA0B;AAC1B,SAAsB,WAAW,CAAC,MAAwC;;QACxE,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;YAChC,IAAI,CAAC,MAAM;gBAAE,MAAM,IAAI,2BAAW,CAAC,8BAA8B,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAAC;YAC3F,MAAM,MAAM,GAAG,wDAAwD,CAAC;YACxE,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAAC,GAAG,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;YACzD,gBAAM,CAAC,KAAK,CAAC,6BAA6B,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC3D,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,2BAAW,CAAC,wBAAwB,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;CAAA;AAXD,kCAWC"}
@@ -0,0 +1,2 @@
1
+ export * from "./sendSMS";
2
+ export * from "./createGroup";
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // export * from "./event";
18
+ __exportStar(require("./sendSMS"), exports);
19
+ __exportStar(require("./createGroup"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2BAA2B;AAC3B,4CAA0B;AAC1B,gDAA8B"}
@@ -0,0 +1,9 @@
1
+ export declare function sendSMS(params: {
2
+ apiKey: string;
3
+ name: string;
4
+ from_name: string;
5
+ sms_sending_profile_id: number;
6
+ content: string;
7
+ send_now?: boolean;
8
+ phone_numbers: string[];
9
+ }): Promise<any>;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.sendSMS = void 0;
16
+ // send sms using active trail https://webapi.mymarketing.co.il/api/docs/User/Api/POST-api-smscampaign-OperationalMessage
17
+ const error_handler_1 = require("@nimee/error-handler");
18
+ const logger_1 = __importDefault(require("@nimee/logger"));
19
+ const axios_1 = __importDefault(require("axios"));
20
+ function sendSMS(params) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ try {
23
+ const { apiKey, name, from_name, content, phone_numbers, sms_sending_profile_id } = params;
24
+ if (!apiKey)
25
+ throw new error_handler_1.CustomError("Missing_API_KEY_SEND_SMS", 400, "Missing API key");
26
+ const apiUrl = "https://capi.inforu.co.il/api/v2/SMS/SendSms";
27
+ // curl --location 'https://capi.inforu.co.il/api/v2/SMS/SendSms' \
28
+ // --header 'Content-Type: application/json' \
29
+ // --header 'Authorization: Your Base Credentials' \
30
+ // --data '{
31
+ // "Data": {
32
+ // "Message": "Hello world",
33
+ // "Recipients": [
34
+ // {
35
+ // "Phone": "0541234567"
36
+ // }
37
+ // ],
38
+ // "Settings": {
39
+ // "Sender": "MyBrand"
40
+ // }
41
+ // }
42
+ // }'
43
+ const data = {
44
+ Data: {
45
+ Message: content,
46
+ Recipients: phone_numbers.map((phone) => ({ Phone: phone })),
47
+ Settings: {
48
+ Sender: from_name,
49
+ },
50
+ },
51
+ };
52
+ const response = yield axios_1.default.post(`${apiUrl}`, data, {
53
+ headers: {
54
+ "Content-Type": "application/json",
55
+ Authorization: apiKey,
56
+ },
57
+ });
58
+ logger_1.default.debug("SMS sent successfully inforu:", response.data);
59
+ return response.data;
60
+ }
61
+ catch (error) {
62
+ logger_1.default.error(JSON.stringify(error));
63
+ throw new error_handler_1.CustomError("Failed to send SMS inforu", 450, error);
64
+ }
65
+ });
66
+ }
67
+ exports.sendSMS = sendSMS;
68
+ //# sourceMappingURL=sendSMS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendSMS.js","sourceRoot":"","sources":["../src/sendSMS.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yHAAyH;AACzH,wDAAiE;AACjE,2DAAmC;AACnC,kDAA0B;AAE1B,SAAsB,OAAO,CAAC,MAQ7B;;QACC,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,GAAG,MAAM,CAAC;YAC3F,IAAI,CAAC,MAAM;gBAAE,MAAM,IAAI,2BAAW,CAAC,0BAA0B,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAAC;YACvF,MAAM,MAAM,GAAG,8CAA8C,CAAC;YAC9D,mEAAmE;YACnE,8CAA8C;YAC9C,oDAAoD;YACpD,YAAY;YACZ,gBAAgB;YAChB,oCAAoC;YACpC,0BAA0B;YAC1B,gBAAgB;YAChB,wCAAwC;YACxC,gBAAgB;YAChB,aAAa;YACb,yBAAyB;YACzB,kCAAkC;YAClC,aAAa;YACb,QAAQ;YACR,KAAK;YACL,MAAM,IAAI,GAAG;gBACX,IAAI,EAAE;oBACJ,OAAO,EAAE,OAAO;oBAChB,UAAU,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;oBAC5D,QAAQ,EAAE;wBACR,MAAM,EAAE,SAAS;qBAClB;iBACF;aACF,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAAC,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE;gBACnD,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;oBAClC,aAAa,EAAE,MAAM;iBACtB;aACF,CAAC,CAAC;YAEH,gBAAM,CAAC,KAAK,CAAC,+BAA+B,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC7D,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,gBAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;YACpC,MAAM,IAAI,2BAAW,CAAC,2BAA2B,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;CAAA;AApDD,0BAoDC"}
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@nimee/inforu",
3
+ "version": "1.0.3",
4
+ "description": "inforu SDK for Node.js",
5
+ "main": "dist/index.js",
6
+ "author": "dan goldberg",
7
+ "license": "ISC",
8
+ "scripts": {
9
+ "build-ts": "tsc",
10
+ "watch-ts": "tsc -w",
11
+ "build": "npm run build-ts",
12
+ "lint": "eslint -c ../../.eslintrc.js --ext .ts src/**",
13
+ "prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write",
14
+ "incVersionAndPublish": "npm version patch && npm run publish-it && npm run i-all-workspaces",
15
+ "publish-it": "npm run build && npm publish --scope=nimee --access public",
16
+ "i-all-workspaces": "version=${npm_package_version} npm i @nimee/active-trail@$version --workspace=@nimee/event --workspace=@nimee/user-event --workspace=@nimee/send-notification --workspace=@nimee/user --workspace=@nimee/payment --workspace=@nimee/analytics --workspace=@nimee/crm"
17
+ },
18
+ "devDependencies": {
19
+ "@typescript-eslint/eslint-plugin": "^5.18.0",
20
+ "@typescript-eslint/eslint-plugin-tslint": "^5.18.0",
21
+ "@typescript-eslint/parser": "^5.18.0",
22
+ "eslint": "8.22.0",
23
+ "eslint-plugin-jsdoc": "^38.1.6",
24
+ "eslint-plugin-no-null": "^1.0.2",
25
+ "nodemon": "^1.19.1",
26
+ "typescript": "^5.2.2"
27
+ },
28
+ "types": "dist/index.d.ts",
29
+ "dependencies": {
30
+ "@nimee/error-handler": "^0.0.9",
31
+ "axios": "1.2.1"
32
+ }
33
+ }
@@ -0,0 +1,46 @@
1
+ import { CustomError, errorHandler } from "@nimee/error-handler";
2
+ import logger from "@nimee/logger";
3
+ import axios from "axios";
4
+ export async function triggerEventToStartAutomation(params: { apiKey: string; username: string; eventName: string; data: any }) {
5
+ try {
6
+ const { apiKey, username, eventName, data } = params;
7
+ if (!apiKey || !eventName || !data || !username) {
8
+ throw new CustomError("Missing_API_KEY_TRIGGER_EVENT", 400, "Missing API key or event name or data or username");
9
+ }
10
+ const json = {
11
+ User: {
12
+ Username: username,
13
+ Token: apiKey,
14
+ },
15
+ Data: {
16
+ ApiEventName: eventName,
17
+ Contacts: data,
18
+ },
19
+ };
20
+ const apiUrl = `https://capi.inforu.co.il/api/Automation/Trigger?json=${json}`;
21
+ const response = await axios.post(`${apiUrl}`);
22
+ logger.debug("trigger sent successfully:", response.data);
23
+ return response.data;
24
+ } catch (error) {
25
+ throw new CustomError("Failed to create group", 450, error);
26
+ }
27
+ }
28
+ // json example:
29
+ // {
30
+ // "User": {
31
+ // "Username": " USER ",
32
+ // "Token": " TOKEN "
33
+ // },
34
+ // "Data": {
35
+ // "ApiEventName": "CustomerPurchase",
36
+ // "Contacts": [{
37
+ // "FirstName": "David",
38
+ // "LastName": "Levi",
39
+ // "Email": "automation@test.com",
40
+ // "PhoneNumber": "0509876543"
41
+ // },
42
+ // {
43
+ // "Email": "SimpleContact@test.com "
44
+ // }]
45
+ // }
46
+ // }
@@ -0,0 +1,15 @@
1
+ import { CustomError, errorHandler } from "@nimee/error-handler";
2
+ import logger from "@nimee/logger";
3
+ import axios from "axios";
4
+ export async function createGroup(params: { apiKey: string; name: string }) {
5
+ try {
6
+ const { apiKey, name } = params;
7
+ if (!apiKey) throw new CustomError("Missing_API_KEY_CREATE_GROUP", 400, "Missing API key");
8
+ const apiUrl = "https://capi.inforu.co.il/api/Automation/Trigger?json=";
9
+ const response = await axios.post(`${apiUrl}`, { name });
10
+ logger.debug("Group created successfully:", response.data);
11
+ return response.data;
12
+ } catch (error) {
13
+ throw new CustomError("Failed to create group", 500, error);
14
+ }
15
+ }
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ // export * from "./event";
2
+ export * from "./sendSMS";
3
+ export * from "./createGroup";
package/src/sendSMS.ts ADDED
@@ -0,0 +1,58 @@
1
+ // send sms using active trail https://webapi.mymarketing.co.il/api/docs/User/Api/POST-api-smscampaign-OperationalMessage
2
+ import { CustomError, errorHandler } from "@nimee/error-handler";
3
+ import logger from "@nimee/logger";
4
+ import axios from "axios";
5
+
6
+ export async function sendSMS(params: {
7
+ apiKey: string;
8
+ name: string;
9
+ from_name: string;
10
+ sms_sending_profile_id: number;
11
+ content: string;
12
+ send_now?: boolean;
13
+ phone_numbers: string[];
14
+ }) {
15
+ try {
16
+ const { apiKey, name, from_name, content, phone_numbers, sms_sending_profile_id } = params;
17
+ if (!apiKey) throw new CustomError("Missing_API_KEY_SEND_SMS", 400, "Missing API key");
18
+ const apiUrl = "https://capi.inforu.co.il/api/v2/SMS/SendSms";
19
+ // curl --location 'https://capi.inforu.co.il/api/v2/SMS/SendSms' \
20
+ // --header 'Content-Type: application/json' \
21
+ // --header 'Authorization: Your Base Credentials' \
22
+ // --data '{
23
+ // "Data": {
24
+ // "Message": "Hello world",
25
+ // "Recipients": [
26
+ // {
27
+ // "Phone": "0541234567"
28
+ // }
29
+ // ],
30
+ // "Settings": {
31
+ // "Sender": "MyBrand"
32
+ // }
33
+ // }
34
+ // }'
35
+ const data = {
36
+ Data: {
37
+ Message: content,
38
+ Recipients: phone_numbers.map((phone) => ({ Phone: phone })),
39
+ Settings: {
40
+ Sender: from_name,
41
+ },
42
+ },
43
+ };
44
+
45
+ const response = await axios.post(`${apiUrl}`, data, {
46
+ headers: {
47
+ "Content-Type": "application/json",
48
+ Authorization: apiKey,
49
+ },
50
+ });
51
+
52
+ logger.debug("SMS sent successfully inforu:", response.data);
53
+ return response.data;
54
+ } catch (error) {
55
+ logger.error(JSON.stringify(error));
56
+ throw new CustomError("Failed to send SMS inforu", 450, error);
57
+ }
58
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "compileOnSave": true,
3
+ "compilerOptions": {
4
+ "module": "commonjs",
5
+ "esModuleInterop": true,
6
+ "declaration": true,
7
+ "target": "es6",
8
+ "noImplicitAny": true,
9
+ "skipLibCheck": true,
10
+ "moduleResolution": "node",
11
+ "sourceMap": true,
12
+ "outDir": "./dist",
13
+ "baseUrl": ".",
14
+ "paths": {
15
+ "*": [
16
+ "node_modules/*",
17
+ "src/types/*"
18
+ ]
19
+ }
20
+ },
21
+ "include": [
22
+ "src/**/*"
23
+ ],
24
+ "exclude": [
25
+ "node_modules",
26
+ "dist"
27
+ ]
28
+ }