@buoy-gg/license 7.0.22 → 7.0.24

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.
Files changed (68) hide show
  1. package/LICENSE +46 -0
  2. package/lib/commonjs/DeviceRegistrationModal.js +1 -189
  3. package/lib/commonjs/LicenseManager.js +14 -610
  4. package/lib/commonjs/api.js +1 -172
  5. package/lib/commonjs/cacheSignature.js +15 -0
  6. package/lib/commonjs/config.js +16 -28
  7. package/lib/commonjs/device-info.js +1 -93
  8. package/lib/commonjs/device-info.web.js +1 -227
  9. package/lib/commonjs/fingerprint.js +1 -30
  10. package/lib/commonjs/fingerprint.web.js +1 -30
  11. package/lib/commonjs/hooks.js +13 -120
  12. package/lib/commonjs/index.js +17 -106
  13. package/lib/commonjs/index.web.js +17 -98
  14. package/lib/commonjs/tier.js +16 -0
  15. package/lib/commonjs/types.js +1 -1
  16. package/lib/commonjs/weekendPro.js +15 -41
  17. package/lib/module/DeviceRegistrationModal.js +1 -185
  18. package/lib/module/LicenseManager.js +14 -607
  19. package/lib/module/api.js +1 -165
  20. package/lib/module/cacheSignature.js +15 -0
  21. package/lib/module/config.js +16 -24
  22. package/lib/module/device-info.js +1 -87
  23. package/lib/module/device-info.web.js +1 -220
  24. package/lib/module/fingerprint.js +1 -10
  25. package/lib/module/fingerprint.web.js +1 -10
  26. package/lib/module/hooks.js +13 -114
  27. package/lib/module/index.js +15 -54
  28. package/lib/module/index.web.js +15 -52
  29. package/lib/module/tier.js +16 -0
  30. package/lib/module/types.js +1 -1
  31. package/lib/module/weekendPro.js +15 -37
  32. package/lib/typescript/commonjs/LicenseManager.d.ts +31 -6
  33. package/lib/typescript/commonjs/LicenseManager.d.ts.map +1 -1
  34. package/lib/typescript/commonjs/cacheSignature.d.ts +42 -0
  35. package/lib/typescript/commonjs/cacheSignature.d.ts.map +1 -0
  36. package/lib/typescript/commonjs/config.d.ts +62 -1
  37. package/lib/typescript/commonjs/config.d.ts.map +1 -1
  38. package/lib/typescript/commonjs/hooks.d.ts +27 -5
  39. package/lib/typescript/commonjs/hooks.d.ts.map +1 -1
  40. package/lib/typescript/commonjs/index.d.ts +20 -2
  41. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  42. package/lib/typescript/commonjs/index.web.d.ts +20 -2
  43. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  44. package/lib/typescript/commonjs/tier.d.ts +55 -0
  45. package/lib/typescript/commonjs/tier.d.ts.map +1 -0
  46. package/lib/typescript/commonjs/types.d.ts +44 -0
  47. package/lib/typescript/commonjs/types.d.ts.map +1 -1
  48. package/lib/typescript/commonjs/weekendPro.d.ts +30 -7
  49. package/lib/typescript/commonjs/weekendPro.d.ts.map +1 -1
  50. package/lib/typescript/module/LicenseManager.d.ts +31 -6
  51. package/lib/typescript/module/LicenseManager.d.ts.map +1 -1
  52. package/lib/typescript/module/cacheSignature.d.ts +42 -0
  53. package/lib/typescript/module/cacheSignature.d.ts.map +1 -0
  54. package/lib/typescript/module/config.d.ts +62 -1
  55. package/lib/typescript/module/config.d.ts.map +1 -1
  56. package/lib/typescript/module/hooks.d.ts +27 -5
  57. package/lib/typescript/module/hooks.d.ts.map +1 -1
  58. package/lib/typescript/module/index.d.ts +20 -2
  59. package/lib/typescript/module/index.d.ts.map +1 -1
  60. package/lib/typescript/module/index.web.d.ts +20 -2
  61. package/lib/typescript/module/index.web.d.ts.map +1 -1
  62. package/lib/typescript/module/tier.d.ts +55 -0
  63. package/lib/typescript/module/tier.d.ts.map +1 -0
  64. package/lib/typescript/module/types.d.ts +44 -0
  65. package/lib/typescript/module/types.d.ts.map +1 -1
  66. package/lib/typescript/module/weekendPro.d.ts +30 -7
  67. package/lib/typescript/module/weekendPro.d.ts.map +1 -1
  68. package/package.json +7 -4
