unismsgateway 1.3.0 → 1.3.2
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/README.md +402 -129
- package/dist/scripts/test-live.d.ts +11 -0
- package/dist/scripts/test-live.js +188 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +13 -0
- package/dist/src/lib/hubtel-gateway.d.ts +13 -0
- package/dist/src/lib/hubtel-gateway.js +57 -0
- package/dist/src/lib/lib.d.ts +5 -0
- package/dist/src/lib/lib.js +20 -0
- package/dist/src/lib/nest-gateway.d.ts +12 -0
- package/dist/src/lib/nest-gateway.js +156 -0
- package/dist/src/lib/platform.d.ts +13 -0
- package/dist/src/lib/platform.js +85 -0
- package/dist/src/lib/route-gateway.d.ts +12 -0
- package/dist/src/lib/route-gateway.js +70 -0
- package/dist/src/lib/types.d.ts +47 -0
- package/dist/src/lib/types.js +2 -0
- package/package.json +6 -2
- /package/dist/lib/{types.d.ts → j;[ ]p;;;j]/ts} +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare type PlatformId = 'route' | 'hubtel' | 'nest';
|
|
2
|
+
export interface QuickSendParams {
|
|
3
|
+
From: string;
|
|
4
|
+
To: string | number;
|
|
5
|
+
Content: string;
|
|
6
|
+
Type?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface SendResult {
|
|
9
|
+
success: boolean;
|
|
10
|
+
messageId?: string;
|
|
11
|
+
data?: any;
|
|
12
|
+
error?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IgatewayParam {
|
|
15
|
+
host?: string;
|
|
16
|
+
port?: number;
|
|
17
|
+
username?: string;
|
|
18
|
+
password?: string;
|
|
19
|
+
clientId?: string;
|
|
20
|
+
clientSecret?: string;
|
|
21
|
+
apiKey?: string;
|
|
22
|
+
protocol?: 'http' | 'https';
|
|
23
|
+
}
|
|
24
|
+
export interface IgatewaySettings {
|
|
25
|
+
platformId: PlatformId;
|
|
26
|
+
param: IgatewayParam;
|
|
27
|
+
}
|
|
28
|
+
/** Send surface used by the facade; third-party SDKs may omit `init()`. */
|
|
29
|
+
export interface ISmsGatewayDelegate {
|
|
30
|
+
quickSend(params: QuickSendParams, callback?: Function): Promise<SendResult>;
|
|
31
|
+
getBalance?(): Promise<any>;
|
|
32
|
+
}
|
|
33
|
+
export interface ISmsGateway extends ISmsGatewayDelegate {
|
|
34
|
+
init(): ISmsGateway;
|
|
35
|
+
}
|
|
36
|
+
export interface NestSmsConfig {
|
|
37
|
+
apiKey: string;
|
|
38
|
+
host?: string;
|
|
39
|
+
protocol?: 'http' | 'https';
|
|
40
|
+
}
|
|
41
|
+
export interface NestSendResponse {
|
|
42
|
+
handshake: {
|
|
43
|
+
id: number;
|
|
44
|
+
label: string;
|
|
45
|
+
};
|
|
46
|
+
data?: any;
|
|
47
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unismsgateway",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "A unified SMS gateway library that brings access to multiple SMS gateways under a single API",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"test": "
|
|
8
|
+
"test": "npm run test:live",
|
|
9
|
+
"test:live": "ts-node scripts/test-live.ts",
|
|
9
10
|
"build": "tsc",
|
|
10
11
|
"prepublish": "npm run build"
|
|
11
12
|
},
|
|
@@ -38,7 +39,10 @@
|
|
|
38
39
|
"node": ">=12.0.0"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
42
|
+
"@types/dotenv": "^6.1.1",
|
|
41
43
|
"@types/node": "^17.0.4",
|
|
44
|
+
"dotenv": "^17.4.0",
|
|
45
|
+
"ts-node": "^10.9.2",
|
|
42
46
|
"typescript": "^4.5.4"
|
|
43
47
|
},
|
|
44
48
|
"dependencies": {
|
|
File without changes
|