@commet/node 9.1.0 → 9.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.
@@ -0,0 +1,86 @@
1
+ ---
2
+ lastModified: 2026-08-18
3
+ title: "plan_grant.expired"
4
+ description: "A plan grant expired."
5
+ full: true
6
+ ---
7
+
8
+ All webhook payloads follow a consistent top-level structure with event-specific data nested within the `data` object.
9
+
10
+ - `id` (string) — The public plan grant ID.
11
+ - `customerId` (string) — The public customer ID.
12
+ - `subscriptionId` (string) — The public subscription ID.
13
+ - `basePlanId` (string) — The public ID of the subscribed base plan.
14
+ - `targetPlanId` (string) — The public ID of the plan whose access was granted.
15
+ - `targetPlanReleaseId` (string) — The public ID of the immutable target plan release.
16
+ - `status` ("active" | "expired" | "revoked") — The plan grant status at this transition.
17
+ - `duration` ("cycles" | "until\_date" | "until\_revoked") — How the plan grant duration is defined at this transition.
18
+ - `durationCycles` (integer | null) — The cycle count when duration is cycles.
19
+ - `startsAt` (string) — When the plan grant started.
20
+ - `expiresAt` (string | null) — The effective expiration deadline, if any.
21
+ - `reason` (string) — The reason recorded for this transition.
22
+ - `source` ("dashboard" | "api" | "system") — Where this transition originated.
23
+ - `revokedAt` (string | null) — When the plan grant was revoked, otherwise null.
24
+ - `createdAt` (string) — When the plan grant was created.
25
+ - `updatedAt` (string) — When the represented transition occurred.
26
+ - `events` (WebhookPlanGrantTimelineEvent\[]) — The grant timeline through the represented transition.
27
+
28
+ ```json
29
+ {
30
+ "event": "plan_grant.expired",
31
+ "timestamp": "2026-06-23T14:30:00.000Z",
32
+ "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
33
+ "mode": "live",
34
+ "apiVersion": "2026-07-31",
35
+ "data": {
36
+ "id": "pgr_1a2b3c4d",
37
+ "customerId": "user_123",
38
+ "subscriptionId": "sub_1a2b3c4d",
39
+ "basePlanId": "pln_starter",
40
+ "targetPlanId": "pln_pro",
41
+ "targetPlanReleaseId": "plr_1a2b3c4d",
42
+ "status": "expired",
43
+ "duration": "cycles",
44
+ "durationCycles": 2,
45
+ "startsAt": "2026-08-01T00:00:00.000Z",
46
+ "expiresAt": "2026-10-01T00:00:00.000Z",
47
+ "reason": "Two-month product evaluation",
48
+ "source": "system",
49
+ "revokedAt": null,
50
+ "createdAt": "2026-08-01T00:00:00.000Z",
51
+ "updatedAt": "2026-10-01T00:05:00.000Z",
52
+ "events": [
53
+ {
54
+ "id": "gre_1a2b3c4d",
55
+ "type": "created",
56
+ "reason": "Two-month product evaluation",
57
+ "source": "api",
58
+ "previousExpiresAt": null,
59
+ "expiresAt": "2026-10-01T00:00:00.000Z",
60
+ "duration": "cycles",
61
+ "durationCycles": 2,
62
+ "requestedExpiresAt": null,
63
+ "createdAt": "2026-08-01T00:00:00.000Z"
64
+ },
65
+ {
66
+ "id": "gre_9i0j1k2l",
67
+ "type": "expired",
68
+ "reason": "Two-month product evaluation",
69
+ "source": "system",
70
+ "previousExpiresAt": null,
71
+ "expiresAt": "2026-10-01T00:00:00.000Z",
72
+ "duration": null,
73
+ "durationCycles": null,
74
+ "requestedExpiresAt": null,
75
+ "createdAt": "2026-10-01T00:05:00.000Z"
76
+ }
77
+ ]
78
+ }
79
+ }
80
+ ```
81
+
82
+ ## When this fires
83
+
84
+ After an expired Plan Grant is durably closed by billing discovery or while creating its replacement. The payload is the old grant at expiration, and its last timeline event is `expired`.
85
+
86
+ `customer.state_changed` also fires with trigger `plan_access_ended` when billing discovery expires the grant.
@@ -0,0 +1,86 @@
1
+ ---
2
+ lastModified: 2026-08-18
3
+ title: "plan_grant.revoked"
4
+ description: "A plan grant was revoked."
5
+ full: true
6
+ ---
7
+
8
+ All webhook payloads follow a consistent top-level structure with event-specific data nested within the `data` object.
9
+
10
+ - `id` (string) — The public plan grant ID.
11
+ - `customerId` (string) — The public customer ID.
12
+ - `subscriptionId` (string) — The public subscription ID.
13
+ - `basePlanId` (string) — The public ID of the subscribed base plan.
14
+ - `targetPlanId` (string) — The public ID of the plan whose access was granted.
15
+ - `targetPlanReleaseId` (string) — The public ID of the immutable target plan release.
16
+ - `status` ("active" | "expired" | "revoked") — The plan grant status at this transition.
17
+ - `duration` ("cycles" | "until\_date" | "until\_revoked") — How the plan grant duration is defined at this transition.
18
+ - `durationCycles` (integer | null) — The cycle count when duration is cycles.
19
+ - `startsAt` (string) — When the plan grant started.
20
+ - `expiresAt` (string | null) — The effective expiration deadline, if any.
21
+ - `reason` (string) — The reason recorded for this transition.
22
+ - `source` ("dashboard" | "api" | "system") — Where this transition originated.
23
+ - `revokedAt` (string | null) — When the plan grant was revoked, otherwise null.
24
+ - `createdAt` (string) — When the plan grant was created.
25
+ - `updatedAt` (string) — When the represented transition occurred.
26
+ - `events` (WebhookPlanGrantTimelineEvent\[]) — The grant timeline through the represented transition.
27
+
28
+ ```json
29
+ {
30
+ "event": "plan_grant.revoked",
31
+ "timestamp": "2026-06-23T14:30:00.000Z",
32
+ "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
33
+ "mode": "live",
34
+ "apiVersion": "2026-07-31",
35
+ "data": {
36
+ "id": "pgr_1a2b3c4d",
37
+ "customerId": "user_123",
38
+ "subscriptionId": "sub_1a2b3c4d",
39
+ "basePlanId": "pln_starter",
40
+ "targetPlanId": "pln_pro",
41
+ "targetPlanReleaseId": "plr_1a2b3c4d",
42
+ "status": "revoked",
43
+ "duration": "until_revoked",
44
+ "durationCycles": null,
45
+ "startsAt": "2026-08-01T00:00:00.000Z",
46
+ "expiresAt": null,
47
+ "reason": "Evaluation completed",
48
+ "source": "api",
49
+ "revokedAt": "2026-08-20T14:00:00.000Z",
50
+ "createdAt": "2026-08-01T00:00:00.000Z",
51
+ "updatedAt": "2026-08-20T14:00:00.000Z",
52
+ "events": [
53
+ {
54
+ "id": "gre_1a2b3c4d",
55
+ "type": "created",
56
+ "reason": "Open-ended evaluation",
57
+ "source": "api",
58
+ "previousExpiresAt": null,
59
+ "expiresAt": null,
60
+ "duration": "until_revoked",
61
+ "durationCycles": null,
62
+ "requestedExpiresAt": null,
63
+ "createdAt": "2026-08-01T00:00:00.000Z"
64
+ },
65
+ {
66
+ "id": "gre_m3n4o5p6",
67
+ "type": "revoked",
68
+ "reason": "Evaluation completed",
69
+ "source": "api",
70
+ "previousExpiresAt": null,
71
+ "expiresAt": null,
72
+ "duration": null,
73
+ "durationCycles": null,
74
+ "requestedExpiresAt": null,
75
+ "createdAt": "2026-08-20T14:00:00.000Z"
76
+ }
77
+ ]
78
+ }
79
+ }
80
+ ```
81
+
82
+ ## When this fires
83
+
84
+ After an active Plan Grant is manually revoked through the API or dashboard. The payload is the grant at revocation, and its last timeline event is `revoked`.
85
+
86
+ `customer.state_changed` also fires with trigger `plan_access_ended`.
@@ -0,0 +1,86 @@
1
+ ---
2
+ lastModified: 2026-08-18
3
+ title: "plan_grant.updated"
4
+ description: "A plan grant duration changed."
5
+ full: true
6
+ ---
7
+
8
+ All webhook payloads follow a consistent top-level structure with event-specific data nested within the `data` object.
9
+
10
+ - `id` (string) — The public plan grant ID.
11
+ - `customerId` (string) — The public customer ID.
12
+ - `subscriptionId` (string) — The public subscription ID.
13
+ - `basePlanId` (string) — The public ID of the subscribed base plan.
14
+ - `targetPlanId` (string) — The public ID of the plan whose access was granted.
15
+ - `targetPlanReleaseId` (string) — The public ID of the immutable target plan release.
16
+ - `status` ("active" | "expired" | "revoked") — The plan grant status at this transition.
17
+ - `duration` ("cycles" | "until\_date" | "until\_revoked") — How the plan grant duration is defined at this transition.
18
+ - `durationCycles` (integer | null) — The cycle count when duration is cycles.
19
+ - `startsAt` (string) — When the plan grant started.
20
+ - `expiresAt` (string | null) — The effective expiration deadline, if any.
21
+ - `reason` (string) — The reason recorded for this transition.
22
+ - `source` ("dashboard" | "api" | "system") — Where this transition originated.
23
+ - `revokedAt` (string | null) — When the plan grant was revoked, otherwise null.
24
+ - `createdAt` (string) — When the plan grant was created.
25
+ - `updatedAt` (string) — When the represented transition occurred.
26
+ - `events` (WebhookPlanGrantTimelineEvent\[]) — The grant timeline through the represented transition.
27
+
28
+ ```json
29
+ {
30
+ "event": "plan_grant.updated",
31
+ "timestamp": "2026-06-23T14:30:00.000Z",
32
+ "organizationId": "8f14e45f-ceea-4e7a-9c3d-1c2b3a4d5e6f",
33
+ "mode": "live",
34
+ "apiVersion": "2026-07-31",
35
+ "data": {
36
+ "id": "pgr_1a2b3c4d",
37
+ "customerId": "user_123",
38
+ "subscriptionId": "sub_1a2b3c4d",
39
+ "basePlanId": "pln_starter",
40
+ "targetPlanId": "pln_pro",
41
+ "targetPlanReleaseId": "plr_1a2b3c4d",
42
+ "status": "active",
43
+ "duration": "until_date",
44
+ "durationCycles": null,
45
+ "startsAt": "2026-08-01T00:00:00.000Z",
46
+ "expiresAt": "2026-11-15T00:00:00.000Z",
47
+ "reason": "Extended evaluation",
48
+ "source": "dashboard",
49
+ "revokedAt": null,
50
+ "createdAt": "2026-08-01T00:00:00.000Z",
51
+ "updatedAt": "2026-08-15T12:00:00.000Z",
52
+ "events": [
53
+ {
54
+ "id": "gre_1a2b3c4d",
55
+ "type": "created",
56
+ "reason": "Two-month product evaluation",
57
+ "source": "api",
58
+ "previousExpiresAt": null,
59
+ "expiresAt": "2026-10-01T00:00:00.000Z",
60
+ "duration": "cycles",
61
+ "durationCycles": 2,
62
+ "requestedExpiresAt": null,
63
+ "createdAt": "2026-08-01T00:00:00.000Z"
64
+ },
65
+ {
66
+ "id": "gre_5e6f7g8h",
67
+ "type": "updated",
68
+ "reason": "Extended evaluation",
69
+ "source": "dashboard",
70
+ "previousExpiresAt": "2026-10-01T00:00:00.000Z",
71
+ "expiresAt": "2026-11-15T00:00:00.000Z",
72
+ "duration": "until_date",
73
+ "durationCycles": null,
74
+ "requestedExpiresAt": "2026-11-15T00:00:00.000Z",
75
+ "createdAt": "2026-08-15T12:00:00.000Z"
76
+ }
77
+ ]
78
+ }
79
+ }
80
+ ```
81
+
82
+ ## When this fires
83
+
84
+ After an active Plan Grant's duration or deadline is committed. The payload is the grant at that update, and its last timeline event is `updated`.
85
+
86
+ This event does not fire for any other field change.
package/docs/webhooks.md CHANGED
@@ -545,6 +545,102 @@ Aggregate entitlement event answering one question: what can this customer acces
545
545
  - `credits` (`WebhookCreditsBalance | null`, required) — For credits plans: planCredits, purchasedCredits, totalCredits. Null otherwise.
