@isnap/sdk 1.3.0-next.58 → 1.3.0-next.60

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.
@@ -2689,33 +2689,39 @@ export interface paths {
2689
2689
  patch?: never;
2690
2690
  trace?: never;
2691
2691
  };
2692
- "/v1/billing/subscriptions": {
2692
+ "/v1/billing/mac-checkout": {
2693
2693
  parameters: {
2694
2694
  query?: never;
2695
2695
  header?: never;
2696
2696
  path?: never;
2697
2697
  cookie?: never;
2698
2698
  };
2699
+ get?: never;
2700
+ put?: never;
2699
2701
  /**
2700
- * List Stripe subscriptions
2701
- * @description Return every active Stripe subscription on the authenticated user's customer record both per-line rental subs and BYOD slot subs. Period boundaries, line link, price ID, and cancellation flag are surfaced verbatim from Stripe.
2702
+ * Start a Stripe Checkout for hosted macOS sessions
2703
+ * @description Create a Stripe Checkout Session for `quantity` rented macOS sessions, priced on a graduated ladder ($35/$30/$25/$20 per session across the 1–10 / 11–30 / 31–50 / 51+ bands). Two rules are enforced here and nowhere else: the quantity must be a whole number of packs at or above the one-pack minimum (`422 mac_quantity_not_a_pack`, the divisor echoed as `issues[0].min`), and a rented session hosts the bridge for one BYOP iPhone so sessions may not exceed the account’s BYOP lines (`422 mac_sessions_exceed_byop_lines`). Stripe’s hosted UI cannot change the quantity afterwards — use `PATCH /v1/billing/subscriptions/{id}`, which applies the same two rules.
2702
2704
  */
2703
- get: {
2705
+ post: {
2704
2706
  parameters: {
2705
2707
  query?: never;
2706
2708
  header?: never;
2707
2709
  path?: never;
2708
2710
  cookie?: never;
2709
2711
  };
2710
- requestBody?: never;
2712
+ requestBody?: {
2713
+ content: {
2714
+ "application/json": components["schemas"]["MacCheckoutBody"];
2715
+ };
2716
+ };
2711
2717
  responses: {
2712
- /** @description Subscription list */
2718
+ /** @description macOS session checkout */
2713
2719
  200: {
2714
2720
  headers: {
2715
2721
  [name: string]: unknown;
2716
2722
  };
2717
2723
  content: {
2718
- "application/json": components["schemas"]["SubscriptionListEnvelope"];
2724
+ "application/json": components["schemas"]["MacCheckoutEnvelope"];
2719
2725
  };
2720
2726
  };
2721
2727
  /** @description Bad request — validation failed */
@@ -2736,6 +2742,24 @@ export interface paths {
2736
2742
  "application/json": components["schemas"]["ErrorEnvelope"];
2737
2743
  };
2738
2744
  };
2745
+ /** @description Not found */
2746
+ 404: {
2747
+ headers: {
2748
+ [name: string]: unknown;
2749
+ };
2750
+ content: {
2751
+ "application/json": components["schemas"]["ErrorEnvelope"];
2752
+ };
2753
+ };
2754
+ /** @description Unprocessable — domain rule violation */
2755
+ 422: {
2756
+ headers: {
2757
+ [name: string]: unknown;
2758
+ };
2759
+ content: {
2760
+ "application/json": components["schemas"]["ErrorEnvelope"];
2761
+ };
2762
+ };
2739
2763
  /** @description Too many requests — rate limit exceeded */
2740
2764
  429: {
2741
2765
  headers: {
@@ -2756,41 +2780,44 @@ export interface paths {
2756
2780
  };
2757
2781
  };
2758
2782
  };
2759
- put?: never;
2760
- post?: never;
2761
2783
  delete?: never;
2762
2784
  options?: never;
2763
2785
  head?: never;
2764
2786
  patch?: never;
2765
2787
  trace?: never;
2766
2788
  };
2767
- "/v1/billing/invoices": {
2789
+ "/v1/billing/subscriptions/{id}": {
2768
2790
  parameters: {
2769
2791
  query?: never;
2770
2792
  header?: never;
2771
2793
  path?: never;
2772
2794
  cookie?: never;
2773
2795
  };
2796
+ get?: never;
2797
+ put?: never;
2798
+ post?: never;
2774
2799
  /**
2775
- * List Stripe invoices
2776
- * @description List the authenticated user's Stripe invoices in reverse-chronological order. Each invoice exposes the period boundaries (unix seconds), the integer-cent amounts, the hosted invoice URL, and the PDF link.
2800
+ * Cancel a subscription
2801
+ * @description Schedule the subscription to cancel at the end of the current billing period. The line remains active until the period rolls over; the partner sees the `cancel_at_period_end: true` flag in `GET /v1/billing/subscriptions` until then.
2777
2802
  */
2778
- get: {
2803
+ delete: {
2779
2804
  parameters: {
2780
2805
  query?: never;
2781
2806
  header?: never;
2782
- path?: never;
2807
+ path: {
2808
+ id: string;
2809
+ };
2783
2810
  cookie?: never;
2784
2811
  };
2785
2812
  requestBody?: never;
2786
2813
  responses: {
2787
- /** @description Invoice list */
2814
+ /** @description Subscription cancelled */
2788
2815
  200: {
2789
2816
  headers: {
2790
2817
  [name: string]: unknown;
2791
2818
  };
2792
2819
  content: {
2793
- "application/json": components["schemas"]["InvoiceListEnvelope"];
2820
+ "application/json": components["schemas"]["BillingMessage"];
2794
2821
  };
2795
2822
  };
2796
2823
  /** @description Bad request — validation failed */
@@ -2811,6 +2838,24 @@ export interface paths {
2811
2838
  "application/json": components["schemas"]["ErrorEnvelope"];
2812
2839
  };
2813
2840
  };
2841
+ /** @description Not found */
2842
+ 404: {
2843
+ headers: {
2844
+ [name: string]: unknown;
2845
+ };
2846
+ content: {
2847
+ "application/json": components["schemas"]["ErrorEnvelope"];
2848
+ };
2849
+ };
2850
+ /** @description Conflict — concurrent or terminal state */
2851
+ 409: {
2852
+ headers: {
2853
+ [name: string]: unknown;
2854
+ };
2855
+ content: {
2856
+ "application/json": components["schemas"]["ErrorEnvelope"];
2857
+ };
2858
+ };
2814
2859
  /** @description Too many requests — rate limit exceeded */
2815
2860
  429: {
2816
2861
  headers: {
@@ -2831,46 +2876,139 @@ export interface paths {
2831
2876
  };
2832
2877
  };
2833
2878
  };
2834
- put?: never;
2835
- post?: never;
2836
- delete?: never;
2837
2879
  options?: never;
2838
2880
  head?: never;
2839
- patch?: never;
2881
+ /**
2882
+ * Change a subscription’s quantity
2883
+ * @description Set the quantity on the subscription’s single quantity-adjustable item — hosted macOS sessions, or BYOP slots. Both directions of the 1:1 rule are enforced: raising sessions above the account’s BYOP lines is `422 mac_sessions_exceed_byop_lines`, and lowering BYOP below the macOS sessions already rented is `422 byop_reduction_strands_mac_sessions`. A macOS quantity must additionally be a whole pack (`422 mac_quantity_not_a_pack`). A subscription that does not carry exactly one adjustable item — a per-line rental, or a wholesale master subscription whose quantities are pushed by metering — is refused `409 subscription_not_quantity_adjustable`.
2884
+ */
2885
+ patch: {
2886
+ parameters: {
2887
+ query?: never;
2888
+ header?: never;
2889
+ path: {
2890
+ id: string;
2891
+ };
2892
+ cookie?: never;
2893
+ };
2894
+ requestBody?: {
2895
+ content: {
2896
+ "application/json": components["schemas"]["SubscriptionQuantityBody"];
2897
+ };
2898
+ };
2899
+ responses: {
2900
+ /** @description Quantity updated */
2901
+ 200: {
2902
+ headers: {
2903
+ [name: string]: unknown;
2904
+ };
2905
+ content: {
2906
+ "application/json": components["schemas"]["SubscriptionQuantityEnvelope"];
2907
+ };
2908
+ };
2909
+ /** @description Bad request — validation failed */
2910
+ 400: {
2911
+ headers: {
2912
+ [name: string]: unknown;
2913
+ };
2914
+ content: {
2915
+ "application/json": components["schemas"]["ErrorEnvelope"];
2916
+ };
2917
+ };
2918
+ /** @description Unauthenticated — missing or invalid bearer token */
2919
+ 401: {
2920
+ headers: {
2921
+ [name: string]: unknown;
2922
+ };
2923
+ content: {
2924
+ "application/json": components["schemas"]["ErrorEnvelope"];
2925
+ };
2926
+ };
2927
+ /** @description Forbidden — caller authenticated but not allowed */
2928
+ 403: {
2929
+ headers: {
2930
+ [name: string]: unknown;
2931
+ };
2932
+ content: {
2933
+ "application/json": components["schemas"]["ErrorEnvelope"];
2934
+ };
2935
+ };
2936
+ /** @description Not found */
2937
+ 404: {
2938
+ headers: {
2939
+ [name: string]: unknown;
2940
+ };
2941
+ content: {
2942
+ "application/json": components["schemas"]["ErrorEnvelope"];
2943
+ };
2944
+ };
2945
+ /** @description Conflict — concurrent or terminal state */
2946
+ 409: {
2947
+ headers: {
2948
+ [name: string]: unknown;
2949
+ };
2950
+ content: {
2951
+ "application/json": components["schemas"]["ErrorEnvelope"];
2952
+ };
2953
+ };
2954
+ /** @description Unprocessable — domain rule violation */
2955
+ 422: {
2956
+ headers: {
2957
+ [name: string]: unknown;
2958
+ };
2959
+ content: {
2960
+ "application/json": components["schemas"]["ErrorEnvelope"];
2961
+ };
2962
+ };
2963
+ /** @description Too many requests — rate limit exceeded */
2964
+ 429: {
2965
+ headers: {
2966
+ [name: string]: unknown;
2967
+ };
2968
+ content: {
2969
+ "application/json": components["schemas"]["ErrorEnvelope"];
2970
+ };
2971
+ };
2972
+ /** @description Internal server error */
2973
+ 500: {
2974
+ headers: {
2975
+ [name: string]: unknown;
2976
+ };
2977
+ content: {
2978
+ "application/json": components["schemas"]["ErrorEnvelope"];
2979
+ };
2980
+ };
2981
+ };
2982
+ };
2840
2983
  trace?: never;
2841
2984
  };
2842
- "/v1/billing/subscriptions/{id}": {
2985
+ "/v1/billing/subscriptions": {
2843
2986
  parameters: {
2844
2987
  query?: never;
2845
2988
  header?: never;
2846
2989
  path?: never;
2847
2990
  cookie?: never;
2848
2991
  };
2849
- get?: never;
2850
- put?: never;
2851
- post?: never;
2852
2992
  /**
2853
- * Cancel a subscription
2854
- * @description Schedule the subscription to cancel at the end of the current billing period. The line remains active until the period rolls over; the partner sees the `cancel_at_period_end: true` flag in `GET /v1/billing/subscriptions` until then.
2993
+ * List Stripe subscriptions
2994
+ * @description Return every active Stripe subscription on the authenticated user's customer record both per-line rental subs and BYOD slot subs. Period boundaries, line link, price ID, and cancellation flag are surfaced verbatim from Stripe.
2855
2995
  */
2856
- delete: {
2996
+ get: {
2857
2997
  parameters: {
2858
2998
  query?: never;
2859
2999
  header?: never;
2860
- path: {
2861
- id: string;
2862
- };
3000
+ path?: never;
2863
3001
  cookie?: never;
2864
3002
  };
2865
3003
  requestBody?: never;
2866
3004
  responses: {
2867
- /** @description Subscription cancelled */
3005
+ /** @description Subscription list */
2868
3006
  200: {
2869
3007
  headers: {
2870
3008
  [name: string]: unknown;
2871
3009
  };
2872
3010
  content: {
2873
- "application/json": components["schemas"]["BillingMessage"];
3011
+ "application/json": components["schemas"]["SubscriptionListEnvelope"];
2874
3012
  };
2875
3013
  };
2876
3014
  /** @description Bad request — validation failed */
@@ -2891,8 +3029,8 @@ export interface paths {
2891
3029
  "application/json": components["schemas"]["ErrorEnvelope"];
2892
3030
  };
2893
3031
  };
2894
- /** @description Not found */
2895
- 404: {
3032
+ /** @description Too many requests — rate limit exceeded */
3033
+ 429: {
2896
3034
  headers: {
2897
3035
  [name: string]: unknown;
2898
3036
  };
@@ -2900,8 +3038,65 @@ export interface paths {
2900
3038
  "application/json": components["schemas"]["ErrorEnvelope"];
2901
3039
  };
2902
3040
  };
2903
- /** @description Conflict concurrent or terminal state */
2904
- 409: {
3041
+ /** @description Internal server error */
3042
+ 500: {
3043
+ headers: {
3044
+ [name: string]: unknown;
3045
+ };
3046
+ content: {
3047
+ "application/json": components["schemas"]["ErrorEnvelope"];
3048
+ };
3049
+ };
3050
+ };
3051
+ };
3052
+ put?: never;
3053
+ post?: never;
3054
+ delete?: never;
3055
+ options?: never;
3056
+ head?: never;
3057
+ patch?: never;
3058
+ trace?: never;
3059
+ };
3060
+ "/v1/billing/invoices": {
3061
+ parameters: {
3062
+ query?: never;
3063
+ header?: never;
3064
+ path?: never;
3065
+ cookie?: never;
3066
+ };
3067
+ /**
3068
+ * List Stripe invoices
3069
+ * @description List the authenticated user's Stripe invoices in reverse-chronological order. Each invoice exposes the period boundaries (unix seconds), the integer-cent amounts, the hosted invoice URL, and the PDF link.
3070
+ */
3071
+ get: {
3072
+ parameters: {
3073
+ query?: never;
3074
+ header?: never;
3075
+ path?: never;
3076
+ cookie?: never;
3077
+ };
3078
+ requestBody?: never;
3079
+ responses: {
3080
+ /** @description Invoice list */
3081
+ 200: {
3082
+ headers: {
3083
+ [name: string]: unknown;
3084
+ };
3085
+ content: {
3086
+ "application/json": components["schemas"]["InvoiceListEnvelope"];
3087
+ };
3088
+ };
3089
+ /** @description Bad request — validation failed */
3090
+ 400: {
3091
+ headers: {
3092
+ [name: string]: unknown;
3093
+ };
3094
+ content: {
3095
+ "application/json": components["schemas"]["ErrorEnvelope"];
3096
+ };
3097
+ };
3098
+ /** @description Unauthenticated — missing or invalid bearer token */
3099
+ 401: {
2905
3100
  headers: {
2906
3101
  [name: string]: unknown;
2907
3102
  };
@@ -2929,6 +3124,9 @@ export interface paths {
2929
3124
  };
2930
3125
  };
2931
3126
  };
3127
+ put?: never;
3128
+ post?: never;
3129
+ delete?: never;
2932
3130
  options?: never;
2933
3131
  head?: never;
2934
3132
  patch?: never;
@@ -6308,6 +6506,66 @@ export interface components {
6308
6506
  */
6309
6507
  billing_cycle: "monthly" | "annual";
6310
6508
  };
6509
+ MacCheckoutEnvelope: {
6510
+ /** @enum {boolean} */
6511
+ success: true;
6512
+ data: components["schemas"]["MacCheckoutResponse"];
6513
+ trace_id: string;
6514
+ request_id: string;
6515
+ };
6516
+ MacCheckoutResponse: {
6517
+ /**
6518
+ * Format: uri
6519
+ * @description Hosted Stripe Checkout URL — redirect the customer here.
6520
+ */
6521
+ checkout_url: string;
6522
+ /**
6523
+ * Format: date-time
6524
+ * @description Session expiry (ISO-8601). Stripe default is 24h.
6525
+ */
6526
+ expires_at: string;
6527
+ /** @description Sessions ordered — echoed back as accepted. */
6528
+ quantity: number;
6529
+ /** @description The pack divisor in force, read from the Stripe Price’s `pack_size` metadata. Quantities must be whole multiples of it, at or above it. */
6530
+ pack_size: number;
6531
+ /** @description Recurring total per period in integer cents, from the Price’s graduated tier ladder. Excludes tax, proration and coupons. */
6532
+ estimated_total_cents: number;
6533
+ };
6534
+ MacCheckoutBody: {
6535
+ /**
6536
+ * @description Number of hosted macOS sessions to rent. Must be a whole number of packs at or above the one-pack minimum — the pack size is read from the Stripe Price and echoed as `pack_size` in the response and in the `422` error `issues[0].min`. A quantity that is not a whole pack is refused `422 mac_quantity_not_a_pack`.
6537
+ * @example 5
6538
+ */
6539
+ quantity: number;
6540
+ /**
6541
+ * @description Stripe price cadence for the session subscription.
6542
+ * @example monthly
6543
+ * @enum {string}
6544
+ */
6545
+ billing_cycle: "monthly" | "quarterly" | "annual";
6546
+ };
6547
+ SubscriptionQuantityEnvelope: {
6548
+ /** @enum {boolean} */
6549
+ success: true;
6550
+ data: components["schemas"]["SubscriptionQuantityResponse"];
6551
+ trace_id: string;
6552
+ request_id: string;
6553
+ };
6554
+ SubscriptionQuantityResponse: {
6555
+ /** @description The Stripe subscription ID (`sub_*`). */
6556
+ subscription_id: string;
6557
+ /** @description The quantity now set on the adjustable item. */
6558
+ quantity: number;
6559
+ /** @description Recurring total per period in integer cents. `null` when the item’s Price carries no computable per-period total. Excludes tax, proration and coupons. */
6560
+ estimated_total_cents: number | null;
6561
+ };
6562
+ SubscriptionQuantityBody: {
6563
+ /**
6564
+ * @description New quantity for the subscription’s single adjustable item — macOS sessions, or BYOP slots. Both products are subject to the 1:1 rule (see the `422` codes), and the macOS product additionally to the pack rule.
6565
+ * @example 10
6566
+ */
6567
+ quantity: number;
6568
+ };
6311
6569
  SubscriptionListEnvelope: {
6312
6570
  /** @enum {boolean} */
6313
6571
  success: true;
@@ -6930,10 +7188,16 @@ export interface components {
6930
7188
  */
6931
7189
  url: string;
6932
7190
  /**
6933
- * @description Version currently published for this platform, read from the release feed that sits beside the artifact `url` resolves to — so the number announced and the file served cannot name different releases. `null` when that feed publishes nothing or cannot be read: render "version not published" rather than a number, because a fabricated version makes a failed install and an uninformed console indistinguishable to whoever is checking. Compare it against an installed version to offer an update.
7191
+ * @description Version currently published for this platform, read from the release feed that sits beside the artifact `url` resolves to — so the number announced and the file served cannot name different releases. `null` when that feed publishes nothing or could not be read; `version_status` says which. Never a configured placeholder: a fabricated version makes a failed install and an uninformed console indistinguishable to whoever is checking. Compare it against an installed version to offer an update.
6934
7192
  * @example 0.0.211
6935
7193
  */
6936
7194
  version: string | null;
7195
+ /**
7196
+ * @description Why `version` holds what it holds. `version` is non-null if and only if this is `published`, so a null is never ambiguous (WHA-2765). `none_published` — the feed answered and publishes no version (a 404, or a feed with no readable item): a real fact about the channel, render "version not published". `unreachable` — the feed could not be read (timeout, DNS failure, a body past the size cap): OUR fault or the update host's, and nobody knows what this channel publishes, so do not tell an operator the version is missing. `misconfigured` — an artifact URL is configured for the platform and no feed URL can be derived from it; someone must fix the deployment. `not_configured` — this deployment ships no artifact for the platform, which is the same fact `available: false` carries. Before this field the last three and the first were one indistinguishable `null`, so a broken appcast URL and a healthy pre-release channel rendered identically.
7197
+ * @example published
7198
+ * @enum {string}
7199
+ */
7200
+ version_status: "published" | "none_published" | "unreachable" | "misconfigured" | "not_configured";
6937
7201
  /**
6938
7202
  * @description False when this deployment has no artifact configured for the platform. The entry is still returned, so a consumer can hide the affordance instead of surfacing a link that 404s on click.
6939
7203
  * @example true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isnap/sdk",
3
- "version": "1.3.0-next.58",
3
+ "version": "1.3.0-next.60",
4
4
  "description": "Official TypeScript SDK for the iSnap P2P telephony API",
5
5
  "license": "MIT",
6
6
  "type": "module",