@sparkvault/sdk-js 15.6.0 → 15.7.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.
@@ -1,9 +1,15 @@
1
1
  /** Named Notify projects owned and billed by one company account. */
2
2
  export type NotifyProjectStatus = 'draft' | 'active' | 'read_only' | 'archived';
3
3
  export interface NotifyProjectBilling {
4
+ /** Present on the flat subscription backed by the company's shared wallet. */
5
+ billing_model?: 'usage_credits';
6
+ enabled?: boolean;
7
+ included_monthly_credits?: number;
8
+ renewal_included_monthly_credits?: number;
4
9
  subscription_item_id?: string | null;
5
10
  subscription_id?: string | null;
6
11
  status: 'draft' | 'active' | 'past_due' | 'read_only';
12
+ /** Historical tier allowance. The credit model's compatibility value is not a usage ceiling. */
7
13
  notifications_cap: number;
8
14
  /** Allowance selected for the next period when a downgrade is scheduled. */
9
15
  renewal_notifications_cap?: number;
@@ -51,12 +57,24 @@ export interface UpdateNotifyProjectOptions {
51
57
  description?: string;
52
58
  sender_name?: string | null;
53
59
  }
54
- export interface PreviewNotifyProjectSubscriptionOptions {
55
- notificationsPerMonth: number;
60
+ export type PreviewNotifyProjectSubscriptionOptions =
61
+ /** New project: one flat monthly plan with credits shared across the company. */
62
+ {
63
+ billingModel: 'usage_credits';
64
+ notificationsPerMonth?: never;
56
65
  }
66
+ /** Existing legacy project: retain its published notification tier. */
67
+ | {
68
+ billingModel?: undefined;
69
+ notificationsPerMonth: number;
70
+ };
57
71
  export interface NotifyProjectSubscriptionPreview {
58
72
  project_id: string;
59
- notifications_per_month: number;
73
+ /** Present for the flat shared-credit plan; absent for historical tier plans. */
74
+ billing_model?: 'usage_credits';
75
+ included_monthly_credits?: number;
76
+ /** Present only when reviewing a historical tier plan. */
77
+ notifications_per_month?: number;
60
78
  /** Exact decimal USD amounts, as strings; repeat the quote without float conversion. */
61
79
  monthly_usd: string;
62
80
  amount_due_now_usd: string;
@@ -65,11 +83,11 @@ export interface NotifyProjectSubscriptionPreview {
65
83
  effective_at: number | null;
66
84
  checkout_required: boolean;
67
85
  }
68
- export interface SubscribeNotifyProjectOptions extends PreviewNotifyProjectSubscriptionOptions {
86
+ export type SubscribeNotifyProjectOptions = PreviewNotifyProjectSubscriptionOptions & {
69
87
  /** Repeat the reviewed quote; a changed price is refused rather than charged. */
70
88
  quotedAmountDueNowUsd: string;
71
89
  prorationDate: number;
72
- }
90
+ };
73
91
  export interface NotifyProjectSubscriptionResponse {
74
92
  project: NotifyProject;
75
93
  /** Present when the company's first subscription needs hosted payment setup. */