@ophelio/sdk 0.2.2 → 0.3.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.
- package/README.md +1 -1
- package/dist/index.cjs +12 -2
- package/dist/index.d.cts +72 -44
- package/dist/index.d.mts +72 -44
- package/dist/index.mjs +12 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -158,7 +158,7 @@ Everything reachable with an API key is covered:
|
|
|
158
158
|
| `admit` | `check({ card })` |
|
|
159
159
|
| `members` | `sync({ since? })`, `get(id)`, `listEntitlements(id, { type? })`, `update(id, ...)`, `remove(id)`, `setPrimary(id)`, `reissueCard(id, { note? })` |
|
|
160
160
|
| `memberships` | `list(params?)`, `get(id)`, `create(...)`, `update(id, ...)`, `cancel(id, ...)`, `uncancel(id)`, `renew(id, ...)`, `upgrade(id, ...)`, `downgrade(id, ...)`, `listMembers(id)`, `addMember(id, ...)`, `listScheduledChanges(id, params?)`, `cancelScheduledChange(id, changeId)`, `listTransactions(id, params?)`, `listTermTransactions(id, termId, params?)`, `createTransaction(id, ...)` |
|
|
161
|
-
| `customers` | `list(params?)`, `get(id)`, `create(...)`, `update(id, ...)`, `delete(id)`, `listMemberships(id, params?)`
|
|
161
|
+
| `customers` | `list(params?)`, `get(id, params?)`, `create(...)`, `update(id, ...)`, `delete(id)`, `listMemberships(id, params?)` — `list`/`get` accept `view: 'full'` to include `membership_summary` |
|
|
162
162
|
| `entitlements` | `redeem(...)`, `recordUsage(...)`, `list()`, `get(id)`, `create(...)`, `update(id, ...)`, `delete(id)` |
|
|
163
163
|
| `plans` | `list()`, `get(id)`, `create(...)`, `update(id, ...)`, `delete(id)`, `listBillingOptions(id)`, `createBillingOption(id, ...)`, `listEntitlements(id)`, `createEntitlement(id, ...)`, `listPlanLinks(id)`, `createPlanLink(id, ...)`, `listPricingGroupMappings(id)`, `createPricingGroupMapping(id, ...)` |
|
|
164
164
|
| `billingOptions` | `list()`, `get(id)`, `update(id, ...)`, `delete(id)`, `listSalesChannels(id)`, `createSalesChannelLink(id, ...)` |
|
package/dist/index.cjs
CHANGED
|
@@ -316,11 +316,17 @@ var BillingOptionsResource = class extends APIResource {
|
|
|
316
316
|
//#endregion
|
|
317
317
|
//#region src/resources/customers.ts
|
|
318
318
|
var CustomersResource = class extends APIResource {
|
|
319
|
+
/**
|
|
320
|
+
* Pass `view: 'full'` to include `membership_summary` on every customer.
|
|
321
|
+
*/
|
|
319
322
|
async list(params, options) {
|
|
320
323
|
const response = await this.transport.request({
|
|
321
324
|
method: "GET",
|
|
322
325
|
path: "/api/v1/customers",
|
|
323
|
-
query:
|
|
326
|
+
query: {
|
|
327
|
+
...pageQuery(params),
|
|
328
|
+
...params?.view ? { view: params.view } : {}
|
|
329
|
+
},
|
|
324
330
|
retryable: true,
|
|
325
331
|
options
|
|
326
332
|
});
|
|
@@ -330,10 +336,14 @@ var CustomersResource = class extends APIResource {
|
|
|
330
336
|
total_size: response.total_size
|
|
331
337
|
};
|
|
332
338
|
}
|
|
333
|
-
|
|
339
|
+
/**
|
|
340
|
+
* Pass `view: 'full'` to include `membership_summary`.
|
|
341
|
+
*/
|
|
342
|
+
get(id, params = {}, options) {
|
|
334
343
|
return this.transport.request({
|
|
335
344
|
method: "GET",
|
|
336
345
|
path: `/api/v1/customers/${encodeURIComponent(id)}`,
|
|
346
|
+
query: params.view ? { view: params.view } : void 0,
|
|
337
347
|
retryable: true,
|
|
338
348
|
options
|
|
339
349
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -997,8 +997,10 @@ interface components {
|
|
|
997
997
|
id: string;
|
|
998
998
|
entity_type: string;
|
|
999
999
|
entity_id: string; /** @enum {string} */
|
|
1000
|
-
action: "create" | "
|
|
1001
|
-
changes:
|
|
1000
|
+
action: "create" | "delete" | "update";
|
|
1001
|
+
changes: {
|
|
1002
|
+
[key: string]: unknown;
|
|
1003
|
+
};
|
|
1002
1004
|
actor_id: string | null; /** Format: date-time */
|
|
1003
1005
|
create_time: string;
|
|
1004
1006
|
};
|
|
@@ -1032,12 +1034,12 @@ interface components {
|
|
|
1032
1034
|
};
|
|
1033
1035
|
UpdateProjectSettingsDto: {
|
|
1034
1036
|
card_id_prefix?: string | null; /** @enum {string|null} */
|
|
1035
|
-
card_id_character_set?: "
|
|
1037
|
+
card_id_character_set?: "alphanumeric_safe" | "digits" | "letters" | null;
|
|
1036
1038
|
card_id_length?: number | null;
|
|
1037
1039
|
regenerate_card_id_on_term_open?: boolean | null;
|
|
1038
1040
|
timezone?: string | null;
|
|
1039
1041
|
default_currency?: string | null; /** @enum {string|null} */
|
|
1040
|
-
display_locale?: "
|
|
1042
|
+
display_locale?: "de-DE" | "en-GB" | "en-US" | "es-ES" | "fr-FR" | "it-IT" | "nl-NL" | null;
|
|
1041
1043
|
};
|
|
1042
1044
|
CreateOrganizationDto: {
|
|
1043
1045
|
slug: string;
|
|
@@ -1077,7 +1079,7 @@ interface components {
|
|
|
1077
1079
|
description: string;
|
|
1078
1080
|
max_party_size: number;
|
|
1079
1081
|
grace_period_duration: number; /** @enum {string} */
|
|
1080
|
-
grace_period_unit: "day" | "
|
|
1082
|
+
grace_period_unit: "day" | "month" | "week" | "year"; /** @enum {string} */
|
|
1081
1083
|
status: "active" | "archived"; /** Format: date-time */
|
|
1082
1084
|
create_time: string; /** Format: date-time */
|
|
1083
1085
|
update_time: string;
|
|
@@ -1102,7 +1104,7 @@ interface components {
|
|
|
1102
1104
|
display_name: string;
|
|
1103
1105
|
max_party_size: number;
|
|
1104
1106
|
grace_period_duration: number; /** @enum {string} */
|
|
1105
|
-
grace_period_unit: "day" | "
|
|
1107
|
+
grace_period_unit: "day" | "month" | "week" | "year"; /** @enum {string} */
|
|
1106
1108
|
status: "active" | "archived";
|
|
1107
1109
|
};
|
|
1108
1110
|
UpdatePlanDto: {
|
|
@@ -1111,14 +1113,14 @@ interface components {
|
|
|
1111
1113
|
description: string;
|
|
1112
1114
|
max_party_size: number;
|
|
1113
1115
|
grace_period_duration: number; /** @enum {string} */
|
|
1114
|
-
grace_period_unit: "day" | "
|
|
1116
|
+
grace_period_unit: "day" | "month" | "week" | "year"; /** @enum {string} */
|
|
1115
1117
|
status: "active" | "archived";
|
|
1116
1118
|
};
|
|
1117
1119
|
BillingOption: {
|
|
1118
1120
|
id: string;
|
|
1119
1121
|
plan_id: string;
|
|
1120
1122
|
unit_amount: number; /** @enum {string} */
|
|
1121
|
-
frequency_unit: "day" | "
|
|
1123
|
+
frequency_unit: "day" | "month" | "week" | "year";
|
|
1122
1124
|
frequency_interval: number;
|
|
1123
1125
|
is_recurring: boolean;
|
|
1124
1126
|
display_name: string;
|
|
@@ -1136,7 +1138,7 @@ interface components {
|
|
|
1136
1138
|
};
|
|
1137
1139
|
CreateBillingOptionForPlanDto: {
|
|
1138
1140
|
unit_amount: number; /** @enum {string} */
|
|
1139
|
-
frequency_unit: "day" | "
|
|
1141
|
+
frequency_unit: "day" | "month" | "week" | "year";
|
|
1140
1142
|
frequency_interval: number;
|
|
1141
1143
|
is_recurring: boolean;
|
|
1142
1144
|
display_name: string;
|
|
@@ -1154,7 +1156,7 @@ interface components {
|
|
|
1154
1156
|
};
|
|
1155
1157
|
PlanLinkView: {
|
|
1156
1158
|
id: string; /** @enum {string} */
|
|
1157
|
-
type: "
|
|
1159
|
+
type: "downgrade" | "upgrade";
|
|
1158
1160
|
plan: components["schemas"]["PlanLinkTargetPlan"];
|
|
1159
1161
|
require_interval_match: boolean; /** Format: date-time */
|
|
1160
1162
|
create_time: string; /** Format: date-time */
|
|
@@ -1165,7 +1167,7 @@ interface components {
|
|
|
1165
1167
|
};
|
|
1166
1168
|
CreatePlanLinkDto: {
|
|
1167
1169
|
/** Format: uuid */target_plan_id: string; /** @enum {string} */
|
|
1168
|
-
type: "
|
|
1170
|
+
type: "downgrade" | "upgrade";
|
|
1169
1171
|
require_interval_match: boolean;
|
|
1170
1172
|
};
|
|
1171
1173
|
PlanLink: {
|
|
@@ -1178,7 +1180,7 @@ interface components {
|
|
|
1178
1180
|
};
|
|
1179
1181
|
PlanEntitlementDefinition: {
|
|
1180
1182
|
code: string; /** @enum {string} */
|
|
1181
|
-
type: "
|
|
1183
|
+
type: "discount" | "early_access" | "free_entry" | "guest_pass";
|
|
1182
1184
|
display_name: string;
|
|
1183
1185
|
};
|
|
1184
1186
|
PlanEntitlement: {
|
|
@@ -1187,7 +1189,7 @@ interface components {
|
|
|
1187
1189
|
entitlement_id: string;
|
|
1188
1190
|
discount_percentage: number | null;
|
|
1189
1191
|
quota_limit: number | null; /** @enum {string} */
|
|
1190
|
-
quota_period: "day" | "
|
|
1192
|
+
quota_period: "day" | "month" | "week" | "year";
|
|
1191
1193
|
requires_member_present: boolean;
|
|
1192
1194
|
early_access_days: number | null;
|
|
1193
1195
|
active_during_grace: boolean; /** Format: date-time */
|
|
@@ -1202,7 +1204,7 @@ interface components {
|
|
|
1202
1204
|
/** Format: uuid */entitlement_id: string;
|
|
1203
1205
|
discount_percentage: number;
|
|
1204
1206
|
quota_limit: number; /** @enum {string} */
|
|
1205
|
-
quota_period: "day" | "
|
|
1207
|
+
quota_period: "day" | "month" | "week" | "year";
|
|
1206
1208
|
requires_member_present: boolean;
|
|
1207
1209
|
early_access_days: number;
|
|
1208
1210
|
active_during_grace: boolean;
|
|
@@ -1280,7 +1282,7 @@ interface components {
|
|
|
1280
1282
|
UpdatePlanEntitlementDto: {
|
|
1281
1283
|
discount_percentage: number;
|
|
1282
1284
|
quota_limit: number; /** @enum {string} */
|
|
1283
|
-
quota_period: "day" | "
|
|
1285
|
+
quota_period: "day" | "month" | "week" | "year";
|
|
1284
1286
|
requires_member_present: boolean;
|
|
1285
1287
|
early_access_days: number;
|
|
1286
1288
|
active_during_grace: boolean;
|
|
@@ -1289,7 +1291,7 @@ interface components {
|
|
|
1289
1291
|
id: string;
|
|
1290
1292
|
code: string;
|
|
1291
1293
|
display_name: string; /** @enum {string} */
|
|
1292
|
-
type: "
|
|
1294
|
+
type: "discount" | "early_access" | "free_entry" | "guest_pass";
|
|
1293
1295
|
target: string | null;
|
|
1294
1296
|
description: string | null; /** Format: date-time */
|
|
1295
1297
|
create_time: string; /** Format: date-time */
|
|
@@ -1313,7 +1315,9 @@ interface components {
|
|
|
1313
1315
|
entitlement_code: string;
|
|
1314
1316
|
members: string[];
|
|
1315
1317
|
used_time?: string;
|
|
1316
|
-
context:
|
|
1318
|
+
context: {
|
|
1319
|
+
[key: string]: unknown;
|
|
1320
|
+
};
|
|
1317
1321
|
};
|
|
1318
1322
|
EntitlementUsage: {
|
|
1319
1323
|
id: string;
|
|
@@ -1321,7 +1325,9 @@ interface components {
|
|
|
1321
1325
|
member_id: string;
|
|
1322
1326
|
plan_entitlement_id: string; /** Format: date-time */
|
|
1323
1327
|
used_time: string;
|
|
1324
|
-
context:
|
|
1328
|
+
context: {
|
|
1329
|
+
[key: string]: unknown;
|
|
1330
|
+
} | null;
|
|
1325
1331
|
idempotency_key: string; /** Format: date-time */
|
|
1326
1332
|
create_time: string;
|
|
1327
1333
|
};
|
|
@@ -1331,7 +1337,7 @@ interface components {
|
|
|
1331
1337
|
CreateEntitlementDto: {
|
|
1332
1338
|
code: string;
|
|
1333
1339
|
display_name: string; /** @enum {string} */
|
|
1334
|
-
type: "
|
|
1340
|
+
type: "discount" | "early_access" | "free_entry" | "guest_pass";
|
|
1335
1341
|
target: string;
|
|
1336
1342
|
description: string;
|
|
1337
1343
|
};
|
|
@@ -1381,13 +1387,13 @@ interface components {
|
|
|
1381
1387
|
};
|
|
1382
1388
|
MemberEntitlement: {
|
|
1383
1389
|
code: string; /** @enum {string} */
|
|
1384
|
-
type: "
|
|
1390
|
+
type: "discount" | "early_access" | "free_entry" | "guest_pass";
|
|
1385
1391
|
target: string | null;
|
|
1386
1392
|
display_name: string;
|
|
1387
1393
|
plan_entitlement_id: string;
|
|
1388
1394
|
discount_percentage: number | null;
|
|
1389
1395
|
quota_limit: number | null; /** @enum {string} */
|
|
1390
|
-
quota_period: "day" | "
|
|
1396
|
+
quota_period: "day" | "month" | "week" | "year";
|
|
1391
1397
|
requires_member_present: boolean;
|
|
1392
1398
|
early_access_days: number | null;
|
|
1393
1399
|
active_during_grace: boolean;
|
|
@@ -1419,10 +1425,10 @@ interface components {
|
|
|
1419
1425
|
reason: string;
|
|
1420
1426
|
})[];
|
|
1421
1427
|
admitted: boolean; /** @enum {string|null} */
|
|
1422
|
-
deny_reason: "
|
|
1428
|
+
deny_reason: "card_not_found" | "member_removed" | "membership_cancelled" | "membership_expired" | "membership_incomplete" | "payment_overdue" | null;
|
|
1423
1429
|
member: components["schemas"]["AdmitMember"] | null;
|
|
1424
1430
|
membership_id: string | null; /** @enum {string|null} */
|
|
1425
|
-
membership_status: "
|
|
1431
|
+
membership_status: "active" | "cancelled" | "expired" | "grace_period" | "incomplete" | "past_due" | null;
|
|
1426
1432
|
plan: string | null;
|
|
1427
1433
|
pricing_group: string | null;
|
|
1428
1434
|
entitlements: components["schemas"]["MemberEntitlement"][];
|
|
@@ -1470,8 +1476,10 @@ interface components {
|
|
|
1470
1476
|
id: string;
|
|
1471
1477
|
subscription_id: string;
|
|
1472
1478
|
event_type: string;
|
|
1473
|
-
payload:
|
|
1474
|
-
|
|
1479
|
+
payload: {
|
|
1480
|
+
[key: string]: unknown;
|
|
1481
|
+
}; /** @enum {string} */
|
|
1482
|
+
status: "delivered" | "exhausted" | "failed" | "pending";
|
|
1475
1483
|
attempts: number; /** Format: date-time */
|
|
1476
1484
|
last_attempt_time: string | null; /** Format: date-time */
|
|
1477
1485
|
next_retry_time: string | null;
|
|
@@ -1538,7 +1546,7 @@ interface components {
|
|
|
1538
1546
|
display_name: string;
|
|
1539
1547
|
unit_amount: number;
|
|
1540
1548
|
currency: string; /** @enum {string} */
|
|
1541
|
-
frequency_unit: "day" | "
|
|
1549
|
+
frequency_unit: "day" | "month" | "week" | "year";
|
|
1542
1550
|
frequency_interval: number;
|
|
1543
1551
|
};
|
|
1544
1552
|
MembershipTerm: {
|
|
@@ -1561,7 +1569,7 @@ interface components {
|
|
|
1561
1569
|
customer_id: string | null; /** Format: date-time */
|
|
1562
1570
|
start_time: string; /** Format: date-time */
|
|
1563
1571
|
end_time: string | null; /** @enum {string} */
|
|
1564
|
-
status: "
|
|
1572
|
+
status: "active" | "cancelled" | "expired" | "grace_period" | "incomplete" | "past_due"; /** Format: date-time */
|
|
1565
1573
|
grace_until: string | null;
|
|
1566
1574
|
auto_renew: boolean;
|
|
1567
1575
|
current_term_id: string | null; /** Format: date-time */
|
|
@@ -1625,7 +1633,7 @@ interface components {
|
|
|
1625
1633
|
CancelMembershipDto: {
|
|
1626
1634
|
cancellation_reason?: string;
|
|
1627
1635
|
effective_time?: string; /** @enum {string} */
|
|
1628
|
-
effective_type?: "
|
|
1636
|
+
effective_type?: "at" | "end_of_term" | "immediate";
|
|
1629
1637
|
};
|
|
1630
1638
|
RenewMembershipDto: {
|
|
1631
1639
|
transaction?: components["schemas"]["CreateMembershipTransactionDto"];
|
|
@@ -1640,13 +1648,13 @@ interface components {
|
|
|
1640
1648
|
};
|
|
1641
1649
|
PlanChangeDto: {
|
|
1642
1650
|
/** Format: uuid */new_billing_option_id: string; /** @enum {string} */
|
|
1643
|
-
effective_type?: "
|
|
1651
|
+
effective_type?: "end_of_term" | "immediate";
|
|
1644
1652
|
members?: components["schemas"]["PlanChangeMemberDto"][];
|
|
1645
1653
|
note?: string;
|
|
1646
1654
|
};
|
|
1647
1655
|
MembershipScheduledChangeMemberResponseDto: {
|
|
1648
1656
|
id: string; /** @enum {string} */
|
|
1649
|
-
operation: "
|
|
1657
|
+
operation: "add" | "remove" | "update";
|
|
1650
1658
|
member_id: string | null;
|
|
1651
1659
|
name: string | null;
|
|
1652
1660
|
role_id: string | null;
|
|
@@ -1655,16 +1663,16 @@ interface components {
|
|
|
1655
1663
|
};
|
|
1656
1664
|
MembershipScheduledChangeResponseDto: {
|
|
1657
1665
|
id: string; /** @enum {string} */
|
|
1658
|
-
type: "
|
|
1666
|
+
type: "downgrade" | "upgrade"; /** Format: date-time */
|
|
1659
1667
|
effective_time: string; /** @enum {string} */
|
|
1660
|
-
status: "
|
|
1668
|
+
status: "applied" | "cancelled" | "failed" | "pending" | "superseded";
|
|
1661
1669
|
new_billing_option_id: string;
|
|
1662
1670
|
applied_term_id: string | null;
|
|
1663
1671
|
failure_reason: string | null;
|
|
1664
1672
|
superseded_by_id: string | null;
|
|
1665
1673
|
note: string | null;
|
|
1666
1674
|
created_by: string | null; /** @enum {string} */
|
|
1667
|
-
source: "
|
|
1675
|
+
source: "admin_ui" | "api" | "customer_self_service" | "system";
|
|
1668
1676
|
members: components["schemas"]["MembershipScheduledChangeMemberResponseDto"][]; /** Format: date-time */
|
|
1669
1677
|
create_time: string; /** Format: date-time */
|
|
1670
1678
|
apply_time: string | null;
|
|
@@ -1691,8 +1699,8 @@ interface components {
|
|
|
1691
1699
|
id: string;
|
|
1692
1700
|
membership_id: string;
|
|
1693
1701
|
membership_term_id: string; /** @enum {string} */
|
|
1694
|
-
type: "
|
|
1695
|
-
status: "failed" | "
|
|
1702
|
+
type: "adjustment" | "chargeback" | "credit" | "payment" | "refund"; /** @enum {string} */
|
|
1703
|
+
status: "failed" | "refunded" | "succeeded";
|
|
1696
1704
|
amount_cents: number;
|
|
1697
1705
|
currency: string;
|
|
1698
1706
|
payment_method_ref: string | null;
|
|
@@ -1718,8 +1726,8 @@ interface components {
|
|
|
1718
1726
|
transactions: components["schemas"]["Transaction"][];
|
|
1719
1727
|
};
|
|
1720
1728
|
CreateTransactionDto: {
|
|
1721
|
-
/** @enum {string} */type: "
|
|
1722
|
-
status: "
|
|
1729
|
+
/** @enum {string} */type: "adjustment" | "chargeback" | "credit" | "payment" | "refund"; /** @enum {string} */
|
|
1730
|
+
status: "failed" | "refunded" | "succeeded";
|
|
1723
1731
|
amount_cents: number;
|
|
1724
1732
|
currency?: string; /** Format: uuid */
|
|
1725
1733
|
membership_term_id?: string;
|
|
@@ -1730,12 +1738,17 @@ interface components {
|
|
|
1730
1738
|
failure_reason?: string;
|
|
1731
1739
|
processed_time?: string;
|
|
1732
1740
|
};
|
|
1741
|
+
CustomerMembershipSummary: {
|
|
1742
|
+
/** @description Memberships linked to the customer, as buyer or through a member row. */total_count: number; /** @description Linked memberships whose status is active or grace_period. */
|
|
1743
|
+
active_count: number;
|
|
1744
|
+
};
|
|
1733
1745
|
Customer: {
|
|
1734
1746
|
id: string;
|
|
1735
1747
|
name: string;
|
|
1736
1748
|
email: string; /** Format: date-time */
|
|
1737
1749
|
create_time: string; /** Format: date-time */
|
|
1738
1750
|
update_time: string;
|
|
1751
|
+
membership_summary?: components["schemas"]["CustomerMembershipSummary"];
|
|
1739
1752
|
};
|
|
1740
1753
|
ListCustomersResponse: {
|
|
1741
1754
|
/**
|
|
@@ -3222,7 +3235,7 @@ interface operations {
|
|
|
3222
3235
|
MembersController_listEntitlements: {
|
|
3223
3236
|
parameters: {
|
|
3224
3237
|
query?: {
|
|
3225
|
-
type?: "
|
|
3238
|
+
type?: "discount" | "early_access" | "free_entry" | "guest_pass";
|
|
3226
3239
|
};
|
|
3227
3240
|
header?: never;
|
|
3228
3241
|
path?: never;
|
|
@@ -4107,7 +4120,7 @@ interface operations {
|
|
|
4107
4120
|
query?: {
|
|
4108
4121
|
page_size?: number;
|
|
4109
4122
|
page_token?: string;
|
|
4110
|
-
status?: ("
|
|
4123
|
+
status?: ("all" | "applied" | "cancelled" | "failed" | "pending" | "superseded")[];
|
|
4111
4124
|
};
|
|
4112
4125
|
header?: never;
|
|
4113
4126
|
path?: never;
|
|
@@ -4255,7 +4268,8 @@ interface operations {
|
|
|
4255
4268
|
parameters: {
|
|
4256
4269
|
query?: {
|
|
4257
4270
|
page_size?: number;
|
|
4258
|
-
page_token?: string;
|
|
4271
|
+
page_token?: string; /** @description Response detail level; `full` populates `membership_summary`. */
|
|
4272
|
+
view?: "basic" | "full";
|
|
4259
4273
|
};
|
|
4260
4274
|
header?: never;
|
|
4261
4275
|
path?: never;
|
|
@@ -4306,7 +4320,9 @@ interface operations {
|
|
|
4306
4320
|
};
|
|
4307
4321
|
CustomersController_get: {
|
|
4308
4322
|
parameters: {
|
|
4309
|
-
query?:
|
|
4323
|
+
query?: {
|
|
4324
|
+
/** @description Response detail level; `full` populates `membership_summary`. */view?: "basic" | "full";
|
|
4325
|
+
};
|
|
4310
4326
|
header?: never;
|
|
4311
4327
|
path?: never;
|
|
4312
4328
|
cookie?: never;
|
|
@@ -4561,6 +4577,7 @@ type BillingOption = Schemas['BillingOption'];
|
|
|
4561
4577
|
type Membership = Schemas['Membership'];
|
|
4562
4578
|
type MembershipTerm = Schemas['MembershipTerm'];
|
|
4563
4579
|
type Customer = Schemas['Customer'];
|
|
4580
|
+
type CustomerMembershipSummary = Schemas['CustomerMembershipSummary'];
|
|
4564
4581
|
type Member = Schemas['Member'];
|
|
4565
4582
|
type SyncMember = Schemas['SyncMember'];
|
|
4566
4583
|
type MemberEntitlement = Schemas['MemberEntitlement'];
|
|
@@ -4582,6 +4599,7 @@ type ScheduledChange = Schemas['MembershipScheduledChangeResponseDto'];
|
|
|
4582
4599
|
type PlanChangeResult = Schemas['PlanChangeResponseDto'];
|
|
4583
4600
|
type MemberSyncResponse = Schemas['MemberSyncResponse'];
|
|
4584
4601
|
type RedeemEntitlementResponse = Schemas['RedeemEntitlementResponseDto'];
|
|
4602
|
+
type CustomerView = 'basic' | 'full';
|
|
4585
4603
|
interface PageParams {
|
|
4586
4604
|
/** Rows per page. Server default 50; capped at 250. */
|
|
4587
4605
|
page_size?: number;
|
|
@@ -4661,8 +4679,18 @@ declare class BillingOptionsResource extends APIResource {
|
|
|
4661
4679
|
//#endregion
|
|
4662
4680
|
//#region src/resources/customers.d.ts
|
|
4663
4681
|
declare class CustomersResource extends APIResource {
|
|
4664
|
-
|
|
4665
|
-
|
|
4682
|
+
/**
|
|
4683
|
+
* Pass `view: 'full'` to include `membership_summary` on every customer.
|
|
4684
|
+
*/
|
|
4685
|
+
list(params?: PageParams & {
|
|
4686
|
+
view?: CustomerView;
|
|
4687
|
+
}, options?: RequestOptions): Promise<Page<Customer>>;
|
|
4688
|
+
/**
|
|
4689
|
+
* Pass `view: 'full'` to include `membership_summary`.
|
|
4690
|
+
*/
|
|
4691
|
+
get(id: string, params?: {
|
|
4692
|
+
view?: CustomerView;
|
|
4693
|
+
}, options?: RequestOptions): Promise<Customer>;
|
|
4666
4694
|
create(params: CreateCustomerParams, options?: RequestOptions): Promise<Customer>;
|
|
4667
4695
|
update(id: string, params: UpdateCustomerParams, options?: RequestOptions): Promise<Customer>;
|
|
4668
4696
|
delete(id: string, options?: RequestOptions): Promise<void>;
|
|
@@ -4997,4 +5025,4 @@ declare function paginate<T>(fetchPage: (params: PageParams) => Promise<Page<T>>
|
|
|
4997
5025
|
*/
|
|
4998
5026
|
declare function collect<T>(fetchPage: (params: PageParams) => Promise<Page<T>>, params?: PageParams): Promise<T[]>;
|
|
4999
5027
|
//#endregion
|
|
5000
|
-
export { AddMemberParams, 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, UpdateMemberParams, 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 };
|
|
5028
|
+
export { AddMemberParams, AdmitResult, AlreadyExistsError, BillingOption, BillingOptionSalesChannel, CancelMembershipParams, CreateBillingOptionParams, CreateBillingOptionSalesChannelParams, CreateCustomerParams, CreateEntitlementParams, CreateMemberRoleParams, CreateMembershipParams, CreatePlanEntitlementParams, CreatePlanLinkParams, CreatePlanParams, CreatePlanPricingGroupMappingParams, CreatePricingGroupParams, CreateSalesChannelParams, CreateTransactionParams, CreateWebhookSubscriptionParams, Customer, CustomerMembershipSummary, CustomerView, 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, UpdateMemberParams, 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 };
|
package/dist/index.d.mts
CHANGED
|
@@ -997,8 +997,10 @@ interface components {
|
|
|
997
997
|
id: string;
|
|
998
998
|
entity_type: string;
|
|
999
999
|
entity_id: string; /** @enum {string} */
|
|
1000
|
-
action: "create" | "
|
|
1001
|
-
changes:
|
|
1000
|
+
action: "create" | "delete" | "update";
|
|
1001
|
+
changes: {
|
|
1002
|
+
[key: string]: unknown;
|
|
1003
|
+
};
|
|
1002
1004
|
actor_id: string | null; /** Format: date-time */
|
|
1003
1005
|
create_time: string;
|
|
1004
1006
|
};
|
|
@@ -1032,12 +1034,12 @@ interface components {
|
|
|
1032
1034
|
};
|
|
1033
1035
|
UpdateProjectSettingsDto: {
|
|
1034
1036
|
card_id_prefix?: string | null; /** @enum {string|null} */
|
|
1035
|
-
card_id_character_set?: "
|
|
1037
|
+
card_id_character_set?: "alphanumeric_safe" | "digits" | "letters" | null;
|
|
1036
1038
|
card_id_length?: number | null;
|
|
1037
1039
|
regenerate_card_id_on_term_open?: boolean | null;
|
|
1038
1040
|
timezone?: string | null;
|
|
1039
1041
|
default_currency?: string | null; /** @enum {string|null} */
|
|
1040
|
-
display_locale?: "
|
|
1042
|
+
display_locale?: "de-DE" | "en-GB" | "en-US" | "es-ES" | "fr-FR" | "it-IT" | "nl-NL" | null;
|
|
1041
1043
|
};
|
|
1042
1044
|
CreateOrganizationDto: {
|
|
1043
1045
|
slug: string;
|
|
@@ -1077,7 +1079,7 @@ interface components {
|
|
|
1077
1079
|
description: string;
|
|
1078
1080
|
max_party_size: number;
|
|
1079
1081
|
grace_period_duration: number; /** @enum {string} */
|
|
1080
|
-
grace_period_unit: "day" | "
|
|
1082
|
+
grace_period_unit: "day" | "month" | "week" | "year"; /** @enum {string} */
|
|
1081
1083
|
status: "active" | "archived"; /** Format: date-time */
|
|
1082
1084
|
create_time: string; /** Format: date-time */
|
|
1083
1085
|
update_time: string;
|
|
@@ -1102,7 +1104,7 @@ interface components {
|
|
|
1102
1104
|
display_name: string;
|
|
1103
1105
|
max_party_size: number;
|
|
1104
1106
|
grace_period_duration: number; /** @enum {string} */
|
|
1105
|
-
grace_period_unit: "day" | "
|
|
1107
|
+
grace_period_unit: "day" | "month" | "week" | "year"; /** @enum {string} */
|
|
1106
1108
|
status: "active" | "archived";
|
|
1107
1109
|
};
|
|
1108
1110
|
UpdatePlanDto: {
|
|
@@ -1111,14 +1113,14 @@ interface components {
|
|
|
1111
1113
|
description: string;
|
|
1112
1114
|
max_party_size: number;
|
|
1113
1115
|
grace_period_duration: number; /** @enum {string} */
|
|
1114
|
-
grace_period_unit: "day" | "
|
|
1116
|
+
grace_period_unit: "day" | "month" | "week" | "year"; /** @enum {string} */
|
|
1115
1117
|
status: "active" | "archived";
|
|
1116
1118
|
};
|
|
1117
1119
|
BillingOption: {
|
|
1118
1120
|
id: string;
|
|
1119
1121
|
plan_id: string;
|
|
1120
1122
|
unit_amount: number; /** @enum {string} */
|
|
1121
|
-
frequency_unit: "day" | "
|
|
1123
|
+
frequency_unit: "day" | "month" | "week" | "year";
|
|
1122
1124
|
frequency_interval: number;
|
|
1123
1125
|
is_recurring: boolean;
|
|
1124
1126
|
display_name: string;
|
|
@@ -1136,7 +1138,7 @@ interface components {
|
|
|
1136
1138
|
};
|
|
1137
1139
|
CreateBillingOptionForPlanDto: {
|
|
1138
1140
|
unit_amount: number; /** @enum {string} */
|
|
1139
|
-
frequency_unit: "day" | "
|
|
1141
|
+
frequency_unit: "day" | "month" | "week" | "year";
|
|
1140
1142
|
frequency_interval: number;
|
|
1141
1143
|
is_recurring: boolean;
|
|
1142
1144
|
display_name: string;
|
|
@@ -1154,7 +1156,7 @@ interface components {
|
|
|
1154
1156
|
};
|
|
1155
1157
|
PlanLinkView: {
|
|
1156
1158
|
id: string; /** @enum {string} */
|
|
1157
|
-
type: "
|
|
1159
|
+
type: "downgrade" | "upgrade";
|
|
1158
1160
|
plan: components["schemas"]["PlanLinkTargetPlan"];
|
|
1159
1161
|
require_interval_match: boolean; /** Format: date-time */
|
|
1160
1162
|
create_time: string; /** Format: date-time */
|
|
@@ -1165,7 +1167,7 @@ interface components {
|
|
|
1165
1167
|
};
|
|
1166
1168
|
CreatePlanLinkDto: {
|
|
1167
1169
|
/** Format: uuid */target_plan_id: string; /** @enum {string} */
|
|
1168
|
-
type: "
|
|
1170
|
+
type: "downgrade" | "upgrade";
|
|
1169
1171
|
require_interval_match: boolean;
|
|
1170
1172
|
};
|
|
1171
1173
|
PlanLink: {
|
|
@@ -1178,7 +1180,7 @@ interface components {
|
|
|
1178
1180
|
};
|
|
1179
1181
|
PlanEntitlementDefinition: {
|
|
1180
1182
|
code: string; /** @enum {string} */
|
|
1181
|
-
type: "
|
|
1183
|
+
type: "discount" | "early_access" | "free_entry" | "guest_pass";
|
|
1182
1184
|
display_name: string;
|
|
1183
1185
|
};
|
|
1184
1186
|
PlanEntitlement: {
|
|
@@ -1187,7 +1189,7 @@ interface components {
|
|
|
1187
1189
|
entitlement_id: string;
|
|
1188
1190
|
discount_percentage: number | null;
|
|
1189
1191
|
quota_limit: number | null; /** @enum {string} */
|
|
1190
|
-
quota_period: "day" | "
|
|
1192
|
+
quota_period: "day" | "month" | "week" | "year";
|
|
1191
1193
|
requires_member_present: boolean;
|
|
1192
1194
|
early_access_days: number | null;
|
|
1193
1195
|
active_during_grace: boolean; /** Format: date-time */
|
|
@@ -1202,7 +1204,7 @@ interface components {
|
|
|
1202
1204
|
/** Format: uuid */entitlement_id: string;
|
|
1203
1205
|
discount_percentage: number;
|
|
1204
1206
|
quota_limit: number; /** @enum {string} */
|
|
1205
|
-
quota_period: "day" | "
|
|
1207
|
+
quota_period: "day" | "month" | "week" | "year";
|
|
1206
1208
|
requires_member_present: boolean;
|
|
1207
1209
|
early_access_days: number;
|
|
1208
1210
|
active_during_grace: boolean;
|
|
@@ -1280,7 +1282,7 @@ interface components {
|
|
|
1280
1282
|
UpdatePlanEntitlementDto: {
|
|
1281
1283
|
discount_percentage: number;
|
|
1282
1284
|
quota_limit: number; /** @enum {string} */
|
|
1283
|
-
quota_period: "day" | "
|
|
1285
|
+
quota_period: "day" | "month" | "week" | "year";
|
|
1284
1286
|
requires_member_present: boolean;
|
|
1285
1287
|
early_access_days: number;
|
|
1286
1288
|
active_during_grace: boolean;
|
|
@@ -1289,7 +1291,7 @@ interface components {
|
|
|
1289
1291
|
id: string;
|
|
1290
1292
|
code: string;
|
|
1291
1293
|
display_name: string; /** @enum {string} */
|
|
1292
|
-
type: "
|
|
1294
|
+
type: "discount" | "early_access" | "free_entry" | "guest_pass";
|
|
1293
1295
|
target: string | null;
|
|
1294
1296
|
description: string | null; /** Format: date-time */
|
|
1295
1297
|
create_time: string; /** Format: date-time */
|
|
@@ -1313,7 +1315,9 @@ interface components {
|
|
|
1313
1315
|
entitlement_code: string;
|
|
1314
1316
|
members: string[];
|
|
1315
1317
|
used_time?: string;
|
|
1316
|
-
context:
|
|
1318
|
+
context: {
|
|
1319
|
+
[key: string]: unknown;
|
|
1320
|
+
};
|
|
1317
1321
|
};
|
|
1318
1322
|
EntitlementUsage: {
|
|
1319
1323
|
id: string;
|
|
@@ -1321,7 +1325,9 @@ interface components {
|
|
|
1321
1325
|
member_id: string;
|
|
1322
1326
|
plan_entitlement_id: string; /** Format: date-time */
|
|
1323
1327
|
used_time: string;
|
|
1324
|
-
context:
|
|
1328
|
+
context: {
|
|
1329
|
+
[key: string]: unknown;
|
|
1330
|
+
} | null;
|
|
1325
1331
|
idempotency_key: string; /** Format: date-time */
|
|
1326
1332
|
create_time: string;
|
|
1327
1333
|
};
|
|
@@ -1331,7 +1337,7 @@ interface components {
|
|
|
1331
1337
|
CreateEntitlementDto: {
|
|
1332
1338
|
code: string;
|
|
1333
1339
|
display_name: string; /** @enum {string} */
|
|
1334
|
-
type: "
|
|
1340
|
+
type: "discount" | "early_access" | "free_entry" | "guest_pass";
|
|
1335
1341
|
target: string;
|
|
1336
1342
|
description: string;
|
|
1337
1343
|
};
|
|
@@ -1381,13 +1387,13 @@ interface components {
|
|
|
1381
1387
|
};
|
|
1382
1388
|
MemberEntitlement: {
|
|
1383
1389
|
code: string; /** @enum {string} */
|
|
1384
|
-
type: "
|
|
1390
|
+
type: "discount" | "early_access" | "free_entry" | "guest_pass";
|
|
1385
1391
|
target: string | null;
|
|
1386
1392
|
display_name: string;
|
|
1387
1393
|
plan_entitlement_id: string;
|
|
1388
1394
|
discount_percentage: number | null;
|
|
1389
1395
|
quota_limit: number | null; /** @enum {string} */
|
|
1390
|
-
quota_period: "day" | "
|
|
1396
|
+
quota_period: "day" | "month" | "week" | "year";
|
|
1391
1397
|
requires_member_present: boolean;
|
|
1392
1398
|
early_access_days: number | null;
|
|
1393
1399
|
active_during_grace: boolean;
|
|
@@ -1419,10 +1425,10 @@ interface components {
|
|
|
1419
1425
|
reason: string;
|
|
1420
1426
|
})[];
|
|
1421
1427
|
admitted: boolean; /** @enum {string|null} */
|
|
1422
|
-
deny_reason: "
|
|
1428
|
+
deny_reason: "card_not_found" | "member_removed" | "membership_cancelled" | "membership_expired" | "membership_incomplete" | "payment_overdue" | null;
|
|
1423
1429
|
member: components["schemas"]["AdmitMember"] | null;
|
|
1424
1430
|
membership_id: string | null; /** @enum {string|null} */
|
|
1425
|
-
membership_status: "
|
|
1431
|
+
membership_status: "active" | "cancelled" | "expired" | "grace_period" | "incomplete" | "past_due" | null;
|
|
1426
1432
|
plan: string | null;
|
|
1427
1433
|
pricing_group: string | null;
|
|
1428
1434
|
entitlements: components["schemas"]["MemberEntitlement"][];
|
|
@@ -1470,8 +1476,10 @@ interface components {
|
|
|
1470
1476
|
id: string;
|
|
1471
1477
|
subscription_id: string;
|
|
1472
1478
|
event_type: string;
|
|
1473
|
-
payload:
|
|
1474
|
-
|
|
1479
|
+
payload: {
|
|
1480
|
+
[key: string]: unknown;
|
|
1481
|
+
}; /** @enum {string} */
|
|
1482
|
+
status: "delivered" | "exhausted" | "failed" | "pending";
|
|
1475
1483
|
attempts: number; /** Format: date-time */
|
|
1476
1484
|
last_attempt_time: string | null; /** Format: date-time */
|
|
1477
1485
|
next_retry_time: string | null;
|
|
@@ -1538,7 +1546,7 @@ interface components {
|
|
|
1538
1546
|
display_name: string;
|
|
1539
1547
|
unit_amount: number;
|
|
1540
1548
|
currency: string; /** @enum {string} */
|
|
1541
|
-
frequency_unit: "day" | "
|
|
1549
|
+
frequency_unit: "day" | "month" | "week" | "year";
|
|
1542
1550
|
frequency_interval: number;
|
|
1543
1551
|
};
|
|
1544
1552
|
MembershipTerm: {
|
|
@@ -1561,7 +1569,7 @@ interface components {
|
|
|
1561
1569
|
customer_id: string | null; /** Format: date-time */
|
|
1562
1570
|
start_time: string; /** Format: date-time */
|
|
1563
1571
|
end_time: string | null; /** @enum {string} */
|
|
1564
|
-
status: "
|
|
1572
|
+
status: "active" | "cancelled" | "expired" | "grace_period" | "incomplete" | "past_due"; /** Format: date-time */
|
|
1565
1573
|
grace_until: string | null;
|
|
1566
1574
|
auto_renew: boolean;
|
|
1567
1575
|
current_term_id: string | null; /** Format: date-time */
|
|
@@ -1625,7 +1633,7 @@ interface components {
|
|
|
1625
1633
|
CancelMembershipDto: {
|
|
1626
1634
|
cancellation_reason?: string;
|
|
1627
1635
|
effective_time?: string; /** @enum {string} */
|
|
1628
|
-
effective_type?: "
|
|
1636
|
+
effective_type?: "at" | "end_of_term" | "immediate";
|
|
1629
1637
|
};
|
|
1630
1638
|
RenewMembershipDto: {
|
|
1631
1639
|
transaction?: components["schemas"]["CreateMembershipTransactionDto"];
|
|
@@ -1640,13 +1648,13 @@ interface components {
|
|
|
1640
1648
|
};
|
|
1641
1649
|
PlanChangeDto: {
|
|
1642
1650
|
/** Format: uuid */new_billing_option_id: string; /** @enum {string} */
|
|
1643
|
-
effective_type?: "
|
|
1651
|
+
effective_type?: "end_of_term" | "immediate";
|
|
1644
1652
|
members?: components["schemas"]["PlanChangeMemberDto"][];
|
|
1645
1653
|
note?: string;
|
|
1646
1654
|
};
|
|
1647
1655
|
MembershipScheduledChangeMemberResponseDto: {
|
|
1648
1656
|
id: string; /** @enum {string} */
|
|
1649
|
-
operation: "
|
|
1657
|
+
operation: "add" | "remove" | "update";
|
|
1650
1658
|
member_id: string | null;
|
|
1651
1659
|
name: string | null;
|
|
1652
1660
|
role_id: string | null;
|
|
@@ -1655,16 +1663,16 @@ interface components {
|
|
|
1655
1663
|
};
|
|
1656
1664
|
MembershipScheduledChangeResponseDto: {
|
|
1657
1665
|
id: string; /** @enum {string} */
|
|
1658
|
-
type: "
|
|
1666
|
+
type: "downgrade" | "upgrade"; /** Format: date-time */
|
|
1659
1667
|
effective_time: string; /** @enum {string} */
|
|
1660
|
-
status: "
|
|
1668
|
+
status: "applied" | "cancelled" | "failed" | "pending" | "superseded";
|
|
1661
1669
|
new_billing_option_id: string;
|
|
1662
1670
|
applied_term_id: string | null;
|
|
1663
1671
|
failure_reason: string | null;
|
|
1664
1672
|
superseded_by_id: string | null;
|
|
1665
1673
|
note: string | null;
|
|
1666
1674
|
created_by: string | null; /** @enum {string} */
|
|
1667
|
-
source: "
|
|
1675
|
+
source: "admin_ui" | "api" | "customer_self_service" | "system";
|
|
1668
1676
|
members: components["schemas"]["MembershipScheduledChangeMemberResponseDto"][]; /** Format: date-time */
|
|
1669
1677
|
create_time: string; /** Format: date-time */
|
|
1670
1678
|
apply_time: string | null;
|
|
@@ -1691,8 +1699,8 @@ interface components {
|
|
|
1691
1699
|
id: string;
|
|
1692
1700
|
membership_id: string;
|
|
1693
1701
|
membership_term_id: string; /** @enum {string} */
|
|
1694
|
-
type: "
|
|
1695
|
-
status: "failed" | "
|
|
1702
|
+
type: "adjustment" | "chargeback" | "credit" | "payment" | "refund"; /** @enum {string} */
|
|
1703
|
+
status: "failed" | "refunded" | "succeeded";
|
|
1696
1704
|
amount_cents: number;
|
|
1697
1705
|
currency: string;
|
|
1698
1706
|
payment_method_ref: string | null;
|
|
@@ -1718,8 +1726,8 @@ interface components {
|
|
|
1718
1726
|
transactions: components["schemas"]["Transaction"][];
|
|
1719
1727
|
};
|
|
1720
1728
|
CreateTransactionDto: {
|
|
1721
|
-
/** @enum {string} */type: "
|
|
1722
|
-
status: "
|
|
1729
|
+
/** @enum {string} */type: "adjustment" | "chargeback" | "credit" | "payment" | "refund"; /** @enum {string} */
|
|
1730
|
+
status: "failed" | "refunded" | "succeeded";
|
|
1723
1731
|
amount_cents: number;
|
|
1724
1732
|
currency?: string; /** Format: uuid */
|
|
1725
1733
|
membership_term_id?: string;
|
|
@@ -1730,12 +1738,17 @@ interface components {
|
|
|
1730
1738
|
failure_reason?: string;
|
|
1731
1739
|
processed_time?: string;
|
|
1732
1740
|
};
|
|
1741
|
+
CustomerMembershipSummary: {
|
|
1742
|
+
/** @description Memberships linked to the customer, as buyer or through a member row. */total_count: number; /** @description Linked memberships whose status is active or grace_period. */
|
|
1743
|
+
active_count: number;
|
|
1744
|
+
};
|
|
1733
1745
|
Customer: {
|
|
1734
1746
|
id: string;
|
|
1735
1747
|
name: string;
|
|
1736
1748
|
email: string; /** Format: date-time */
|
|
1737
1749
|
create_time: string; /** Format: date-time */
|
|
1738
1750
|
update_time: string;
|
|
1751
|
+
membership_summary?: components["schemas"]["CustomerMembershipSummary"];
|
|
1739
1752
|
};
|
|
1740
1753
|
ListCustomersResponse: {
|
|
1741
1754
|
/**
|
|
@@ -3222,7 +3235,7 @@ interface operations {
|
|
|
3222
3235
|
MembersController_listEntitlements: {
|
|
3223
3236
|
parameters: {
|
|
3224
3237
|
query?: {
|
|
3225
|
-
type?: "
|
|
3238
|
+
type?: "discount" | "early_access" | "free_entry" | "guest_pass";
|
|
3226
3239
|
};
|
|
3227
3240
|
header?: never;
|
|
3228
3241
|
path?: never;
|
|
@@ -4107,7 +4120,7 @@ interface operations {
|
|
|
4107
4120
|
query?: {
|
|
4108
4121
|
page_size?: number;
|
|
4109
4122
|
page_token?: string;
|
|
4110
|
-
status?: ("
|
|
4123
|
+
status?: ("all" | "applied" | "cancelled" | "failed" | "pending" | "superseded")[];
|
|
4111
4124
|
};
|
|
4112
4125
|
header?: never;
|
|
4113
4126
|
path?: never;
|
|
@@ -4255,7 +4268,8 @@ interface operations {
|
|
|
4255
4268
|
parameters: {
|
|
4256
4269
|
query?: {
|
|
4257
4270
|
page_size?: number;
|
|
4258
|
-
page_token?: string;
|
|
4271
|
+
page_token?: string; /** @description Response detail level; `full` populates `membership_summary`. */
|
|
4272
|
+
view?: "basic" | "full";
|
|
4259
4273
|
};
|
|
4260
4274
|
header?: never;
|
|
4261
4275
|
path?: never;
|
|
@@ -4306,7 +4320,9 @@ interface operations {
|
|
|
4306
4320
|
};
|
|
4307
4321
|
CustomersController_get: {
|
|
4308
4322
|
parameters: {
|
|
4309
|
-
query?:
|
|
4323
|
+
query?: {
|
|
4324
|
+
/** @description Response detail level; `full` populates `membership_summary`. */view?: "basic" | "full";
|
|
4325
|
+
};
|
|
4310
4326
|
header?: never;
|
|
4311
4327
|
path?: never;
|
|
4312
4328
|
cookie?: never;
|
|
@@ -4561,6 +4577,7 @@ type BillingOption = Schemas['BillingOption'];
|
|
|
4561
4577
|
type Membership = Schemas['Membership'];
|
|
4562
4578
|
type MembershipTerm = Schemas['MembershipTerm'];
|
|
4563
4579
|
type Customer = Schemas['Customer'];
|
|
4580
|
+
type CustomerMembershipSummary = Schemas['CustomerMembershipSummary'];
|
|
4564
4581
|
type Member = Schemas['Member'];
|
|
4565
4582
|
type SyncMember = Schemas['SyncMember'];
|
|
4566
4583
|
type MemberEntitlement = Schemas['MemberEntitlement'];
|
|
@@ -4582,6 +4599,7 @@ type ScheduledChange = Schemas['MembershipScheduledChangeResponseDto'];
|
|
|
4582
4599
|
type PlanChangeResult = Schemas['PlanChangeResponseDto'];
|
|
4583
4600
|
type MemberSyncResponse = Schemas['MemberSyncResponse'];
|
|
4584
4601
|
type RedeemEntitlementResponse = Schemas['RedeemEntitlementResponseDto'];
|
|
4602
|
+
type CustomerView = 'basic' | 'full';
|
|
4585
4603
|
interface PageParams {
|
|
4586
4604
|
/** Rows per page. Server default 50; capped at 250. */
|
|
4587
4605
|
page_size?: number;
|
|
@@ -4661,8 +4679,18 @@ declare class BillingOptionsResource extends APIResource {
|
|
|
4661
4679
|
//#endregion
|
|
4662
4680
|
//#region src/resources/customers.d.ts
|
|
4663
4681
|
declare class CustomersResource extends APIResource {
|
|
4664
|
-
|
|
4665
|
-
|
|
4682
|
+
/**
|
|
4683
|
+
* Pass `view: 'full'` to include `membership_summary` on every customer.
|
|
4684
|
+
*/
|
|
4685
|
+
list(params?: PageParams & {
|
|
4686
|
+
view?: CustomerView;
|
|
4687
|
+
}, options?: RequestOptions): Promise<Page<Customer>>;
|
|
4688
|
+
/**
|
|
4689
|
+
* Pass `view: 'full'` to include `membership_summary`.
|
|
4690
|
+
*/
|
|
4691
|
+
get(id: string, params?: {
|
|
4692
|
+
view?: CustomerView;
|
|
4693
|
+
}, options?: RequestOptions): Promise<Customer>;
|
|
4666
4694
|
create(params: CreateCustomerParams, options?: RequestOptions): Promise<Customer>;
|
|
4667
4695
|
update(id: string, params: UpdateCustomerParams, options?: RequestOptions): Promise<Customer>;
|
|
4668
4696
|
delete(id: string, options?: RequestOptions): Promise<void>;
|
|
@@ -4997,4 +5025,4 @@ declare function paginate<T>(fetchPage: (params: PageParams) => Promise<Page<T>>
|
|
|
4997
5025
|
*/
|
|
4998
5026
|
declare function collect<T>(fetchPage: (params: PageParams) => Promise<Page<T>>, params?: PageParams): Promise<T[]>;
|
|
4999
5027
|
//#endregion
|
|
5000
|
-
export { AddMemberParams, 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, UpdateMemberParams, 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 };
|
|
5028
|
+
export { AddMemberParams, AdmitResult, AlreadyExistsError, BillingOption, BillingOptionSalesChannel, CancelMembershipParams, CreateBillingOptionParams, CreateBillingOptionSalesChannelParams, CreateCustomerParams, CreateEntitlementParams, CreateMemberRoleParams, CreateMembershipParams, CreatePlanEntitlementParams, CreatePlanLinkParams, CreatePlanParams, CreatePlanPricingGroupMappingParams, CreatePricingGroupParams, CreateSalesChannelParams, CreateTransactionParams, CreateWebhookSubscriptionParams, Customer, CustomerMembershipSummary, CustomerView, 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, UpdateMemberParams, 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 };
|
package/dist/index.mjs
CHANGED
|
@@ -315,11 +315,17 @@ var BillingOptionsResource = class extends APIResource {
|
|
|
315
315
|
//#endregion
|
|
316
316
|
//#region src/resources/customers.ts
|
|
317
317
|
var CustomersResource = class extends APIResource {
|
|
318
|
+
/**
|
|
319
|
+
* Pass `view: 'full'` to include `membership_summary` on every customer.
|
|
320
|
+
*/
|
|
318
321
|
async list(params, options) {
|
|
319
322
|
const response = await this.transport.request({
|
|
320
323
|
method: "GET",
|
|
321
324
|
path: "/api/v1/customers",
|
|
322
|
-
query:
|
|
325
|
+
query: {
|
|
326
|
+
...pageQuery(params),
|
|
327
|
+
...params?.view ? { view: params.view } : {}
|
|
328
|
+
},
|
|
323
329
|
retryable: true,
|
|
324
330
|
options
|
|
325
331
|
});
|
|
@@ -329,10 +335,14 @@ var CustomersResource = class extends APIResource {
|
|
|
329
335
|
total_size: response.total_size
|
|
330
336
|
};
|
|
331
337
|
}
|
|
332
|
-
|
|
338
|
+
/**
|
|
339
|
+
* Pass `view: 'full'` to include `membership_summary`.
|
|
340
|
+
*/
|
|
341
|
+
get(id, params = {}, options) {
|
|
333
342
|
return this.transport.request({
|
|
334
343
|
method: "GET",
|
|
335
344
|
path: `/api/v1/customers/${encodeURIComponent(id)}`,
|
|
345
|
+
query: params.view ? { view: params.view } : void 0,
|
|
336
346
|
retryable: true,
|
|
337
347
|
options
|
|
338
348
|
});
|