@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.
Files changed (48) hide show
  1. package/README.md +17 -19
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.js +14 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/models/v1/index.d.ts +1 -0
  6. package/dist/models/v1/index.js +1 -0
  7. package/dist/models/v1/index.js.map +1 -1
  8. package/dist/models/v1/requests/batches/batches-request-data.d.ts +71 -0
  9. package/dist/models/v1/requests/batches/batches-request-data.js +3 -0
  10. package/dist/models/v1/requests/batches/batches-request-data.js.map +1 -0
  11. package/dist/models/v1/requests/delivery-reports/delivery-reports-request-data.d.ts +33 -0
  12. package/dist/models/v1/requests/delivery-reports/delivery-reports-request-data.js +3 -0
  13. package/dist/models/v1/requests/delivery-reports/delivery-reports-request-data.js.map +1 -0
  14. package/dist/models/v1/requests/groups/groups-request-data.d.ts +37 -0
  15. package/dist/models/v1/requests/groups/groups-request-data.js +3 -0
  16. package/dist/models/v1/requests/groups/groups-request-data.js.map +1 -0
  17. package/dist/models/v1/requests/inbounds/inbounds-request-data.d.ts +18 -0
  18. package/dist/models/v1/requests/inbounds/inbounds-request-data.js +3 -0
  19. package/dist/models/v1/requests/inbounds/inbounds-request-data.js.map +1 -0
  20. package/dist/models/v1/requests/index.d.ts +4 -0
  21. package/dist/models/v1/requests/index.js +21 -0
  22. package/dist/models/v1/requests/index.js.map +1 -0
  23. package/dist/rest/v1/batches/batches-api.d.ts +1 -62
  24. package/dist/rest/v1/batches/batches-api.jest.fixture.d.ts +2 -2
  25. package/dist/rest/v1/batches/batches-api.jest.fixture.js.map +1 -1
  26. package/dist/rest/v1/batches/batches-api.js +15 -15
  27. package/dist/rest/v1/batches/batches-api.js.map +1 -1
  28. package/dist/rest/v1/delivery-reports/delivery-reports-api.d.ts +1 -33
  29. package/dist/rest/v1/delivery-reports/delivery-reports-api.jest.fixture.d.ts +2 -2
  30. package/dist/rest/v1/delivery-reports/delivery-reports-api.jest.fixture.js.map +1 -1
  31. package/dist/rest/v1/delivery-reports/delivery-reports-api.js +5 -5
  32. package/dist/rest/v1/delivery-reports/delivery-reports-api.js.map +1 -1
  33. package/dist/rest/v1/groups/groups-api.d.ts +1 -35
  34. package/dist/rest/v1/groups/groups-api.jest.fixture.d.ts +2 -2
  35. package/dist/rest/v1/groups/groups-api.jest.fixture.js.map +1 -1
  36. package/dist/rest/v1/groups/groups-api.js +13 -13
  37. package/dist/rest/v1/groups/groups-api.js.map +1 -1
  38. package/dist/rest/v1/inbounds/inbounds-api.d.ts +1 -19
  39. package/dist/rest/v1/inbounds/inbounds-api.jest.fixture.d.ts +2 -2
  40. package/dist/rest/v1/inbounds/inbounds-api.js +3 -3
  41. package/dist/rest/v1/inbounds/inbounds-api.js.map +1 -1
  42. package/dist/rest/v1/sms-domain-api.d.ts +10 -5
  43. package/dist/rest/v1/sms-domain-api.js +27 -38
  44. package/dist/rest/v1/sms-domain-api.js.map +1 -1
  45. package/dist/rest/v1/sms-service.d.ts +28 -5
  46. package/dist/rest/v1/sms-service.js +36 -8
  47. package/dist/rest/v1/sms-service.js.map +1 -1
  48. 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 basePath for each API
17
- *
18
- * @param {string} basePath - The new base path to use for all the APIs.
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
- setBasePath(basePath) {
21
- this.groups.setBasePath(basePath);
22
- this.deliveryReports.setBasePath(basePath);
23
- this.batches.setBasePath(basePath);
24
- this.inbounds.setBasePath(basePath);
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,CAAC,MAAM,GAAG,IAAI,kBAAS,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,eAAe,GAAG,IAAI,qCAAkB,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,OAAO,GAAG,IAAI,oBAAU,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,QAAQ,G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MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,MAAM,CAAC,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.4",
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.4"
31
+ "@sinch/sdk-client": "^0.0.5"
32
32
  },
33
33
  "devDependencies": {},
34
34
  "publishConfig": {