@@ -0,0 +1,55 @@
1
+ /*!
2
+ * PROPRIETARY — Buoy Pro license enforcement. NOT open source.
3
+ *
4
+ * Copyright (c) Buoy. All rights reserved. Licensed under the Buoy EULA
5
+ * (https://buoy.gg/terms), not an OSS license.
6
+ *
7
+ * This file is part of the technological measure that controls access to paid
8
+ * Buoy Pro features: it decides which tier a validated key grants. Modifying,
9
+ * patching, aliasing, stubbing, or otherwise altering it so that Pro features
10
+ * unlock without a valid license is a breach of the EULA and, in the United
11
+ * States, circumvention of an access control under 17 U.S.C. § 1201 — which
12
+ * applies whether or not any code is copied.
13
+ *
14
+ * Pro is $9/mo, and is free for everyone every weekend. Buy a key at
15
+ * https://buoy.gg or use it free on Saturday and Sunday.
16
+ */
17
+ import type { BuoyTier, KeygenLicense } from "./types";
18
+ /**
19
+ * Which tier a *validated* license grants.
20
+ *
21
+ * Only ever called with a license the server already accepted — an invalid or
22
+ * absent key never reaches here, it resolves to "anonymous" upstream.
23
+ *
24
+ * The policy is the primary signal because Keygen sets it on every
25
+ * create/upgrade/downgrade, and free↔paid is implemented as a policy swap that
26
+ * keeps the same key. `metadata.plan` is only a fallback for licenses created
27
+ * outside that flow.
28
+ *
29
+ * Unrecognized policies resolve to "pro" **on purpose**. A license hand-made in
30
+ * the Keygen dashboard (a comp, a support extension, a future plan whose ID
31
+ * predates this build) has no metadata and an unknown policy — and those are
32
+ * always paid. The opposite default would silently downgrade paying customers
33
+ * every time a policy is added before clients ship. The blast radius is small:
34
+ * reaching this branch at all requires already holding a key our license server
35
+ * validated, and free keys ARE recognized.
36
+ */
37
+ export declare function resolveTier(license: KeygenLicense): BuoyTier;
38
+ /**
39
+ * The tier to fall back to when validation returns a FATAL error.
40
+ *
41
+ * `EXPIRED` is treated as **free**, not anonymous. An expired key still proves
42
+ * an account exists, and it is not even a stable state: the website's
43
+ * `subscription_expired` webhook calls `downgradeLicenseToFree()`, which swaps
44
+ * that very key onto the Free policy with a null expiry. So free is the steady
45
+ * state, and anonymous is only the gap before the webhook lands (or before the
46
+ * `/api/licenses` self-heal runs). Dropping someone to the trial tier in that
47
+ * window would hit them at the exact moment they are deciding whether to
48
+ * re-subscribe.
49
+ *
50
+ * Every other fatal code means either "not our key" (`NOT_FOUND`,
51
+ * `PRODUCT_SCOPE_MISMATCH`) or a deliberate revocation (`SUSPENDED`, `BANNED`).
52
+ * Nothing about those proves an account, so they fall to anonymous.
53
+ */
54
+ export declare function tierAfterFatalError(code: string): BuoyTier;
55
+ //# sourceMappingURL=tier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tier.d.ts","sourceRoot":"","sources":["../../../src/tier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,QAAQ,CAgB5D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAE1D"}
@@ -3,6 +3,29 @@
3
3
  *
4
4
  * Simplified: No device/machine management - we trust our customers.
5
5
  */
