@sinch/sms 0.0.4 → 0.0.5
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 +17 -19
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/models/v1/index.d.ts +1 -0
- package/dist/models/v1/index.js +1 -0
- package/dist/models/v1/index.js.map +1 -1
- package/dist/models/v1/requests/batches/batches-request-data.d.ts +71 -0
- package/dist/models/v1/requests/batches/batches-request-data.js +3 -0
- package/dist/models/v1/requests/batches/batches-request-data.js.map +1 -0
- package/dist/models/v1/requests/delivery-reports/delivery-reports-request-data.d.ts +33 -0
- package/dist/models/v1/requests/delivery-reports/delivery-reports-request-data.js +3 -0
- package/dist/models/v1/requests/delivery-reports/delivery-reports-request-data.js.map +1 -0
- package/dist/models/v1/requests/groups/groups-request-data.d.ts +37 -0
- package/dist/models/v1/requests/groups/groups-request-data.js +3 -0
- package/dist/models/v1/requests/groups/groups-request-data.js.map +1 -0
- package/dist/models/v1/requests/inbounds/inbounds-request-data.d.ts +18 -0
- package/dist/models/v1/requests/inbounds/inbounds-request-data.js +3 -0
- package/dist/models/v1/requests/inbounds/inbounds-request-data.js.map +1 -0
- package/dist/models/v1/requests/index.d.ts +4 -0
- package/dist/models/v1/requests/index.js +21 -0
- package/dist/models/v1/requests/index.js.map +1 -0
- package/dist/rest/v1/batches/batches-api.d.ts +1 -62
- package/dist/rest/v1/batches/batches-api.jest.fixture.d.ts +2 -2
- package/dist/rest/v1/batches/batches-api.jest.fixture.js.map +1 -1
- package/dist/rest/v1/batches/batches-api.js +15 -15
- package/dist/rest/v1/batches/batches-api.js.map +1 -1
- package/dist/rest/v1/delivery-reports/delivery-reports-api.d.ts +1 -33
- package/dist/rest/v1/delivery-reports/delivery-reports-api.jest.fixture.d.ts +2 -2
- package/dist/rest/v1/delivery-reports/delivery-reports-api.jest.fixture.js.map +1 -1
- package/dist/rest/v1/delivery-reports/delivery-reports-api.js +5 -5
- package/dist/rest/v1/delivery-reports/delivery-reports-api.js.map +1 -1
- package/dist/rest/v1/groups/groups-api.d.ts +1 -35
- package/dist/rest/v1/groups/groups-api.jest.fixture.d.ts +2 -2
- package/dist/rest/v1/groups/groups-api.jest.fixture.js.map +1 -1
- package/dist/rest/v1/groups/groups-api.js +13 -13
- package/dist/rest/v1/groups/groups-api.js.map +1 -1
- package/dist/rest/v1/inbounds/inbounds-api.d.ts +1 -19
- package/dist/rest/v1/inbounds/inbounds-api.jest.fixture.d.ts +2 -2
- package/dist/rest/v1/inbounds/inbounds-api.js +3 -3
- package/dist/rest/v1/inbounds/inbounds-api.js.map +1 -1
- package/dist/rest/v1/sms-domain-api.d.ts +10 -5
- package/dist/rest/v1/sms-domain-api.js +27 -38
- package/dist/rest/v1/sms-domain-api.js.map +1 -1
- package/dist/rest/v1/sms-service.d.ts +28 -5
- package/dist/rest/v1/sms-service.js +36 -8
- package/dist/rest/v1/sms-service.js.map +1 -1
- package/package.json +2 -2
|
@@ -5,7 +5,26 @@ const groups_1 = require("./groups");
|
|
|
5
5
|
const delivery_reports_1 = require("./delivery-reports");
|
|
6
6
|
const batches_1 = require("./batches");
|
|
7
7
|
const inbounds_1 = require("./inbounds");
|
|
8
|
+
/**
|
|
9
|
+
* The SMS Service exposes the following APIs:
|
|
10
|
+
* - groups
|
|
11
|
+
* - batches
|
|
12
|
+
* - inbounds
|
|
13
|
+
* - deliveryReports
|
|
14
|
+
*/
|
|
8
15
|
class SmsService {
|
|
16
|
+
/**
|
|
17
|
+
* Create a new SmsService instance with its configuration. This service can be instantiated with 2 different authentication mechanisms:
|
|
18
|
+
* - OAuth2: the required properties are `projectId`, `keyId` and `keySecret`
|
|
19
|
+
* - API Token: the required properties are `servicePlanId` and `apiToken`
|
|
20
|
+
*
|
|
21
|
+
* Other supported properties:
|
|
22
|
+
* - `smsRegion`
|
|
23
|
+
* - `smsHostname`
|
|
24
|
+
* - `forceOAuth2ForSmsApi`
|
|
25
|
+
* - `forceServicePlanIdUsageForSmsApi`
|
|
26
|
+
* @param {SinchClientParameters} params - an Object containing the necessary properties to initialize the service
|
|
27
|
+
*/
|
|
9
28
|
constructor(params) {
|
|
10
29
|
this.groups = new groups_1.GroupsApi(params);
|
|
11
30
|
this.deliveryReports = new delivery_reports_1.DeliveryReportsApi(params);
|
|
@@ -13,15 +32,24 @@ class SmsService {
|
|
|
13
32
|
this.inbounds = new inbounds_1.InboundsApi(params);
|
|
14
33
|
}
|
|
15
34
|
/**
|
|
16
|
-
* Update the default
|
|
17
|
-
*
|
|
18
|
-
|
|
35
|
+
* Update the default hostname for each API
|
|
36
|
+
* @param {string} hostname - The new hostname to use for all the APIs.
|
|
37
|
+
*/
|
|
38
|
+
setHostname(hostname) {
|
|
39
|
+
this.groups.setHostname(hostname);
|
|
40
|
+
this.deliveryReports.setHostname(hostname);
|
|
41
|
+
this.batches.setHostname(hostname);
|
|
42
|
+
this.inbounds.setHostname(hostname);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Update the current region for each API
|
|
46
|
+
* @param {SmsRegion} region - The new region to use in the production URL
|
|
19
47
|
*/
|
|
20
|
-
|
|
21
|
-
this.groups.
|
|
22
|
-
this.deliveryReports.
|
|
23
|
-
this.batches.
|
|
24
|
-
this.inbounds.
|
|
48
|
+
setRegion(region) {
|
|
49
|
+
this.groups.setRegion(region);
|
|
50
|
+
this.deliveryReports.setRegion(region);
|
|
51
|
+
this.batches.setRegion(region);
|
|
52
|
+
this.inbounds.setRegion(region);
|
|
25
53
|
}
|
|
26
54
|
}
|
|
27
55
|
exports.SmsService = SmsService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sms-service.js","sourceRoot":"","sources":["../../../src/rest/v1/sms-service.ts"],"names":[],"mappings":";;;AAGA,qCAAqC;AACrC,yDAAwD;AACxD,uCAAuC;AACvC,yCAAyC;AAEzC,MAAa,UAAU;IAMrB,YAAY,MAA6B;QACvC,IAAI,C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AAC,CAAC;QACvC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC/B,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;CACF;AA9CD,gCA8CC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sinch/sms",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Sinch SMS API",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"compile": "tsc -p tsconfig.build.json && tsc -p tsconfig.tests.json && rimraf dist/tests tsconfig.build.tsbuildinfo"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@sinch/sdk-client": "^0.0.
|
|
31
|
+
"@sinch/sdk-client": "^0.0.5"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {},
|
|
34
34
|
"publishConfig": {
|