@feelflow/ffid-sdk 8.1.0 → 9.0.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.
@@ -64,12 +64,27 @@ interface FFIDSubscriptionCreatedPayload {
64
64
  */
65
65
  serviceCode?: string;
66
66
  }
67
+ /**
68
+ * `subscription.updated`.
69
+ *
70
+ * 9.0.0 aligned this type with what FFID sends (#6380): `status` is always present, and
71
+ * `subscriptionId` / `organizationId` are absent when the event comes from a Stripe notice
72
+ * whose subscription FFID could not match to its own record (check before use).
73
+ * `previousPlan` was removed — FFID never sent it.
74
+ */
67
75
  interface FFIDSubscriptionUpdatedPayload {
68
- subscriptionId: string;
76
+ /**
77
+ * Subscription status after the change — the raw status string (FFID's or Stripe's), not a
78
+ * closed enum. Use `effectiveStatus` for access decisions.
79
+ */
80
+ status: string;
81
+ /** FFID subscription UUID. Absent when FFID could not match the Stripe subscription */
82
+ subscriptionId?: string;
83
+ /** Stripe subscription id (`sub_...`). Present on events that come from Stripe notices */
84
+ stripeSubscriptionId?: string;
69
85
  organizationId?: string;
86
+ /** Plan code after the change */
70
87
  plan?: string;
71
- previousPlan?: string;
72
- status?: string;
73
88
  effectiveStatus?: EffectiveSubscriptionStatus;
74
89
  gracePeriodEndsAt?: string | null;
75
90
  /**
@@ -242,9 +257,27 @@ interface FFIDSubscriptionDowngradeCanceledPayload {
242
257
  */
243
258
  serviceCode?: string;
244
259
  }
260
+ /**
261
+ * `subscription.trial_ending` — sent when Stripe announces that a trial is about to end.
262
+ *
263
+ * 9.0.0 aligned this type with what FFID sends (#6380). FFID does not resolve its own
264
+ * subscription UUID for this event; identify the subscription by `stripeSubscriptionId`
265
+ * (and the service by `serviceCode`).
266
+ */
245
267
  interface FFIDSubscriptionTrialEndingPayload {
246
- subscriptionId: string;
247
- organizationId?: string;
268
+ /** Stripe subscription id (`sub_...`) */
269
+ stripeSubscriptionId: string;
270
+ /**
271
+ * Days until the trial ends, rounded **up** at the moment FFID processed Stripe's notice
272
+ * (a trial ending later the same day is `1`). `0` only when the trial had already ended by
273
+ * then. Fixed when the event is created — a redelivered event carries the same value.
274
+ */
275
+ daysRemaining: number;
276
+ /**
277
+ * Trial end date **for display**, in Japanese long form in JST (e.g. `2026年10月3日`) — not
278
+ * an ISO timestamp. `(無効な日時)` when FFID could not read Stripe's timestamp. Use
279
+ * `daysRemaining` for any calculation.
280
+ */
248
281
  trialEndDate: string;
249
282
  /**
250
283
  * Code of the service the subscription belongs to (e.g. `chatbot-v2`), resolved by FFID when
@@ -64,12 +64,27 @@ interface FFIDSubscriptionCreatedPayload {
64
64
  */
65
65
  serviceCode?: string;
66
66
  }
67
+ /**
68
+ * `subscription.updated`.
69
+ *
70
+ * 9.0.0 aligned this type with what FFID sends (#6380): `status` is always present, and
71
+ * `subscriptionId` / `organizationId` are absent when the event comes from a Stripe notice
72
+ * whose subscription FFID could not match to its own record (check before use).
73
+ * `previousPlan` was removed — FFID never sent it.
74
+ */
67
75
  interface FFIDSubscriptionUpdatedPayload {
68
- subscriptionId: string;
76
+ /**
77
+ * Subscription status after the change — the raw status string (FFID's or Stripe's), not a
78
+ * closed enum. Use `effectiveStatus` for access decisions.
79
+ */
80
+ status: string;
81
+ /** FFID subscription UUID. Absent when FFID could not match the Stripe subscription */
82
+ subscriptionId?: string;
83
+ /** Stripe subscription id (`sub_...`). Present on events that come from Stripe notices */
84
+ stripeSubscriptionId?: string;
69
85
  organizationId?: string;
86
+ /** Plan code after the change */
70
87
  plan?: string;
71
- previousPlan?: string;
72
- status?: string;
73
88
  effectiveStatus?: EffectiveSubscriptionStatus;
74
89
  gracePeriodEndsAt?: string | null;
75
90
  /**
@@ -242,9 +257,27 @@ interface FFIDSubscriptionDowngradeCanceledPayload {
242
257
  */
243
258
  serviceCode?: string;
244
259
  }
260
+ /**
261
+ * `subscription.trial_ending` — sent when Stripe announces that a trial is about to end.
262
+ *
263
+ * 9.0.0 aligned this type with what FFID sends (#6380). FFID does not resolve its own
264
+ * subscription UUID for this event; identify the subscription by `stripeSubscriptionId`
265
+ * (and the service by `serviceCode`).
266
+ */
245
267
  interface FFIDSubscriptionTrialEndingPayload {
246
- subscriptionId: string;
247
- organizationId?: string;
268
+ /** Stripe subscription id (`sub_...`) */
269
+ stripeSubscriptionId: string;
270
+ /**
271
+ * Days until the trial ends, rounded **up** at the moment FFID processed Stripe's notice
272
+ * (a trial ending later the same day is `1`). `0` only when the trial had already ended by
273
+ * then. Fixed when the event is created — a redelivered event carries the same value.
274
+ */
275
+ daysRemaining: number;
276
+ /**
277
+ * Trial end date **for display**, in Japanese long form in JST (e.g. `2026年10月3日`) — not
278
+ * an ISO timestamp. `(無効な日時)` when FFID could not read Stripe's timestamp. Use
279
+ * `daysRemaining` for any calculation.
280
+ */
248
281
  trialEndDate: string;
249
282
  /**
250
283
  * Code of the service the subscription belongs to (e.g. `chatbot-v2`), resolved by FFID when
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feelflow/ffid-sdk",
3
- "version": "8.1.0",
3
+ "version": "9.0.0",
4
4
  "description": "FeelFlow ID Platform SDK for React/Next.js applications",
5
5
  "keywords": [
6
6
  "feelflow",