@buoy-gg/license 7.0.39 → 7.0.41

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.
@@ -0,0 +1,55 @@
1
+ "use client";
2
+ import{a as L,b as m,c as P,d as A,e as t}from"./chunks/chunk-GRUXDUJG.mjs";import{useEffect as b,useState as y}from"react";function c(s=new Date){let e=s.getDay();return e===0||e===6}function l(){let[s,e]=y(()=>c());return b(()=>{let r=setInterval(()=>{let n=c();e(o=>o===n?o:n)},6e4);return()=>clearInterval(r)},[]),s}function a(s,e){return e&&s}import{useState as x,useEffect as g,useCallback as d}from"react";function i(){let[s,e]=x(t.getState());g(()=>{let o=t.subscribe(u=>{e(t.getState())});return t.initialize().then(()=>{e(t.getState())}),o},[]);let r=d(async o=>{let u=await t.setLicenseKey(o,{force:!0});return e(t.getState()),u},[]),n=d(async()=>{await t.clearLicense(),e(t.getState())},[]);return{...s,setLicenseKey:r,clearLicense:n}}function k(){return i().access}function w(){let{tier:s,isInitialized:e}=i();return e?s:"free"}function T(s){let{isPro:e,isInitialized:r,isValidating:n}=i();return{hasAccess:e,isPro:e,isLoading:!r||n}}function S(){let{isPro:s,isInitialized:e,access:r}=i(),n=a(r.status==="admitted",l());return e&&s||n}function v(){let{isPro:s,isInitialized:e,access:r}=i(),n=e&&s,o=a(r.status==="admitted",l())&&!n;return{isPro:n||o,isLicensed:n,isWeekendFree:o,reason:n?"licensed":o?"weekend":null}}async function C(s){let{LicenseManager:e}=await import("./chunks/LicenseManager-JHLFWSUD.mjs");return await e.initialize(),e.setLicenseKey(s)}function f(){return a(t.hasAccountAccess(),c())}function D(){return t.isPro()?!0:f()}function V(s){return t.hasEntitlement(s)?!0:f()}export{t as LicenseManager,L as LicenseTransportError,V as hasEntitlement,P as isBuoyToken,D as isPro,m as isTransientLicenseError,c as isWeekendFreePro,A as resolveAccountAccess,C as setLicenseKey,k as useAccountAccess,T as useFeatureAccess,S as useIsPro,i as useLicense,v as useProAccess,w as useTier,l as useWeekendFreePro};
3
+ /*!
4
+ * PROPRIETARY — Buoy Pro license enforcement. NOT open source.
5
+ *
6
+ * Copyright (c) Buoy. All rights reserved. Licensed under the Buoy EULA
7
+ * (https://buoy.gg/terms), not an OSS license.
8
+ *
9
+ * Despite its small size, this file is a technological measure that controls
10
+ * access to paid Buoy Pro features: every `useIsPro()` gate in every Buoy tool
11
+ * unlocks when `isWeekendFreePro()` returns true. Modifying, patching,
12
+ * aliasing, stubbing, or otherwise altering it so that Pro features unlock
13
+ * without a valid license is a breach of the EULA and, in the United States,
14
+ * circumvention of an access control under 17 U.S.C. § 1201 — which applies
15
+ * whether or not any code is copied.
16
+ *
17
+ * Pro is $9/mo, and is free every weekend for anyone holding a key —
18
+ * including a free one (`npx buoy login`). Buy a key at
19
+ * https://buoy.gg or use it free on Saturday and Sunday.
20
+ */
21
+ /*!
22
+ * PROPRIETARY — Buoy Pro license enforcement. NOT open source.
23
+ *
24
+ * Copyright (c) Buoy. All rights reserved. Licensed under the Buoy EULA
25
+ * (https://buoy.gg/terms), not an OSS license.
26
+ *
27
+ * This file is the technological measure that controls access to paid Buoy Pro
28
+ * features: `useIsPro()` here is the single gate every Buoy tool consults.
29
+ * Modifying, patching, aliasing, stubbing, or otherwise altering it so that Pro
30
+ * features unlock without a valid license is a breach of the EULA and, in the
31
+ * United States, circumvention of an access control under 17 U.S.C. § 1201 —
32
+ * which applies whether or not any code is copied.
33
+ *
34
+ * Pro is $9/mo, and is free every weekend for anyone holding a key —
35
+ * including a free one (`npx buoy login`). Buy a key at
36
+ * https://buoy.gg or use it free on Saturday and Sunday.
37
+ */
38
+ /*!
39
+ * PROPRIETARY — Buoy Pro license enforcement. NOT open source.
40
+ *
41
+ * Copyright (c) Buoy. All rights reserved. Licensed under the Buoy EULA
42
+ * (https://buoy.gg/terms), not an OSS license.
43
+ *
44
+ * This package is the technological measure that controls access to paid Buoy
45
+ * Pro features. Modifying, patching, aliasing, stubbing, or otherwise altering
46
+ * it — including replacing this module via a bundler alias, package override,
47
+ * or postinstall patch — so that Pro features unlock without a valid license is
48
+ * a breach of the EULA and, in the United States, circumvention of an access
49
+ * control under 17 U.S.C. § 1201, which applies whether or not any code is
50
+ * copied.
51
+ *
52
+ * Pro is $9/mo, and is free every weekend for anyone holding a key —
53
+ * including a free one (`npx buoy login`). Buy a key at
54
+ * https://buoy.gg or use it free on Saturday and Sunday.
55
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/license",
3
- "version": "7.0.39",
3
+ "version": "7.0.41",
4
4
  "description": "License validation for React Buoy Pro features",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "main": "lib/commonjs/index.js",
@@ -13,7 +13,7 @@
13
13
  "react-native": "./lib/module/index.js",
14
14
  "browser": {
15
15
  "types": "./lib/typescript/module/index.web.d.ts",
16
- "default": "./lib/module/index.web.js"
16
+ "default": "./lib/web/index.mjs"
17
17
  },
18
18
  "import": {
19
19
  "types": "./lib/typescript/module/index.d.ts",
@@ -34,6 +34,10 @@
34
34
  "types": "./lib/typescript/commonjs/headless.d.ts",
35
35
  "default": "./lib/commonjs/headless.js"
36
36
  }
37
+ },
38
+ "./web": {
39
+ "types": "./lib/typescript/module/index.web.d.ts",
40
+ "default": "./lib/web/index.mjs"
37
41
  }
38
42
  },
39
43
  "files": [
@@ -43,7 +47,9 @@
43
47
  "sideEffects": false,
44
48
  "peerDependencies": {
45
49
  "react": "*",
46
- "react-native": "*"
50
+ "react-native": "*",
51
+ "react-native-web": "^0.21.0",
52
+ "react-dom": ">=18"
47
53
  },
48
54
  "react-native-builder-bob": {
49
55
  "source": "src",
@@ -100,10 +106,22 @@
100
106
  "dependencies": {
101
107
  "tweetnacl": "^1.0.3"
102
108
  },
109
+ "peerDependenciesMeta": {
110
+ "react-native": {
111
+ "optional": true
112
+ },
113
+ "react-native-web": {
114
+ "optional": true
115
+ },
116
+ "react-dom": {
117
+ "optional": true
118
+ }
119
+ },
103
120
  "scripts": {
104
- "build": "bob build && node ./scripts/minify-lib.mjs",
121
+ "build": "bob build && node ./scripts/minify-lib.mjs && pnpm run build:web",
105
122
  "typecheck": "tsc --noEmit",
106
123
  "clean": "rimraf lib",
107
- "test": "pnpm run typecheck"
124
+ "test": "pnpm run typecheck",
125
+ "build:web": "node ../../scripts/build-web.mjs license"
108
126
  }
109
127
  }