vibefast-cli 0.1.3 → 0.1.4
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/cloudflare-worker/worker.js +14 -6
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
|
@@ -49,27 +49,35 @@ async function validateLicenseWithLemon(licenseKey, env) {
|
|
|
49
49
|
body: JSON.stringify({ license_key: licenseKey }),
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
+
let payload = null;
|
|
53
|
+
try {
|
|
54
|
+
payload = await res.json();
|
|
55
|
+
} catch (err) {
|
|
56
|
+
console.error("[Worker] Failed to parse LemonSqueezy response", err);
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
if (!res.ok) {
|
|
53
|
-
const detail =
|
|
60
|
+
const detail =
|
|
61
|
+
(payload && (payload.error || payload.message)) || res.statusText;
|
|
54
62
|
console.error(
|
|
55
63
|
`[Worker] LemonSqueezy validation failed: ${res.status} ${res.statusText} ${detail}`
|
|
56
64
|
);
|
|
57
65
|
return {
|
|
58
66
|
ok: false,
|
|
59
|
-
status: res.status
|
|
67
|
+
status: res.status,
|
|
60
68
|
message:
|
|
61
69
|
res.status === 401
|
|
62
70
|
? "License validation is unauthorized. Check your LemonSqueezy API key."
|
|
63
|
-
: "Unable to validate license at this time.",
|
|
71
|
+
: detail || "Unable to validate license at this time.",
|
|
64
72
|
};
|
|
65
73
|
}
|
|
66
74
|
|
|
67
|
-
const data =
|
|
68
|
-
if (!data
|
|
75
|
+
const data = payload;
|
|
76
|
+
if (!data?.valid) {
|
|
69
77
|
return {
|
|
70
78
|
ok: false,
|
|
71
79
|
status: 401,
|
|
72
|
-
message: "License key is invalid.",
|
|
80
|
+
message: data?.error || "License key is invalid.",
|
|
73
81
|
};
|
|
74
82
|
}
|
|
75
83
|
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
-
import pkg from '../package.json'
|
|
3
|
+
import pkg from '../package.json' with { type: 'json' };
|
|
4
4
|
import { addCommand } from './commands/add.js';
|
|
5
5
|
import { removeCommand } from './commands/remove.js';
|
|
6
6
|
import { listCommand } from './commands/list.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,GAAG,MAAM,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,IAAI,CAAC;KACV,WAAW,CAAC,oDAAoD,CAAC;KACjE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC;AAEnC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAC/B,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAElC,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { Command } from 'commander';
|
|
4
|
-
import pkg from '../package.json'
|
|
4
|
+
import pkg from '../package.json' with { type: 'json' };
|
|
5
5
|
import { addCommand } from './commands/add.js';
|
|
6
6
|
import { removeCommand } from './commands/remove.js';
|
|
7
7
|
import { listCommand } from './commands/list.js';
|