web-manager 4.1.39 → 4.1.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.
- package/CHANGELOG.md +11 -0
- package/CLAUDE.md +5 -5
- package/dist/index.js +1 -1
- package/dist/modules/auth.js +8 -5
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
14
14
|
- `Fixed` for any bug fixes.
|
|
15
15
|
- `Security` in case of vulnerabilities.
|
|
16
16
|
|
|
17
|
+
---
|
|
18
|
+
## [4.1.41] - 2026-05-10
|
|
19
|
+
### Changed
|
|
20
|
+
- Bumped dependencies: `@sentry/browser` ^10.47.0 → ^10.52.0, `firebase` ^12.11.0 → ^12.13.0, `prepare-package` ^2.0.7 → ^2.1.0.
|
|
21
|
+
- Added empty `hooks: {}` to `preparePackage` config to align with prepare-package 2.1.0 schema.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
## [4.1.40] - 2026-05-10
|
|
25
|
+
### Changed
|
|
26
|
+
- **BREAKING (internal)**: `_resolveUsage()` now reads `config.payment.products` instead of `config.payment.plans`. Aligns with OMEGA's canonical shape (the SSOT) — same key name in BEM, UJM, EM. No backwards-compat shim; consumers must use `payment.products`. Default in `_processConfiguration()` updated from `plans: []` to `products: []`. Renamed local vars `plan`/`plans`/`planConfig` → `productId`/`products`/`product`. CLAUDE.md updated.
|
|
27
|
+
|
|
17
28
|
---
|
|
18
29
|
## [4.1.39] - 2026-04-10
|
|
19
30
|
### Changed
|
package/CLAUDE.md
CHANGED
|
@@ -153,7 +153,7 @@ document.body.addEventListener('click', (e) => {
|
|
|
153
153
|
- **Class**: `Auth`
|
|
154
154
|
- **Key Methods**: `listen(options, callback)`, `isAuthenticated()`, `getUser()`, `signInWithEmailAndPassword()`, `signOut()`, `getIdToken()`, `resolveSubscription(account?)`
|
|
155
155
|
- **Bindings**: Updates `auth` and `usage` context on auth settle
|
|
156
|
-
- **Usage Resolution**: `_resolveUsage(state)` merges `account.usage` (Firestore) with
|
|
156
|
+
- **Usage Resolution**: `_resolveUsage(state)` merges `account.usage` (Firestore) with product limits from `config.payment.products` (OMEGA-canonical shape — same key name in BEM, UJM, and EM) to produce the `usage` bindings key (e.g., `{ credits: { monthly: 5, limit: 100 } }`)
|
|
157
157
|
|
|
158
158
|
#### resolveSubscription(account?)
|
|
159
159
|
Derives calculated subscription fields from raw account data. Returns only fields that require derivation logic — raw data (product.id, status, trial, cancellation) lives on `account.subscription` directly.
|
|
@@ -269,13 +269,13 @@ Current test coverage is minimal - focuses on configuration and storage.
|
|
|
269
269
|
|
|
270
270
|
### Modifying Configuration Defaults
|
|
271
271
|
1. Edit `_processConfiguration()` in `src/index.js`
|
|
272
|
-
2. Add to `defaults` object (e.g., `payment: { processors: {},
|
|
272
|
+
2. Add to `defaults` object (e.g., `payment: { processors: {}, products: [] }`)
|
|
273
273
|
3. Document in README.md Configuration section
|
|
274
274
|
|
|
275
275
|
### Payment Configuration
|
|
276
|
-
Payment config
|
|
277
|
-
- `processors`: Stripe, PayPal,
|
|
278
|
-
- `
|
|
276
|
+
Payment config shape mirrors OMEGA (the SSOT) — same key names used in BEM, UJM, and EM:
|
|
277
|
+
- `processors`: Stripe, PayPal, Chargebee, Coinbase (publishable keys / client IDs)
|
|
278
|
+
- `products`: Array of `{ id, name, type, limits: { feature: N }, prices, trial, paypal, stripe, chargebee }` — used to resolve usage limits on the frontend AND drive checkout flows
|
|
279
279
|
|
|
280
280
|
### Adding a Data Binding Action
|
|
281
281
|
1. Edit `_executeAction()` in `src/modules/bindings.js`
|
package/dist/index.js
CHANGED
package/dist/modules/auth.js
CHANGED
|
@@ -256,14 +256,17 @@ class Auth {
|
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
// Resolve usage bindings from account data +
|
|
259
|
+
// Resolve usage bindings from account data + product limits from config.
|
|
260
260
|
// Returns: { credits: { monthly: 5, limit: 100 }, ... }
|
|
261
|
+
//
|
|
262
|
+
// The product catalog lives at `config.payment.products` (OMEGA canonical
|
|
263
|
+
// shape — matches BEM, UJM, and EM). Each product entry has `{ id, limits: {...} }`.
|
|
261
264
|
_resolveUsage(state) {
|
|
262
265
|
const accountUsage = state.account?.usage || {};
|
|
263
|
-
const
|
|
264
|
-
const
|
|
265
|
-
const
|
|
266
|
-
const limits
|
|
266
|
+
const productId = state.resolved?.plan || 'basic';
|
|
267
|
+
const products = this.manager.config.payment?.products || [];
|
|
268
|
+
const product = products.find(p => p.id === productId) || {};
|
|
269
|
+
const limits = product.limits || {};
|
|
267
270
|
|
|
268
271
|
// Merge current usage with limits for each feature
|
|
269
272
|
const usage = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-manager",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.41",
|
|
4
4
|
"description": "Easily access important variables such as the query string, current domain, and current page in a single object.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -36,20 +36,21 @@
|
|
|
36
36
|
"input": "./src",
|
|
37
37
|
"output": "./dist",
|
|
38
38
|
"replace": {},
|
|
39
|
-
"type": "copy"
|
|
39
|
+
"type": "copy",
|
|
40
|
+
"hooks": {}
|
|
40
41
|
},
|
|
41
42
|
"notes": {
|
|
42
43
|
"@sentry/browser": "Resolved by using OVERRIDES in web-manager (lighthouse is the issue"
|
|
43
44
|
},
|
|
44
45
|
"dependencies": {
|
|
45
|
-
"@sentry/browser": "^10.
|
|
46
|
+
"@sentry/browser": "^10.52.0",
|
|
46
47
|
"chatsy": "^2.0.14",
|
|
47
|
-
"firebase": "^12.
|
|
48
|
+
"firebase": "^12.13.0",
|
|
48
49
|
"itwcw-package-analytics": "^1.0.8",
|
|
49
50
|
"lodash": "^4.18.1"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
53
|
"mocha": "^11.7.5",
|
|
53
|
-
"prepare-package": "^2.0
|
|
54
|
+
"prepare-package": "^2.1.0"
|
|
54
55
|
}
|
|
55
56
|
}
|