546
546
  - `balance` (`WebhookBalance | null`, required) — For balance plans: currentBalance in rate scale (10000 = $1.00). Null otherwise.
547
547
 
548
+ ## plan_grant.created
549
+
550
+ Fired after a plan grant is durably created. The payload is the grant snapshot at creation.
551
+
552
+ ### Data
553
+
554
+ - `id` (`string`, required) — The public plan grant ID.
555
+ - `customerId` (`string`, required) — The public customer ID.
556
+ - `subscriptionId` (`string`, required) — The public subscription ID.
557
+ - `basePlanId` (`string`, required) — The public ID of the subscribed base plan.
558
+ - `targetPlanId` (`string`, required) — The public ID of the plan whose access was granted.
559
+ - `targetPlanReleaseId` (`string`, required) — The public ID of the immutable target plan release.
560
+ - `status` (`"active" | "expired" | "revoked"`, required) — The plan grant status at this transition.
561
+ - `duration` (`"cycles" | "until_date" | "until_revoked"`, required) — How the plan grant duration is defined at this transition.
562
+ - `durationCycles` (`number | null`, required) — The cycle count when duration is cycles.
563
+ - `startsAt` (`string`, required) — When the plan grant started.
564
+ - `expiresAt` (`string | null`, required) — The effective expiration deadline, if any.
565
+ - `reason` (`string`, required) — The reason recorded for this transition.
566
+ - `source` (`"dashboard" | "api" | "system"`, required) — Where this transition originated.
567
+ - `revokedAt` (`string | null`, required) — When the plan grant was revoked, otherwise null.
568
+ - `createdAt` (`string`, required) — When the plan grant was created.
569
+ - `updatedAt` (`string`, required) — When the represented transition occurred.
570
+ - `events` (`Array<WebhookPlanGrantTimelineEvent>`, required) — The grant timeline through the represented transition.
571
+
572
+ ## plan_grant.updated
573
+
574
+ Fired after a plan grant duration or deadline is durably changed. The payload is the grant snapshot at that update.
575
+
576
+ ### Data
577
+
578
+ - `id` (`string`, required) — The public plan grant ID.
579
+ - `customerId` (`string`, required) — The public customer ID.
580
+ - `subscriptionId` (`string`, required) — The public subscription ID.
581
+ - `basePlanId` (`string`, required) — The public ID of the subscribed base plan.
582
+ - `targetPlanId` (`string`, required) — The public ID of the plan whose access was granted.
583
+ - `targetPlanReleaseId` (`string`, required) — The public ID of the immutable target plan release.
584
+ - `status` (`"active" | "expired" | "revoked"`, required) — The plan grant status at this transition.
585
+ - `duration` (`"cycles" | "until_date" | "until_revoked"`, required) — How the plan grant duration is defined at this transition.
586
+ - `durationCycles` (`number | null`, required) — The cycle count when duration is cycles.
587
+ - `startsAt` (`string`, required) — When the plan grant started.
588
+ - `expiresAt` (`string | null`, required) — The effective expiration deadline, if any.
589
+ - `reason` (`string`, required) — The reason recorded for this transition.
590
+ - `source` (`"dashboard" | "api" | "system"`, required) — Where this transition originated.
591
+ - `revokedAt` (`string | null`, required) — When the plan grant was revoked, otherwise null.
592
+ - `createdAt` (`string`, required) — When the plan grant was created.
593
+ - `updatedAt` (`string`, required) — When the represented transition occurred.
594
+ - `events` (`Array<WebhookPlanGrantTimelineEvent>`, required) — The grant timeline through the represented transition.
595
+
596
+ ## plan_grant.expired
597
+
598
+ Fired after a plan grant is durably expired, whether discovered automatically or while replacing an expired grant.
599
+
600
+ ### Data
601
+
602
+ - `id` (`string`, required) — The public plan grant ID.
603
+ - `customerId` (`string`, required) — The public customer ID.
604
+ - `subscriptionId` (`string`, required) — The public subscription ID.
605
+ - `basePlanId` (`string`, required) — The public ID of the subscribed base plan.
606
+ - `targetPlanId` (`string`, required) — The public ID of the plan whose access was granted.
607
+ - `targetPlanReleaseId` (`string`, required) — The public ID of the immutable target plan release.
608
+ - `status` (`"active" | "expired" | "revoked"`, required) — The plan grant status at this transition.
609
+ - `duration` (`"cycles" | "until_date" | "until_revoked"`, required) — How the plan grant duration is defined at this transition.
610
+ - `durationCycles` (`number | null`, required) — The cycle count when duration is cycles.
611
+ - `startsAt` (`string`, required) — When the plan grant started.
612
+ - `expiresAt` (`string | null`, required) — The effective expiration deadline, if any.
613
+ - `reason` (`string`, required) — The reason recorded for this transition.
614
+ - `source` (`"dashboard" | "api" | "system"`, required) — Where this transition originated.
615
+ - `revokedAt` (`string | null`, required) — When the plan grant was revoked, otherwise null.
616
+ - `createdAt` (`string`, required) — When the plan grant was created.
617
+ - `updatedAt` (`string`, required) — When the represented transition occurred.
618
+ - `events` (`Array<WebhookPlanGrantTimelineEvent>`, required) — The grant timeline through the represented transition.
619
+
620
+ ## plan_grant.revoked
621
+
622
+ Fired after an active plan grant is durably revoked. The payload is the grant snapshot at revocation.
623
+
624
+ ### Data
625
+
626
+ - `id` (`string`, required) — The public plan grant ID.
627
+ - `customerId` (`string`, required) — The public customer ID.
628
+ - `subscriptionId` (`string`, required) — The public subscription ID.
629
+ - `basePlanId` (`string`, required) — The public ID of the subscribed base plan.
630
+ - `targetPlanId` (`string`, required) — The public ID of the plan whose access was granted.
631
+ - `targetPlanReleaseId` (`string`, required) — The public ID of the immutable target plan release.
632
+ - `status` (`"active" | "expired" | "revoked"`, required) — The plan grant status at this transition.
633
+ - `duration` (`"cycles" | "until_date" | "until_revoked"`, required) — How the plan grant duration is defined at this transition.
634
+ - `durationCycles` (`number | null`, required) — The cycle count when duration is cycles.
635
+ - `startsAt` (`string`, required) — When the plan grant started.
636
+ - `expiresAt` (`string | null`, required) — The effective expiration deadline, if any.
637
+ - `reason` (`string`, required) — The reason recorded for this transition.
638
+ - `source` (`"dashboard" | "api" | "system"`, required) — Where this transition originated.
639
+ - `revokedAt` (`string | null`, required) — When the plan grant was revoked, otherwise null.
640
+ - `createdAt` (`string`, required) — When the plan grant was created.
641
+ - `updatedAt` (`string`, required) — When the represented transition occurred.
642
+ - `events` (`Array<WebhookPlanGrantTimelineEvent>`, required) — The grant timeline through the represented transition.
643
+
548
644
  ## credits.granted
549
645
 
550
646
  Fired when non-purchase credits are granted to a subscription: plan-included credits at the start of each billing period, or a manual adjustment from the dashboard. Credit pack purchases fire credits.purchased instead.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commet/node",
3
- "version": "9.1.0",
3
+ "version": "9.2.0",
4
4
  "description": "Commet SDK for Node.js - Billing and usage tracking",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",