khoros-aurora-sdk 24.9.0 → 24.9.1
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/build-hash.txt +1 -1
- package/package.json +1 -1
- package/scripts/buildPluginCli.js +0 -63
- package/scripts/formatPluginCli.js +0 -66
- package/scripts/generateCli.js +27 -65
- package/scripts/initPluginCli.js +0 -66
- package/scripts/lintPluginCli.js +0 -66
- package/scripts/pluginLoggerCli.js +3360 -1319
- package/scripts/pluginPreviewCli.js +257 -2524
- package/types/mf/index.d.ts +998 -30
- package/types/pkg/index.d.ts +998 -30
package/build-hash.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
a55e52f
|
package/package.json
CHANGED
|
@@ -25,68 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
mod
|
|
26
26
|
));
|
|
27
27
|
|
|
28
|
-
// ../shared/utils/authentication/SdkKeyValidator.js
|
|
29
|
-
var require_SdkKeyValidator = __commonJS({
|
|
30
|
-
"../shared/utils/authentication/SdkKeyValidator.js"(exports2) {
|
|
31
|
-
"use strict";
|
|
32
|
-
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
33
|
-
function adopt(value) {
|
|
34
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
35
|
-
resolve(value);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
39
|
-
function fulfilled(value) {
|
|
40
|
-
try {
|
|
41
|
-
step(generator.next(value));
|
|
42
|
-
} catch (e) {
|
|
43
|
-
reject(e);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function rejected(value) {
|
|
47
|
-
try {
|
|
48
|
-
step(generator["throw"](value));
|
|
49
|
-
} catch (e) {
|
|
50
|
-
reject(e);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function step(result) {
|
|
54
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
55
|
-
}
|
|
56
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
60
|
-
exports2.validatePath = exports2.isSdkKeyValid = void 0;
|
|
61
|
-
var validatePath2 = "validSdkToken";
|
|
62
|
-
exports2.validatePath = validatePath2;
|
|
63
|
-
function isSdkKeyValid2(log12, validateUrl, token, headers) {
|
|
64
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
if (!token) {
|
|
66
|
-
log12.warn("No token provided");
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
const fetchHeaders = Object.assign(Object.assign({ "content-type": "application/json" }, headers), { authorization: `Bearer ${token}` });
|
|
70
|
-
log12.debug("Validate url: %s, headers: %o", validateUrl, fetchHeaders);
|
|
71
|
-
try {
|
|
72
|
-
const result = yield fetch(validateUrl, {
|
|
73
|
-
headers: fetchHeaders
|
|
74
|
-
});
|
|
75
|
-
log12.debug("Validate token response is %d: %s", result.status, result.statusText);
|
|
76
|
-
if (result.ok) {
|
|
77
|
-
const body = yield result.json();
|
|
78
|
-
return body.data;
|
|
79
|
-
}
|
|
80
|
-
} catch (error) {
|
|
81
|
-
log12.error(error, "Network error attempting to validate sdk token at url: %s", validateUrl);
|
|
82
|
-
}
|
|
83
|
-
return false;
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
exports2.isSdkKeyValid = isSdkKeyValid2;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
28
|
// ../shared/utils/tools/assetCompressor.js
|
|
91
29
|
var require_assetCompressor = __commonJS({
|
|
92
30
|
"../shared/utils/tools/assetCompressor.js"(exports2, module2) {
|
|
@@ -498,7 +436,6 @@ function parseChangeSet(existingChangeSet) {
|
|
|
498
436
|
var changeSet_default = parseChangeSet;
|
|
499
437
|
|
|
500
438
|
// scripts/cliBase.ts
|
|
501
|
-
var import_SdkKeyValidator = __toESM(require_SdkKeyValidator());
|
|
502
439
|
var import_dotenv_flow = __toESM(require("dotenv-flow"));
|
|
503
440
|
var import_findup_sync = __toESM(require("findup-sync"));
|
|
504
441
|
var import_node_path5 = __toESM(require("node:path"));
|
|
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
8
|
var __copyProps = (to, from, except, desc) => {
|
|
12
9
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
10
|
for (let key of __getOwnPropNames(from))
|
|
@@ -25,70 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
22
|
mod
|
|
26
23
|
));
|
|
27
24
|
|
|
28
|
-
// ../shared/utils/authentication/SdkKeyValidator.js
|
|
29
|
-
var require_SdkKeyValidator = __commonJS({
|
|
30
|
-
"../shared/utils/authentication/SdkKeyValidator.js"(exports2) {
|
|
31
|
-
"use strict";
|
|
32
|
-
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
33
|
-
function adopt(value) {
|
|
34
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
35
|
-
resolve(value);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
39
|
-
function fulfilled(value) {
|
|
40
|
-
try {
|
|
41
|
-
step(generator.next(value));
|
|
42
|
-
} catch (e) {
|
|
43
|
-
reject(e);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function rejected(value) {
|
|
47
|
-
try {
|
|
48
|
-
step(generator["throw"](value));
|
|
49
|
-
} catch (e) {
|
|
50
|
-
reject(e);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function step(result) {
|
|
54
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
55
|
-
}
|
|
56
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
60
|
-
exports2.validatePath = exports2.isSdkKeyValid = void 0;
|
|
61
|
-
var validatePath2 = "validSdkToken";
|
|
62
|
-
exports2.validatePath = validatePath2;
|
|
63
|
-
function isSdkKeyValid2(log5, validateUrl, token, headers) {
|
|
64
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
if (!token) {
|
|
66
|
-
log5.warn("No token provided");
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
const fetchHeaders = Object.assign(Object.assign({ "content-type": "application/json" }, headers), { authorization: `Bearer ${token}` });
|
|
70
|
-
log5.debug("Validate url: %s, headers: %o", validateUrl, fetchHeaders);
|
|
71
|
-
try {
|
|
72
|
-
const result = yield fetch(validateUrl, {
|
|
73
|
-
headers: fetchHeaders
|
|
74
|
-
});
|
|
75
|
-
log5.debug("Validate token response is %d: %s", result.status, result.statusText);
|
|
76
|
-
if (result.ok) {
|
|
77
|
-
const body = yield result.json();
|
|
78
|
-
return body.data;
|
|
79
|
-
}
|
|
80
|
-
} catch (error) {
|
|
81
|
-
log5.error(error, "Network error attempting to validate sdk token at url: %s", validateUrl);
|
|
82
|
-
}
|
|
83
|
-
return false;
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
exports2.isSdkKeyValid = isSdkKeyValid2;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
25
|
// scripts/cliBase.ts
|
|
91
|
-
var import_SdkKeyValidator = __toESM(require_SdkKeyValidator());
|
|
92
26
|
var import_dotenv_flow = __toESM(require("dotenv-flow"));
|
|
93
27
|
var import_findup_sync = __toESM(require("findup-sync"));
|
|
94
28
|
var import_node_path = __toESM(require("node:path"));
|
package/scripts/generateCli.js
CHANGED
|
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
8
|
var __copyProps = (to, from, except, desc) => {
|
|
12
9
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
10
|
for (let key of __getOwnPropNames(from))
|
|
@@ -25,70 +22,35 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
22
|
mod
|
|
26
23
|
));
|
|
27
24
|
|
|
28
|
-
// ../shared/utils/authentication/SdkKeyValidator.
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} catch (e) {
|
|
50
|
-
reject(e);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function step(result) {
|
|
54
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
55
|
-
}
|
|
56
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
60
|
-
exports2.validatePath = exports2.isSdkKeyValid = void 0;
|
|
61
|
-
var validatePath2 = "validSdkToken";
|
|
62
|
-
exports2.validatePath = validatePath2;
|
|
63
|
-
function isSdkKeyValid2(log5, validateUrl, token, headers) {
|
|
64
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
if (!token) {
|
|
66
|
-
log5.warn("No token provided");
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
const fetchHeaders = Object.assign(Object.assign({ "content-type": "application/json" }, headers), { authorization: `Bearer ${token}` });
|
|
70
|
-
log5.debug("Validate url: %s, headers: %o", validateUrl, fetchHeaders);
|
|
71
|
-
try {
|
|
72
|
-
const result = yield fetch(validateUrl, {
|
|
73
|
-
headers: fetchHeaders
|
|
74
|
-
});
|
|
75
|
-
log5.debug("Validate token response is %d: %s", result.status, result.statusText);
|
|
76
|
-
if (result.ok) {
|
|
77
|
-
const body = yield result.json();
|
|
78
|
-
return body.data;
|
|
79
|
-
}
|
|
80
|
-
} catch (error) {
|
|
81
|
-
log5.error(error, "Network error attempting to validate sdk token at url: %s", validateUrl);
|
|
82
|
-
}
|
|
83
|
-
return false;
|
|
84
|
-
});
|
|
25
|
+
// ../shared/utils/authentication/SdkKeyValidator.ts
|
|
26
|
+
var validatePath = "validSdkToken";
|
|
27
|
+
async function isSdkKeyValid(log5, validateUrl, token, headers) {
|
|
28
|
+
if (!token) {
|
|
29
|
+
log5.warn("No token provided");
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
const fetchHeaders = {
|
|
33
|
+
"content-type": "application/json",
|
|
34
|
+
...headers,
|
|
35
|
+
authorization: `Bearer ${token}`
|
|
36
|
+
};
|
|
37
|
+
log5.debug("Validate url: %s, headers: %o", validateUrl, fetchHeaders);
|
|
38
|
+
try {
|
|
39
|
+
const result = await fetch(validateUrl, {
|
|
40
|
+
headers: fetchHeaders
|
|
41
|
+
});
|
|
42
|
+
log5.debug("Validate token response is %d: %s", result.status, result.statusText);
|
|
43
|
+
if (result.ok) {
|
|
44
|
+
const body = await result.json();
|
|
45
|
+
return body.data;
|
|
85
46
|
}
|
|
86
|
-
|
|
47
|
+
} catch (error) {
|
|
48
|
+
log5.error(error, "Network error attempting to validate sdk token at url: %s", validateUrl);
|
|
87
49
|
}
|
|
88
|
-
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
89
52
|
|
|
90
53
|
// scripts/cliBase.ts
|
|
91
|
-
var import_SdkKeyValidator = __toESM(require_SdkKeyValidator());
|
|
92
54
|
var import_dotenv_flow = __toESM(require("dotenv-flow"));
|
|
93
55
|
var import_findup_sync = __toESM(require("findup-sync"));
|
|
94
56
|
var import_node_path = __toESM(require("node:path"));
|
|
@@ -266,8 +228,8 @@ var baseOptionsCheck = async (argv) => {
|
|
|
266
228
|
"No SDK key specified. Please add a SDK_KEY entry in the .env.local file or pass it via the -k option."
|
|
267
229
|
);
|
|
268
230
|
} else {
|
|
269
|
-
const validateUrl = liaApiUrlBuilder_default(liaUrl, `auth/${
|
|
270
|
-
const tokenValid = await
|
|
231
|
+
const validateUrl = liaApiUrlBuilder_default(liaUrl, `auth/${validatePath}`);
|
|
232
|
+
const tokenValid = await isSdkKeyValid(log3, validateUrl, sdkKey);
|
|
271
233
|
if (!tokenValid) {
|
|
272
234
|
throw new Error(
|
|
273
235
|
"The SDK key is invalid. Please update SDK_KEY entry in the .env.local file or pass it via the -k option."
|
package/scripts/initPluginCli.js
CHANGED
|
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
8
|
var __copyProps = (to, from, except, desc) => {
|
|
12
9
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
10
|
for (let key of __getOwnPropNames(from))
|
|
@@ -25,70 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
22
|
mod
|
|
26
23
|
));
|
|
27
24
|
|
|
28
|
-
// ../shared/utils/authentication/SdkKeyValidator.js
|
|
29
|
-
var require_SdkKeyValidator = __commonJS({
|
|
30
|
-
"../shared/utils/authentication/SdkKeyValidator.js"(exports2) {
|
|
31
|
-
"use strict";
|
|
32
|
-
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
33
|
-
function adopt(value) {
|
|
34
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
35
|
-
resolve(value);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
39
|
-
function fulfilled(value) {
|
|
40
|
-
try {
|
|
41
|
-
step(generator.next(value));
|
|
42
|
-
} catch (e) {
|
|
43
|
-
reject(e);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function rejected(value) {
|
|
47
|
-
try {
|
|
48
|
-
step(generator["throw"](value));
|
|
49
|
-
} catch (e) {
|
|
50
|
-
reject(e);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function step(result) {
|
|
54
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
55
|
-
}
|
|
56
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
60
|
-
exports2.validatePath = exports2.isSdkKeyValid = void 0;
|
|
61
|
-
var validatePath2 = "validSdkToken";
|
|
62
|
-
exports2.validatePath = validatePath2;
|
|
63
|
-
function isSdkKeyValid2(log5, validateUrl, token, headers) {
|
|
64
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
if (!token) {
|
|
66
|
-
log5.warn("No token provided");
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
const fetchHeaders = Object.assign(Object.assign({ "content-type": "application/json" }, headers), { authorization: `Bearer ${token}` });
|
|
70
|
-
log5.debug("Validate url: %s, headers: %o", validateUrl, fetchHeaders);
|
|
71
|
-
try {
|
|
72
|
-
const result = yield fetch(validateUrl, {
|
|
73
|
-
headers: fetchHeaders
|
|
74
|
-
});
|
|
75
|
-
log5.debug("Validate token response is %d: %s", result.status, result.statusText);
|
|
76
|
-
if (result.ok) {
|
|
77
|
-
const body = yield result.json();
|
|
78
|
-
return body.data;
|
|
79
|
-
}
|
|
80
|
-
} catch (error) {
|
|
81
|
-
log5.error(error, "Network error attempting to validate sdk token at url: %s", validateUrl);
|
|
82
|
-
}
|
|
83
|
-
return false;
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
exports2.isSdkKeyValid = isSdkKeyValid2;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
25
|
// scripts/cliBase.ts
|
|
91
|
-
var import_SdkKeyValidator = __toESM(require_SdkKeyValidator());
|
|
92
26
|
var import_dotenv_flow = __toESM(require("dotenv-flow"));
|
|
93
27
|
var import_findup_sync = __toESM(require("findup-sync"));
|
|
94
28
|
var import_node_path = __toESM(require("node:path"));
|
package/scripts/lintPluginCli.js
CHANGED
|
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
8
|
var __copyProps = (to, from, except, desc) => {
|
|
12
9
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
10
|
for (let key of __getOwnPropNames(from))
|
|
@@ -25,70 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
22
|
mod
|
|
26
23
|
));
|
|
27
24
|
|
|
28
|
-
// ../shared/utils/authentication/SdkKeyValidator.js
|
|
29
|
-
var require_SdkKeyValidator = __commonJS({
|
|
30
|
-
"../shared/utils/authentication/SdkKeyValidator.js"(exports2) {
|
|
31
|
-
"use strict";
|
|
32
|
-
var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
33
|
-
function adopt(value) {
|
|
34
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
35
|
-
resolve(value);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
39
|
-
function fulfilled(value) {
|
|
40
|
-
try {
|
|
41
|
-
step(generator.next(value));
|
|
42
|
-
} catch (e) {
|
|
43
|
-
reject(e);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function rejected(value) {
|
|
47
|
-
try {
|
|
48
|
-
step(generator["throw"](value));
|
|
49
|
-
} catch (e) {
|
|
50
|
-
reject(e);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function step(result) {
|
|
54
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
55
|
-
}
|
|
56
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
60
|
-
exports2.validatePath = exports2.isSdkKeyValid = void 0;
|
|
61
|
-
var validatePath2 = "validSdkToken";
|
|
62
|
-
exports2.validatePath = validatePath2;
|
|
63
|
-
function isSdkKeyValid2(log5, validateUrl, token, headers) {
|
|
64
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
if (!token) {
|
|
66
|
-
log5.warn("No token provided");
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
const fetchHeaders = Object.assign(Object.assign({ "content-type": "application/json" }, headers), { authorization: `Bearer ${token}` });
|
|
70
|
-
log5.debug("Validate url: %s, headers: %o", validateUrl, fetchHeaders);
|
|
71
|
-
try {
|
|
72
|
-
const result = yield fetch(validateUrl, {
|
|
73
|
-
headers: fetchHeaders
|
|
74
|
-
});
|
|
75
|
-
log5.debug("Validate token response is %d: %s", result.status, result.statusText);
|
|
76
|
-
if (result.ok) {
|
|
77
|
-
const body = yield result.json();
|
|
78
|
-
return body.data;
|
|
79
|
-
}
|
|
80
|
-
} catch (error) {
|
|
81
|
-
log5.error(error, "Network error attempting to validate sdk token at url: %s", validateUrl);
|
|
82
|
-
}
|
|
83
|
-
return false;
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
exports2.isSdkKeyValid = isSdkKeyValid2;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
25
|
// scripts/cliBase.ts
|
|
91
|
-
var import_SdkKeyValidator = __toESM(require_SdkKeyValidator());
|
|
92
26
|
var import_dotenv_flow = __toESM(require("dotenv-flow"));
|
|
93
27
|
var import_findup_sync = __toESM(require("findup-sync"));
|
|
94
28
|
var import_node_path = __toESM(require("node:path"));
|