@peable.to/contracts 6.1.0 → 6.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.
Files changed (38) hide show
  1. package/dist/cjs/resources/billingEngine/index.js +4 -1
  2. package/dist/cjs/resources/billingEngine/quotes.js +342 -0
  3. package/dist/cjs/resources/connect/reporting.js +250 -2
  4. package/dist/cjs/resources/events/events.js +4 -0
  5. package/dist/cjs/vocabulary/errors.js +4 -0
  6. package/dist/cjs/vocabulary/events.js +4 -0
  7. package/dist/cjs/vocabulary/index.js +1 -0
  8. package/dist/cjs/vocabulary/invoices.js +3 -0
  9. package/dist/cjs/vocabulary/quotes.js +31 -0
  10. package/dist/cjs/vocabulary/reporting.js +28 -1
  11. package/dist/esm/resources/billingEngine/index.js +4 -1
  12. package/dist/esm/resources/billingEngine/quotes.js +339 -0
  13. package/dist/esm/resources/connect/reporting.js +251 -3
  14. package/dist/esm/resources/events/events.js +4 -0
  15. package/dist/esm/vocabulary/errors.js +4 -0
  16. package/dist/esm/vocabulary/events.js +4 -0
  17. package/dist/esm/vocabulary/index.js +1 -0
  18. package/dist/esm/vocabulary/invoices.js +3 -0
  19. package/dist/esm/vocabulary/quotes.js +28 -0
  20. package/dist/esm/vocabulary/reporting.js +27 -0
  21. package/dist/types/resources/billingEngine/index.d.ts +839 -1
  22. package/dist/types/resources/billingEngine/invoices.d.ts +12 -0
  23. package/dist/types/resources/billingEngine/quotes.d.ts +1032 -0
  24. package/dist/types/resources/connect/index.d.ts +671 -0
  25. package/dist/types/resources/connect/reporting.d.ts +894 -0
  26. package/dist/types/resources/events/events.d.ts +16 -0
  27. package/dist/types/resources/events/index.d.ts +54 -2
  28. package/dist/types/resources/events/webhookDeliveries.d.ts +12 -0
  29. package/dist/types/resources/events/webhookEndpoints.d.ts +52 -4
  30. package/dist/types/resources/payments/disputes.d.ts +10 -10
  31. package/dist/types/resources/payments/index.d.ts +6 -6
  32. package/dist/types/vocabulary/errors.d.ts +4 -0
  33. package/dist/types/vocabulary/events.d.ts +4 -0
  34. package/dist/types/vocabulary/index.d.ts +1 -0
  35. package/dist/types/vocabulary/invoices.d.ts +1 -1
  36. package/dist/types/vocabulary/quotes.d.ts +27 -0
  37. package/dist/types/vocabulary/reporting.d.ts +23 -0
  38. package/package.json +1 -1
