dymo-api 1.0.36 → 1.0.37

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/dist/dymo-api.js CHANGED
@@ -49,9 +49,6 @@ class DymoAPI {
49
49
  this.autoupdate();
50
50
  this.initializeTokens(); // Calls the function to obtain tokens when creating the object.
51
51
  }
52
- getBaseUrl() {
53
- return this.local ? "http://localhost:3050" : "https://api.tpeoficial.com";
54
- }
55
52
  async getTokens() {
56
53
  const currentTime = new Date();
57
54
  if (this.tokensResponse && this.lastFetchTime && (currentTime.getTime() - this.lastFetchTime.getTime()) < 5 * 60 * 1000) {
@@ -102,8 +99,9 @@ class DymoAPI {
102
99
  return await PrivateAPI.isValidData(this.rootApiKey || this.apiKey, data);
103
100
  }
104
101
  async sendEmail(data) {
102
+ console.log(this.serverEmailConfig, this.rootApiKey);
105
103
  if (!this.serverEmailConfig && !this.rootApiKey)
106
- throw customError(5000, `You must configure the email client settings.`);
104
+ throw customError(5000, "You must configure the email client settings.");
107
105
  return await PrivateAPI.sendEmail(this.rootApiKey || this.apiKey, { serverEmailConfig: this.serverEmailConfig, ...data });
108
106
  }
109
107
  async getRandom(data) {
package/dist/dymo-api.mjs CHANGED
@@ -49,9 +49,6 @@ class DymoAPI {
49
49
  this.autoupdate();
50
50
  this.initializeTokens(); // Calls the function to obtain tokens when creating the object.
51
51
  }
52
- getBaseUrl() {
53
- return this.local ? "http://localhost:3050" : "https://api.tpeoficial.com";
54
- }
55
52
  async getTokens() {
56
53
  const currentTime = new Date();
57
54
  if (this.tokensResponse && this.lastFetchTime && (currentTime.getTime() - this.lastFetchTime.getTime()) < 5 * 60 * 1000) {
@@ -102,8 +99,9 @@ class DymoAPI {
102
99
  return await PrivateAPI.isValidData(this.rootApiKey || this.apiKey, data);
103
100
  }
104
101
  async sendEmail(data) {
102
+ console.log(this.serverEmailConfig, this.rootApiKey);
105
103
  if (!this.serverEmailConfig && !this.rootApiKey)
106
- throw customError(5000, `You must configure the email client settings.`);
104
+ throw customError(5000, "You must configure the email client settings.");
107
105
  return await PrivateAPI.sendEmail(this.rootApiKey || this.apiKey, { serverEmailConfig: this.serverEmailConfig, ...data });
108
106
  }
109
107
  async getRandom(data) {
@@ -9,12 +9,10 @@ const child_process_1 = require("child_process");
9
9
  const localVersion = (0, child_process_1.execSync)(`npm list dymo-api --depth=0`).toString().match(new RegExp(`dymo-api@(\\d+\\.\\d+\\.\\d+)`))?.[1] || "0.0.0";
10
10
  async function checkForUpdates() {
11
11
  try {
12
- const response = await axios_1.default.get(`https://registry.npmjs.org/dymo-api/latest`);
12
+ const response = await axios_1.default.get("https://registry.npmjs.org/dymo-api/latest");
13
13
  const latestVersion = response.data.version;
14
14
  if (localVersion !== latestVersion)
15
15
  console.log(`A new version of dymo-api is available: ${latestVersion}. You are using ${localVersion}. Consider updating.`);
16
- else
17
- console.log(`You are using the latest version of dymo-api: ${localVersion}.`);
18
16
  }
19
17
  catch (error) {
20
18
  if (error.response)
@@ -25,7 +25,6 @@ declare class DymoAPI {
25
25
  local?: boolean;
26
26
  serverEmailConfig?: ServerEmailConfig;
27
27
  });
28
- private getBaseUrl;
29
28
  private getTokens;
30
29
  private initializeTokens;
31
30
  private autoupdate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dymo-api",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "description": "Flow system for Dymo API.",
5
5
  "main": "dist/dymo-api.js",
6
6
  "module": "dist/dymo-api.mjs",