@commet/node 5.0.0 → 5.2.0
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/README.md +16 -3
- package/dist/index.d.mts +414 -345
- package/dist/index.d.ts +414 -345
- package/dist/index.js +85 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +85 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ await commet.subscriptions.create({
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
// Track usage events
|
|
62
|
-
await commet.usage.
|
|
62
|
+
await commet.usage.track({
|
|
63
63
|
feature: 'api_call',
|
|
64
64
|
value: 1,
|
|
65
65
|
customerId: 'cus_123'
|
|
@@ -68,12 +68,25 @@ await commet.usage.create({
|
|
|
68
68
|
// Manage seats
|
|
69
69
|
await commet.seats.add({
|
|
70
70
|
customerId: 'cus_123',
|
|
71
|
-
|
|
71
|
+
featureCode: 'admin',
|
|
72
72
|
count: 5
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
+
// Track durable quota (e.g. projects, tasks)
|
|
76
|
+
await commet.quota.add({
|
|
77
|
+
customerId: 'cus_123',
|
|
78
|
+
featureCode: 'projects',
|
|
79
|
+
count: 5
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// Read the current quota allowance (held vs included)
|
|
83
|
+
const projects = await commet.quota.get({
|
|
84
|
+
customerId: 'cus_123',
|
|
85
|
+
featureCode: 'projects'
|
|
86
|
+
});
|
|
87
|
+
|
|
75
88
|
// Check feature access
|
|
76
|
-
const feature = await commet.features.
|
|
89
|
+
const feature = await commet.features.get({
|
|
77
90
|
externalId: 'user_123',
|
|
78
91
|
code: 'api_calls'
|
|
79
92
|
});
|