dymo-api 1.0.87 → 1.0.88

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.
@@ -36,7 +36,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const PublicAPI = __importStar(require("./branches/public.cjs"));
37
37
  const PrivateAPI = __importStar(require("./branches/private.cjs"));
38
38
  const config_1 = __importStar(require("./config/index.cjs"));
39
- const autoupdate_1 = require("./services/autoupdate.cjs");
40
39
  const customError = (code, message) => {
41
40
  return Object.assign(new Error(), { code, message: `[${config_1.default.lib.name}] ${message}` });
42
41
  };
@@ -64,24 +63,6 @@ class DymoAPI {
64
63
  this.serverEmailConfig = serverEmailConfig;
65
64
  this.baseUrl = baseUrl;
66
65
  (0, config_1.setBaseUrl)(baseUrl);
67
- this.autoupdate();
68
- }
69
- /**
70
- * Checks for updates and logs a message if a new version is available.
71
- *
72
- * This method is called in the constructor and will throw an error if the
73
- * update check fails.
74
- *
75
- * @throws Will throw an error if there is an issue with the update check
76
- * process.
77
- */
78
- async autoupdate() {
79
- try {
80
- await (0, autoupdate_1.checkForUpdates)();
81
- }
82
- catch (error) {
83
- console.error(`[${config_1.default.lib.name}] Error checking the latest version in npmjs: ${error.message}`);
84
- }
85
66
  }
86
67
  // FUNCTIONS / Private.
87
68
  /**
@@ -1,7 +1,6 @@
1
1
  import * as PublicAPI from "./branches/public.js";
2
2
  import * as PrivateAPI from "./branches/private.js";
3
3
  import config, { setBaseUrl } from "./config/index.js";
4
- import { checkForUpdates } from "./services/autoupdate.js";
5
4
  const customError = (code, message) => {
6
5
  return Object.assign(new Error(), { code, message: `[${config.lib.name}] ${message}` });
7
6
  };
@@ -29,24 +28,6 @@ class DymoAPI {
29
28
  this.serverEmailConfig = serverEmailConfig;
30
29
  this.baseUrl = baseUrl;
31
30
  setBaseUrl(baseUrl);
32
- this.autoupdate();
33
- }
34
- /**
35
- * Checks for updates and logs a message if a new version is available.
36
- *
37
- * This method is called in the constructor and will throw an error if the
38
- * update check fails.
39
- *
40
- * @throws Will throw an error if there is an issue with the update check
41
- * process.
42
- */
43
- async autoupdate() {
44
- try {
45
- await checkForUpdates();
46
- }
47
- catch (error) {
48
- console.error(`[${config.lib.name}] Error checking the latest version in npmjs: ${error.message}`);
49
- }
50
31
  }
51
32
  // FUNCTIONS / Private.
52
33
  /**
@@ -27,16 +27,6 @@ declare class DymoAPI {
27
27
  baseUrl?: string;
28
28
  serverEmailConfig?: Interfaces.ServerEmailConfig;
29
29
  });
30
- /**
31
- * Checks for updates and logs a message if a new version is available.
32
- *
33
- * This method is called in the constructor and will throw an error if the
34
- * update check fails.
35
- *
36
- * @throws Will throw an error if there is an issue with the update check
37
- * process.
38
- */
39
- private autoupdate;
40
30
  /**
41
31
  * Validates the given data against the configured validation settings.
42
32
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dymo-api",
3
- "version": "1.0.87",
3
+ "version": "1.0.88",
4
4
  "description": "Flow system for Dymo API.",
5
5
  "main": "dist/cjs/dymo-api.js",
6
6
  "module": "dist/esm/dymo-api.js",
@@ -1,27 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.checkForUpdates = checkForUpdates;
7
- const axios_1 = __importDefault(require("axios"));
8
- //@ts-ignore
9
- const child_process_1 = require("child_process");
10
- 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";
11
- async function checkForUpdates() {
12
- try {
13
- const response = await axios_1.default.get("https://registry.npmjs.org/dymo-api/latest");
14
- const latestVersion = response.data.version;
15
- if (localVersion !== latestVersion)
16
- console.log(`[Dymo API] A new version of dymo-api is available: ${latestVersion}. You are using ${localVersion}. Consider updating.`);
17
- }
18
- catch (error) {
19
- if (error.response)
20
- console.error("[Dymo API] Error fetching the latest version:", error.response.data);
21
- else if (error.request)
22
- console.error("[Dymo API] No response received from the server:", error.request);
23
- else
24
- console.error("[Dymo API] An unknown error occurred:", error.message);
25
- }
26
- }
27
- ;
@@ -1,21 +0,0 @@
1
- import axios from "axios";
2
- //@ts-ignore
3
- import { execSync } from "child_process";
4
- const localVersion = execSync("npm list dymo-api --depth=0").toString().match(new RegExp("dymo-api@(\\d+\\.\\d+\\.\\d+)"))?.[1] || "0.0.0";
5
- export async function checkForUpdates() {
6
- try {
7
- const response = await axios.get("https://registry.npmjs.org/dymo-api/latest");
8
- const latestVersion = response.data.version;
9
- if (localVersion !== latestVersion)
10
- console.log(`[Dymo API] A new version of dymo-api is available: ${latestVersion}. You are using ${localVersion}. Consider updating.`);
11
- }
12
- catch (error) {
13
- if (error.response)
14
- console.error("[Dymo API] Error fetching the latest version:", error.response.data);
15
- else if (error.request)
16
- console.error("[Dymo API] No response received from the server:", error.request);
17
- else
18
- console.error("[Dymo API] An unknown error occurred:", error.message);
19
- }
20
- }
21
- ;
@@ -1 +0,0 @@
1
- export declare function checkForUpdates(): Promise<void>;