mysendingbox 1.0.8 → 1.0.10

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 CHANGED
@@ -138,7 +138,7 @@ $ npm install
138
138
 
139
139
  ```javascript
140
140
 
141
- var Seeuletter = require('seeuletter')('YOUR API KEY');
141
+ var Seeuletter = require('mysendingbox')('YOUR API KEY');
142
142
 
143
143
 
144
144
 
@@ -669,4 +669,4 @@ Copyright © 2025 Exaland.app
669
669
 
670
670
 
671
671
 
672
- Released under the MIT License, which can be found in the repository in `LICENSE.txt`.
672
+ Released under the MIT License, which can be found in the repository in `LICENSE.txt`.
package/lib/index.js CHANGED
@@ -12,8 +12,6 @@ var Seeuletter = function (apiKey, options) {
12
12
  return new Seeuletter(apiKey, options);
13
13
  }
14
14
 
15
- this.resourceBase = require('./resources/resourceBase');
16
-
17
15
  if (apiKey && typeof apiKey === 'object') {
18
16
  options = apiKey;
19
17
  apiKey = null;
@@ -32,7 +30,7 @@ var Seeuletter = function (apiKey, options) {
32
30
  this.options.headers['Seeuletter-Version'] = options.apiVersion;
33
31
  }
34
32
 
35
- for (var key in options) {
33
+ for (var key in options) {
36
34
  this.options[key] = options[key];
37
35
  }
38
36
 
@@ -4,7 +4,7 @@ var util = require('util');
4
4
  var ResourceBase = require('./resourceBase');
5
5
 
6
6
  var Accounts = function (config) {
7
- ResourceBase.call(this, 'accounts', { ...config, useBody: true });
7
+ ResourceBase.call(this, 'accounts', Object.assign({}, config, { useBody: true }));
8
8
  };
9
9
 
10
10
  util.inherits(Accounts, ResourceBase);
@@ -4,11 +4,13 @@ const axios = require('axios')
4
4
  const stream = require('stream')
5
5
 
6
6
  var ResourceBase = function (endpoint, config) {
7
+ if (!config || !config.options) {
8
+ throw new Error('Invalid resource configuration: expected { options: { host, apiKey, headers } }')
9
+ }
7
10
  this.uri = config.options.host + endpoint
8
11
  this.config = config.options
9
12
  this.useBody = config.useBody || false
10
13
  }
11
-
12
14
  (function () {
13
15
  this._transmit = function (method, uri, qs, form, headers, callback) {
14
16
  if (typeof headers === 'function') {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "Mysendingbox.com",
12
12
  "printing"
13
13
  ],
14
- "version": "1.0.8",
14
+ "version": "1.0.10",
15
15
  "homepage": "https://github.com/exaland/mysendingbox-node",
16
16
  "author": "Exaland Concept For -> Mysendingbox <hello@mysendingbox.fr> (https://www.mysendingbox.fr/)",
17
17
  "dependencies": {