sms77-client
Advanced tools
Comparing version 1.4.2 to 1.5.0
@@ -5,5 +5,2 @@ export default class BaseClient { | ||
static BASE_URL: string; | ||
static ERROR_CODES: Map<number, string>; | ||
static SUCCESS_CODES: Map<number, string>; | ||
static GSM_CODES: ["0", "1", "2", "3", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "10", "11", "12", "13", "14", "15", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "3a", "47", "48", "56", "2100", "2101", "2102", "2200", "2201", "2202", "2203", "2204", "2205", "2206", "2207", "2300", "2301", "2302", "2400", "2401", "2402", "2403", "2404", "6000", "6xxx", "6001", "6002", "6003", "6004", "6005", "6006", "8000", "8001", "8002", "8003", "8004", "8008", "800b", "8010", "a001", "a002", "cxxx", "c000", "c001", "c002", "c003", "c004", "c005", "c006", "c007", "c008", "c009", "c00a", "c00b", "c00d", "d000", "d001", "d002", "d004", "d00a", "d00c", "d010", "d020", "e010", "e040", "e082", "fc0a", "fc06", "fc07", "fc08", "ffdd", "ffde", "ffdf", "ffe0", "ffe1", "ffe5", "fff0", "ffff", "4xxx", "81xx", "82xx", "83xx", "84xx", "85xx", "86xx", "87xx", "88xx", "8axx", "89xx", "8cxx", "exxx", "e140"]; | ||
constructor(apiKey: string, sendWith: string); | ||
@@ -10,0 +7,0 @@ post(endpoint: string, data?: { |
@@ -1,1 +0,5 @@ | ||
export declare const CONTACTS_ACTIONS: ["del", "read", "write"]; | ||
export declare enum CONTACTS_ACTIONS { | ||
del = 0, | ||
read = 1, | ||
write = 2 | ||
} |
@@ -1,1 +0,6 @@ | ||
export declare const LOOKUP_TYPES: ["cname", "format", "hlr", "mnp"]; | ||
export declare enum LOOKUP_TYPES { | ||
cname = 0, | ||
format = 1, | ||
hlr = 2, | ||
mnp = 3 | ||
} |
@@ -1,1 +0,14 @@ | ||
export declare const NETWORK_TYPES: ["fixed_line", "fixed_line_or_mobile", "mobile", "pager", "personal_number", "premium_rate", "shared_cost", "toll_free", "uan", "unknown", "voicemail", "voip"]; | ||
export declare enum NETWORK_TYPES { | ||
fixed_line = 0, | ||
fixed_line_or_mobile = 1, | ||
mobile = 2, | ||
pager = 3, | ||
personal_number = 4, | ||
premium_rate = 5, | ||
shared_cost = 6, | ||
toll_free = 7, | ||
uan = 8, | ||
unknown = 9, | ||
voicemail = 10, | ||
voip = 11 | ||
} |
@@ -1,1 +0,8 @@ | ||
export declare const PROVIDER_NAMES: ["d1", "d2", "o2", "eplus", "N/A", "int"]; | ||
export declare enum PROVIDER_NAMES { | ||
d1 = 0, | ||
d2 = 1, | ||
o2 = 2, | ||
eplus = 3, | ||
'N/A' = 4, | ||
int = 5 | ||
} |
@@ -1,1 +0,11 @@ | ||
export declare const STATUS_REPORT_CODES: ["DELIVERED", "NOTDELIVERED", "BUFFERED", "TRANSMITTED", "ACCEPTED", "EXPIRED", "REJECTED", "FAILED", "UNKNOWN"]; | ||
export declare enum STATUS_REPORT_CODES { | ||
DELIVERED = 0, | ||
NOTDELIVERED = 1, | ||
BUFFERED = 2, | ||
TRANSMITTED = 3, | ||
ACCEPTED = 4, | ||
EXPIRED = 5, | ||
REJECTED = 6, | ||
FAILED = 7, | ||
UNKNOWN = 8 | ||
} |
import { ContactsParams, ContactsResponse, LookupParams, LookupResponse, PricingParams, PricingResponse, SmsParams, SmsResponse, StatusParams, StatusResponse, ValidateForVoiceParams, ValidateForVoiceResponse, VoiceParams, VoiceResponse } from './types'; | ||
export * from './types'; | ||
import BaseClient from "./BaseClient"; | ||
import BaseClient from './BaseClient'; | ||
export default class Sms77Client extends BaseClient { | ||
@@ -5,0 +5,0 @@ protected apiKey: string; |
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Sms77Client = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
module.exports = require("../src/Sms77Client").default; | ||
module.exports = require('../src/Sms77Client').default; | ||
},{"../src/Sms77Client":3}],2:[function(require,module,exports){ | ||
@@ -54,4 +54,2 @@ "use strict"; | ||
var ERROR_CODES_1 = require("./constants/ERROR_CODES"); | ||
var SUCCESS_CODES_1 = require("./constants/SUCCESS_CODES"); | ||
var GSM_CODES_1 = require("./constants/GSM_CODES"); | ||
var BaseClient = /** @class */ (function () { | ||
@@ -87,4 +85,4 @@ function BaseClient(apiKey, sendWith) { | ||
code = Number.parseInt(text); | ||
if (BaseClient.ERROR_CODES.has(code)) { | ||
throw new Error(code + ": " + BaseClient.ERROR_CODES.get(code)); | ||
if (ERROR_CODES_1.ERROR_CODES.has(code)) { | ||
throw new Error(code + ": " + ERROR_CODES_1.ERROR_CODES.get(code)); | ||
} | ||
@@ -102,5 +100,2 @@ try { | ||
BaseClient.BASE_URL = 'https://gateway.sms77.io/api'; | ||
BaseClient.ERROR_CODES = ERROR_CODES_1.ERROR_CODES; | ||
BaseClient.SUCCESS_CODES = SUCCESS_CODES_1.SUCCESS_CODES; | ||
BaseClient.GSM_CODES = GSM_CODES_1.GSM_CODES; | ||
return BaseClient; | ||
@@ -110,3 +105,3 @@ }()); | ||
},{"./constants/ERROR_CODES":4,"./constants/GSM_CODES":5,"./constants/SUCCESS_CODES":6}],3:[function(require,module,exports){ | ||
},{"./constants/ERROR_CODES":4}],3:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -166,2 +161,3 @@ var __extends = (this && this.__extends) || (function () { | ||
exports.__esModule = true; | ||
var SUCCESS_CODES_1 = require("./constants/SUCCESS_CODES"); | ||
var BaseClient_1 = __importDefault(require("./BaseClient")); | ||
@@ -205,3 +201,3 @@ var splitByLine = function (str) { return str.split('\n'); }; | ||
} | ||
if (Sms77Client.SUCCESS_CODES.has(Number.parseInt(res["return"]))) { | ||
if (SUCCESS_CODES_1.SUCCESS_CODES.has(Number.parseInt(res["return"]))) { | ||
if (res.id) { | ||
@@ -309,3 +305,3 @@ return [2 /*return*/, Number.parseInt(res.id)]; | ||
},{"./BaseClient":2}],4:[function(require,module,exports){ | ||
},{"./BaseClient":2,"./constants/SUCCESS_CODES":5}],4:[function(require,module,exports){ | ||
"use strict"; | ||
@@ -340,8 +336,2 @@ exports.__esModule = true; | ||
exports.__esModule = true; | ||
var util_1 = require("../util"); | ||
exports.GSM_CODES = util_1.tuple('0', '1', '2', '3', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', '10', '11', '12', '13', '14', '15', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '2b', '2c', '2d', '2e', '2f', '30', '31', '32', '33', '34', '35', '36', '3a', '47', '48', '56', '2100', '2101', '2102', '2200', '2201', '2202', '2203', '2204', '2205', '2206', '2207', '2300', '2301', '2302', '2400', '2401', '2402', '2403', '2404', '6000', '6xxx', '6001', '6002', '6003', '6004', '6005', '6006', '8000', '8001', '8002', '8003', '8004', '8008', '800b', '8010', 'a001', 'a002', 'cxxx', 'c000', 'c001', 'c002', 'c003', 'c004', 'c005', 'c006', 'c007', 'c008', 'c009', 'c00a', 'c00b', 'c00d', 'd000', 'd001', 'd002', 'd004', 'd00a', 'd00c', 'd010', 'd020', 'e010', 'e040', 'e082', 'fc0a', 'fc06', 'fc07', 'fc08', 'ffdd', 'ffde', 'ffdf', 'ffe0', 'ffe1', 'ffe5', 'fff0', 'ffff', '4xxx', '81xx', '82xx', '83xx', '84xx', '85xx', '86xx', '87xx', '88xx', '8axx', '89xx', '8cxx', 'exxx', 'e140'); | ||
},{"../util":7}],6:[function(require,module,exports){ | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports.SUCCESS_CODES = new Map([ | ||
@@ -352,14 +342,3 @@ [151, 'Contacts updated/created/deleted with CSV response.'], | ||
},{}],7:[function(require,module,exports){ | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports.tuple = function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
return args; | ||
}; | ||
},{}]},{},[1])(1) | ||
}); |
@@ -8,7 +8,7 @@ import { GSM_CODES } from './constants/GSM_CODES'; | ||
export declare type GsmCode = (typeof GSM_CODES)[number]; | ||
export declare type NetworkType = (typeof NETWORK_TYPES)[number]; | ||
export declare type ContactsAction = (typeof CONTACTS_ACTIONS)[number]; | ||
export declare type LookupType = (typeof LOOKUP_TYPES)[number]; | ||
export declare type ProviderName = (typeof PROVIDER_NAMES)[number]; | ||
export declare type StatusDeliveryCode = (typeof STATUS_REPORT_CODES)[number]; | ||
export declare type NetworkType = keyof typeof NETWORK_TYPES; | ||
export declare type ContactsAction = keyof typeof CONTACTS_ACTIONS; | ||
export declare type LookupType = typeof LOOKUP_TYPES; | ||
export declare type ProviderName = keyof typeof PROVIDER_NAMES; | ||
export declare type StatusDeliveryCode = keyof typeof STATUS_REPORT_CODES; | ||
export declare type CNAMApiCodes = 202 | 600; | ||
@@ -15,0 +15,0 @@ export declare type BaseApiResponse = { |
@@ -9,4 +9,10 @@ { | ||
}, | ||
"files": ["dist/Sms77Client.umd.js", "dist/constants/*.d.ts", "dist/*.d.ts"], | ||
"keywords": ["sms"], | ||
"files": [ | ||
"dist/Sms77Client.umd.js", | ||
"dist/constants/*.*", | ||
"dist/*.d.ts" | ||
], | ||
"keywords": [ | ||
"sms" | ||
], | ||
"license": "MIT", | ||
@@ -25,3 +31,4 @@ "main": "dist/Sms77Client.umd.js", | ||
"types": "dist/Sms77Client.d.ts", | ||
"version": "1.4.2" | ||
"version": "1.5.0", | ||
"homepage": "https://www.sms77.io/en/docs/gateway/http-api/" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
24
692
32989