@@ -2895,8 +2895,8 @@ export declare const paymentsRoutes: readonly [{
2895
2895
  }, import("zod/v4/core").$strict>;
2896
2896
  evidence: import("zod").ZodOptional<import("zod").ZodObject<{
2897
2897
  customer_name: import("zod").ZodNullable<import("zod").ZodString>;
2898
- billing_address: import("zod").ZodNullable<import("zod").ZodString>;
2899
2898
  access_activity_log: import("zod").ZodNullable<import("zod").ZodString>;
2899
+ billing_address: import("zod").ZodNullable<import("zod").ZodString>;
2900
2900
  cancellation_policy_disclosure: import("zod").ZodNullable<import("zod").ZodString>;
2901
2901
  cancellation_rebuttal: import("zod").ZodNullable<import("zod").ZodString>;
2902
2902
  customer_email_address: import("zod").ZodNullable<import("zod").ZodString>;
@@ -3014,8 +3014,8 @@ export declare const paymentsRoutes: readonly [{
3014
3014
  }, import("zod/v4/core").$strict>;
3015
3015
  evidence: import("zod").ZodOptional<import("zod").ZodObject<{
3016
3016
  customer_name: import("zod").ZodNullable<import("zod").ZodString>;
3017
- billing_address: import("zod").ZodNullable<import("zod").ZodString>;
3018
3017
  access_activity_log: import("zod").ZodNullable<import("zod").ZodString>;
3018
+ billing_address: import("zod").ZodNullable<import("zod").ZodString>;
3019
3019
  cancellation_policy_disclosure: import("zod").ZodNullable<import("zod").ZodString>;
3020
3020
  cancellation_rebuttal: import("zod").ZodNullable<import("zod").ZodString>;
3021
3021
  customer_email_address: import("zod").ZodNullable<import("zod").ZodString>;
@@ -3119,8 +3119,8 @@ export declare const paymentsRoutes: readonly [{
3119
3119
  }, import("zod/v4/core").$strict>;
3120
3120
  evidence: import("zod").ZodOptional<import("zod").ZodObject<{
3121
3121
  customer_name: import("zod").ZodNullable<import("zod").ZodString>;
3122
- billing_address: import("zod").ZodNullable<import("zod").ZodString>;
3123
3122
  access_activity_log: import("zod").ZodNullable<import("zod").ZodString>;
3123
+ billing_address: import("zod").ZodNullable<import("zod").ZodString>;
3124
3124
  cancellation_policy_disclosure: import("zod").ZodNullable<import("zod").ZodString>;
3125
3125
  cancellation_rebuttal: import("zod").ZodNullable<import("zod").ZodString>;
3126
3126
  customer_email_address: import("zod").ZodNullable<import("zod").ZodString>;
@@ -3176,8 +3176,8 @@ export declare const paymentsRoutes: readonly [{
3176
3176
  shipping_documentation: import("zod").ZodOptional<import("zod").ZodString>;
3177
3177
  uncategorized_file: import("zod").ZodOptional<import("zod").ZodString>;
3178
3178
  customer_name: import("zod").ZodOptional<import("zod").ZodString>;
3179
- billing_address: import("zod").ZodOptional<import("zod").ZodString>;
3180
3179
  access_activity_log: import("zod").ZodOptional<import("zod").ZodString>;
3180
+ billing_address: import("zod").ZodOptional<import("zod").ZodString>;
3181
3181
  cancellation_policy_disclosure: import("zod").ZodOptional<import("zod").ZodString>;
3182
3182
  cancellation_rebuttal: import("zod").ZodOptional<import("zod").ZodString>;
3183
3183
  customer_email_address: import("zod").ZodOptional<import("zod").ZodString>;
@@ -3251,8 +3251,8 @@ export declare const paymentsRoutes: readonly [{
3251
3251
  }, import("zod/v4/core").$strict>;
3252
3252
  evidence: import("zod").ZodOptional<import("zod").ZodObject<{
3253
3253
  customer_name: import("zod").ZodNullable<import("zod").ZodString>;
3254
- billing_address: import("zod").ZodNullable<import("zod").ZodString>;
3255
3254
  access_activity_log: import("zod").ZodNullable<import("zod").ZodString>;
3255
+ billing_address: import("zod").ZodNullable<import("zod").ZodString>;
3256
3256
  cancellation_policy_disclosure: import("zod").ZodNullable<import("zod").ZodString>;
3257
3257
  cancellation_rebuttal: import("zod").ZodNullable<import("zod").ZodString>;
3258
3258
  customer_email_address: import("zod").ZodNullable<import("zod").ZodString>;
@@ -3351,8 +3351,8 @@ export declare const paymentsRoutes: readonly [{
3351
3351
  }, import("zod/v4/core").$strict>;
3352
3352
  evidence: import("zod").ZodOptional<import("zod").ZodObject<{
3353
3353
  customer_name: import("zod").ZodNullable<import("zod").ZodString>;
3354
- billing_address: import("zod").ZodNullable<import("zod").ZodString>;
3355
3354
  access_activity_log: import("zod").ZodNullable<import("zod").ZodString>;
3355
+ billing_address: import("zod").ZodNullable<import("zod").ZodString>;
3356
3356
  cancellation_policy_disclosure: import("zod").ZodNullable<import("zod").ZodString>;
3357
3357
  cancellation_rebuttal: import("zod").ZodNullable<import("zod").ZodString>;
3358
3358
  customer_email_address: import("zod").ZodNullable<import("zod").ZodString>;
@@ -91,8 +91,12 @@ export declare const ERROR_CODE_DESCRIPTIONS: {
91
91
  readonly invoice_not_editable: "The invoice is finalized and can no longer be edited.";
92
92
  readonly invoice_unexpected_state: "The invoice is in a status that does not allow this operation.";
93
93
  readonly invoice_no_customer_line_items: "The invoice has no line items to finalize.";
94
+ readonly quote_not_editable: "Only a draft quote can be edited.";
95
+ readonly quote_unexpected_state: "The quote's status does not allow this.";
96
+ readonly quote_expired: "The quote expired.";
94
97
  readonly invoice_payment_intent_requires_action: "The invoice's payment needs the customer to act (a card challenge).";
95
98
  readonly subscription_unexpected_state: "The subscription is in a status that does not allow this operation.";
99
+ readonly report_schedule_unexpected_state: "A canceled report schedule never changes.";
96
100
  readonly customer_currency_mismatch: "The currency differs from the customer's billing currency.";
97
101
  readonly customer_test_clock_mismatch: "The objects live on different test clocks.";
98
102
  readonly coupon_invalid: "The coupon does not exist or is no longer valid.";
@@ -116,6 +116,10 @@ export declare const WEBHOOK_EVENT_OBJECTS: {
116
116
  readonly 'billing_portal.configuration.created': "billing_portal.configuration";
117
117
  readonly 'billing_portal.configuration.updated': "billing_portal.configuration";
118
118
  readonly 'billing_portal.session.created': "billing_portal.session";
119
+ readonly 'quote.created': "quote";
120
+ readonly 'quote.finalized': "quote";
121
+ readonly 'quote.accepted': "quote";
122
+ readonly 'quote.canceled': "quote";
119
123
  readonly 'tax.assessment.created': "tax.assessment";
120
124
  readonly 'tax.review_item.created': "tax.review_item";
121
125
  readonly 'tax.review_item.updated': "tax.review_item";
@@ -9,6 +9,7 @@ export * from './lists';
9
9
  export * from './money';
10
10
  export * from './tax';
11
11
  export * from './subscriptions';
12
+ export * from './quotes';
12
13
  export * from './reporting';
13
14
  export * from './payments';
14
15
  export * from './version';
@@ -1,7 +1,7 @@
1
1
  export declare const INVOICE_STATUSES: readonly ["draft", "open", "paid", "void", "uncollectible"];
2
2
  export type InvoiceStatus = (typeof INVOICE_STATUSES)[number];
3
3
  /** Why an invoice exists. */
4
- export declare const INVOICE_BILLING_REASONS: readonly ["manual", "subscription_create", "subscription_cycle", "subscription_update", "subscription_cancel", "upcoming"];
4
+ export declare const INVOICE_BILLING_REASONS: readonly ["manual", "subscription_create", "subscription_cycle", "subscription_update", "subscription_cancel", "upcoming", "quote_accept"];
5
5
  export type InvoiceBillingReason = (typeof INVOICE_BILLING_REASONS)[number];
6
6
  /**
7
7
  * `automatic_tax.status` — Peable Tax (ADR 0011) is computed before an invoice
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Where a quote stands — Stripe's four.
3
+ *
4
+ * - `draft` — being written; the only status a quote can be edited in.
5
+ * - `open` — finalized: numbered, priced and taxed, waiting for the
6
+ * customer's answer until `expires_at`.
7
+ * - `accepted` — terminal: the native billing engine made its invoice (one-time
8
+ * lines) or its subscription and first invoice (recurring lines).
9
+ * - `canceled` — terminal: cancelled by the merchant, or expired while open.
10
+ */
11
+ export declare const QUOTE_STATUSES: readonly ["draft", "open", "accepted", "canceled"];
12
+ export type QuoteStatus = (typeof QUOTE_STATUSES)[number];
13
+ /** Bounds a quote is checked against. */
14
+ export declare const QUOTE_LIMITS: {
15
+ /** Lines on one quote — a subscription's item limit. */
16
+ readonly lineItemsMax: 20;
17
+ readonly quantityMax: 1000000;
18
+ /** `header` and `footer`; `description` is 1500 like an invoice's. */
19
+ readonly headerMax: 50;
20
+ readonly footerMax: 500;
21
+ readonly descriptionMax: 1500;
22
+ /** A quote expires 30 days after it is created unless `expires_at` says otherwise (Stripe's default). */
23
+ readonly defaultExpiryDays: 30;
24
+ /** `expires_at` at most this far ahead. */
25
+ readonly expiryMaxDays: 365;
26
+ readonly trialPeriodDaysMax: 730;
27
+ };
@@ -16,3 +16,26 @@ export declare const REQUEST_LOG_STATUS_CLASSES: readonly ["2xx", "3xx", "4xx",
16
16
  export type RequestLogStatusClass = (typeof REQUEST_LOG_STATUS_CLASSES)[number];
17
17
  /** How long a request log is kept (and served). */
18
18
  export declare const REQUEST_LOG_RETENTION_DAYS = 30;
19
+ /**
20
+ * A report schedule's lifecycle: `active` fires at each occurrence, `paused`
21
+ * fires nothing until resumed (resuming never backfills), `canceled` is
22
+ * terminal.
23
+ */
24
+ export declare const REPORT_SCHEDULE_STATUSES: readonly ["active", "paused", "canceled"];
25
+ export type ReportScheduleStatus = (typeof REPORT_SCHEDULE_STATUSES)[number];
26
+ /**
27
+ * How often a schedule fires — Stripe's payout-schedule spelling: every day,
28
+ * once a week on `weekly_anchor`, once a month on `monthly_anchor`. Each
29
+ * occurrence is local midnight in the schedule's timezone, and its run covers
30
+ * the time since the previous occurrence.
31
+ */
32
+ export declare const REPORT_SCHEDULE_INTERVALS: readonly ["daily", "weekly", "monthly"];
33
+ export type ReportScheduleInterval = (typeof REPORT_SCHEDULE_INTERVALS)[number];
34
+ /** A weekly schedule's day, Monday first (ISO 8601). */
35
+ export declare const REPORT_SCHEDULE_WEEKDAYS: readonly ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"];
36
+ export type ReportScheduleWeekday = (typeof REPORT_SCHEDULE_WEEKDAYS)[number];
37
+ /** The languages a schedule's emails are written in — Orbit's own. */
38
+ export declare const REPORT_SCHEDULE_LOCALES: readonly ["en", "es"];
39
+ export type ReportScheduleLocale = (typeof REPORT_SCHEDULE_LOCALES)[number];
40
+ /** How many addresses one schedule may email. */
41
+ export declare const REPORT_SCHEDULE_MAX_RECIPIENTS = 10;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peable.to/contracts",
3
- "version": "6.1.0",
3
+ "version": "6.3.0",
4
4
  "description": "The Peable wire, declared once: Zod contracts of every public route, the OpenAPI 3.1 generator and the closed value sets (ADR 0014 D5).",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",