@mspcopilot/n8n-nodes-connectwise 0.2.1-beta.7 → 0.2.1-beta.9
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-beta/credentials/ConnectWisePsaApi.credentials.js +2 -2
- package/dist-beta/nodes/ConnectWise/PSA/ConnectWisePsa.node.js +1 -1
- package/dist-beta/nodes/ConnectWise/PSA/helpers/hint-collector.js +1 -1
- package/dist-beta/nodes/ConnectWise/PSA/transport/version-check.js +7 -5
- package/package.json +1 -1
|
@@ -117,10 +117,10 @@ class ConnectWisePsaApi {
|
|
|
117
117
|
name: "checkForUpdates",
|
|
118
118
|
type: "boolean",
|
|
119
119
|
default: !0,
|
|
120
|
-
hint: "Current version: 0.2.1-beta.
|
|
120
|
+
hint: "Current version: 0.2.1-beta.9 (beta edition)",
|
|
121
121
|
description: "Check for new versions of this node package and show notifications when updates are available"
|
|
122
122
|
} ] : [], ...process.env.MSPCOPILOT_BETA === "true" ? [ {
|
|
123
|
-
displayName: "Current version: 0.2.1-beta.
|
|
123
|
+
displayName: "Current version: 0.2.1-beta.9 (beta)",
|
|
124
124
|
name: "versionInfo",
|
|
125
125
|
type: "notice",
|
|
126
126
|
default: ""
|
|
@@ -85,7 +85,7 @@ const resources = {
|
|
|
85
85
|
|
|
86
86
|
class ConnectWisePsa {
|
|
87
87
|
constructor() {
|
|
88
|
-
console.log(`🔌 ConnectWise PSA Node Loaded | 📦 v0.2.1-beta.
|
|
88
|
+
console.log(`🔌 ConnectWise PSA Node Loaded | 📦 v0.2.1-beta.9 | 🏗️ Build: ${"beta".toUpperCase()} (${"prod".toUpperCase()} mode)`);
|
|
89
89
|
}
|
|
90
90
|
description={
|
|
91
91
|
displayName: "ConnectWise PSA",
|
|
@@ -73,7 +73,7 @@ const HINT_TYPES = {
|
|
|
73
73
|
beta_downgrade: {
|
|
74
74
|
aggregate: "dedupe",
|
|
75
75
|
type: "warning",
|
|
76
|
-
template: () => `You have <code>MSPCOPILOT_BETA=true</code> set, but you're running a stable build. Beta features are not available. You may have been silently downgraded by n8n's "update available" prompt
|
|
76
|
+
template: () => `You have <code>MSPCOPILOT_BETA=true</code> set, but you're running a stable build. Beta features are not available. You may have been silently downgraded by n8n's "update available" prompt. See the <a href="https://${import_common.DOCURL_PREFIX}/beta-upgrade${import_common.DOCURL_SUFFIX}" target="_blank">beta upgrade guide</a> for details.`
|
|
77
77
|
},
|
|
78
78
|
beta_update: {
|
|
79
79
|
aggregate: "dedupe",
|
|
@@ -39,14 +39,15 @@ module.exports = __toCommonJS(version_check_exports);
|
|
|
39
39
|
|
|
40
40
|
var fs = __toESM(require("fs/promises")), path = __toESM(require("path")), os = __toESM(require("os")), import_common = require("../descriptions/common.descriptions"), import_hint_collector = require("../helpers/hint-collector");
|
|
41
41
|
|
|
42
|
-
const CACHE_FILE_PATH = path.join(os.tmpdir(), "connectwise-n8n-version-cache.json"), CURRENT_VERSION = "0.2.1-beta.
|
|
42
|
+
const CACHE_FILE_PATH = path.join(os.tmpdir(), "connectwise-n8n-version-cache.json"), CURRENT_VERSION = "0.2.1-beta.9";
|
|
43
43
|
|
|
44
44
|
let inMemoryCache = null, cacheLoadPromise = null, fetchInProgress = !1;
|
|
45
45
|
|
|
46
46
|
async function initializeCache() {
|
|
47
47
|
try {
|
|
48
48
|
const fileContent = await fs.readFile(CACHE_FILE_PATH, "utf-8"), cacheEntry = JSON.parse(fileContent);
|
|
49
|
-
if (Date.now() < cacheEntry.expires ? (
|
|
49
|
+
if (Date.now() < cacheEntry.expires ? (cacheEntry.data.updateAvailable && cacheEntry.data.latest === CURRENT_VERSION && (cacheEntry.data.updateAvailable = !1),
|
|
50
|
+
inMemoryCache = cacheEntry.data, inMemoryCache.updateAvailable && (console.log(`🎉 ConnectWise PSA Node v${inMemoryCache.latest} is available! (current: v${CURRENT_VERSION})`),
|
|
50
51
|
console.log(` Beta upgrade guide: https://${import_common.DOCURL_PREFIX}/beta-upgrade${import_common.DOCURL_SUFFIX}`))) : cacheEntry.data?.accessKeyInfo && (inMemoryCache = cacheEntry.data),
|
|
51
52
|
inMemoryCache?.accessKeyInfo) try {
|
|
52
53
|
const {updateAccessKeyFromServer: updateAccessKeyFromServer} = await import("./access-key.js");
|
|
@@ -76,8 +77,9 @@ async function fetchLatestVersion(accessKey) {
|
|
|
76
77
|
lastChecked: Date.now()
|
|
77
78
|
};
|
|
78
79
|
try {
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
const effectiveBuild = (process.env.MSPCOPILOT_BETA === "true", "beta");
|
|
81
|
+
console.log(`🔍 Checking for updates (${effectiveBuild} v${CURRENT_VERSION})...`);
|
|
82
|
+
const controller = new AbortController, timeoutId = setTimeout(() => controller.abort(), 5e3), url = `${import_common.VERSION_CHECK_URL}?version=${CURRENT_VERSION}&build=${effectiveBuild}`, headers = {
|
|
81
83
|
Accept: "application/json"
|
|
82
84
|
};
|
|
83
85
|
accessKey && (headers.Authorization = `Bearer ${accessKey}`);
|
|
@@ -91,7 +93,7 @@ async function fetchLatestVersion(accessKey) {
|
|
|
91
93
|
const data = await response.json();
|
|
92
94
|
if (data && typeof data.latest == "string" && (versionInfo.latest = data.latest,
|
|
93
95
|
versionInfo.updateAvailable = data.updateAvailable || !1, versionInfo.message = data.message,
|
|
94
|
-
console.log(`✅ Version check complete:
|
|
96
|
+
console.log(`✅ Version check complete: ${effectiveBuild} v${CURRENT_VERSION}, latest=${data.latest}, updateAvailable=${data.updateAvailable}`)),
|
|
95
97
|
data?.accessKeyInfo) {
|
|
96
98
|
versionInfo.accessKeyInfo = data.accessKeyInfo;
|
|
97
99
|
try {
|