@synity/bitrix-skills 1.3.8 → 1.3.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/CHANGELOG.md +6 -0
- package/dist/cli.js +4 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/cli.js
CHANGED
|
@@ -1000,15 +1000,18 @@ function listFeatures(featuresDir) {
|
|
|
1000
1000
|
// src/lib/license.ts
|
|
1001
1001
|
init_esm_shims();
|
|
1002
1002
|
var LICENSE_WORKER_URL = "https://license-gate.synity.workers.dev";
|
|
1003
|
+
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
1003
1004
|
async function verifyLicense(key) {
|
|
1004
1005
|
if (!key || key.trim() === "") {
|
|
1005
1006
|
return { ok: true, tier: 0 };
|
|
1006
1007
|
}
|
|
1008
|
+
const trimmed = key.trim();
|
|
1009
|
+
const isToken = UUID_RE.test(trimmed);
|
|
1007
1010
|
try {
|
|
1008
1011
|
const res = await fetch(`${LICENSE_WORKER_URL}/verify`, {
|
|
1009
1012
|
method: "POST",
|
|
1010
1013
|
headers: { "Content-Type": "application/json" },
|
|
1011
|
-
body: JSON.stringify({
|
|
1014
|
+
body: JSON.stringify(isToken ? { token: trimmed } : { key: trimmed }),
|
|
1012
1015
|
signal: AbortSignal.timeout(8e3)
|
|
1013
1016
|
});
|
|
1014
1017
|
if (!res.ok) {
|