@outseta/react 0.4.34 → 0.4.36
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.
- package/dist/index.js +35 -0
- package/package.json +2 -2
- package/src/generated/billing/billing.ts +76 -0
- package/src/generated/outsetaAPI.schemas.ts +124 -1
package/dist/index.js
CHANGED
|
@@ -1660,6 +1660,32 @@ var usePlanDeletePlan = (options) => {
|
|
|
1660
1660
|
const mutationOptions = getPlanDeletePlanMutationOptions(options);
|
|
1661
1661
|
return useMutation(mutationOptions);
|
|
1662
1662
|
};
|
|
1663
|
+
var planAddOnGetAllPlanAddOns = (params, options, signal) => {
|
|
1664
|
+
return customFetch2({
|
|
1665
|
+
url: `/api/v1/billing/planaddons`,
|
|
1666
|
+
method: "GET",
|
|
1667
|
+
params,
|
|
1668
|
+
signal
|
|
1669
|
+
}, options);
|
|
1670
|
+
};
|
|
1671
|
+
var getPlanAddOnGetAllPlanAddOnsQueryKey = (params) => {
|
|
1672
|
+
return [
|
|
1673
|
+
`/api/v1/billing/planaddons`,
|
|
1674
|
+
...params ? [params] : []
|
|
1675
|
+
];
|
|
1676
|
+
};
|
|
1677
|
+
var getPlanAddOnGetAllPlanAddOnsQueryOptions = (params, options) => {
|
|
1678
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
1679
|
+
const queryKey = queryOptions?.queryKey ?? getPlanAddOnGetAllPlanAddOnsQueryKey(params);
|
|
1680
|
+
const queryFn = ({ signal }) => planAddOnGetAllPlanAddOns(params, requestOptions, signal);
|
|
1681
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
1682
|
+
};
|
|
1683
|
+
function usePlanAddOnGetAllPlanAddOns(params, options) {
|
|
1684
|
+
const queryOptions = getPlanAddOnGetAllPlanAddOnsQueryOptions(params, options);
|
|
1685
|
+
const query = useQuery(queryOptions);
|
|
1686
|
+
query.queryKey = queryOptions.queryKey;
|
|
1687
|
+
return query;
|
|
1688
|
+
}
|
|
1663
1689
|
var planFamilyGetAllPlanFamilies = (params, options, signal) => {
|
|
1664
1690
|
return customFetch2({
|
|
1665
1691
|
url: `/api/v1/billing/planfamilies`,
|
|
@@ -3879,6 +3905,10 @@ var AccountWebhookEntitySubscriptionsItemLatestInvoiceBillingInvoiceStatus = {
|
|
|
3879
3905
|
Uncollectible: 6,
|
|
3880
3906
|
Processing: 7
|
|
3881
3907
|
};
|
|
3908
|
+
var AccountWebhookEntityCurrentStripeProductInstancesItemAccountRegistrationMode = {
|
|
3909
|
+
Individual: 1,
|
|
3910
|
+
Team: 2
|
|
3911
|
+
};
|
|
3882
3912
|
var AccountWebhookEntityCurrentSubscriptionBillingRenewalTerm = {
|
|
3883
3913
|
Monthly: 1,
|
|
3884
3914
|
Yearly: 2,
|
|
@@ -4029,6 +4059,7 @@ export {
|
|
|
4029
4059
|
AccountRegistrationMode,
|
|
4030
4060
|
AccountStage,
|
|
4031
4061
|
AccountWebhookEntityAccountStage,
|
|
4062
|
+
AccountWebhookEntityCurrentStripeProductInstancesItemAccountRegistrationMode,
|
|
4032
4063
|
AccountWebhookEntityCurrentSubscriptionBillingRenewalTerm,
|
|
4033
4064
|
AccountWebhookEntityCurrentSubscriptionDiscountCouponSubscriptionsItemDiscountCouponDuration,
|
|
4034
4065
|
AccountWebhookEntityCurrentSubscriptionLatestInvoiceBillingInvoiceStatus,
|
|
@@ -4301,6 +4332,8 @@ export {
|
|
|
4301
4332
|
getPersonRequestMagicLinkMutationOptions,
|
|
4302
4333
|
getPersonSetTemporaryPasswordMutationOptions,
|
|
4303
4334
|
getPersonUpdatePersonMutationOptions,
|
|
4335
|
+
getPlanAddOnGetAllPlanAddOnsQueryKey,
|
|
4336
|
+
getPlanAddOnGetAllPlanAddOnsQueryOptions,
|
|
4304
4337
|
getPlanAddPlanMutationOptions,
|
|
4305
4338
|
getPlanDeletePlanMutationOptions,
|
|
4306
4339
|
getPlanFamilyAddPlanFamilyMutationOptions,
|
|
@@ -4364,6 +4397,7 @@ export {
|
|
|
4364
4397
|
personRequestMagicLink,
|
|
4365
4398
|
personSetTemporaryPassword,
|
|
4366
4399
|
personUpdatePerson,
|
|
4400
|
+
planAddOnGetAllPlanAddOns,
|
|
4367
4401
|
planAddPlan,
|
|
4368
4402
|
planDeletePlan,
|
|
4369
4403
|
planFamilyAddPlanFamily,
|
|
@@ -4488,6 +4522,7 @@ export {
|
|
|
4488
4522
|
usePersonRequestMagicLink,
|
|
4489
4523
|
usePersonSetTemporaryPassword,
|
|
4490
4524
|
usePersonUpdatePerson,
|
|
4525
|
+
usePlanAddOnGetAllPlanAddOns,
|
|
4491
4526
|
usePlanAddPlan,
|
|
4492
4527
|
usePlanDeletePlan,
|
|
4493
4528
|
usePlanFamilyAddPlanFamily,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outseta/react",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.36",
|
|
4
4
|
"description": "React hooks and components for the Outseta API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@outseta/api-client": "0.3.
|
|
21
|
+
"@outseta/api-client": "0.3.42"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^18.0.0 || ^19.0.0"
|
|
@@ -30,6 +30,8 @@ import type {
|
|
|
30
30
|
PaymentInformation,
|
|
31
31
|
PaymentInformationSavePaymentInformationBody,
|
|
32
32
|
Plan,
|
|
33
|
+
PlanAddOnGetAllPlanAddOns200,
|
|
34
|
+
PlanAddOnGetAllPlanAddOnsParams,
|
|
33
35
|
PlanAddPlanBody,
|
|
34
36
|
PlanFamily,
|
|
35
37
|
PlanFamilyAddPlanFamilyBody,
|
|
@@ -2835,6 +2837,80 @@ export const usePlanDeletePlan = <TError = void,
|
|
|
2835
2837
|
return useMutation(mutationOptions);
|
|
2836
2838
|
}
|
|
2837
2839
|
/**
|
|
2840
|
+
* Standard filtering applies, so the associations of a single plan are retrieved
|
|
2841
|
+
with ?Plan.Uid={planUid} and those of a single add-on with ?AddOn.Uid={addOnUid}.
|
|
2842
|
+
A PlanAddOns collection nested inside a plan or an add-on holds at most 100
|
|
2843
|
+
entries, so a plan with more add-ons than that is read in full through this
|
|
2844
|
+
endpoint, which is paginated and has no such maximum.
|
|
2845
|
+
* @summary Retrieve the associations between plans and add-ons.
|
|
2846
|
+
*/
|
|
2847
|
+
export const planAddOnGetAllPlanAddOns = (
|
|
2848
|
+
params?: PlanAddOnGetAllPlanAddOnsParams,
|
|
2849
|
+
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
|
2850
|
+
) => {
|
|
2851
|
+
|
|
2852
|
+
|
|
2853
|
+
return customFetch<PlanAddOnGetAllPlanAddOns200>(
|
|
2854
|
+
{url: `/api/v1/billing/planaddons`, method: 'GET',
|
|
2855
|
+
params, signal
|
|
2856
|
+
},
|
|
2857
|
+
options);
|
|
2858
|
+
}
|
|
2859
|
+
|
|
2860
|
+
|
|
2861
|
+
|
|
2862
|
+
|
|
2863
|
+
export const getPlanAddOnGetAllPlanAddOnsQueryKey = (params?: PlanAddOnGetAllPlanAddOnsParams,) => {
|
|
2864
|
+
return [
|
|
2865
|
+
`/api/v1/billing/planaddons`, ...(params ? [params]: [])
|
|
2866
|
+
] as const;
|
|
2867
|
+
}
|
|
2868
|
+
|
|
2869
|
+
|
|
2870
|
+
export const getPlanAddOnGetAllPlanAddOnsQueryOptions = <TData = Awaited<ReturnType<typeof planAddOnGetAllPlanAddOns>>, TError = void>(params?: PlanAddOnGetAllPlanAddOnsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof planAddOnGetAllPlanAddOns>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
2871
|
+
) => {
|
|
2872
|
+
|
|
2873
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
2874
|
+
|
|
2875
|
+
const queryKey = queryOptions?.queryKey ?? getPlanAddOnGetAllPlanAddOnsQueryKey(params);
|
|
2876
|
+
|
|
2877
|
+
|
|
2878
|
+
|
|
2879
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof planAddOnGetAllPlanAddOns>>> = ({ signal }) => planAddOnGetAllPlanAddOns(params, requestOptions, signal);
|
|
2880
|
+
|
|
2881
|
+
|
|
2882
|
+
|
|
2883
|
+
|
|
2884
|
+
|
|
2885
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof planAddOnGetAllPlanAddOns>>, TError, TData> & { queryKey: QueryKey }
|
|
2886
|
+
}
|
|
2887
|
+
|
|
2888
|
+
export type PlanAddOnGetAllPlanAddOnsQueryResult = NonNullable<Awaited<ReturnType<typeof planAddOnGetAllPlanAddOns>>>
|
|
2889
|
+
export type PlanAddOnGetAllPlanAddOnsQueryError = void
|
|
2890
|
+
|
|
2891
|
+
|
|
2892
|
+
/**
|
|
2893
|
+
* @summary Retrieve the associations between plans and add-ons.
|
|
2894
|
+
*/
|
|
2895
|
+
|
|
2896
|
+
export function usePlanAddOnGetAllPlanAddOns<TData = Awaited<ReturnType<typeof planAddOnGetAllPlanAddOns>>, TError = void>(
|
|
2897
|
+
params?: PlanAddOnGetAllPlanAddOnsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof planAddOnGetAllPlanAddOns>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
|
|
2898
|
+
|
|
2899
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
2900
|
+
|
|
2901
|
+
const queryOptions = getPlanAddOnGetAllPlanAddOnsQueryOptions(params,options)
|
|
2902
|
+
|
|
2903
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
2904
|
+
|
|
2905
|
+
query.queryKey = queryOptions.queryKey ;
|
|
2906
|
+
|
|
2907
|
+
return query;
|
|
2908
|
+
}
|
|
2909
|
+
|
|
2910
|
+
|
|
2911
|
+
|
|
2912
|
+
|
|
2913
|
+
/**
|
|
2838
2914
|
* @summary Retrieve all plan families.
|
|
2839
2915
|
*/
|
|
2840
2916
|
export const planFamilyGetAllPlanFamilies = (
|
|
@@ -481,6 +481,11 @@ export type AccountAllOfPrimarySubscription = Subscription | null;
|
|
|
481
481
|
*/
|
|
482
482
|
export type AccountAllOfPrimaryStripeSubscription = StripeSubscription | null;
|
|
483
483
|
|
|
484
|
+
/**
|
|
485
|
+
* @nullable
|
|
486
|
+
*/
|
|
487
|
+
export type AccountAllOfStripeCheckoutMetadata = {[key: string]: string} | null;
|
|
488
|
+
|
|
484
489
|
export type AccountAllOf = {
|
|
485
490
|
/**
|
|
486
491
|
* @minLength 1
|
|
@@ -595,6 +600,8 @@ export type AccountAllOf = {
|
|
|
595
600
|
/** @nullable */
|
|
596
601
|
CurrentStripeProducts?: string | null;
|
|
597
602
|
/** @nullable */
|
|
603
|
+
CurrentStripeProductInstances?: StripeProduct[] | null;
|
|
604
|
+
/** @nullable */
|
|
598
605
|
CurrentSubscription?: AccountAllOfCurrentSubscription;
|
|
599
606
|
/** @nullable */
|
|
600
607
|
DomainName?: string | null;
|
|
@@ -615,6 +622,8 @@ export type AccountAllOf = {
|
|
|
615
622
|
/** @nullable */
|
|
616
623
|
RecaptchaToken?: string | null;
|
|
617
624
|
/** @nullable */
|
|
625
|
+
StripeCheckoutMetadata?: AccountAllOfStripeCheckoutMetadata;
|
|
626
|
+
/** @nullable */
|
|
618
627
|
StripeNextInvoiceSequence?: number | null;
|
|
619
628
|
/** @nullable */
|
|
620
629
|
StripePrice?: string[] | null;
|
|
@@ -1004,6 +1013,8 @@ export type StripeProductAllOf = {
|
|
|
1004
1013
|
NumberOfPurchases?: number;
|
|
1005
1014
|
NumberOfSubscriptions?: number;
|
|
1006
1015
|
/** @nullable */
|
|
1016
|
+
Quantity?: number | null;
|
|
1017
|
+
/** @nullable */
|
|
1007
1018
|
StripeProductFamily?: StripeProductAllOfStripeProductFamily;
|
|
1008
1019
|
[key: string]: unknown | null;
|
|
1009
1020
|
};
|
|
@@ -4564,7 +4575,6 @@ export type CrmSettingsAllOf = {
|
|
|
4564
4575
|
RegistrationConfirmationEmailDelaySeconds?: number;
|
|
4565
4576
|
/** @nullable */
|
|
4566
4577
|
RegistrationCallbackUrlLocations?: string | null;
|
|
4567
|
-
TwoFactorAuthenticationAvailable?: boolean;
|
|
4568
4578
|
MagicLinkLoginOnly?: boolean;
|
|
4569
4579
|
};
|
|
4570
4580
|
|
|
@@ -6125,6 +6135,101 @@ export type AccountWebhookEntityTaxIdsItem = {
|
|
|
6125
6135
|
IsInvalid?: boolean;
|
|
6126
6136
|
};
|
|
6127
6137
|
|
|
6138
|
+
/**
|
|
6139
|
+
* `1` - Individual, `2` - Team
|
|
6140
|
+
*/
|
|
6141
|
+
export type AccountWebhookEntityCurrentStripeProductInstancesItemAccountRegistrationMode = typeof AccountWebhookEntityCurrentStripeProductInstancesItemAccountRegistrationMode[keyof typeof AccountWebhookEntityCurrentStripeProductInstancesItemAccountRegistrationMode];
|
|
6142
|
+
|
|
6143
|
+
|
|
6144
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
6145
|
+
export const AccountWebhookEntityCurrentStripeProductInstancesItemAccountRegistrationMode = {
|
|
6146
|
+
Individual: 1,
|
|
6147
|
+
Team: 2,
|
|
6148
|
+
} as const;
|
|
6149
|
+
|
|
6150
|
+
export type AccountWebhookEntityCurrentStripeProductInstancesItem = {
|
|
6151
|
+
/**
|
|
6152
|
+
* @maxLength 10
|
|
6153
|
+
* @nullable
|
|
6154
|
+
*/
|
|
6155
|
+
Uid?: string | null;
|
|
6156
|
+
/** @nullable */
|
|
6157
|
+
_objectType?: string | null;
|
|
6158
|
+
/** @minLength 1 */
|
|
6159
|
+
Created: string;
|
|
6160
|
+
/** @minLength 1 */
|
|
6161
|
+
Updated: string;
|
|
6162
|
+
/**
|
|
6163
|
+
* @maxLength 255
|
|
6164
|
+
* @nullable
|
|
6165
|
+
*/
|
|
6166
|
+
StripeId?: string | null;
|
|
6167
|
+
IsLivemode?: boolean;
|
|
6168
|
+
/**
|
|
6169
|
+
* @maxLength 250
|
|
6170
|
+
* @nullable
|
|
6171
|
+
*/
|
|
6172
|
+
Name?: string | null;
|
|
6173
|
+
/**
|
|
6174
|
+
* @maxLength 255
|
|
6175
|
+
* @nullable
|
|
6176
|
+
*/
|
|
6177
|
+
DefaultPriceId?: string | null;
|
|
6178
|
+
/** @nullable */
|
|
6179
|
+
Description?: string | null;
|
|
6180
|
+
IsActive?: boolean;
|
|
6181
|
+
/**
|
|
6182
|
+
* @maxLength 36
|
|
6183
|
+
* @nullable
|
|
6184
|
+
*/
|
|
6185
|
+
TaxCodeId?: string | null;
|
|
6186
|
+
/**
|
|
6187
|
+
* @maxLength 250
|
|
6188
|
+
* @nullable
|
|
6189
|
+
*/
|
|
6190
|
+
UnitLabel?: string | null;
|
|
6191
|
+
/** `1` - Individual, `2` - Team */
|
|
6192
|
+
AccountRegistrationMode?: AccountWebhookEntityCurrentStripeProductInstancesItemAccountRegistrationMode;
|
|
6193
|
+
ExpiresAfterMonths?: number;
|
|
6194
|
+
/** @nullable */
|
|
6195
|
+
ExpirationDate?: string | null;
|
|
6196
|
+
IsPerUser?: boolean;
|
|
6197
|
+
IsQuantityEditable?: boolean;
|
|
6198
|
+
/** @nullable */
|
|
6199
|
+
MaximumPeople?: number | null;
|
|
6200
|
+
/**
|
|
6201
|
+
* @maxLength 8
|
|
6202
|
+
* @nullable
|
|
6203
|
+
*/
|
|
6204
|
+
MigratedAddOnUid?: string | null;
|
|
6205
|
+
/**
|
|
6206
|
+
* @maxLength 8
|
|
6207
|
+
* @nullable
|
|
6208
|
+
*/
|
|
6209
|
+
MigratedPlanUid?: string | null;
|
|
6210
|
+
/** @nullable */
|
|
6211
|
+
MinimumQuantity?: number | null;
|
|
6212
|
+
/**
|
|
6213
|
+
* @maxLength 250
|
|
6214
|
+
* @nullable
|
|
6215
|
+
*/
|
|
6216
|
+
PostLoginPath?: string | null;
|
|
6217
|
+
/**
|
|
6218
|
+
* @maxLength 500
|
|
6219
|
+
* @nullable
|
|
6220
|
+
*/
|
|
6221
|
+
PostPurchaseUrl?: string | null;
|
|
6222
|
+
RequirePaymentInformation?: boolean;
|
|
6223
|
+
TrialPeriodDays?: number;
|
|
6224
|
+
/** @nullable */
|
|
6225
|
+
TrialUntilDate?: string | null;
|
|
6226
|
+
CanDelete?: boolean;
|
|
6227
|
+
NumberOfPurchases?: number;
|
|
6228
|
+
NumberOfSubscriptions?: number;
|
|
6229
|
+
/** @nullable */
|
|
6230
|
+
Quantity?: number | null;
|
|
6231
|
+
};
|
|
6232
|
+
|
|
6128
6233
|
/**
|
|
6129
6234
|
* `1` - Monthly, `2` - Yearly, `3` - Quarterly, `4` - One Time
|
|
6130
6235
|
*/
|
|
@@ -7394,6 +7499,8 @@ export interface AccountWebhookEntity {
|
|
|
7394
7499
|
/** @nullable */
|
|
7395
7500
|
CurrentStripeProducts?: string | null;
|
|
7396
7501
|
/** @nullable */
|
|
7502
|
+
CurrentStripeProductInstances?: AccountWebhookEntityCurrentStripeProductInstancesItem[] | null;
|
|
7503
|
+
/** @nullable */
|
|
7397
7504
|
CurrentSubscription?: AccountWebhookEntityCurrentSubscription;
|
|
7398
7505
|
/** @nullable */
|
|
7399
7506
|
DomainName?: string | null;
|
|
@@ -10074,6 +10181,22 @@ export type PlanAddPlanBody = Plan | null;
|
|
|
10074
10181
|
*/
|
|
10075
10182
|
export type PlanUpdatePlanBody = Plan | null;
|
|
10076
10183
|
|
|
10184
|
+
export type PlanAddOnGetAllPlanAddOnsParams = {
|
|
10185
|
+
/**
|
|
10186
|
+
* 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.
|
|
10187
|
+
*/
|
|
10188
|
+
limit?: LimitParameter;
|
|
10189
|
+
/**
|
|
10190
|
+
* 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).
|
|
10191
|
+
*/
|
|
10192
|
+
offset?: OffsetParameter;
|
|
10193
|
+
};
|
|
10194
|
+
|
|
10195
|
+
export type PlanAddOnGetAllPlanAddOns200 = {
|
|
10196
|
+
metadata?: CollectionMetadata;
|
|
10197
|
+
items?: PlanAddOn[];
|
|
10198
|
+
};
|
|
10199
|
+
|
|
10077
10200
|
export type PlanFamilyGetAllPlanFamiliesParams = {
|
|
10078
10201
|
/**
|
|
10079
10202
|
* 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.
|