@outseta/react 0.4.47 → 0.5.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.
@@ -19,6 +19,8 @@ import type {
19
19
  AccountAddAccountParams,
20
20
  AccountAddPersonToAccountBody,
21
21
  AccountCancelAccountBody,
22
+ AccountExpireCurrentSubscriptionBody,
23
+ AccountExtendRenewalBody,
22
24
  AccountExtendTrialBody,
23
25
  AccountGetAllAccounts200,
24
26
  AccountGetAllAccountsParams,
@@ -1491,6 +1493,94 @@ export const useAccountExtendTrial = <TError = void,
1491
1493
  return useMutation(mutationOptions);
1492
1494
  }
1493
1495
  /**
1496
+ * Acts on the account's current subscription. The account must be in the Subscribing,
1497
+ Cancelling, Trialing, CancellingTrial or PastDue stage, and the request is rejected when
1498
+ a future subscription (a scheduled plan change) is waiting to start on the account.
1499
+
1500
+ ToDate is the new renewal date. It must be after the subscription's start date, on or
1501
+ after the date of the subscription's latest invoice, and not later than ExpirationDate.
1502
+ Moving the renewal date earlier gives no credit for the rest of the current term.
1503
+
1504
+ ExpirationDate is the date the subscription ends. Outseta ends the subscription when it
1505
+ reaches this date and sets its EndDate to it. When only ExpirationDate is sent and it is
1506
+ before the current renewal date, the renewal date moves to the expiration date.
1507
+
1508
+ Every request sets the expiration date. If ExpirationDate is omitted, the subscription's
1509
+ existing expiration date is removed, except when ToDate is later than it: then the
1510
+ expiration date moves to ToDate. To remove the expiration date, send an empty body ({}).
1511
+ To keep an expiration date while changing the renewal date, send both.
1512
+
1513
+ Times of day: ExpirationDate is first set to the time of day of the subscription's start
1514
+ date, and the checks above compare ToDate with the time of day you send. For example, with
1515
+ a subscription that started at 12:00 UTC, ToDate 2027-03-31T18:00:00Z is later than
1516
+ ExpirationDate 2027-03-31T00:00:00Z and is rejected. Send ToDate with the time of day of the
1517
+ current RenewalDate to avoid this. The saved renewal date keeps the time of day of the
1518
+ current RenewalDate.
1519
+ * @summary Set the renewal date or expiration date of the current subscription.
1520
+ */
1521
+ export const accountExtendRenewal = (
1522
+ accountUid: string | null,
1523
+ accountExtendRenewalBody: AccountExtendRenewalBody,
1524
+ options?: SecondParameter<typeof customFetch>,) => {
1525
+
1526
+
1527
+ return customFetch<Blob>(
1528
+ {url: `/api/v1/crm/accounts/${accountUid}/extend-renewal`, method: 'PUT',
1529
+ headers: {'Content-Type': 'application/json', },
1530
+ data: accountExtendRenewalBody,
1531
+ responseType: 'blob'
1532
+ },
1533
+ options);
1534
+ }
1535
+
1536
+
1537
+
1538
+ export const getAccountExtendRenewalMutationOptions = <TError = void,
1539
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountExtendRenewal>>, TError,{accountUid: string | null;data: AccountExtendRenewalBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1540
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountExtendRenewal>>, TError,{accountUid: string | null;data: AccountExtendRenewalBody}, TContext> => {
1541
+
1542
+ const mutationKey = ['accountExtendRenewal'];
1543
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1544
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1545
+ options
1546
+ : {...options, mutation: {...options.mutation, mutationKey}}
1547
+ : {mutation: { mutationKey, }, request: undefined};
1548
+
1549
+
1550
+
1551
+
1552
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountExtendRenewal>>, {accountUid: string | null;data: AccountExtendRenewalBody}> = (props) => {
1553
+ const {accountUid,data} = props ?? {};
1554
+
1555
+ return accountExtendRenewal(accountUid,data,requestOptions)
1556
+ }
1557
+
1558
+
1559
+
1560
+
1561
+ return { mutationFn, ...mutationOptions }}
1562
+
1563
+ export type AccountExtendRenewalMutationResult = NonNullable<Awaited<ReturnType<typeof accountExtendRenewal>>>
1564
+ export type AccountExtendRenewalMutationBody = AccountExtendRenewalBody
1565
+ export type AccountExtendRenewalMutationError = void
1566
+
1567
+ /**
1568
+ * @summary Set the renewal date or expiration date of the current subscription.
1569
+ */
1570
+ export const useAccountExtendRenewal = <TError = void,
1571
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountExtendRenewal>>, TError,{accountUid: string | null;data: AccountExtendRenewalBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1572
+ ): UseMutationResult<
1573
+ Awaited<ReturnType<typeof accountExtendRenewal>>,
1574
+ TError,
1575
+ {accountUid: string | null;data: AccountExtendRenewalBody},
1576
+ TContext
1577
+ > => {
1578
+
1579
+ const mutationOptions = getAccountExtendRenewalMutationOptions(options);
1580
+
1581
+ return useMutation(mutationOptions);
1582
+ }
1583
+ /**
1494
1584
  * Pass personUid as a query parameter to send to a specific person, or personUid=* to send
1495
1585
  to all people on the account. If no personUid is provided, the email is sent to the
1496
1586
  primary contact.
@@ -1556,6 +1646,86 @@ export const useAccountSendConfirmationEmail = <TError = void,
1556
1646
  return useMutation(mutationOptions);
1557
1647
  }
1558
1648
  /**
1649
+ * Applies to Outseta billing (v2) only. With Stripe Billing (v3), cancel the Stripe
1650
+ subscription instead: POST /billing/stripe/subscriptions/{subscriptionUid}/cancel with
1651
+ cancelImmediately=true.
1652
+
1653
+ The subscription and its add-ons end now, and the account moves to the Expired stage
1654
+ (TrialExpired if it was in the Trialing stage). Any future subscription (a scheduled plan
1655
+ change) is deleted. Unpaid invoices on the subscription are marked uncollectible, so no
1656
+ more automatic payment attempts are made on them. You can still record a payment against
1657
+ them. No call is made to Stripe, and the payment method is not changed.
1658
+
1659
+ The request is rejected when the account is already in the Expired or TrialExpired stage,
1660
+ or when the subscription's renewal date is in the past.
1661
+
1662
+ The body is optional. Send CancelationReason and Comment to record why the account was
1663
+ cancelled. Without a body, the reason records who made the request.
1664
+ * @summary Cancel an account's current subscription immediately.
1665
+ */
1666
+ export const accountExpireCurrentSubscription = (
1667
+ accountUid: string | null,
1668
+ accountExpireCurrentSubscriptionBody: NonReadonly<AccountExpireCurrentSubscriptionBody>,
1669
+ options?: SecondParameter<typeof customFetch>,) => {
1670
+
1671
+
1672
+ return customFetch<Blob>(
1673
+ {url: `/api/v1/crm/accounts/${accountUid}/expire-current-subscription`, method: 'PUT',
1674
+ headers: {'Content-Type': 'application/json', },
1675
+ data: accountExpireCurrentSubscriptionBody,
1676
+ responseType: 'blob'
1677
+ },
1678
+ options);
1679
+ }
1680
+
1681
+
1682
+
1683
+ export const getAccountExpireCurrentSubscriptionMutationOptions = <TError = void,
1684
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountExpireCurrentSubscription>>, TError,{accountUid: string | null;data: NonReadonly<AccountExpireCurrentSubscriptionBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
1685
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountExpireCurrentSubscription>>, TError,{accountUid: string | null;data: NonReadonly<AccountExpireCurrentSubscriptionBody>}, TContext> => {
1686
+
1687
+ const mutationKey = ['accountExpireCurrentSubscription'];
1688
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1689
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1690
+ options
1691
+ : {...options, mutation: {...options.mutation, mutationKey}}
1692
+ : {mutation: { mutationKey, }, request: undefined};
1693
+
1694
+
1695
+
1696
+
1697
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountExpireCurrentSubscription>>, {accountUid: string | null;data: NonReadonly<AccountExpireCurrentSubscriptionBody>}> = (props) => {
1698
+ const {accountUid,data} = props ?? {};
1699
+
1700
+ return accountExpireCurrentSubscription(accountUid,data,requestOptions)
1701
+ }
1702
+
1703
+
1704
+
1705
+
1706
+ return { mutationFn, ...mutationOptions }}
1707
+
1708
+ export type AccountExpireCurrentSubscriptionMutationResult = NonNullable<Awaited<ReturnType<typeof accountExpireCurrentSubscription>>>
1709
+ export type AccountExpireCurrentSubscriptionMutationBody = NonReadonly<AccountExpireCurrentSubscriptionBody>
1710
+ export type AccountExpireCurrentSubscriptionMutationError = void
1711
+
1712
+ /**
1713
+ * @summary Cancel an account's current subscription immediately.
1714
+ */
1715
+ export const useAccountExpireCurrentSubscription = <TError = void,
1716
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountExpireCurrentSubscription>>, TError,{accountUid: string | null;data: NonReadonly<AccountExpireCurrentSubscriptionBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
1717
+ ): UseMutationResult<
1718
+ Awaited<ReturnType<typeof accountExpireCurrentSubscription>>,
1719
+ TError,
1720
+ {accountUid: string | null;data: NonReadonly<AccountExpireCurrentSubscriptionBody>},
1721
+ TContext
1722
+ > => {
1723
+
1724
+ const mutationOptions = getAccountExpireCurrentSubscriptionMutationOptions(options);
1725
+
1726
+ return useMutation(mutationOptions);
1727
+ }
1728
+ /**
1559
1729
  * Returns the people associated with your account.
1560
1730
  * @summary Retrieve all people.
1561
1731
  */
@@ -990,16 +990,6 @@ export type StripeProductAllOf = {
990
990
  IsQuantityEditable?: boolean;
991
991
  /** @nullable */
992
992
  MaximumPeople?: number | null;
993
- /**
994
- * @maxLength 8
995
- * @nullable
996
- */
997
- MigratedAddOnUid?: string | null;
998
- /**
999
- * @maxLength 8
1000
- * @nullable
1001
- */
1002
- MigratedPlanUid?: string | null;
1003
993
  /** @nullable */
1004
994
  MinimumQuantity?: number | null;
1005
995
  /**
@@ -1018,7 +1008,6 @@ export type StripeProductAllOf = {
1018
1008
  TrialPeriodDays?: number;
1019
1009
  /** @nullable */
1020
1010
  TrialUntilDate?: string | null;
1021
- CanDelete?: boolean;
1022
1011
  NumberOfPurchases?: number;
1023
1012
  NumberOfSubscriptions?: number;
1024
1013
  /** @nullable */
@@ -4875,9 +4864,17 @@ export interface ExtendTrialParams {
4875
4864
  }
4876
4865
 
4877
4866
  export interface ExtendRenewalParams {
4878
- /** @nullable */
4867
+ /**
4868
+ * The new renewal date of the subscription. Omit it to keep the current renewal date, unless
4869
+ ExpirationDate is earlier than it: then the renewal date moves to ExpirationDate.
4870
+ * @nullable
4871
+ */
4879
4872
  ToDate?: string | null;
4880
- /** @nullable */
4873
+ /**
4874
+ * The date the subscription ends. Omit it to remove the subscription's expiration date, unless
4875
+ ToDate is later than the existing expiration date: then the expiration date moves to ToDate.
4876
+ * @nullable
4877
+ */
4881
4878
  ExpirationDate?: string | null;
4882
4879
  }
4883
4880
 
@@ -5017,6 +5014,14 @@ export interface SessionFlowDataSubscriptionUpdateConfirmItemOptions {
5017
5014
  Quantity?: number | null;
5018
5015
  }
5019
5016
 
5017
+ export interface ImportResult {
5018
+ CountImported?: number;
5019
+ CountError?: number;
5020
+ CountTotal?: number;
5021
+ /** @nullable */
5022
+ ErrorMessages?: string[] | null;
5023
+ }
5024
+
5020
5025
  export interface InvoiceStatusChangeOptions {
5021
5026
  /** @nullable */
5022
5027
  NewStatus?: string | null;
@@ -6405,16 +6410,6 @@ export type AccountWebhookEntityCurrentStripeProductInstancesItem = {
6405
6410
  IsQuantityEditable?: boolean;
6406
6411
  /** @nullable */
6407
6412
  MaximumPeople?: number | null;
6408
- /**
6409
- * @maxLength 8
6410
- * @nullable
6411
- */
6412
- MigratedAddOnUid?: string | null;
6413
- /**
6414
- * @maxLength 8
6415
- * @nullable
6416
- */
6417
- MigratedPlanUid?: string | null;
6418
6413
  /** @nullable */
6419
6414
  MinimumQuantity?: number | null;
6420
6415
  /**
@@ -6431,7 +6426,6 @@ export type AccountWebhookEntityCurrentStripeProductInstancesItem = {
6431
6426
  TrialPeriodDays?: number;
6432
6427
  /** @nullable */
6433
6428
  TrialUntilDate?: string | null;
6434
- CanDelete?: boolean;
6435
6429
  NumberOfPurchases?: number;
6436
6430
  NumberOfSubscriptions?: number;
6437
6431
  /** @nullable */
@@ -10132,6 +10126,16 @@ export type AccountCancelAccountBody = AccountCancelation | null;
10132
10126
  */
10133
10127
  export type AccountExtendTrialBody = ExtendTrialParams | null;
10134
10128
 
10129
+ /**
10130
+ * @nullable
10131
+ */
10132
+ export type AccountExtendRenewalBody = ExtendRenewalParams | null;
10133
+
10134
+ /**
10135
+ * @nullable
10136
+ */
10137
+ export type AccountExpireCurrentSubscriptionBody = AccountCancelation | null;
10138
+
10135
10139
  export type PersonGetAllPeopleParams = {
10136
10140
  /**
10137
10141
  * Match on the person's first or last name or email address
@@ -10178,6 +10182,241 @@ export type PersonForgotPasswordBody = Person | null;
10178
10182
  */
10179
10183
  export type PersonRequestMagicLinkBody = Person | null;
10180
10184
 
10185
+ export type StripeInvoiceLineItemsGetAllParams = {
10186
+ /**
10187
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
10188
+ */
10189
+ limit?: LimitParameter;
10190
+ /**
10191
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
10192
+ */
10193
+ offset?: OffsetParameter;
10194
+ };
10195
+
10196
+ export type StripeInvoiceLineItemsGetAll200 = {
10197
+ metadata?: CollectionMetadata;
10198
+ items?: StripeInvoiceLineItem[];
10199
+ };
10200
+
10201
+ export type StripePaymentMethodsGetAllParams = {
10202
+ /**
10203
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
10204
+ */
10205
+ limit?: LimitParameter;
10206
+ /**
10207
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
10208
+ */
10209
+ offset?: OffsetParameter;
10210
+ };
10211
+
10212
+ export type StripePaymentMethodsGetAll200 = {
10213
+ metadata?: CollectionMetadata;
10214
+ items?: StripePaymentMethod[];
10215
+ };
10216
+
10217
+ export type StripePricesGetAllParams = {
10218
+ /**
10219
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
10220
+ */
10221
+ limit?: LimitParameter;
10222
+ /**
10223
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
10224
+ */
10225
+ offset?: OffsetParameter;
10226
+ };
10227
+
10228
+ export type StripePricesGetAll200 = {
10229
+ metadata?: CollectionMetadata;
10230
+ items?: StripePrice[];
10231
+ };
10232
+
10233
+ export type StripePromotionCodesGetAllParams = {
10234
+ /**
10235
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
10236
+ */
10237
+ limit?: LimitParameter;
10238
+ /**
10239
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
10240
+ */
10241
+ offset?: OffsetParameter;
10242
+ };
10243
+
10244
+ export type StripePromotionCodesGetAll200 = {
10245
+ metadata?: CollectionMetadata;
10246
+ items?: StripePromotionCode[];
10247
+ };
10248
+
10249
+ /**
10250
+ * @nullable
10251
+ */
10252
+ export type StripePromotionCodesCreateBody = StripePromotionCode | null;
10253
+
10254
+ /**
10255
+ * @nullable
10256
+ */
10257
+ export type StripePromotionCodesUpdateBody = StripePromotionCode | null;
10258
+
10259
+ export type StripeProductFamiliesGetAllParams = {
10260
+ /**
10261
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
10262
+ */
10263
+ limit?: LimitParameter;
10264
+ /**
10265
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
10266
+ */
10267
+ offset?: OffsetParameter;
10268
+ };
10269
+
10270
+ export type StripeProductFamiliesGetAll200 = {
10271
+ metadata?: CollectionMetadata;
10272
+ items?: StripeProductFamily[];
10273
+ };
10274
+
10275
+ /**
10276
+ * @nullable
10277
+ */
10278
+ export type StripeProductFamiliesPostBody = StripeProductFamily | null;
10279
+
10280
+ /**
10281
+ * @nullable
10282
+ */
10283
+ export type StripeProductFamiliesPutBody = StripeProductFamily | null;
10284
+
10285
+ export type StripeCouponsGetAllParams = {
10286
+ /**
10287
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
10288
+ */
10289
+ limit?: LimitParameter;
10290
+ /**
10291
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
10292
+ */
10293
+ offset?: OffsetParameter;
10294
+ };
10295
+
10296
+ export type StripeCouponsGetAll200 = {
10297
+ metadata?: CollectionMetadata;
10298
+ items?: StripeCoupon[];
10299
+ };
10300
+
10301
+ /**
10302
+ * @nullable
10303
+ */
10304
+ export type StripeCouponsCreateBody = StripeCoupon | null;
10305
+
10306
+ export type StripeCouponsGetRedemptionsParams = {
10307
+ /**
10308
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
10309
+ */
10310
+ limit?: LimitParameter;
10311
+ /**
10312
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
10313
+ */
10314
+ offset?: OffsetParameter;
10315
+ };
10316
+
10317
+ export type StripeCouponsGetRedemptions200 = {
10318
+ metadata?: CollectionMetadata;
10319
+ items?: StripeDiscount[];
10320
+ };
10321
+
10322
+ export type StripeInvoicesGetAllParams = {
10323
+ /**
10324
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
10325
+ */
10326
+ limit?: LimitParameter;
10327
+ /**
10328
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
10329
+ */
10330
+ offset?: OffsetParameter;
10331
+ };
10332
+
10333
+ export type StripeInvoicesGetAll200 = {
10334
+ metadata?: CollectionMetadata;
10335
+ items?: StripeInvoice[];
10336
+ };
10337
+
10338
+ /**
10339
+ * @nullable
10340
+ */
10341
+ export type StripeInvoicesPostBody = StripeInvoice | null;
10342
+
10343
+ /**
10344
+ * @nullable
10345
+ */
10346
+ export type StripeInvoicesChangeInvoiceStatusBody = InvoiceStatusChangeOptions | null;
10347
+
10348
+ /**
10349
+ * @nullable
10350
+ */
10351
+ export type StripeInvoicesIssueInvoiceCreditBody = InvoiceCreditOptions | null;
10352
+
10353
+ export type StripeSubscriptionsGetAllParams = {
10354
+ /**
10355
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
10356
+ */
10357
+ limit?: LimitParameter;
10358
+ /**
10359
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
10360
+ */
10361
+ offset?: OffsetParameter;
10362
+ };
10363
+
10364
+ export type StripeSubscriptionsGetAll200 = {
10365
+ metadata?: CollectionMetadata;
10366
+ items?: StripeSubscription[];
10367
+ };
10368
+
10369
+ /**
10370
+ * @nullable
10371
+ */
10372
+ export type StripeSubscriptionsCreateBody = StripeSubscription | null;
10373
+
10374
+ /**
10375
+ * @nullable
10376
+ */
10377
+ export type StripeSubscriptionsPauseCollectionBody = PauseCollectionOptions | null;
10378
+
10379
+ /**
10380
+ * @nullable
10381
+ */
10382
+ export type StripeSubscriptionsChangeBody = StripeSubscription | null;
10383
+
10384
+ /**
10385
+ * @nullable
10386
+ */
10387
+ export type StripeSubscriptionsPreviewChangeBody = StripeSubscription | null;
10388
+
10389
+ /**
10390
+ * @nullable
10391
+ */
10392
+ export type StripeSubscriptionsExtendTrialBody = ExtendSubscriptionOptions | null;
10393
+
10394
+ export type StripeProductsGetAllParams = {
10395
+ /**
10396
+ * Requested page size. The server caps it at 100, or 25 when requested fields expand child objects or require additional queries; metadata.limit reports the applied value. Use offset=1 for the second page.
10397
+ */
10398
+ limit?: LimitParameter;
10399
+ /**
10400
+ * Zero-based page number, not a record offset. With limit=50, the second page is offset=1; offset=50 is page index 50 (records 2501-2550).
10401
+ */
10402
+ offset?: OffsetParameter;
10403
+ };
10404
+
10405
+ export type StripeProductsGetAll200 = {
10406
+ metadata?: CollectionMetadata;
10407
+ items?: StripeProduct[];
10408
+ };
10409
+
10410
+ /**
10411
+ * @nullable
10412
+ */
10413
+ export type StripeProductsPostBody = StripeProduct | null;
10414
+
10415
+ /**
10416
+ * @nullable
10417
+ */
10418
+ export type StripeProductsPutBody = StripeProduct | null;
10419
+
10181
10420
  export type DiscountCouponGetDiscountCouponByCodeParams = {
10182
10421
  /**
10183
10422
  * The unique identifier of the plan to validate the coupon against
@@ -697,7 +697,33 @@ export const useTokenTwoFactorEnrollmentBeginEmail = <TError = string,
697
697
 
698
698
  return useMutation(mutationOptions);
699
699
  }
700
- export const tokenTwoFactorEnrollmentBeginTotp = (
700
+ /**
701
+ * Call this when `POST /api/v1/tokens` returned
702
+ `two_factor_enrollment_required` and the user chooses an authenticator
703
+ app. Post the enrollment token from that response:
704
+
705
+ { "enrollment_token": "eyJ..." }
706
+
707
+ A fresh shared secret is generated and returned in three forms so you
708
+ can present it however suits your client:
709
+
710
+ {
711
+ "challenge_token": "eyJ...",
712
+ "secret": "JBSWY3DPEHPK3PXP",
713
+ "otpauth_uri": "otpauth://totp/Acme:user@example.com?secret=...&issuer=Acme&...",
714
+ "qr_code_png_base64": "iVBORw0KGgo...",
715
+ "expires_in": 600
716
+ }
717
+
718
+ Have the user add the secret to their authenticator app (by scanning
719
+ `qr_code_png_base64`, opening `otpauth_uri`, or typing `secret`), then
720
+ confirm a code via `POST /api/v1/tokens/two-factor/enroll/totp/confirm`.
721
+ Returns `401` if the enrollment token is invalid/expired and `403` if
722
+ forced enrollment does not apply to this user. Rate limited to 5
723
+ requests per minute (`429`).
724
+ * @summary Begin authenticator-app (TOTP) enrollment during a forced-2FA login.
725
+ */
726
+ export const tokenTwoFactorEnrollmentBeginTotp = (
701
727
  params: TokenTwoFactorEnrollmentBeginTotpParams,
702
728
  options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
703
729
  ) => {
@@ -741,7 +767,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
741
767
 
742
768
  export type TokenTwoFactorEnrollmentBeginTotpMutationError = string
743
769
 
744
- export const useTokenTwoFactorEnrollmentBeginTotp = <TError = string,
770
+ /**
771
+ * @summary Begin authenticator-app (TOTP) enrollment during a forced-2FA login.
772
+ */
773
+ export const useTokenTwoFactorEnrollmentBeginTotp = <TError = string,
745
774
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof tokenTwoFactorEnrollmentBeginTotp>>, TError,{params: TokenTwoFactorEnrollmentBeginTotpParams}, TContext>, request?: SecondParameter<typeof customFetch>}
746
775
  ): UseMutationResult<
747
776
  Awaited<ReturnType<typeof tokenTwoFactorEnrollmentBeginTotp>>,
package/src/index.ts CHANGED
@@ -5,9 +5,12 @@ export type { OutsetaCredentials } from "@outseta/api-client";
5
5
  export * from "./components/index.js";
6
6
 
7
7
  // Generated React hooks and schema types
8
+ // BEGIN generated tag exports (scripts/post-generate.mjs)
8
9
  export * from "./generated/activity/activity.js";
9
- export * from "./generated/billing/billing.js";
10
+ export * from "./generated/billing-v2/billing-v2.js";
11
+ export * from "./generated/billing-v3/billing-v3.js";
10
12
  export * from "./generated/crm/crm.js";
11
13
  export * from "./generated/email/email.js";
12
14
  export * from "./generated/support/support.js";
15
+ // END generated tag exports
13
16
  export * from "./generated/outsetaAPI.schemas.js";