@diagonal-hq/cli 0.1.0 → 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 +214 -16
- package/dist/capabilities.generated.d.ts +397 -0
- package/dist/cli.mjs +14991 -1375
- package/dist/fields.generated.d.ts +416 -0
- package/dist/fields.generated.js +35 -0
- package/dist/index.d.ts +176 -77
- package/dist/index.js +10 -17
- package/dist/sdk-contract.d.ts +27 -5
- package/dist/workflow/data.d.ts +10 -0
- package/dist/workflow/generated/capabilities.d.ts +27 -26
- package/dist/workflow/notifications.d.ts +1 -1
- package/dist/workflow/workflow.d.ts +3 -1
- package/package.json +4 -1
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
// Generated by `artisan app:generate-custom-typescript` from CapabilityType. Do not edit.
|
|
2
|
+
// The `capabilities` key of defineResource, one settings type for each capability.
|
|
3
|
+
|
|
4
|
+
import type { FieldDefinition, FieldType } from './fields.generated';
|
|
5
|
+
import type { StaticValue } from './index';
|
|
6
|
+
|
|
7
|
+
/** The keys of the fields whose type is one of `TTypes`. */
|
|
8
|
+
export type FieldKeyOf<TFields, TTypes extends FieldType = FieldType> = {
|
|
9
|
+
[TKey in keyof TFields]: TFields[TKey] extends FieldDefinition<infer TType> ? (TType extends TTypes ? TKey : never) : never;
|
|
10
|
+
}[keyof TFields] &
|
|
11
|
+
string;
|
|
12
|
+
|
|
13
|
+
/** A capability that a resource file can declare. */
|
|
14
|
+
export type CapabilityType = "authenticatable" | "availability" | "booking" | "eventable" | "itemizable" | "lockable" | "notifiable" | "payable" | "payable_adjustment" | "payer" | "payer_balance_entry" | "payment" | "payment_method" | "price" | "product" | "refund" | "revenue_accounting" | "schedulable" | "subscription" | "subscription_discount" | "subscription_item" | "subscription_period";
|
|
15
|
+
|
|
16
|
+
/** Authenticatable: Enable authentication for this resource */
|
|
17
|
+
export type AuthenticatableCapabilitySettings<TFields> = {
|
|
18
|
+
"email_field": FieldKeyOf<TFields, "email">;
|
|
19
|
+
"password_field": FieldKeyOf<TFields, "password">;
|
|
20
|
+
"authentication_enabled_field"?: FieldKeyOf<TFields, "boolean"> | null;
|
|
21
|
+
"two_factor_enabled"?: boolean | null;
|
|
22
|
+
"magic_link_enabled"?: boolean | null;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** Availability: Records of this resource open, close, or replace the regular hours of Schedulable records on some dates, such as time off or a holiday. Needs the Eventable capability */
|
|
26
|
+
export type AvailabilityCapabilitySettings<TFields> = {
|
|
27
|
+
"schedulable_relation": FieldKeyOf<TFields, "relation">;
|
|
28
|
+
"effect_field": FieldKeyOf<TFields, "select">;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** Booking: Records of this resource take capacity from Schedulable records and are refused when none is left. Changing how places are counted briefly pauses new bookings */
|
|
32
|
+
export type BookingCapabilitySettings<TFields> = {
|
|
33
|
+
"bookable_relations": readonly (FieldKeyOf<TFields>)[];
|
|
34
|
+
"quantity_field"?: FieldKeyOf<TFields, "number"> | null;
|
|
35
|
+
"status_field"?: FieldKeyOf<TFields, "select" | "text"> | null;
|
|
36
|
+
"status_effects"?: readonly ({
|
|
37
|
+
"value": string;
|
|
38
|
+
"effect": "takes" | "held" | "waiting" | "released";
|
|
39
|
+
})[] | null;
|
|
40
|
+
"expired_status"?: string | null;
|
|
41
|
+
"needs_rescheduling_status"?: string | null;
|
|
42
|
+
"hold_expires_field"?: FieldKeyOf<TFields, "datetime"> | null;
|
|
43
|
+
"time_source_relation"?: FieldKeyOf<TFields, "relation"> | null;
|
|
44
|
+
"start_field"?: FieldKeyOf<TFields, "datetime"> | null;
|
|
45
|
+
"end_field"?: FieldKeyOf<TFields, "datetime"> | null;
|
|
46
|
+
"status_source_relation"?: FieldKeyOf<TFields, "relation"> | null;
|
|
47
|
+
"source_status_field"?: FieldKeyOf<TFields, "text" | "select"> | null;
|
|
48
|
+
"buffer_before_minutes"?: number | null;
|
|
49
|
+
"buffer_after_minutes"?: number | null;
|
|
50
|
+
"idempotency_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
51
|
+
"require_availability"?: boolean | null;
|
|
52
|
+
"min_notice_minutes"?: number | null;
|
|
53
|
+
"max_advance_days"?: number | null;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** Eventable: Enable calendar event functionality for records of this resource */
|
|
57
|
+
export type EventableCapabilitySettings<TFields> = {
|
|
58
|
+
"event_schedule_field": FieldKeyOf<TFields, "event_schedule">;
|
|
59
|
+
"label_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
60
|
+
"location_field"?: FieldKeyOf<TFields, "location" | "text"> | null;
|
|
61
|
+
"video_conference_link_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
62
|
+
"engine"?: "series" | null;
|
|
63
|
+
"repeat_horizon_days"?: number | null;
|
|
64
|
+
"repeat_excluded_fields"?: readonly (FieldKeyOf<TFields>)[] | null;
|
|
65
|
+
"repeat_owner_relation"?: FieldKeyOf<TFields, "relation"> | null;
|
|
66
|
+
"timezone_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
67
|
+
"respect_closures"?: boolean | null;
|
|
68
|
+
"repeat_record_workflows"?: boolean | null;
|
|
69
|
+
"closures_role"?: boolean | null;
|
|
70
|
+
"description_template"?: string | null;
|
|
71
|
+
"calendar_sync"?: boolean | null;
|
|
72
|
+
"calendar_owner_relation"?: FieldKeyOf<TFields, "relation"> | null;
|
|
73
|
+
"calendar_title_template"?: string | null;
|
|
74
|
+
"calendar_description_template"?: string | null;
|
|
75
|
+
"location_select_field"?: FieldKeyOf<TFields, "select"> | null;
|
|
76
|
+
"calendar_event_color"?: "banana" | "basil" | "blueberry" | "flamingo" | "grape" | "graphite" | "lavender" | "peacock" | "sage" | "tangerine" | "tomato" | null;
|
|
77
|
+
"calendar_reminder_minutes"?: number | null;
|
|
78
|
+
"calendar_meeting_links"?: boolean | null;
|
|
79
|
+
"calendar_meeting_link_condition_field"?: FieldKeyOf<TFields, "boolean"> | null;
|
|
80
|
+
"calendar_attendee_paths"?: readonly (string)[] | null;
|
|
81
|
+
"calendar_status_field"?: FieldKeyOf<TFields, "select" | "text"> | null;
|
|
82
|
+
"calendar_status_meanings"?: readonly ({
|
|
83
|
+
"value": string;
|
|
84
|
+
"meaning": "cancelled" | "tentative";
|
|
85
|
+
})[] | null;
|
|
86
|
+
"calendar_status_colors"?: readonly ({
|
|
87
|
+
"value": string;
|
|
88
|
+
"color": "banana" | "basil" | "blueberry" | "flamingo" | "grape" | "graphite" | "lavender" | "peacock" | "sage" | "tangerine" | "tomato";
|
|
89
|
+
})[] | null;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/** Itemizable: Configure this resource as a line item belonging to a payable record */
|
|
93
|
+
export type ItemizableCapabilitySettings<TFields> = {
|
|
94
|
+
"accounting_source_field"?: FieldKeyOf<TFields, "select"> | null;
|
|
95
|
+
"recognition_date_field"?: FieldKeyOf<TFields, "date" | "datetime"> | null;
|
|
96
|
+
"service_period_start_field"?: FieldKeyOf<TFields, "date" | "datetime"> | null;
|
|
97
|
+
"service_period_end_field"?: FieldKeyOf<TFields, "date" | "datetime"> | null;
|
|
98
|
+
"accounting_sources"?: readonly ({
|
|
99
|
+
"key": string;
|
|
100
|
+
"label": string;
|
|
101
|
+
"source_paths"?: readonly ({
|
|
102
|
+
"fields"?: readonly string[] | null;
|
|
103
|
+
"component"?: "start" | "end" | null;
|
|
104
|
+
})[] | null;
|
|
105
|
+
"inline"?: {
|
|
106
|
+
"recognition_method_field": FieldKeyOf<TFields, "select">;
|
|
107
|
+
"revenue_account_field": FieldKeyOf<TFields, "wallet_accounting_account">;
|
|
108
|
+
"deferred_revenue_account_field"?: FieldKeyOf<TFields, "wallet_accounting_account"> | null;
|
|
109
|
+
} | null;
|
|
110
|
+
"recognition_date"?: {
|
|
111
|
+
"fields"?: readonly string[] | null;
|
|
112
|
+
"component"?: "start" | "end" | null;
|
|
113
|
+
} | null;
|
|
114
|
+
"service_period_start"?: {
|
|
115
|
+
"fields"?: readonly string[] | null;
|
|
116
|
+
"component"?: "start" | "end" | null;
|
|
117
|
+
} | null;
|
|
118
|
+
"service_period_end"?: {
|
|
119
|
+
"fields"?: readonly string[] | null;
|
|
120
|
+
"component"?: "start" | "end" | null;
|
|
121
|
+
} | null;
|
|
122
|
+
})[] | null;
|
|
123
|
+
"subscription_accounting_source"?: string | null;
|
|
124
|
+
"parent_relation_field": FieldKeyOf<TFields, "relation">;
|
|
125
|
+
"revenue_account_field"?: FieldKeyOf<TFields, "wallet_accounting_account"> | null;
|
|
126
|
+
"description_field": FieldKeyOf<TFields, "text">;
|
|
127
|
+
"quantity_field"?: FieldKeyOf<TFields, "number"> | null;
|
|
128
|
+
"unit_price_field": FieldKeyOf<TFields, "money">;
|
|
129
|
+
"total_field": FieldKeyOf<TFields, "money">;
|
|
130
|
+
"price_field"?: FieldKeyOf<TFields, "relation"> | null;
|
|
131
|
+
"source_subscription_item_field"?: FieldKeyOf<TFields, "relation"> | null;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/** Lockable: Lock fields from being changed once a record matches a configured filter */
|
|
135
|
+
export type LockableCapabilitySettings<TFields> = {
|
|
136
|
+
"rules"?: readonly ({
|
|
137
|
+
"filter": StaticValue;
|
|
138
|
+
"fields": readonly (FieldKeyOf<TFields>)[];
|
|
139
|
+
})[] | null;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/** Notifiable: Enable notifications for this resource */
|
|
143
|
+
export type NotifiableCapabilitySettings<TFields> = {
|
|
144
|
+
"email_field"?: FieldKeyOf<TFields, "email"> | null;
|
|
145
|
+
"phone_field"?: FieldKeyOf<TFields, "phone" | "text"> | null;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
/** Payable: Configure this resource as an invoiceable record that tracks amounts due, paid, and payment status */
|
|
149
|
+
export type PayableCapabilitySettings<TFields> = {
|
|
150
|
+
"status_field": FieldKeyOf<TFields, "select">;
|
|
151
|
+
"amount_total_field": FieldKeyOf<TFields, "money">;
|
|
152
|
+
"amount_paid_field": FieldKeyOf<TFields, "money">;
|
|
153
|
+
"amount_subtotal_field"?: FieldKeyOf<TFields, "money"> | null;
|
|
154
|
+
"amount_adjustment_field"?: FieldKeyOf<TFields, "money"> | null;
|
|
155
|
+
"amount_credit_adjustment_field"?: FieldKeyOf<TFields, "money"> | null;
|
|
156
|
+
"amount_charge_adjustment_field"?: FieldKeyOf<TFields, "money"> | null;
|
|
157
|
+
"amount_written_off_field"?: FieldKeyOf<TFields, "money"> | null;
|
|
158
|
+
"amount_outstanding_field"?: FieldKeyOf<TFields, "money"> | null;
|
|
159
|
+
"amount_overpaid_field"?: FieldKeyOf<TFields, "money"> | null;
|
|
160
|
+
"currency_field": FieldKeyOf<TFields, "text">;
|
|
161
|
+
"paid_at_field"?: FieldKeyOf<TFields, "datetime"> | null;
|
|
162
|
+
"due_at_field"?: FieldKeyOf<TFields, "date" | "datetime"> | null;
|
|
163
|
+
"period_start_field"?: FieldKeyOf<TFields, "date" | "datetime"> | null;
|
|
164
|
+
"period_end_field"?: FieldKeyOf<TFields, "date" | "datetime"> | null;
|
|
165
|
+
"payer_field"?: FieldKeyOf<TFields, "relation"> | null;
|
|
166
|
+
"exclude_from_subscription_status_field"?: FieldKeyOf<TFields, "boolean"> | null;
|
|
167
|
+
"source_subscription_field"?: FieldKeyOf<TFields, "relation"> | null;
|
|
168
|
+
"source_subscription_period_field"?: FieldKeyOf<TFields, "relation"> | null;
|
|
169
|
+
"accounting_entity_field"?: FieldKeyOf<TFields, "wallet_accounting_entity"> | null;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/** Payable Adjustment: Configure this resource as an adjustment record that increases or decreases a payable total */
|
|
173
|
+
export type PayableAdjustmentCapabilitySettings<TFields> = {
|
|
174
|
+
"corrects_operation_field"?: FieldKeyOf<TFields, "uuid"> | null;
|
|
175
|
+
"line_allocations_field"?: FieldKeyOf<TFields, "list"> | null;
|
|
176
|
+
"accounting_account_field"?: FieldKeyOf<TFields, "wallet_accounting_account"> | null;
|
|
177
|
+
"source_line_field"?: FieldKeyOf<TFields, "relation"> | null;
|
|
178
|
+
"covered_start_field"?: FieldKeyOf<TFields, "date"> | null;
|
|
179
|
+
"covered_end_field"?: FieldKeyOf<TFields, "date"> | null;
|
|
180
|
+
"payable_field": FieldKeyOf<TFields, "relation">;
|
|
181
|
+
"payment_field"?: FieldKeyOf<TFields, "relation"> | null;
|
|
182
|
+
"kind_field": FieldKeyOf<TFields, "select">;
|
|
183
|
+
"status_field": FieldKeyOf<TFields, "select">;
|
|
184
|
+
"calculation_type_field": FieldKeyOf<TFields, "select">;
|
|
185
|
+
"amount_field": FieldKeyOf<TFields, "money">;
|
|
186
|
+
"fixed_amount_field"?: FieldKeyOf<TFields, "money"> | null;
|
|
187
|
+
"percent_field"?: FieldKeyOf<TFields, "number"> | null;
|
|
188
|
+
"description_field": FieldKeyOf<TFields, "text">;
|
|
189
|
+
"effective_at_field"?: FieldKeyOf<TFields, "date" | "datetime"> | null;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
/** Payer: Configure this resource as a payment customer whose Stripe Customer ID is automatically managed */
|
|
193
|
+
export type PayerCapabilitySettings<TFields> = {
|
|
194
|
+
"email_field"?: FieldKeyOf<TFields, "email"> | null;
|
|
195
|
+
"name_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
196
|
+
"balance_field"?: FieldKeyOf<TFields, "money"> | null;
|
|
197
|
+
"default_payment_method_field"?: FieldKeyOf<TFields, "relation"> | null;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
/** Payer Balance Entry: Configure this resource as an immutable ledger of credits and debits against payer balances */
|
|
201
|
+
export type PayerBalanceEntryCapabilitySettings<TFields> = {
|
|
202
|
+
"accounting_entity_field"?: FieldKeyOf<TFields, "wallet_accounting_entity"> | null;
|
|
203
|
+
"description_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
204
|
+
"source_payable_field"?: FieldKeyOf<TFields, "relation"> | null;
|
|
205
|
+
"payer_field": FieldKeyOf<TFields, "relation">;
|
|
206
|
+
"direction_field": FieldKeyOf<TFields, "select">;
|
|
207
|
+
"amount_field": FieldKeyOf<TFields, "money">;
|
|
208
|
+
"effective_at_field"?: FieldKeyOf<TFields, "date" | "datetime"> | null;
|
|
209
|
+
"payment_field"?: FieldKeyOf<TFields, "relation"> | null;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
/** Payment: Configure this resource as a payment record that tracks individual transactions against a payable */
|
|
213
|
+
export type PaymentCapabilitySettings<TFields> = {
|
|
214
|
+
"payable_field": FieldKeyOf<TFields, "relation">;
|
|
215
|
+
"payer_field"?: FieldKeyOf<TFields, "relation"> | null;
|
|
216
|
+
"amount_field": FieldKeyOf<TFields, "money">;
|
|
217
|
+
"currency_field": FieldKeyOf<TFields, "text">;
|
|
218
|
+
"method_field": FieldKeyOf<TFields, "select">;
|
|
219
|
+
"status_field": FieldKeyOf<TFields, "select">;
|
|
220
|
+
"failure_reason_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
221
|
+
"refunded_amount_field"?: FieldKeyOf<TFields, "money"> | null;
|
|
222
|
+
"diagonal_fee_field": FieldKeyOf<TFields, "money">;
|
|
223
|
+
"diagonal_fee_refunded_field": FieldKeyOf<TFields, "money">;
|
|
224
|
+
"diagonal_fee_net_field": FieldKeyOf<TFields, "money">;
|
|
225
|
+
"notes_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
226
|
+
"paid_at_field"?: FieldKeyOf<TFields, "datetime"> | null;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
/** Payment Method: Configure this resource as a saved payment method synced from Stripe for a payer */
|
|
230
|
+
export type PaymentMethodCapabilitySettings<TFields> = {
|
|
231
|
+
"payer_field": FieldKeyOf<TFields, "relation">;
|
|
232
|
+
"type_field": FieldKeyOf<TFields, "select">;
|
|
233
|
+
"display_name_field": FieldKeyOf<TFields, "text">;
|
|
234
|
+
"brand_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
235
|
+
"last4_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
236
|
+
"exp_month_field"?: FieldKeyOf<TFields, "number"> | null;
|
|
237
|
+
"exp_year_field"?: FieldKeyOf<TFields, "number"> | null;
|
|
238
|
+
"bank_name_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
/** Price: Configure this resource as product pricing records with an amount and billing cadence */
|
|
242
|
+
export type PriceCapabilitySettings<TFields> = {
|
|
243
|
+
"product_field": FieldKeyOf<TFields, "relation">;
|
|
244
|
+
"amount_field": FieldKeyOf<TFields, "money">;
|
|
245
|
+
"recurrence_field": FieldKeyOf<TFields, "select">;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/** Product: Configure this resource as sellable catalog items that prices and subscriptions can reference */
|
|
249
|
+
export type ProductCapabilitySettings<TFields> = {
|
|
250
|
+
"name_field": FieldKeyOf<TFields, "text">;
|
|
251
|
+
"accounting_entity_field"?: FieldKeyOf<TFields, "wallet_accounting_entity"> | null;
|
|
252
|
+
"revenue_account_field"?: FieldKeyOf<TFields, "wallet_accounting_account"> | null;
|
|
253
|
+
"description_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
/** Refund: Configure this resource as a refund record that reverses part or all of a payment */
|
|
257
|
+
export type RefundCapabilitySettings<TFields> = {
|
|
258
|
+
"payment_field": FieldKeyOf<TFields, "relation">;
|
|
259
|
+
"amount_field": FieldKeyOf<TFields, "money">;
|
|
260
|
+
"currency_field": FieldKeyOf<TFields, "text">;
|
|
261
|
+
"reason_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
262
|
+
"status_field": FieldKeyOf<TFields, "select">;
|
|
263
|
+
"failure_reason_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
264
|
+
"refunded_at_field": FieldKeyOf<TFields, "datetime">;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
/** Revenue accounting: Supply revenue accounts and recognition rules for purchases of this record. Purchase dates are mapped on Itemizable. */
|
|
268
|
+
export type RevenueAccountingCapabilitySettings<TFields> = {
|
|
269
|
+
"recognition_method_field": FieldKeyOf<TFields, "select">;
|
|
270
|
+
"revenue_account_field": FieldKeyOf<TFields, "wallet_accounting_account">;
|
|
271
|
+
"deferred_revenue_account_field"?: FieldKeyOf<TFields, "wallet_accounting_account"> | null;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
/** Schedulable: Mark this resource as an availability-bearing participant such as a person, room, event, or ticket type, with an optional capacity that Bookings take from */
|
|
275
|
+
export type SchedulableCapabilitySettings<TFields> = {
|
|
276
|
+
"color_field"?: FieldKeyOf<TFields, "color"> | null;
|
|
277
|
+
"name_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
278
|
+
"capacity_field"?: FieldKeyOf<TFields, "number"> | null;
|
|
279
|
+
"seats_left_field"?: FieldKeyOf<TFields, "number"> | null;
|
|
280
|
+
"timezone_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
281
|
+
"regular_hours_field"?: FieldKeyOf<TFields, "regular_hours"> | null;
|
|
282
|
+
"hours_within_relation"?: FieldKeyOf<TFields, "relation"> | null;
|
|
283
|
+
"limits"?: readonly ({
|
|
284
|
+
"period": "day" | "week" | "month";
|
|
285
|
+
"max": number;
|
|
286
|
+
"measure"?: "bookings" | "minutes" | null;
|
|
287
|
+
})[] | null;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
/** Subscription: Configure this resource as a recurring agreement that generates payable invoices each billing period */
|
|
291
|
+
export type SubscriptionCapabilitySettings<TFields> = {
|
|
292
|
+
"payer_field": FieldKeyOf<TFields, "relation">;
|
|
293
|
+
"status_field": FieldKeyOf<TFields, "select">;
|
|
294
|
+
"collection_method_field": FieldKeyOf<TFields, "select">;
|
|
295
|
+
"interval_field"?: FieldKeyOf<TFields, "select"> | null;
|
|
296
|
+
"started_at_field": FieldKeyOf<TFields, "datetime">;
|
|
297
|
+
"activated_at_field"?: FieldKeyOf<TFields, "datetime"> | null;
|
|
298
|
+
"current_period_start_field": FieldKeyOf<TFields, "datetime">;
|
|
299
|
+
"current_period_end_field": FieldKeyOf<TFields, "datetime">;
|
|
300
|
+
"next_invoice_at_field": FieldKeyOf<TFields, "datetime">;
|
|
301
|
+
"canceled_at_field"?: FieldKeyOf<TFields, "datetime"> | null;
|
|
302
|
+
"cancel_at_period_end_field"?: FieldKeyOf<TFields, "boolean"> | null;
|
|
303
|
+
"latest_invoice_field"?: FieldKeyOf<TFields, "relation"> | null;
|
|
304
|
+
"periods_field"?: FieldKeyOf<TFields, "relation"> | null;
|
|
305
|
+
"grace_period_days_field"?: FieldKeyOf<TFields, "number"> | null;
|
|
306
|
+
"activation_policy_field"?: FieldKeyOf<TFields, "select"> | null;
|
|
307
|
+
"initial_term_anchor_field"?: FieldKeyOf<TFields, "select"> | null;
|
|
308
|
+
"initial_payment_window_days_field"?: FieldKeyOf<TFields, "number"> | null;
|
|
309
|
+
"trial_started_at_field"?: FieldKeyOf<TFields, "datetime"> | null;
|
|
310
|
+
"trial_ends_at_field"?: FieldKeyOf<TFields, "datetime"> | null;
|
|
311
|
+
"trial_payment_method_policy_field"?: FieldKeyOf<TFields, "select"> | null;
|
|
312
|
+
"lapse_billing_behavior_field"?: FieldKeyOf<TFields, "select"> | null;
|
|
313
|
+
"billing_cycle_mode_field"?: FieldKeyOf<TFields, "select"> | null;
|
|
314
|
+
"billing_anchor_month_field"?: FieldKeyOf<TFields, "number"> | null;
|
|
315
|
+
"billing_anchor_day_field"?: FieldKeyOf<TFields, "number"> | null;
|
|
316
|
+
"billing_timezone_field"?: FieldKeyOf<TFields, "text"> | null;
|
|
317
|
+
"accounting_entity_field"?: FieldKeyOf<TFields, "wallet_accounting_entity"> | null;
|
|
318
|
+
"period_planning_lead_days"?: number | null;
|
|
319
|
+
"default_billing_cycle_mode"?: "anniversary" | "calendar_aligned" | null;
|
|
320
|
+
"default_billing_anchor_month"?: number | null;
|
|
321
|
+
"default_billing_anchor_day"?: number | null;
|
|
322
|
+
"default_billing_timezone"?: string | null;
|
|
323
|
+
"allowed_billing_anchors"?: readonly ({
|
|
324
|
+
"month": number;
|
|
325
|
+
"day": number;
|
|
326
|
+
})[] | null;
|
|
327
|
+
"default_activation_policy"?: "after_first_payment" | "immediate" | null;
|
|
328
|
+
"default_initial_term_anchor"?: "first_payment_at" | "subscription_created_at" | null;
|
|
329
|
+
"default_initial_payment_window_days"?: number | null;
|
|
330
|
+
"default_trial_days"?: number | null;
|
|
331
|
+
"default_trial_payment_method_policy"?: "optional" | "required" | null;
|
|
332
|
+
"default_grace_period_days"?: number | null;
|
|
333
|
+
"default_lapse_billing_behavior"?: "continue_billing" | "suspend_renewals" | "cancel" | null;
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
/** Subscription Discount: Apply a discount to the first invoice, every invoice, or one billing period of a subscription */
|
|
337
|
+
export type SubscriptionDiscountCapabilitySettings<TFields> = {
|
|
338
|
+
"subscription_field": FieldKeyOf<TFields, "relation">;
|
|
339
|
+
"status_field": FieldKeyOf<TFields, "select">;
|
|
340
|
+
"duration_field": FieldKeyOf<TFields, "select">;
|
|
341
|
+
"calculation_type_field": FieldKeyOf<TFields, "select">;
|
|
342
|
+
"percent_field"?: FieldKeyOf<TFields, "number"> | null;
|
|
343
|
+
"fixed_amount_field"?: FieldKeyOf<TFields, "money"> | null;
|
|
344
|
+
"description_field": FieldKeyOf<TFields, "text">;
|
|
345
|
+
"period_start_field"?: FieldKeyOf<TFields, "date"> | null;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
/** Subscription Item: Configure this resource as a recurring line in a subscription that renews each billing period */
|
|
349
|
+
export type SubscriptionItemCapabilitySettings<TFields> = {
|
|
350
|
+
"subscription_field": FieldKeyOf<TFields, "relation">;
|
|
351
|
+
"price_field": FieldKeyOf<TFields, "relation">;
|
|
352
|
+
"product_field"?: FieldKeyOf<TFields, "relation"> | null;
|
|
353
|
+
"quantity_field"?: FieldKeyOf<TFields, "number"> | null;
|
|
354
|
+
"price_snapshot_field": FieldKeyOf<TFields, "money">;
|
|
355
|
+
"description_snapshot_field": FieldKeyOf<TFields, "text">;
|
|
356
|
+
"starts_at_field"?: FieldKeyOf<TFields, "datetime"> | null;
|
|
357
|
+
"ends_at_field"?: FieldKeyOf<TFields, "datetime"> | null;
|
|
358
|
+
"status_field": FieldKeyOf<TFields, "select">;
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
/** Subscription Period: Track a billable subscription period with a stable identity. */
|
|
362
|
+
export type SubscriptionPeriodCapabilitySettings<TFields> = {
|
|
363
|
+
"subscription_field": FieldKeyOf<TFields, "relation">;
|
|
364
|
+
"billing_key_field": FieldKeyOf<TFields, "text">;
|
|
365
|
+
"kind_field": FieldKeyOf<TFields, "select">;
|
|
366
|
+
"period_start_field": FieldKeyOf<TFields, "datetime">;
|
|
367
|
+
"period_end_field": FieldKeyOf<TFields, "datetime">;
|
|
368
|
+
"lifecycle_field": FieldKeyOf<TFields, "select">;
|
|
369
|
+
"primary_invoice_field": FieldKeyOf<TFields, "relation">;
|
|
370
|
+
"superseded_by_field": FieldKeyOf<TFields, "relation">;
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
/** The capabilities of a resource. A field reference names a field of the resource by its key. */
|
|
374
|
+
export type ResourceCapabilities<TFields> = {
|
|
375
|
+
authenticatable?: AuthenticatableCapabilitySettings<TFields>;
|
|
376
|
+
availability?: AvailabilityCapabilitySettings<TFields>;
|
|
377
|
+
booking?: BookingCapabilitySettings<TFields>;
|
|
378
|
+
eventable?: EventableCapabilitySettings<TFields>;
|
|
379
|
+
itemizable?: ItemizableCapabilitySettings<TFields>;
|
|
380
|
+
lockable?: LockableCapabilitySettings<TFields>;
|
|
381
|
+
notifiable?: NotifiableCapabilitySettings<TFields>;
|
|
382
|
+
payable?: PayableCapabilitySettings<TFields>;
|
|
383
|
+
payable_adjustment?: PayableAdjustmentCapabilitySettings<TFields>;
|
|
384
|
+
payer?: PayerCapabilitySettings<TFields>;
|
|
385
|
+
payer_balance_entry?: PayerBalanceEntryCapabilitySettings<TFields>;
|
|
386
|
+
payment?: PaymentCapabilitySettings<TFields>;
|
|
387
|
+
payment_method?: PaymentMethodCapabilitySettings<TFields>;
|
|
388
|
+
price?: PriceCapabilitySettings<TFields>;
|
|
389
|
+
product?: ProductCapabilitySettings<TFields>;
|
|
390
|
+
refund?: RefundCapabilitySettings<TFields>;
|
|
391
|
+
revenue_accounting?: RevenueAccountingCapabilitySettings<TFields>;
|
|
392
|
+
schedulable?: SchedulableCapabilitySettings<TFields>;
|
|
393
|
+
subscription?: SubscriptionCapabilitySettings<TFields>;
|
|
394
|
+
subscription_discount?: SubscriptionDiscountCapabilitySettings<TFields>;
|
|
395
|
+
subscription_item?: SubscriptionItemCapabilitySettings<TFields>;
|
|
396
|
+
subscription_period?: SubscriptionPeriodCapabilitySettings<TFields>;
|
|
397
|
+
};
|