@blueprintitai/shop-os-install 0.5.15 → 0.5.16
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/bin/shop-os-install.js +21 -0
- package/package.json +1 -1
package/bin/shop-os-install.js
CHANGED
|
@@ -351,6 +351,25 @@ async function validateLicense(key) {
|
|
|
351
351
|
return { ok: true, license: body };
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
+
// Fire-and-forget activation ping. GET /refresh bumps the license record's
|
|
355
|
+
// last_seen and activations counter, so the admin dashboard's activations
|
|
356
|
+
// column counts completed installs. Best-effort by design: not awaited at the
|
|
357
|
+
// call site, 5s abort, and any failure is swallowed — the install outcome must
|
|
358
|
+
// never depend on it.
|
|
359
|
+
async function bumpActivation(key) {
|
|
360
|
+
try {
|
|
361
|
+
const controller = new AbortController();
|
|
362
|
+
const timer = setTimeout(() => controller.abort(), 5000);
|
|
363
|
+
await fetch(`${LICENSE_SERVER}/refresh?key=${encodeURIComponent(key)}`, {
|
|
364
|
+
headers: { "user-agent": `shop-os-installer/${VERSION}` },
|
|
365
|
+
signal: controller.signal,
|
|
366
|
+
});
|
|
367
|
+
clearTimeout(timer);
|
|
368
|
+
} catch {
|
|
369
|
+
// best-effort only
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
354
373
|
// ---------- claude code config ----------
|
|
355
374
|
|
|
356
375
|
function readJSON(path, fallback) {
|
|
@@ -1110,6 +1129,8 @@ async function main() {
|
|
|
1110
1129
|
const result = await validateLicense(key);
|
|
1111
1130
|
if (result.ok) {
|
|
1112
1131
|
license = { ...result.license, key };
|
|
1132
|
+
// Not awaited: completes in the background while marketplaces clone.
|
|
1133
|
+
bumpActivation(key);
|
|
1113
1134
|
ok(`License valid for ${bold(license.customer)}`);
|
|
1114
1135
|
info(`Product: ${license.product}`);
|
|
1115
1136
|
info(`Entitlements: ${license.entitlements.join(", ")}`);
|
package/package.json
CHANGED