6
+ /**
7
+ * The three access tiers.
8
+ *
9
+ * - "anonymous" — no credential, or one that failed validation. A trial tier:
10
+ * every tool is visible, with much smaller caps.
11
+ * - "free" — a validated key on the Free policy. Today's free tier.
12
+ * - "pro" — a validated key on the Solo or Business policy.
13
+ *
14
+ * Deliberately NOT a boolean: the free ceiling never moves, so anonymous is
15
+ * carved out *below* free rather than free being extended.
16
+ */
17
+ export type BuoyTier = "anonymous" | "free" | "pro";
18
+ /**
19
+ * What granted the current tier.
20
+ *
21
+ * - "key" — a Keygen license key (developers; build-time credential).
22
+ * - "session" — a logged-in Business seat (QA/support on distributed builds).
23
+ * NOT IMPLEMENTED YET; the type exists so every downstream layer
24
+ * reads `tier` instead of "does a key exist", which is what makes
25
+ * adding on-device login additive rather than a rewrite.
26
+ * - "none" — anonymous.
27
+ */
28
+ export type TierSource = "key" | "session" | "none";
6
29
  export interface LicenseValidationResult {
7
30
  valid: boolean;
8
31
  code: "VALID" | "NOT_FOUND" | "SUSPENDED" | "EXPIRED" | "OVERDUE" | "NO_MACHINE" | "NO_MACHINES" | "TOO_MANY_MACHINES" | "TOO_MANY_CORES" | "TOO_MANY_PROCESSES" | "FINGERPRINT_SCOPE_MISMATCH" | "HEARTBEAT_NOT_STARTED" | "HEARTBEAT_DEAD" | "PRODUCT_SCOPE_REQUIRED" | "PRODUCT_SCOPE_MISMATCH" | "POLICY_SCOPE_REQUIRED" | "POLICY_SCOPE_MISMATCH" | "MACHINE_SCOPE_REQUIRED" | "MACHINE_SCOPE_MISMATCH" | "ENTITLEMENTS_MISSING" | "ENTITLEMENTS_SCOPE_MISMATCH" | "BANNED";
@@ -132,6 +155,15 @@ export interface CachedLicense {
132
155
  licenseId: string;
133
156
  valid: boolean;
134
157
  isPro: boolean;
158
+ /**
159
+ * The tier this key resolved to. Covered by the cache checksum — without
160
+ * that, a blob could be hand-edited from "free" to "pro" and still verify.
161
+ *
162
+ * Optional for backward compatibility: a cache written before tiers existed
163
+ * has no `tier` and is read as "pro", because the only way to hold a
164
+ * validated cache back then was to have bought one.
165
+ */
166
+ tier?: BuoyTier;
135
167
  expiresAt: string | null;
136
168
  cachedAt: number;
137
169
  lastValidatedAt: number;
@@ -139,11 +171,23 @@ export interface CachedLicense {
139
171
  fingerprint?: string;
140
172
  /** Device name */
141
173
  deviceName?: string;
174
+ /**
175
+ * Tamper-evident checksum over the licensing fields (see cacheSignature.ts).
176
+ * A blob whose checksum is missing or doesn't match is not trusted for Pro.
177
+ * Deliberately excludes fingerprint/deviceName so completing device
178
+ * registration can update those without re-signing.
179
+ */
180
+ sig?: string;
142
181
  }
143
182
  export interface LicenseState {
144
183
  isInitialized: boolean;
145
184
  isValidating: boolean;
185
+ /** Convenience mirror of `tier === "pro"`. Kept so existing callers work. */
146
186
  isPro: boolean;
187
+ /** The access tier. This is the value gates and caps should read. */
188
+ tier: BuoyTier;
189
+ /** What granted `tier`. */
190
+ tierSource: TierSource;
147
191
  licenseKey: string | null;
148
192
  error: string | null;
149
193
  expiresAt: Date | null;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EACA,OAAO,GACP,WAAW,GACX,WAAW,GACX,SAAS,GACT,SAAS,GACT,YAAY,GACZ,aAAa,GACb,mBAAmB,GACnB,gBAAgB,GAChB,oBAAoB,GACpB,4BAA4B,GAC5B,uBAAuB,GACvB,gBAAgB,GAChB,wBAAwB,GACxB,wBAAwB,GACxB,uBAAuB,GACvB,uBAAuB,GACvB,wBAAwB,GACxB,wBAAwB,GACxB,sBAAsB,GACtB,6BAA6B,GAC7B,QAAQ,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;QACnE,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,OAAO,CAAC;QACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,SAAS,EAAE,OAAO,CAAC;QACnB,QAAQ,EAAE,OAAO,CAAC;QAClB,MAAM,EAAE,OAAO,CAAC;QAChB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,QAAQ,EAAE,MAA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,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,6EAA6E;IAC7E,KAAK,EAAE,OAAO,CAAC;IACf,qEAAqE;IACrE,IAAI,EAAE,QAAQ,CAAC;IACf,2BAA2B;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,YAAY,GACZ,WAAW,GACX,OAAO,GACP,aAAa,CAAC;AAElB,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC"}
@@ -1,12 +1,19 @@
1
- /**
2
- * Weekend Pass — Pro is free for everyone on weekends.
1
+ /*!
2
+ * PROPRIETARY — Buoy Pro license enforcement. NOT open source.
3
+ *
4
+ * Copyright (c) Buoy. All rights reserved. Licensed under the Buoy EULA
5
+ * (https://buoy.gg/terms), not an OSS license.
3
6
  *
4
- * A no-strings way to let people try Pro on their personal projects (most
5
- * folks don't work weekends, so it's great for side projects but not the
6
- * Mon–Fri day job). Evaluated in LOCAL time: active all of Saturday & Sunday.
7
+ * Despite its small size, this file is a technological measure that controls
8
+ * access to paid Buoy Pro features: every `useIsPro()` gate in every Buoy tool
9
+ * unlocks when `isWeekendFreePro()` returns true. Modifying, patching,
10
+ * aliasing, stubbing, or otherwise altering it so that Pro features unlock
11
+ * without a valid license is a breach of the EULA and, in the United States,
12
+ * circumvention of an access control under 17 U.S.C. § 1201 — which applies
13
+ * whether or not any code is copied.
7
14
  *
8
- * This is intentionally tiny and dependency-free so it can be shared by every
9
- * `useIsPro()` gate without pulling in extra packages.
15
+ * Pro is $9/mo, and is free for everyone every weekend. Buy a key at
16
+ * https://buoy.gg or use it free on Saturday and Sunday.
10
17
  */
11
18
  /** Whether the Weekend Pass is active right now (local Saturday or Sunday). */
12
19
  export declare function isWeekendFreePro(now?: Date): boolean;
@@ -16,4 +23,20 @@ export declare function isWeekendFreePro(now?: Date): boolean;
16
23
  * midnight without a reload.
17
24
  */
18
25
  export declare function useWeekendFreePro(): boolean;
26
+ /**
27
+ * Whether the Weekend Pass applies to a given tier.
28
+ *
29
+ * The pass is free Pro every Saturday and Sunday — and it used to apply to
30
+ * everyone, including people with no key at all. That made the anonymous tier
31
+ * incoherent: two days in seven, having no account beat having one.
32
+ *
33
+ * Requiring a (free) key is the rare change that costs Pro nothing. It grants
34
+ * no new value — the pass already existed and was already given away — it only
35
+ * withdraws it from anonymous, which makes claiming a key worth something and
36
+ * leaves every paying customer exactly where they were.
37
+ *
38
+ * Takes the tier as an argument rather than reading it, so this module stays a
39
+ * pure calendar utility and `hooks.ts` can keep importing it without a cycle.
40
+ */
41
+ export declare function weekendPassAppliesTo(tier: "anonymous" | "free" | "pro", weekend: boolean): boolean;
19
42
  //# sourceMappingURL=weekendPro.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"weekendPro.d.ts","sourceRoot":"","sources":["../../../src/weekendPro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,IAAiB,GAAG,OAAO,CAGhE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAY3C"}
1
+ {"version":3,"file":"weekendPro.d.ts","sourceRoot":"","sources":["../../../src/weekendPro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAiBH,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,IAAiB,GAAG,OAAO,CAGhE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAY3C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK,EAClC,OAAO,EAAE,OAAO,GACf,OAAO,CAOT"}
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@buoy-gg/license",
3
- "version": "7.0.22",
3
+ "version": "7.0.24",
4
4
  "description": "License validation for React Buoy Pro features",
5
+ "license": "SEE LICENSE IN LICENSE",
5
6
  "main": "lib/commonjs/index.js",
6
7
  "module": "lib/module/index.js",
7
8
  "types": "lib/typescript/module/index.d.ts",
@@ -22,7 +23,8 @@
22
23
  "./package.json": "./package.json"
23
24
  },
24
25
  "files": [
25
- "lib"
26
+ "lib",
27
+ "LICENSE"
26
28
  ],
27
29
  "sideEffects": false,
28
30
  "dependencies": {},
@@ -59,7 +61,8 @@
59
61
  "devDependencies": {
60
62
  "@types/react": "^19.1.0",
61
63
  "@types/react-native": "^0.73.0",
62
- "typescript": "~5.8.3"
64
+ "typescript": "~5.8.3",
65
+ "esbuild": "^0.25.0"
63
66
  },
64
67
  "repository": {
65
68
  "type": "git",
@@ -74,7 +77,7 @@
74
77
  "tag": "latest"
75
78
  },
76
79
  "scripts": {
77
- "build": "bob build",
80
+ "build": "bob build && node ./scripts/minify-lib.mjs",
78
81
  "typecheck": "tsc --noEmit",
79
82
  "clean": "rimraf lib",
80
83
  "test": "pnpm run typecheck"