@ophelio/sdk 0.1.1 → 0.2.1
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/README.md +71 -50
- package/dist/index.cjs +162 -33
- package/dist/index.d.cts +226 -34
- package/dist/index.d.mts +226 -34
- package/dist/index.mjs +161 -34
- package/package.json +5 -2
package/dist/index.d.cts
CHANGED
|
@@ -56,12 +56,6 @@ declare class Transport {
|
|
|
56
56
|
private parseBody;
|
|
57
57
|
}
|
|
58
58
|
//#endregion
|
|
59
|
-
//#region src/resources/resource.d.ts
|
|
60
|
-
declare class APIResource {
|
|
61
|
-
protected readonly transport: Transport;
|
|
62
|
-
constructor(transport: Transport);
|
|
63
|
-
}
|
|
64
|
-
//#endregion
|
|
65
59
|
//#region src/generated/schema.d.ts
|
|
66
60
|
/**
|
|
67
61
|
* This file was auto-generated by openapi-typescript.
|
|
@@ -993,6 +987,16 @@ interface components {
|
|
|
993
987
|
create_time: string;
|
|
994
988
|
};
|
|
995
989
|
ListAuditLogsResponse: {
|
|
990
|
+
/**
|
|
991
|
+
* @description Opaque token for the next page; empty string on the last page.
|
|
992
|
+
* @example
|
|
993
|
+
*/
|
|
994
|
+
next_page_token: string;
|
|
995
|
+
/**
|
|
996
|
+
* @description Total number of results across all pages.
|
|
997
|
+
* @example 42
|
|
998
|
+
*/
|
|
999
|
+
total_size: number;
|
|
996
1000
|
audit_logs: components["schemas"]["AuditLogs"][];
|
|
997
1001
|
};
|
|
998
1002
|
Project: {
|
|
@@ -1427,6 +1431,16 @@ interface components {
|
|
|
1427
1431
|
create_time: string;
|
|
1428
1432
|
};
|
|
1429
1433
|
ListWebhookDeliveriesResponse: {
|
|
1434
|
+
/**
|
|
1435
|
+
* @description Opaque token for the next page; empty string on the last page.
|
|
1436
|
+
* @example
|
|
1437
|
+
*/
|
|
1438
|
+
next_page_token: string;
|
|
1439
|
+
/**
|
|
1440
|
+
* @description Total number of results across all pages.
|
|
1441
|
+
* @example 42
|
|
1442
|
+
*/
|
|
1443
|
+
total_size: number;
|
|
1430
1444
|
webhook_deliveries: components["schemas"]["WebhookDelivery"][];
|
|
1431
1445
|
};
|
|
1432
1446
|
CreateWebhookSubscriptionDto: {
|
|
@@ -1540,6 +1554,16 @@ interface components {
|
|
|
1540
1554
|
current_term: components["schemas"]["MembershipTerm"] | null;
|
|
1541
1555
|
};
|
|
1542
1556
|
ListMembershipsResponse: {
|
|
1557
|
+
/**
|
|
1558
|
+
* @description Opaque token for the next page; empty string on the last page.
|
|
1559
|
+
* @example
|
|
1560
|
+
*/
|
|
1561
|
+
next_page_token: string;
|
|
1562
|
+
/**
|
|
1563
|
+
* @description Total number of results across all pages.
|
|
1564
|
+
* @example 42
|
|
1565
|
+
*/
|
|
1566
|
+
total_size: number;
|
|
1543
1567
|
memberships: components["schemas"]["Membership"][];
|
|
1544
1568
|
};
|
|
1545
1569
|
ListMembershipMembersResponse: {
|
|
@@ -1623,6 +1647,16 @@ interface components {
|
|
|
1623
1647
|
applied_term: components["schemas"]["MembershipTerm"] | null;
|
|
1624
1648
|
};
|
|
1625
1649
|
ListScheduledChangesResponse: {
|
|
1650
|
+
/**
|
|
1651
|
+
* @description Opaque token for the next page; empty string on the last page.
|
|
1652
|
+
* @example
|
|
1653
|
+
*/
|
|
1654
|
+
next_page_token: string;
|
|
1655
|
+
/**
|
|
1656
|
+
* @description Total number of results across all pages.
|
|
1657
|
+
* @example 42
|
|
1658
|
+
*/
|
|
1659
|
+
total_size: number;
|
|
1626
1660
|
scheduled_changes: components["schemas"]["MembershipScheduledChangeResponseDto"][];
|
|
1627
1661
|
};
|
|
1628
1662
|
Transaction: {
|
|
@@ -1643,6 +1677,16 @@ interface components {
|
|
|
1643
1677
|
update_time: string;
|
|
1644
1678
|
};
|
|
1645
1679
|
ListTransactionsResponse: {
|
|
1680
|
+
/**
|
|
1681
|
+
* @description Opaque token for the next page; empty string on the last page.
|
|
1682
|
+
* @example
|
|
1683
|
+
*/
|
|
1684
|
+
next_page_token: string;
|
|
1685
|
+
/**
|
|
1686
|
+
* @description Total number of results across all pages.
|
|
1687
|
+
* @example 42
|
|
1688
|
+
*/
|
|
1689
|
+
total_size: number;
|
|
1646
1690
|
transactions: components["schemas"]["Transaction"][];
|
|
1647
1691
|
};
|
|
1648
1692
|
CreateTransactionDto: {
|
|
@@ -1666,6 +1710,16 @@ interface components {
|
|
|
1666
1710
|
update_time: string;
|
|
1667
1711
|
};
|
|
1668
1712
|
ListCustomersResponse: {
|
|
1713
|
+
/**
|
|
1714
|
+
* @description Opaque token for the next page; empty string on the last page.
|
|
1715
|
+
* @example
|
|
1716
|
+
*/
|
|
1717
|
+
next_page_token: string;
|
|
1718
|
+
/**
|
|
1719
|
+
* @description Total number of results across all pages.
|
|
1720
|
+
* @example 42
|
|
1721
|
+
*/
|
|
1722
|
+
total_size: number;
|
|
1669
1723
|
customers: components["schemas"]["Customer"][];
|
|
1670
1724
|
};
|
|
1671
1725
|
CreateCustomerDto: {
|
|
@@ -1676,6 +1730,19 @@ interface components {
|
|
|
1676
1730
|
name: string; /** Format: email */
|
|
1677
1731
|
email: string;
|
|
1678
1732
|
};
|
|
1733
|
+
ListCustomerMembershipsResponse: {
|
|
1734
|
+
/**
|
|
1735
|
+
* @description Opaque token for the next page; empty string on the last page.
|
|
1736
|
+
* @example
|
|
1737
|
+
*/
|
|
1738
|
+
next_page_token: string;
|
|
1739
|
+
/**
|
|
1740
|
+
* @description Total number of results across all pages.
|
|
1741
|
+
* @example 42
|
|
1742
|
+
*/
|
|
1743
|
+
total_size: number;
|
|
1744
|
+
memberships: components["schemas"]["Membership"][];
|
|
1745
|
+
};
|
|
1679
1746
|
};
|
|
1680
1747
|
responses: never;
|
|
1681
1748
|
parameters: never;
|
|
@@ -1705,7 +1772,10 @@ interface operations {
|
|
|
1705
1772
|
};
|
|
1706
1773
|
AuditLogsController_list: {
|
|
1707
1774
|
parameters: {
|
|
1708
|
-
query?:
|
|
1775
|
+
query?: {
|
|
1776
|
+
page_size?: number;
|
|
1777
|
+
page_token?: string;
|
|
1778
|
+
};
|
|
1709
1779
|
header?: never;
|
|
1710
1780
|
path?: never;
|
|
1711
1781
|
cookie?: never;
|
|
@@ -2846,8 +2916,7 @@ interface operations {
|
|
|
2846
2916
|
parameters: {
|
|
2847
2917
|
query?: never;
|
|
2848
2918
|
header: {
|
|
2849
|
-
|
|
2850
|
-
"Idempotency-Key": string;
|
|
2919
|
+
/** @description Required idempotency key, up to 255 characters. Deduplicated per member: repeating a request with the same key and member returns the original redemption, and reusing that key for the same member with a different entitlement returns 409. A longer key is rejected with 400. */"Idempotency-Key": string;
|
|
2851
2920
|
};
|
|
2852
2921
|
path?: never;
|
|
2853
2922
|
cookie?: never;
|
|
@@ -2882,14 +2951,21 @@ interface operations {
|
|
|
2882
2951
|
"application/json": components["schemas"]["ErrorResponse"];
|
|
2883
2952
|
};
|
|
2884
2953
|
};
|
|
2954
|
+
409: {
|
|
2955
|
+
headers: {
|
|
2956
|
+
[name: string]: unknown;
|
|
2957
|
+
};
|
|
2958
|
+
content: {
|
|
2959
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2960
|
+
};
|
|
2961
|
+
};
|
|
2885
2962
|
};
|
|
2886
2963
|
};
|
|
2887
2964
|
EntitlementsController_usage: {
|
|
2888
2965
|
parameters: {
|
|
2889
2966
|
query?: never;
|
|
2890
2967
|
header: {
|
|
2891
|
-
|
|
2892
|
-
"Idempotency-Key": string;
|
|
2968
|
+
/** @description Required idempotency key, up to 255 characters. One usage row is recorded per member, so the same key may carry different members across calls. A longer key is rejected with 400. */"Idempotency-Key": string;
|
|
2893
2969
|
};
|
|
2894
2970
|
path?: never;
|
|
2895
2971
|
cookie?: never;
|
|
@@ -3277,7 +3353,10 @@ interface operations {
|
|
|
3277
3353
|
};
|
|
3278
3354
|
WebhookSubscriptionsController_listDeliveries: {
|
|
3279
3355
|
parameters: {
|
|
3280
|
-
query?:
|
|
3356
|
+
query?: {
|
|
3357
|
+
page_size?: number;
|
|
3358
|
+
page_token?: string;
|
|
3359
|
+
};
|
|
3281
3360
|
header?: never;
|
|
3282
3361
|
path?: never;
|
|
3283
3362
|
cookie?: never;
|
|
@@ -3558,7 +3637,10 @@ interface operations {
|
|
|
3558
3637
|
};
|
|
3559
3638
|
MembershipsController_list: {
|
|
3560
3639
|
parameters: {
|
|
3561
|
-
query?:
|
|
3640
|
+
query?: {
|
|
3641
|
+
page_size?: number;
|
|
3642
|
+
page_token?: string;
|
|
3643
|
+
};
|
|
3562
3644
|
header?: never;
|
|
3563
3645
|
path?: never;
|
|
3564
3646
|
cookie?: never;
|
|
@@ -3578,7 +3660,9 @@ interface operations {
|
|
|
3578
3660
|
MembershipsController_create: {
|
|
3579
3661
|
parameters: {
|
|
3580
3662
|
query?: never;
|
|
3581
|
-
header?:
|
|
3663
|
+
header?: {
|
|
3664
|
+
/** @description Optional idempotency key, up to 255 characters. Repeating a request with the same key returns the original result; reusing a key with a different request body returns 409. A longer key is rejected with 400, and an empty or whitespace-only value is treated as no key. */"Idempotency-Key"?: string;
|
|
3665
|
+
};
|
|
3582
3666
|
path?: never;
|
|
3583
3667
|
cookie?: never;
|
|
3584
3668
|
};
|
|
@@ -3604,6 +3688,14 @@ interface operations {
|
|
|
3604
3688
|
"application/json": components["schemas"]["ErrorResponse"];
|
|
3605
3689
|
};
|
|
3606
3690
|
};
|
|
3691
|
+
409: {
|
|
3692
|
+
headers: {
|
|
3693
|
+
[name: string]: unknown;
|
|
3694
|
+
};
|
|
3695
|
+
content: {
|
|
3696
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
3697
|
+
};
|
|
3698
|
+
};
|
|
3607
3699
|
};
|
|
3608
3700
|
};
|
|
3609
3701
|
MembershipsController_get: {
|
|
@@ -3752,7 +3844,9 @@ interface operations {
|
|
|
3752
3844
|
MembershipsController_renew: {
|
|
3753
3845
|
parameters: {
|
|
3754
3846
|
query?: never;
|
|
3755
|
-
header?:
|
|
3847
|
+
header?: {
|
|
3848
|
+
/** @description Optional idempotency key, up to 255 characters. Repeating a request with the same key returns the original result; reusing a key with a different request body returns 409. A longer key is rejected with 400, and an empty or whitespace-only value is treated as no key. */"Idempotency-Key"?: string;
|
|
3849
|
+
};
|
|
3756
3850
|
path?: never;
|
|
3757
3851
|
cookie?: never;
|
|
3758
3852
|
};
|
|
@@ -3778,6 +3872,14 @@ interface operations {
|
|
|
3778
3872
|
"application/json": components["schemas"]["ErrorResponse"];
|
|
3779
3873
|
};
|
|
3780
3874
|
};
|
|
3875
|
+
409: {
|
|
3876
|
+
headers: {
|
|
3877
|
+
[name: string]: unknown;
|
|
3878
|
+
};
|
|
3879
|
+
content: {
|
|
3880
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
3881
|
+
};
|
|
3882
|
+
};
|
|
3781
3883
|
};
|
|
3782
3884
|
};
|
|
3783
3885
|
MembershipsController_upgrade: {
|
|
@@ -3845,6 +3947,8 @@ interface operations {
|
|
|
3845
3947
|
MembershipsController_listScheduledChanges: {
|
|
3846
3948
|
parameters: {
|
|
3847
3949
|
query?: {
|
|
3950
|
+
page_size?: number;
|
|
3951
|
+
page_token?: string;
|
|
3848
3952
|
status?: ("pending" | "applied" | "cancelled" | "superseded" | "failed" | "all")[];
|
|
3849
3953
|
};
|
|
3850
3954
|
header?: never;
|
|
@@ -3890,7 +3994,10 @@ interface operations {
|
|
|
3890
3994
|
};
|
|
3891
3995
|
MembershipsController_listTransactions: {
|
|
3892
3996
|
parameters: {
|
|
3893
|
-
query?:
|
|
3997
|
+
query?: {
|
|
3998
|
+
page_size?: number;
|
|
3999
|
+
page_token?: string;
|
|
4000
|
+
};
|
|
3894
4001
|
header?: never;
|
|
3895
4002
|
path?: never;
|
|
3896
4003
|
cookie?: never;
|
|
@@ -3918,7 +4025,9 @@ interface operations {
|
|
|
3918
4025
|
MembershipsController_recordTransaction: {
|
|
3919
4026
|
parameters: {
|
|
3920
4027
|
query?: never;
|
|
3921
|
-
header?:
|
|
4028
|
+
header?: {
|
|
4029
|
+
/** @description Optional idempotency key, up to 255 characters. Repeating a request with the same key returns the original result; reusing a key with a different request body returns 409. A longer key is rejected with 400, and an empty or whitespace-only value is treated as no key. */"Idempotency-Key"?: string;
|
|
4030
|
+
};
|
|
3922
4031
|
path?: never;
|
|
3923
4032
|
cookie?: never;
|
|
3924
4033
|
};
|
|
@@ -3944,11 +4053,22 @@ interface operations {
|
|
|
3944
4053
|
"application/json": components["schemas"]["ErrorResponse"];
|
|
3945
4054
|
};
|
|
3946
4055
|
};
|
|
4056
|
+
409: {
|
|
4057
|
+
headers: {
|
|
4058
|
+
[name: string]: unknown;
|
|
4059
|
+
};
|
|
4060
|
+
content: {
|
|
4061
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
4062
|
+
};
|
|
4063
|
+
};
|
|
3947
4064
|
};
|
|
3948
4065
|
};
|
|
3949
4066
|
MembershipsController_listTermTransactions: {
|
|
3950
4067
|
parameters: {
|
|
3951
|
-
query?:
|
|
4068
|
+
query?: {
|
|
4069
|
+
page_size?: number;
|
|
4070
|
+
page_token?: string;
|
|
4071
|
+
};
|
|
3952
4072
|
header?: never;
|
|
3953
4073
|
path?: never;
|
|
3954
4074
|
cookie?: never;
|
|
@@ -3975,7 +4095,10 @@ interface operations {
|
|
|
3975
4095
|
};
|
|
3976
4096
|
CustomersController_list: {
|
|
3977
4097
|
parameters: {
|
|
3978
|
-
query?:
|
|
4098
|
+
query?: {
|
|
4099
|
+
page_size?: number;
|
|
4100
|
+
page_token?: string;
|
|
4101
|
+
};
|
|
3979
4102
|
header?: never;
|
|
3980
4103
|
path?: never;
|
|
3981
4104
|
cookie?: never;
|
|
@@ -4110,7 +4233,10 @@ interface operations {
|
|
|
4110
4233
|
};
|
|
4111
4234
|
CustomersController_listMemberships: {
|
|
4112
4235
|
parameters: {
|
|
4113
|
-
query?:
|
|
4236
|
+
query?: {
|
|
4237
|
+
page_size?: number;
|
|
4238
|
+
page_token?: string;
|
|
4239
|
+
};
|
|
4114
4240
|
header?: never;
|
|
4115
4241
|
path?: never;
|
|
4116
4242
|
cookie?: never;
|
|
@@ -4122,7 +4248,7 @@ interface operations {
|
|
|
4122
4248
|
[name: string]: unknown;
|
|
4123
4249
|
};
|
|
4124
4250
|
content: {
|
|
4125
|
-
"application/json": components["schemas"]["
|
|
4251
|
+
"application/json": components["schemas"]["ListCustomerMembershipsResponse"];
|
|
4126
4252
|
};
|
|
4127
4253
|
};
|
|
4128
4254
|
404: {
|
|
@@ -4298,6 +4424,19 @@ type ScheduledChange = Schemas['MembershipScheduledChangeResponseDto'];
|
|
|
4298
4424
|
type PlanChangeResult = Schemas['PlanChangeResponseDto'];
|
|
4299
4425
|
type MemberSyncResponse = Schemas['MemberSyncResponse'];
|
|
4300
4426
|
type RedeemEntitlementResponse = Schemas['RedeemEntitlementResponseDto'];
|
|
4427
|
+
interface PageParams {
|
|
4428
|
+
/** Rows per page. Server default 50; capped at 250. */
|
|
4429
|
+
page_size?: number;
|
|
4430
|
+
/** Opaque token from a previous page's `next_page_token`. */
|
|
4431
|
+
page_token?: string;
|
|
4432
|
+
}
|
|
4433
|
+
interface Page<T> {
|
|
4434
|
+
items: T[];
|
|
4435
|
+
/** Opaque token for the next page; empty string on the last page. */
|
|
4436
|
+
next_page_token: string;
|
|
4437
|
+
/** Total number of rows across all pages. */
|
|
4438
|
+
total_size: number;
|
|
4439
|
+
}
|
|
4301
4440
|
type CreateMembershipParams = Schemas['CreateMembershipDto'];
|
|
4302
4441
|
type UpdateMembershipParams = Schemas['UpdateMembershipDto'];
|
|
4303
4442
|
type CancelMembershipParams = Schemas['CancelMembershipDto'];
|
|
@@ -4330,6 +4469,12 @@ type RenewMembershipParams = Schemas['RenewMembershipDto'];
|
|
|
4330
4469
|
type PlanChangeParams = Schemas['PlanChangeDto'];
|
|
4331
4470
|
type EntitlementType = 'free_entry' | 'guest_pass' | 'discount' | 'early_access';
|
|
4332
4471
|
//#endregion
|
|
4472
|
+
//#region src/resources/resource.d.ts
|
|
4473
|
+
declare class APIResource {
|
|
4474
|
+
protected readonly transport: Transport;
|
|
4475
|
+
constructor(transport: Transport);
|
|
4476
|
+
}
|
|
4477
|
+
//#endregion
|
|
4333
4478
|
//#region src/resources/admit.d.ts
|
|
4334
4479
|
declare class AdmitResource extends APIResource {
|
|
4335
4480
|
/** Gate admission check: `GET /admit?card=<cardId>`. */
|
|
@@ -4356,12 +4501,12 @@ declare class BillingOptionsResource extends APIResource {
|
|
|
4356
4501
|
//#endregion
|
|
4357
4502
|
//#region src/resources/customers.d.ts
|
|
4358
4503
|
declare class CustomersResource extends APIResource {
|
|
4359
|
-
list(options?: RequestOptions): Promise<Customer
|
|
4504
|
+
list(params?: PageParams, options?: RequestOptions): Promise<Page<Customer>>;
|
|
4360
4505
|
get(id: string, options?: RequestOptions): Promise<Customer>;
|
|
4361
4506
|
create(params: CreateCustomerParams, options?: RequestOptions): Promise<Customer>;
|
|
4362
4507
|
update(id: string, params: UpdateCustomerParams, options?: RequestOptions): Promise<Customer>;
|
|
4363
4508
|
delete(id: string, options?: RequestOptions): Promise<void>;
|
|
4364
|
-
listMemberships(id: string, options?: RequestOptions): Promise<Membership
|
|
4509
|
+
listMemberships(id: string, params?: PageParams, options?: RequestOptions): Promise<Page<Membership>>;
|
|
4365
4510
|
}
|
|
4366
4511
|
//#endregion
|
|
4367
4512
|
//#region src/resources/entitlements.d.ts
|
|
@@ -4412,22 +4557,37 @@ declare class MembersResource extends APIResource {
|
|
|
4412
4557
|
//#endregion
|
|
4413
4558
|
//#region src/resources/memberships.d.ts
|
|
4414
4559
|
declare class MembershipsResource extends APIResource {
|
|
4415
|
-
list(options?: RequestOptions): Promise<Membership
|
|
4560
|
+
list(params?: PageParams, options?: RequestOptions): Promise<Page<Membership>>;
|
|
4416
4561
|
get(id: string, options?: RequestOptions): Promise<Membership>;
|
|
4417
|
-
|
|
4562
|
+
/**
|
|
4563
|
+
* Create a membership atomically (record, members, first term, optional
|
|
4564
|
+
* payment). Idempotent: the Idempotency-Key is generated once per call (and
|
|
4565
|
+
* reused across the SDK's internal retries), so a retried create returns the
|
|
4566
|
+
* original membership instead of creating a duplicate. Supply your own key to
|
|
4567
|
+
* dedupe application-level retries across processes.
|
|
4568
|
+
*/
|
|
4569
|
+
create(params: CreateMembershipParams, options?: IdempotentRequestOptions): Promise<Membership>;
|
|
4418
4570
|
update(id: string, params: UpdateMembershipParams, options?: RequestOptions): Promise<Membership>;
|
|
4419
4571
|
/** Cancellation is a state change, not a delete — see also `uncancel`. */
|
|
4420
4572
|
cancel(id: string, params: CancelMembershipParams, options?: RequestOptions): Promise<Membership>;
|
|
4421
4573
|
uncancel(id: string, options?: RequestOptions): Promise<Membership>;
|
|
4422
|
-
listTransactions(id: string, options?: RequestOptions): Promise<Transaction
|
|
4574
|
+
listTransactions(id: string, params?: PageParams, options?: RequestOptions): Promise<Page<Transaction>>;
|
|
4423
4575
|
/**
|
|
4424
4576
|
* Report a payment outcome. Ophel.io never processes payments — your
|
|
4425
4577
|
* payment provider does; this records the result and drives dunning.
|
|
4578
|
+
* Idempotent: the Idempotency-Key is generated once per call (and reused
|
|
4579
|
+
* across the SDK's internal retries), so a retried report records the
|
|
4580
|
+
* transaction once and does not advance dunning twice.
|
|
4426
4581
|
*/
|
|
4427
|
-
createTransaction(id: string, params: CreateTransactionParams, options?:
|
|
4582
|
+
createTransaction(id: string, params: CreateTransactionParams, options?: IdempotentRequestOptions): Promise<Transaction>;
|
|
4428
4583
|
listMembers(id: string, options?: RequestOptions): Promise<Member[]>;
|
|
4429
|
-
/**
|
|
4430
|
-
|
|
4584
|
+
/**
|
|
4585
|
+
* Open the next term. Rejected (409) while cancelled or cancellation-pending.
|
|
4586
|
+
* Idempotent: the Idempotency-Key is generated once per call (and reused
|
|
4587
|
+
* across the SDK's internal retries), so a retried renewal returns the
|
|
4588
|
+
* original result instead of opening a second term.
|
|
4589
|
+
*/
|
|
4590
|
+
renew(id: string, params: RenewMembershipParams, options?: IdempotentRequestOptions): Promise<Membership>;
|
|
4431
4591
|
/**
|
|
4432
4592
|
* Move to a linked higher plan. Applies immediately or schedules at term
|
|
4433
4593
|
* end — `scheduled_change` is non-null in the deferred case.
|
|
@@ -4435,11 +4595,11 @@ declare class MembershipsResource extends APIResource {
|
|
|
4435
4595
|
upgrade(id: string, params: PlanChangeParams, options?: RequestOptions): Promise<PlanChangeResult>;
|
|
4436
4596
|
/** Mirror of upgrade towards a linked lower plan. */
|
|
4437
4597
|
downgrade(id: string, params: PlanChangeParams, options?: RequestOptions): Promise<PlanChangeResult>;
|
|
4438
|
-
listScheduledChanges(id: string, params?: {
|
|
4598
|
+
listScheduledChanges(id: string, params?: PageParams & {
|
|
4439
4599
|
status?: 'all';
|
|
4440
|
-
}, options?: RequestOptions): Promise<ScheduledChange
|
|
4600
|
+
}, options?: RequestOptions): Promise<Page<ScheduledChange>>;
|
|
4441
4601
|
cancelScheduledChange(id: string, changeId: string, options?: RequestOptions): Promise<void>;
|
|
4442
|
-
listTermTransactions(id: string, termId: string, options?: RequestOptions): Promise<Transaction
|
|
4602
|
+
listTermTransactions(id: string, termId: string, params?: PageParams, options?: RequestOptions): Promise<Page<Transaction>>;
|
|
4443
4603
|
}
|
|
4444
4604
|
//#endregion
|
|
4445
4605
|
//#region src/resources/plan-entitlements.d.ts
|
|
@@ -4501,7 +4661,7 @@ declare class SalesChannelsResource extends APIResource {
|
|
|
4501
4661
|
declare class WebhookSubscriptionsResource extends APIResource {
|
|
4502
4662
|
list(options?: RequestOptions): Promise<WebhookSubscription[]>;
|
|
4503
4663
|
get(id: string, options?: RequestOptions): Promise<WebhookSubscription>;
|
|
4504
|
-
listDeliveries(id: string, options?: RequestOptions): Promise<WebhookDelivery
|
|
4664
|
+
listDeliveries(id: string, params?: PageParams, options?: RequestOptions): Promise<Page<WebhookDelivery>>;
|
|
4505
4665
|
/** The HMAC signing secret is only returned on creation — store it then. */
|
|
4506
4666
|
create(params: CreateWebhookSubscriptionParams, options?: RequestOptions): Promise<WebhookSubscription>;
|
|
4507
4667
|
update(id: string, params: UpdateWebhookSubscriptionParams, options?: RequestOptions): Promise<WebhookSubscription>;
|
|
@@ -4623,4 +4783,36 @@ declare class OphelioTimeoutError extends OphelioError {}
|
|
|
4623
4783
|
/** X-Ophelio-Signature did not match the webhook payload. */
|
|
4624
4784
|
declare class WebhookSignatureVerificationError extends OphelioError {}
|
|
4625
4785
|
//#endregion
|
|
4626
|
-
|
|
4786
|
+
//#region src/core/pagination.d.ts
|
|
4787
|
+
/**
|
|
4788
|
+
* Streams every item across all pages of a paginated `list*` method, fetching
|
|
4789
|
+
* the next page lazily as you iterate:
|
|
4790
|
+
*
|
|
4791
|
+
* ```ts
|
|
4792
|
+
* for await (const membership of paginate((page) => ophelio.memberships.list(page))) {
|
|
4793
|
+
* // …
|
|
4794
|
+
* }
|
|
4795
|
+
*
|
|
4796
|
+
* // nested + filtered + abortable:
|
|
4797
|
+
* for await (const change of paginate((page) =>
|
|
4798
|
+
* ophelio.memberships.listScheduledChanges(id, { ...page, status: 'all' }, { signal }))) {
|
|
4799
|
+
* // …
|
|
4800
|
+
* }
|
|
4801
|
+
* ```
|
|
4802
|
+
*
|
|
4803
|
+
* Because this walks offset pages, a row may be seen twice or skipped across a
|
|
4804
|
+
* page boundary if the collection is written to concurrently.
|
|
4805
|
+
*/
|
|
4806
|
+
declare function paginate<T>(fetchPage: (params: PageParams) => Promise<Page<T>>, params?: PageParams): AsyncGenerator<T>;
|
|
4807
|
+
/**
|
|
4808
|
+
* Drains every page into a single array — the "give me everything" shortcut
|
|
4809
|
+
* over `paginate`. Loads the whole collection into memory, so prefer
|
|
4810
|
+
* `paginate` for large or unbounded lists.
|
|
4811
|
+
*
|
|
4812
|
+
* ```ts
|
|
4813
|
+
* const customers = await collect((page) => ophelio.customers.list(page))
|
|
4814
|
+
* ```
|
|
4815
|
+
*/
|
|
4816
|
+
declare function collect<T>(fetchPage: (params: PageParams) => Promise<Page<T>>, params?: PageParams): Promise<T[]>;
|
|
4817
|
+
//#endregion
|
|
4818
|
+
export { AdmitResult, AlreadyExistsError, BillingOption, BillingOptionSalesChannel, CancelMembershipParams, CreateBillingOptionParams, CreateBillingOptionSalesChannelParams, CreateCustomerParams, CreateEntitlementParams, CreateMemberRoleParams, CreateMembershipParams, CreatePlanEntitlementParams, CreatePlanLinkParams, CreatePlanParams, CreatePlanPricingGroupMappingParams, CreatePricingGroupParams, CreateSalesChannelParams, CreateTransactionParams, CreateWebhookSubscriptionParams, Customer, DEFAULT_BASE_URL, Entitlement, EntitlementType, EntitlementUsage, type IdempotentRequestOptions, InternalError, InvalidArgumentError, Member, MemberEntitlement, MemberRole, MemberSyncResponse, Membership, MembershipTerm, NotFoundError, Ophelio, OphelioConnectionError, OphelioError, type OphelioOptions, OphelioTimeoutError, type OphelioWebhookEvent, Page, PageParams, PermissionDeniedError, Plan, PlanChangeParams, PlanChangeResult, PlanEntitlement, PlanLink, PlanLinkView, PlanPricingGroupMapping, PricingGroup, RecordUsageParams, RedeemEntitlementParams, RedeemEntitlementResponse, ReissueCardParams, RenewMembershipParams, type RequestOptions, ResourceExhaustedError, SalesChannel, ScheduledChange, SyncMember, Transaction, UnauthenticatedError, UnavailableError, UnimplementedError, UpdateBillingOptionParams, UpdateCustomerParams, UpdateEntitlementParams, UpdateMemberRoleParams, UpdateMembershipParams, UpdatePlanEntitlementParams, UpdatePlanParams, UpdatePricingGroupParams, UpdateSalesChannelParams, UpdateWebhookSubscriptionParams, WEBHOOK_EVENT_CODES, WebhookDelivery, type WebhookEventCode, WebhookSignatureVerificationError, WebhookSubscription, collect, type components, constructEvent, type operations, paginate, type paths, verifyWebhookSignature };
|