Skip to content

Commit 372ea45

Browse files
committed
Fix: cnostructor config interface:
1 parent 27332a0 commit 372ea45

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

lib/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Base64 } from "js-base64";
33
import { CustomAxiosError } from "./error";
44
import { initSMSToken, sendLMS, sendShortSMS, sendMMS } from "./modules/gabia-service";
55
import { IGabiaAPIConfiguration } from "./types/IGabiaAPIConfiguration";
6+
import IGabiaConfig from "./types/IGabiaConfig";
67
import { IDefaultRes, IDefaultResData, IGetAccessToken } from "./types/IGabiaResponse";
78

89
const gabiaAPIConfiguration: IGabiaAPIConfiguration = {
@@ -31,11 +32,11 @@ class GabiaSMS {
3132
* @param apiKey Apikey issued by gabiaSMS service
3233
* @param refKey refKey issued by gabiaSMS service
3334
*/
34-
constructor(gabiaId: string, apiKey: string, refKey: string) {
35+
constructor(config: IGabiaConfig) {
3536

36-
this.gabiaId = gabiaId;
37-
this.API_KEY = apiKey;
38-
this.refKEY = refKey;
37+
this.gabiaId = config.gabiaId;
38+
this.API_KEY = config.apiKey;
39+
this.refKEY = config.refKey;
3940
this.$axios = axios.create();
4041
this.gabiaToken = '';
4142
}

lib/types/IGabiaConfig.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default interface IGabiaConfig {
2+
3+
gabiaId: string;
4+
apiKey: string;
5+
refKey: string;
6+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-gabia-sms",
3-
"version": "0.0.9",
3+
"version": "0.0.10",
44
"description": "using gabiad sms service",
55
"main": "dist/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)