@wildo-ai/external-connectors-models 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/core/commons.external-connectors-models.schemas.d.ts +13 -132
- package/dist/esm/core/commons.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/core/commons.external-connectors-models.schemas.js +13 -31
- package/dist/esm/core/commons.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/core/operation-classification.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/core/operation-classification.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/core/security.external-connectors-models.schemas.d.ts +40 -8
- package/dist/esm/core/security.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/core/security.external-connectors-models.schemas.js +61 -14
- package/dist/esm/core/security.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.d.ts +26 -163
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.js +20 -92
- package/dist/esm/protocols/agent-client-protocol.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/billing.standard-interface.schemas.d.ts +130 -10
- package/dist/esm/protocols/billing.standard-interface.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/billing.standard-interface.schemas.js +41 -0
- package/dist/esm/protocols/billing.standard-interface.schemas.js.map +1 -1
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.d.ts +1 -16
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.js +1 -7
- package/dist/esm/protocols/document-extraction.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/email.external-connectors-models.schemas.d.ts +1 -56
- package/dist/esm/protocols/email.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/email.external-connectors-models.schemas.js +0 -20
- package/dist/esm/protocols/email.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/email.standard-interface.schemas.d.ts +4 -4
- package/dist/esm/protocols/email.standard-interface.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.d.ts +1 -16
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.js +4 -9
- package/dist/esm/protocols/embeddings.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/frontend.external-connectors-models.schemas.d.ts +6 -13
- package/dist/esm/protocols/frontend.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/frontend.external-connectors-models.schemas.js +0 -9
- package/dist/esm/protocols/frontend.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/hooks-capability.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/hooks-capability.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.d.ts +1 -15
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.js +1 -9
- package/dist/esm/protocols/hooks.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/image.external-connectors-models.schemas.d.ts +1 -18
- package/dist/esm/protocols/image.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/image.external-connectors-models.schemas.js +1 -7
- package/dist/esm/protocols/image.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/llm.external-connectors-models.schemas.d.ts +92 -40
- package/dist/esm/protocols/llm.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/llm.external-connectors-models.schemas.js +154 -41
- package/dist/esm/protocols/llm.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/oauth2-provider-assurance.definitions.d.ts +7 -0
- package/dist/esm/protocols/oauth2-provider-assurance.definitions.d.ts.map +1 -0
- package/dist/esm/protocols/oauth2-provider-assurance.definitions.js +36 -0
- package/dist/esm/protocols/oauth2-provider-assurance.definitions.js.map +1 -0
- package/dist/esm/protocols/oauth2-provider-assurance.schemas.d.ts +23 -0
- package/dist/esm/protocols/oauth2-provider-assurance.schemas.d.ts.map +1 -0
- package/dist/esm/protocols/oauth2-provider-assurance.schemas.js +25 -0
- package/dist/esm/protocols/oauth2-provider-assurance.schemas.js.map +1 -0
- package/dist/esm/protocols/oauth2.external-connectors-models.schemas.d.ts +0 -148
- package/dist/esm/protocols/oauth2.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/oauth2.external-connectors-models.schemas.js +1 -40
- package/dist/esm/protocols/oauth2.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.d.ts +530 -15
- package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.js +380 -0
- package/dist/esm/protocols/rest-operations.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/sms.external-connectors-models.schemas.d.ts +0 -39
- package/dist/esm/protocols/sms.external-connectors-models.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/sms.external-connectors-models.schemas.js +0 -13
- package/dist/esm/protocols/sms.external-connectors-models.schemas.js.map +1 -1
- package/dist/esm/protocols/sms.standard-interface.schemas.d.ts +1 -1
- package/dist/esm/protocols/sms.standard-interface.schemas.d.ts.map +1 -1
- package/dist/esm/protocols/sms.standard-interface.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -3
- package/dist/esm/.native.tsbuildinfo +0 -1
- package/dist/esm/core/protocols.external-connectors-models.schemas.d.ts +0 -74
- package/dist/esm/core/protocols.external-connectors-models.schemas.d.ts.map +0 -1
- package/dist/esm/core/protocols.external-connectors-models.schemas.js +0 -1
- package/dist/esm/core/protocols.external-connectors-models.schemas.js.map +0 -1
- package/dist/esm/protocols/rest-api.external-connectors-models.schemas.d.ts +0 -37
- package/dist/esm/protocols/rest-api.external-connectors-models.schemas.d.ts.map +0 -1
- package/dist/esm/protocols/rest-api.external-connectors-models.schemas.js +0 -10
- package/dist/esm/protocols/rest-api.external-connectors-models.schemas.js.map +0 -1
|
@@ -62,6 +62,45 @@ export declare enum ProrationBehavior {
|
|
|
62
62
|
/** Prorate and invoice the difference IMMEDIATELY rather than at the next cycle. */
|
|
63
63
|
ALWAYS_INVOICE = "always_invoice"
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* How the provider treats a subscription change whose resulting payment does not succeed (#535, decision D6).
|
|
67
|
+
*
|
|
68
|
+
* Wildo applies a confirmed plan change IMMEDIATELY: entitlements move at local completion, and a failed proration
|
|
69
|
+
* payment moves the subscription to `past_due` through the webhook projection, where dunning owns what happens next.
|
|
70
|
+
* The value is DECLARED on every engine-issued change rather than left to the provider's default, so a change of that
|
|
71
|
+
* default can never silently change the semantics.
|
|
72
|
+
*
|
|
73
|
+
* Deliberately a one-member vocabulary. `pending_if_incomplete` (apply only after payment, expire after 23 h) was
|
|
74
|
+
* weighed and rejected in #535; add a member only with a decision that changes D6.
|
|
75
|
+
*
|
|
76
|
+
* spec-cite: https://docs.stripe.com/api/subscriptions/update — `payment_behavior`; the value equals Stripe's wire value,
|
|
77
|
+
* so the Stripe adapter passes it untranslated, as it does `ProrationBehavior`.
|
|
78
|
+
*/
|
|
79
|
+
export declare enum StandardBilling_SubscriptionPaymentBehavior {
|
|
80
|
+
/** Apply the change now; an unpaid resulting invoice leaves the subscription `past_due`. */
|
|
81
|
+
ALLOW_INCOMPLETE = "allow_incomplete"
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* What a FAILED provider mutation tells the caller about whether the change took effect (#535, decision D3).
|
|
85
|
+
*
|
|
86
|
+
* The distinction that matters is not the HTTP status but what may be recorded next: a conclusive refusal and a request
|
|
87
|
+
* that never executed may both be recorded as "no effect", while an indeterminate outcome must NEVER be — the provider
|
|
88
|
+
* may have applied it, or may still apply it. Only the adapter can read its vendor's error shape, so each adapter
|
|
89
|
+
* classifies (`StandardBilling_Interface.classifyMutationError`) and the engine decides on the class alone.
|
|
90
|
+
*
|
|
91
|
+
* spec-cite: https://docs.stripe.com/error-low-level — "Network errors", "Server errors", "Content errors" (the
|
|
92
|
+
* source of the classes for the Stripe adapter; other adapters map their own vendor's equivalents).
|
|
93
|
+
*/
|
|
94
|
+
export declare enum StandardBilling_MutationErrorClass {
|
|
95
|
+
/** The provider evaluated the request and refused it (e.g. a declined card, a missing object). No effect. */
|
|
96
|
+
CONCLUSIVE_REJECTION = "conclusive_rejection",
|
|
97
|
+
/** Refused before execution (rate limit, authentication). No effect; a later attempt must use a NEW idempotency key. */
|
|
98
|
+
NOT_EXECUTED = "not_executed",
|
|
99
|
+
/** Another request with the same idempotency key is still being processed. The outcome is not known yet. */
|
|
100
|
+
IN_FLIGHT_CONFLICT = "in_flight_conflict",
|
|
101
|
+
/** Timeout, connection loss, server error, or a failure after the provider answered. The change may have applied. */
|
|
102
|
+
INDETERMINATE = "indeterminate"
|
|
103
|
+
}
|
|
65
104
|
/**
|
|
66
105
|
* Subscription status values (maps to Stripe subscription statuses).
|
|
67
106
|
*/
|
|
@@ -143,10 +182,37 @@ export interface StandardBilling_WebhookEvent {
|
|
|
143
182
|
createdAt: Date;
|
|
144
183
|
}
|
|
145
184
|
export interface StandardBilling_CreateCustomerRequest {
|
|
146
|
-
/**
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
185
|
+
/**
|
|
186
|
+
* Descriptive name — the organisation's name for an org-scoped account, the person's display name
|
|
187
|
+
* for a user-scoped one.
|
|
188
|
+
*
|
|
189
|
+
* OPTIONAL, and that is the point (issue #486). It was required, and a caller that could not
|
|
190
|
+
* resolve one therefore had to INVENT it: the engine sent the literal `'Unknown'` for every
|
|
191
|
+
* customer it ever created. A contract that cannot express "we do not know" forces every caller to
|
|
192
|
+
* lie, and a fabricated value is worse than an absent one — an operator reading the provider
|
|
193
|
+
* dashboard cannot tell it from a real answer.
|
|
194
|
+
*/
|
|
195
|
+
name?: string;
|
|
196
|
+
/**
|
|
197
|
+
* Contact email for invoices and receipts.
|
|
198
|
+
*
|
|
199
|
+
* OPTIONAL for the same reason as `name`, and additionally because **an organisation frequently has
|
|
200
|
+
* no billing email at all**. Sending a natural person's address for an ORGANISATION's customer
|
|
201
|
+
* record would put personal data on a record that is not about a person — the opposite of data
|
|
202
|
+
* minimisation, which asks that personal data be "adequate, relevant and limited to what is
|
|
203
|
+
* necessary".
|
|
204
|
+
* spec-cite: GDPR Art. 5(1)(c) — https://gdpr-info.eu/art-5-gdpr/
|
|
205
|
+
*
|
|
206
|
+
* It also makes the later erasure story cheap: an organisation record carrying no individual's
|
|
207
|
+
* identity never has to be visited when that individual exercises their right to erasure, so the
|
|
208
|
+
* obligation to inform recipients of an erasure does not reach it.
|
|
209
|
+
* spec-cite: GDPR Art. 17(2) — https://gdpr-info.eu/art-17-gdpr/
|
|
210
|
+
*
|
|
211
|
+
* Absent is a legitimate value at the provider: Stripe's own customer `email` is optional.
|
|
212
|
+
* spec-cite: N/A — describes the Stripe Customer object's declared optionality in this
|
|
213
|
+
* repository's own words (https://docs.stripe.com/api/customers/object).
|
|
214
|
+
*/
|
|
215
|
+
email?: string;
|
|
150
216
|
/** Arbitrary key-value metadata stored on the provider customer */
|
|
151
217
|
metadata?: Record<string, string>;
|
|
152
218
|
}
|
|
@@ -224,6 +290,8 @@ export interface StandardBilling_SyncPriceRequest {
|
|
|
224
290
|
amount: number;
|
|
225
291
|
currency: string;
|
|
226
292
|
interval?: BillingInterval;
|
|
293
|
+
/** Multiplier of the recurring interval (3 months = quarterly). Omitted means 1; ignored for one-time prices. */
|
|
294
|
+
intervalCount?: number;
|
|
227
295
|
/** For TIERED/VOLUME pricing models */
|
|
228
296
|
tiers?: Array<{
|
|
229
297
|
upTo: number | null;
|
|
@@ -281,14 +349,32 @@ export interface StandardBilling_CreateSubscriptionResponse {
|
|
|
281
349
|
providerSubscriptionId: string;
|
|
282
350
|
status: string;
|
|
283
351
|
}
|
|
352
|
+
/** Provider-confirmed identities of correlated additions from the same update operation. */
|
|
353
|
+
export interface StandardBilling_UpdateSubscriptionResponse {
|
|
354
|
+
createdItems: Array<{
|
|
355
|
+
clientItemKey: string;
|
|
356
|
+
providerSubscriptionItemId: string;
|
|
357
|
+
}>;
|
|
358
|
+
}
|
|
284
359
|
export interface StandardBilling_UpdateSubscriptionRequest {
|
|
360
|
+
/**
|
|
361
|
+
* Server-owned identity of one attempted change, reused with the SAME subscription and payload
|
|
362
|
+
* when recovering a lost response. Never generate a new key for a retry. Provider retention is
|
|
363
|
+
* bounded: this does not replace confirmation consumption, freshness checks or reconciliation.
|
|
364
|
+
* This is request transport metadata, not subscription metadata or a browser authoring field.
|
|
365
|
+
*/
|
|
366
|
+
idempotencyKey?: string;
|
|
367
|
+
/** Item patches: omitted existing items are retained; an item without an ID is added. */
|
|
285
368
|
items?: Array<{
|
|
286
|
-
/** Provider-side subscription item ID
|
|
287
|
-
* If omitted, the provider transformer falls back to index-based matching. */
|
|
369
|
+
/** Provider-side subscription item ID to update. Omit only when adding a new item. */
|
|
288
370
|
providerSubscriptionItemId?: string;
|
|
371
|
+
/** Backend-generated correlation key for an intentional new item; echoed with its created provider ID. */
|
|
372
|
+
clientItemKey?: string;
|
|
289
373
|
providerPriceId: string;
|
|
290
374
|
quantity?: number;
|
|
291
375
|
}>;
|
|
376
|
+
/** Explicit provider-side item IDs to remove. Omitting an item from `items` never removes it. */
|
|
377
|
+
removedProviderSubscriptionItemIds?: string[];
|
|
292
378
|
/** Provider promotion code to apply */
|
|
293
379
|
providerPromotionCodeId?: string;
|
|
294
380
|
/**
|
|
@@ -301,9 +387,31 @@ export interface StandardBilling_UpdateSubscriptionRequest {
|
|
|
301
387
|
* subscription update did before this field existed.
|
|
302
388
|
*/
|
|
303
389
|
prorationBehavior?: ProrationBehavior;
|
|
390
|
+
/**
|
|
391
|
+
* How the provider treats an unpaid resulting invoice (#535, D6). Absent sends none, so the provider's default
|
|
392
|
+
* applies; the engine's own plan-change dispatch always declares it.
|
|
393
|
+
*/
|
|
394
|
+
paymentBehavior?: StandardBilling_SubscriptionPaymentBehavior;
|
|
395
|
+
/** Unix seconds used for proration. Reuse the preview instant when confirming the same change. */
|
|
396
|
+
prorationDate?: number;
|
|
304
397
|
metadata?: Record<string, string>;
|
|
305
398
|
}
|
|
306
|
-
|
|
399
|
+
/**
|
|
400
|
+
* Hypothetical item patch for an upcoming invoice. Item identity, quantity and proration must match
|
|
401
|
+
* the eventual update; selecting the first provider item can accidentally preview an addon change.
|
|
402
|
+
* Omitted items remain on the subscription. This request never changes the subscription itself.
|
|
403
|
+
*/
|
|
404
|
+
export type StandardBilling_SubscriptionPreviewRequest = Pick<StandardBilling_UpdateSubscriptionRequest, 'items' | 'removedProviderSubscriptionItemIds' | 'prorationBehavior' | 'prorationDate'>;
|
|
405
|
+
/**
|
|
406
|
+
* Request transport options shared by the subscription mutations that carry no payload of their own.
|
|
407
|
+
*
|
|
408
|
+
* `idempotencyKey` has the same contract as on {@link StandardBilling_UpdateSubscriptionRequest}: a server-owned
|
|
409
|
+
* identity of ONE attempted change, reused with the same subscription and options only to recover a lost response.
|
|
410
|
+
*/
|
|
411
|
+
export interface StandardBilling_SubscriptionMutationOptions {
|
|
412
|
+
idempotencyKey?: string;
|
|
413
|
+
}
|
|
414
|
+
export interface StandardBilling_CancelSubscriptionOptions extends StandardBilling_SubscriptionMutationOptions {
|
|
307
415
|
/** If true, subscription remains active until current period ends */
|
|
308
416
|
atPeriodEnd?: boolean;
|
|
309
417
|
}
|
|
@@ -341,6 +449,7 @@ export interface StandardBilling_SubscriptionData {
|
|
|
341
449
|
* Returned by retrieveUpcomingInvoice() for plan change previews.
|
|
342
450
|
*/
|
|
343
451
|
export interface StandardBilling_InvoicePreview {
|
|
452
|
+
/** Upcoming invoice amount due, in currency minor units; not a promise of an immediate charge. */
|
|
344
453
|
amount: number;
|
|
345
454
|
currency: string;
|
|
346
455
|
lineItems: Array<{
|
|
@@ -496,14 +605,25 @@ export interface StandardBilling_Interface {
|
|
|
496
605
|
syncProduct(request: StandardBilling_SyncProductRequest): Promise<StandardBilling_SyncProductResponse>;
|
|
497
606
|
syncPrice(request: StandardBilling_SyncPriceRequest): Promise<StandardBilling_SyncPriceResponse>;
|
|
498
607
|
createSubscription(request: StandardBilling_CreateSubscriptionRequest): Promise<StandardBilling_CreateSubscriptionResponse>;
|
|
499
|
-
updateSubscription(providerSubscriptionId: string, request: StandardBilling_UpdateSubscriptionRequest): Promise<
|
|
608
|
+
updateSubscription(providerSubscriptionId: string, request: StandardBilling_UpdateSubscriptionRequest): Promise<StandardBilling_UpdateSubscriptionResponse>;
|
|
500
609
|
cancelSubscription(providerSubscriptionId: string, options?: StandardBilling_CancelSubscriptionOptions): Promise<void>;
|
|
501
610
|
pauseSubscription(providerSubscriptionId: string): Promise<void>;
|
|
611
|
+
/** Resume paused payment collection; does not undo a scheduled cancellation. */
|
|
502
612
|
resumeSubscription(providerSubscriptionId: string): Promise<void>;
|
|
613
|
+
/** Remove a pending period-end cancellation without changing collection or lifecycle status. */
|
|
614
|
+
removeScheduledCancellation(providerSubscriptionId: string, options?: StandardBilling_SubscriptionMutationOptions): Promise<void>;
|
|
615
|
+
/**
|
|
616
|
+
* Classify an error thrown by `updateSubscription`, `cancelSubscription` or `removeScheduledCancellation` (#535, D3).
|
|
617
|
+
*
|
|
618
|
+
* Must answer {@link StandardBilling_MutationErrorClass.INDETERMINATE} for anything the adapter cannot positively place
|
|
619
|
+
* — including an error the adapter itself threw AFTER the provider answered — because every other class licenses the
|
|
620
|
+
* caller to record that the change did not happen.
|
|
621
|
+
*/
|
|
622
|
+
classifyMutationError(error: unknown): StandardBilling_MutationErrorClass;
|
|
503
623
|
/** On-demand retrieval for reconciliation (if webhook missed) */
|
|
504
624
|
retrieveSubscription(providerSubscriptionId: string): Promise<StandardBilling_SubscriptionData>;
|
|
505
|
-
/** Preview
|
|
506
|
-
retrieveUpcomingInvoice(providerSubscriptionId: string,
|
|
625
|
+
/** Preview the upcoming invoice for an optional item change; the amount is not necessarily charged immediately. */
|
|
626
|
+
retrieveUpcomingInvoice(providerSubscriptionId: string, request?: StandardBilling_SubscriptionPreviewRequest): Promise<StandardBilling_InvoicePreview>;
|
|
507
627
|
/**
|
|
508
628
|
* Invoices the provider holds for one customer, newest first.
|
|
509
629
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing.standard-interface.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"billing.standard-interface.schemas.d.ts","sourceRoot":"","sources":["../../../../src/protocols/billing.standard-interface.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH;;GAEG;AACH,oBAAY,YAAY;IACtB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,+CAA+C;IAC/C,MAAM,WAAW;IACjB,mDAAmD;IACnD,SAAS,cAAc;IACvB,mCAAmC;IACnC,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,mDAAmD;IACnD,SAAS,cAAc;IACvB,2CAA2C;IAC3C,SAAS,cAAc;CACxB;AAED;;;;;;;;;;;GAWG;AACH,oBAAY,iBAAiB;IAC3B,6FAA6F;IAC7F,iBAAiB,sBAAsB;IACvC,2FAA2F;IAC3F,IAAI,SAAS;IACb,oFAAoF;IACpF,cAAc,mBAAmB;CAClC;AAED;;;;;;;;;;;;;GAaG;AACH,oBAAY,2CAA2C;IACr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AAY,CAAC,kBAAkB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,2BAA2B,EAAE,CAAC,CAAC;IAG/G,qEAAqE;IACrE,qBAAqB,CAAC,OAAO,EAAE,4CAA4C,GAAG,OAAO,CAAC,6CAA6C,CAAC,CAAC;IACrI,8EAA8E;IAC9E,2BAA2B,CAAC,kBAAkB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,mDAAmD,CAAC,CAAC;IAGzI,WAAW,CAAC,OAAO,EAAE,kCAAkC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAGxE,qFAAqF;IACrF,QAAQ,CAAC,0BAA0B,EAAE,MAAM,CAAC;IAC5C,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IACjG,0GAA0G;IAC1G,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,4BAA4B,GAAG,IAAI,CAAC;IAGrF,YAAY,CAAC,OAAO,EAAE,mCAAmC,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;IAC1G,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,2CAA2C,CAAC,CAAC;CACnH"}
|
|
@@ -69,6 +69,47 @@ export var ProrationBehavior;
|
|
|
69
69
|
/** Prorate and invoice the difference IMMEDIATELY rather than at the next cycle. */
|
|
70
70
|
ProrationBehavior["ALWAYS_INVOICE"] = "always_invoice";
|
|
71
71
|
})(ProrationBehavior || (ProrationBehavior = {}));
|
|
72
|
+
/**
|
|
73
|
+
* How the provider treats a subscription change whose resulting payment does not succeed (#535, decision D6).
|
|
74
|
+
*
|
|
75
|
+
* Wildo applies a confirmed plan change IMMEDIATELY: entitlements move at local completion, and a failed proration
|
|
76
|
+
* payment moves the subscription to `past_due` through the webhook projection, where dunning owns what happens next.
|
|
77
|
+
* The value is DECLARED on every engine-issued change rather than left to the provider's default, so a change of that
|
|
78
|
+
* default can never silently change the semantics.
|
|
79
|
+
*
|
|
80
|
+
* Deliberately a one-member vocabulary. `pending_if_incomplete` (apply only after payment, expire after 23 h) was
|
|
81
|
+
* weighed and rejected in #535; add a member only with a decision that changes D6.
|
|
82
|
+
*
|
|
83
|
+
* spec-cite: https://docs.stripe.com/api/subscriptions/update — `payment_behavior`; the value equals Stripe's wire value,
|
|
84
|
+
* so the Stripe adapter passes it untranslated, as it does `ProrationBehavior`.
|
|
85
|
+
*/
|
|
86
|
+
export var StandardBilling_SubscriptionPaymentBehavior;
|
|
87
|
+
(function (StandardBilling_SubscriptionPaymentBehavior) {
|
|
88
|
+
/** Apply the change now; an unpaid resulting invoice leaves the subscription `past_due`. */
|
|
89
|
+
StandardBilling_SubscriptionPaymentBehavior["ALLOW_INCOMPLETE"] = "allow_incomplete";
|
|
90
|
+
})(StandardBilling_SubscriptionPaymentBehavior || (StandardBilling_SubscriptionPaymentBehavior = {}));
|
|
91
|
+
/**
|
|
92
|
+
* What a FAILED provider mutation tells the caller about whether the change took effect (#535, decision D3).
|
|
93
|
+
*
|
|
94
|
+
* The distinction that matters is not the HTTP status but what may be recorded next: a conclusive refusal and a request
|
|
95
|
+
* that never executed may both be recorded as "no effect", while an indeterminate outcome must NEVER be — the provider
|
|
96
|
+
* may have applied it, or may still apply it. Only the adapter can read its vendor's error shape, so each adapter
|
|
97
|
+
* classifies (`StandardBilling_Interface.classifyMutationError`) and the engine decides on the class alone.
|
|
98
|
+
*
|
|
99
|
+
* spec-cite: https://docs.stripe.com/error-low-level — "Network errors", "Server errors", "Content errors" (the
|
|
100
|
+
* source of the classes for the Stripe adapter; other adapters map their own vendor's equivalents).
|
|
101
|
+
*/
|
|
102
|
+
export var StandardBilling_MutationErrorClass;
|
|
103
|
+
(function (StandardBilling_MutationErrorClass) {
|
|
104
|
+
/** The provider evaluated the request and refused it (e.g. a declined card, a missing object). No effect. */
|
|
105
|
+
StandardBilling_MutationErrorClass["CONCLUSIVE_REJECTION"] = "conclusive_rejection";
|
|
106
|
+
/** Refused before execution (rate limit, authentication). No effect; a later attempt must use a NEW idempotency key. */
|
|
107
|
+
StandardBilling_MutationErrorClass["NOT_EXECUTED"] = "not_executed";
|
|
108
|
+
/** Another request with the same idempotency key is still being processed. The outcome is not known yet. */
|
|
109
|
+
StandardBilling_MutationErrorClass["IN_FLIGHT_CONFLICT"] = "in_flight_conflict";
|
|
110
|
+
/** Timeout, connection loss, server error, or a failure after the provider answered. The change may have applied. */
|
|
111
|
+
StandardBilling_MutationErrorClass["INDETERMINATE"] = "indeterminate";
|
|
112
|
+
})(StandardBilling_MutationErrorClass || (StandardBilling_MutationErrorClass = {}));
|
|
72
113
|
/**
|
|
73
114
|
* Subscription status values (maps to Stripe subscription statuses).
|
|
74
115
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing.standard-interface.schemas.js","sourceRoot":"","sources":["../../../src/protocols/billing.standard-interface.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,kEAAkE;AAClE,yEAAyE;AACzE,kEAAkE;AAElE;;GAEG;AACH,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,qCAAqB,CAAA;IACrB,+CAA+C;IAC/C,iCAAiB,CAAA;IACjB,mDAAmD;IACnD,uCAAuB,CAAA;IACvB,mCAAmC;IACnC,mCAAmB,CAAA;AACrB,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,gCAAa,CAAA;AACf,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;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D,CAAA;IAEzD,oCAAoC;IACpC,kEAAqC,CAAA;IACrC,kEAAqC,CAAA;IAErC,mFAAmF;IACnF,qFAAqF;IACrF,8DAAiC,CAAA;IACjC,8DAAiC,CAAA;IACjC,8DAAiC,CAAA;IAEjC,yEAAyE;IACzE,oFAAuD,CAAA;IACvD,oFAAuD,CAAA;IACvD,oFAAuD,CAAA;IAEvD,kFAAkF;IAClF,qFAAqF;IACrF,gFAAmD,CAAA;IACnD,gFAAmD,CAAA;AACrD,CAAC,EAlCW,yBAAyB,KAAzB,yBAAyB,QAkCpC","sourcesContent":["/**\n * Standard Billing Interface\n * --------\n * This is the canonical interface that Wildo uses internally for all billing\n * operations. The ETL layer transforms these standard requests into\n * provider-specific API calls (e.g., Stripe, Paddle, LemonSqueezy).\n *\n * Design Principles:\n * 1. Provider-agnostic — works with any billing provider\n * 2. Hosted-first — uses provider-hosted checkout and portals (no PCI scope)\n * 3. Webhook-driven — state changes flow in via webhooks, not polling\n * 4. Scope-agnostic — billing accounts map to any Wildo scope (org, user)\n *\n * @see billing-and-features-system.md §7.1 (Standard Billing Interface)\n */\n\n// ===============================================================\n// Billing Interface Enums (canonical source, re-exported by saas-models)\n// ===============================================================\n\n/**\n * Pricing model for a price entry.\n */\nexport enum PricingModel {\n FLAT = 'flat',\n PER_UNIT = 'per_unit',\n /** Volume pricing (all units at tier price) */\n TIERED = 'tiered',\n /** Incremental (each tier priced independently) */\n GRADUATED = 'graduated',\n /** Price per package of N units */\n PACKAGE = 'package',\n}\n\n/**\n * Billing interval for recurring prices.\n */\nexport enum BillingInterval {\n MONTH = 'month',\n YEAR = 'year',\n}\n\n/**\n * Tax display mode: how prices are displayed (HT vs TTC).\n */\nexport enum TaxDisplayMode {\n /** Price amounts are HT (tax added at checkout) */\n EXCLUSIVE = 'exclusive',\n /** Price amounts are TTC (tax embedded) */\n INCLUSIVE = 'inclusive',\n}\n\n/**\n * How a mid-cycle subscription change is settled.\n *\n * A PROTOCOL vocabulary, and it lives here for the same reason {@link TaxDisplayMode} does: these three\n * values are the wire values a billing provider accepts. It was declared in `@wildo-ai/saas-models`\n * until 2026-09-08 and re-exported the other way round, which is why an authored proration could be\n * resolved by the engine and had no field on the request to travel in — the request contract could not\n * name the type without a package cycle, so the resolved value was sent as provider METADATA and\n * ignored (#516).\n *\n * `@wildo-ai/saas-models` re-exports it, so every existing consumer is unchanged.\n */\nexport enum ProrationBehavior {\n /** Credit the unused time and charge the new price pro rata, settled on the next invoice. */\n CREATE_PRORATIONS = 'create_prorations',\n /** No proration: the change takes effect and the next invoice is the new price in full. */\n NONE = 'none',\n /** Prorate and invoice the difference IMMEDIATELY rather than at the next cycle. */\n ALWAYS_INVOICE = 'always_invoice',\n}\n\n/**\n * Subscription status values (maps to Stripe subscription statuses).\n */\nexport enum SubscriptionStatus {\n ACTIVE = 'active',\n PAST_DUE = 'past_due',\n UNPAID = 'unpaid',\n CANCELLED = 'cancelled',\n /** Stripe: first payment never completed within 23h window */\n INCOMPLETE = 'incomplete',\n INCOMPLETE_EXPIRED = 'incomplete_expired',\n TRIALING = 'trialing',\n PAUSED = 'paused',\n}\n\n/**\n * Invoice lifecycle status, as the PROVIDER reports it.\n *\n * A PROTOCOL vocabulary for the same reason {@link SubscriptionStatus} is one: these are the states\n * a billing provider puts an invoice in, and the adapter's job is to map its own wire values onto\n * them. It was declared in `@wildo-ai/saas-models` until 2026-09-09 and could not be named by this\n * package at all, so `listInvoices` — the read the reconciliation sweep needs — had no way to type\n * the one field the sweep compares.\n *\n * Moved rather than duplicated: a second enum with the same five members would be two sources for\n * one closed vocabulary, which is what `CLAUDE.md` forbids. `@wildo-ai/saas-models` re-exports it\n * exactly as it already re-exports `SubscriptionStatus`, `TaxDisplayMode` and `ProrationBehavior`,\n * so every existing consumer — including the `invoiceRefs` schema, the badge palette and the\n * documentation catalogue — imports the same specifier it always did.\n */\nexport enum InvoiceStatus {\n /** Not finalized: the provider has not issued it for collection and it may still change. */\n DRAFT = 'draft',\n /** Finalized and awaiting payment. */\n OPEN = 'open',\n /** Settled. */\n PAID = 'paid',\n /** Cancelled by the provider or the merchant; never collectable. */\n VOID = 'void',\n /** Written off — payment was attempted and abandoned. */\n UNCOLLECTIBLE = 'uncollectible',\n}\n\n// ===============================================================\n// Standard Billing Event Types\n// ===============================================================\n\n/**\n * Canonical billing events the system cares about.\n * Provider-specific events are mapped to these types by the transformer.\n * Only events that affect local state (features, status) need to be handled.\n */\nexport enum StandardBilling_EventType {\n // Subscription lifecycle (→ feature sync)\n SUBSCRIPTION_CREATED = 'subscription.created',\n SUBSCRIPTION_UPDATED = 'subscription.updated',\n SUBSCRIPTION_DELETED = 'subscription.deleted',\n SUBSCRIPTION_TRIAL_WILL_END = 'subscription.trial_will_end',\n\n // Invoice status (→ billing status tracking, past_due detection)\n INVOICE_PAID = 'invoice.paid',\n INVOICE_PAYMENT_FAILED = 'invoice.payment_failed',\n INVOICE_FINALIZED = 'invoice.finalized',\n\n // Checkout (→ one-off purchase completion for ONE_TIME, CREDIT_PACK, ITEM products)\n CHECKOUT_SESSION_COMPLETED = 'checkout.session.completed',\n\n // Customer (→ billing account sync)\n CUSTOMER_UPDATED = 'customer.updated',\n CUSTOMER_DELETED = 'customer.deleted',\n\n // Coupon (→ no local action; coupons are managed through Wildo's promotion system.\n // Included for logging/audit in case coupons are modified directly on the provider.)\n COUPON_CREATED = 'coupon.created',\n COUPON_UPDATED = 'coupon.updated',\n COUPON_DELETED = 'coupon.deleted',\n\n // Customer discount (→ subscription re-sync to pick up discount changes)\n CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created',\n CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated',\n CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted',\n\n // Payment method (→ no local action needed; provider manages via Customer Portal.\n // Included for completeness: apps can optionally log these events for audit trails.)\n PAYMENT_METHOD_ATTACHED = 'payment_method.attached',\n PAYMENT_METHOD_DETACHED = 'payment_method.detached',\n}\n\n// ===============================================================\n// Standard Billing Webhook Event\n// ===============================================================\n\n/**\n * Canonical webhook event representation.\n * Provider transformers parse raw webhook payloads into this shape.\n */\nexport interface StandardBilling_WebhookEvent {\n /** Canonical event type */\n type: StandardBilling_EventType;\n /** Provider-assigned event ID (for idempotency) */\n providerEventId: string;\n /** Event payload — shape varies by event type */\n data: Record<string, unknown>;\n /** When the event occurred at the provider */\n createdAt: Date;\n}\n\n// ===============================================================\n// Request/Response Types\n// ===============================================================\n\n// ── Customer ────────────────────────────────────────────────────\n\nexport interface StandardBilling_CreateCustomerRequest {\n /** Descriptive name (e.g., organization name or user display name) */\n name: string;\n /** Contact email for invoices and receipts */\n email: string;\n /** Arbitrary key-value metadata stored on the provider customer */\n metadata?: Record<string, string>;\n}\n\nexport interface StandardBilling_CreateCustomerResponse {\n providerCustomerId: string;\n}\n\n/**\n * Postal address on a provider customer record.\n *\n * Every field is independently clearable (`null`) rather than merely omittable: `undefined` means\n * \"leave whatever the provider already has\", `null` means \"blank it\". Subject erasure needs the\n * second meaning — an address that is silently preserved because the request could only express\n * \"no change\" is personal data surviving an erasure.\n */\nexport interface StandardBilling_CustomerAddress {\n line1?: string | null;\n line2?: string | null;\n city?: string | null;\n state?: string | null;\n postalCode?: string | null;\n /** ISO 3166-1 alpha-2 country code. */\n country?: string | null;\n}\n\nexport interface StandardBilling_UpdateCustomerRequest {\n name?: string;\n email?: string;\n metadata?: Record<string, string>;\n /**\n * Contact phone. `null` clears it at the provider — see {@link StandardBilling_CustomerAddress}\n * for why clearability is expressed separately from omission.\n */\n phone?: string | null;\n /**\n * Billing address. `null` clears the whole address; a partial object clears only the fields it\n * sets to `null` and leaves the rest untouched.\n */\n address?: StandardBilling_CustomerAddress | null;\n}\n\n/**\n * A stored payment instrument attached to a provider customer.\n *\n * Deliberately thin: enough to identify an instrument for detachment and to render a\n * \"•••• 4242\"-style hint, and nothing more. Wildo never handles raw instrument data — that is the\n * whole point of routing users through the provider-hosted portal — so this carries no PAN, no\n * expiry, and no billing details.\n */\nexport interface StandardBilling_PaymentMethodSummary {\n providerPaymentMethodId: string;\n /**\n * Instrument kind as the provider names it (`'card'`, `'sepa_debit'`, `'us_bank_account'`, …).\n * Intentionally an OPEN provider identifier, not a closed Wildo vocabulary: the set differs per\n * provider and grows without our involvement, and nothing in the framework branches on it — it\n * is carried for display and diagnostics only.\n */\n type: string;\n /** Last four digits, when the instrument exposes them. */\n last4?: string;\n}\n\n// ── Product/Price Sync ──────────────────────────────────────────\n\nexport interface StandardBilling_SyncProductRequest {\n /** Internal Wildo product key (stored in metadata for reverse lookup) */\n productKey: string;\n name: string;\n description?: string;\n /** If set, updates existing provider product instead of creating new */\n providerProductId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface StandardBilling_SyncProductResponse {\n providerProductId: string;\n}\n\nexport interface StandardBilling_SyncPriceRequest {\n providerProductId: string;\n model: PricingModel;\n /** Amount in smallest currency unit (cents) */\n amount: number;\n currency: string;\n interval?: BillingInterval;\n /** For TIERED/VOLUME pricing models */\n tiers?: Array<{\n upTo: number | null;\n unitAmount: number;\n flatAmount?: number;\n }>;\n /** For PACKAGE pricing */\n packageSize?: number;\n /** Tax behavior */\n taxBehavior?: TaxDisplayMode;\n /** If set, updates existing provider price instead of creating new */\n providerPriceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface StandardBilling_SyncPriceResponse {\n providerPriceId: string;\n}\n\n// ── Subscription Lifecycle ──────────────────────────────────────\n\nexport interface StandardBilling_CreateSubscriptionRequest {\n providerCustomerId: string;\n items: Array<{\n providerPriceId: string;\n quantity?: number;\n }>;\n trialPeriodDays?: number;\n /** Provider promotion code to apply */\n providerPromotionCodeId?: string;\n /**\n * Ask the provider to compute tax on this purchase (#408, 2026-09-08).\n *\n * Set from the application's `billing.tax.calculationMode`, which is PROVIDER_MANAGED or\n * DISABLED — Wildo never calculates tax locally, so the only question a provider is asked is\n * whether to calculate at all. A provider that cannot compute tax ignores this; one that can and\n * is not configured for the customer's jurisdiction will say so at the call, which is the right\n * place for that failure.\n *\n * Distinct from a price's `taxBehavior`, which says whether a displayed amount INCLUDES tax.\n * That one has always reached the provider; this one decides whether tax is computed.\n */\n automaticTax?: boolean;\n /**\n * Require a payment method up front for a trial (#408, 2026-09-08).\n *\n * Set from the product's `behaviorPolicy.trial.requirePaymentMethod`, which was declared,\n * labelled, rendered on billing screens and passed to no provider call — so a trial declared as\n * requiring a card behaved identically to one that did not. Wonder Todos' enterprise plan\n * (`true`) and professional plan (`false`) were indistinguishable at the provider.\n *\n * Two provider-side consequences follow and a connector should honour both: collect the payment\n * method during checkout, and decide what happens if the trial ends without one.\n */\n requirePaymentMethodForTrial?: boolean;\n metadata?: Record<string, string>;\n}\n\nexport interface StandardBilling_CreateSubscriptionResponse {\n providerSubscriptionId: string;\n status: string;\n}\n\nexport interface StandardBilling_UpdateSubscriptionRequest {\n items?: Array<{\n /** Provider-side subscription item ID (used to target the correct item on the provider).\n * If omitted, the provider transformer falls back to index-based matching. */\n providerSubscriptionItemId?: string;\n providerPriceId: string;\n quantity?: number;\n }>;\n /** Provider promotion code to apply */\n providerPromotionCodeId?: string;\n /**\n * How the provider settles this mid-cycle change (#516).\n *\n * The engine resolves it from the target product's `upgrade`/`downgrade` behaviour policy and it\n * had nowhere to travel: it was put in `metadata`, a free-form bag the provider does not read, so a\n * product declaring `NONE` for a downgrade was still prorated by the provider's own default. Absent\n * means \"do not send one\" — the provider applies its account default, which is what every\n * subscription update did before this field existed.\n */\n prorationBehavior?: ProrationBehavior;\n metadata?: Record<string, string>;\n}\n\nexport interface StandardBilling_CancelSubscriptionOptions {\n /** If true, subscription remains active until current period ends */\n atPeriodEnd?: boolean;\n}\n\n// ── Read/Sync (Reconciliation) ──────────────────────────────────\n\n/**\n * StandardBilling_SubscriptionData: canonical subscription representation\n * returned by the provider adapter's retrieveSubscription().\n * Used for reconciliation when webhooks may have been missed.\n */\nexport interface StandardBilling_SubscriptionData {\n providerSubscriptionId: string;\n status: SubscriptionStatus;\n currentPeriodStart: Date;\n currentPeriodEnd: Date;\n cancelAtPeriodEnd: boolean;\n trialEnd?: Date;\n items: Array<{\n providerSubscriptionItemId: string;\n providerProductId: string;\n providerPriceId: string;\n quantity: number;\n }>;\n /** Active discount on this subscription (from coupon/promotion code) */\n discount?: {\n providerCouponId: string;\n percentOff?: number;\n amountOff?: number;\n currency?: string;\n duration: string;\n durationInMonths?: number;\n end?: Date;\n };\n}\n\n/**\n * StandardBilling_InvoicePreview: canonical upcoming invoice from provider.\n * Returned by retrieveUpcomingInvoice() for plan change previews.\n */\nexport interface StandardBilling_InvoicePreview {\n amount: number;\n currency: string;\n lineItems: Array<{\n description: string;\n amount: number;\n quantity: number;\n providerPriceId?: string;\n }>;\n periodStart: Date;\n periodEnd: Date;\n}\n\n/**\n * StandardBilling_InvoiceData: an invoice the provider ALREADY holds.\n *\n * Distinct from {@link StandardBilling_InvoicePreview}, and the distinction is the point: a preview\n * is a hypothetical the provider computes on request and never stores, while this is a record that\n * exists at the provider whether or not Wildo ever heard about it. The second is what a\n * reconciliation sweep needs — a webhook that was never delivered leaves an invoice that exists\n * there and nowhere here, and no amount of previewing finds it.\n *\n * Deliberately thin. It carries what `invoiceRefs` stores and nothing else: line items, tax\n * breakdowns and payment attempts live at the provider, and the customer reaches them through the\n * provider-hosted portal.\n */\nexport interface StandardBilling_InvoiceData {\n providerInvoiceId: string;\n /** The customer the invoice was billed to — the key that maps it back to a local billing account. */\n providerCustomerId: string;\n status: InvoiceStatus;\n /**\n * The invoice TOTAL, in the CURRENCY's smallest unit.\n *\n * The total, not the amount PAID: an invoice's value does not depend on whether it has been\n * settled, and an unpaid invoice recorded at zero is indistinguishable from a zero invoice.\n */\n total: number;\n currency: string;\n hostedInvoiceUrl?: string;\n invoicePdfUrl?: string;\n /** When the provider created the invoice — used to bound how far back a sweep looks. */\n createdAt: Date;\n}\n\n// ── Checkout / Portal (Provider-Hosted UI) ──────────────────────\n\nexport interface StandardBilling_CreateCheckoutSessionRequest {\n providerCustomerId: string;\n lineItems: Array<{\n providerPriceId: string;\n quantity?: number;\n }>;\n /** Checkout mode: 'subscription' for recurring, 'payment' for one-time */\n mode: 'subscription' | 'payment';\n successUrl: string;\n cancelUrl: string;\n /** Allow promotion codes in checkout */\n allowPromotionCodes?: boolean;\n /** Pre-fill promotion code */\n providerPromotionCodeId?: string;\n /** Trial period for subscriptions */\n trialPeriodDays?: number;\n /**\n * Ask the provider to compute tax on this purchase (#408, 2026-09-08).\n *\n * Set from the application's `billing.tax.calculationMode`, which is PROVIDER_MANAGED or\n * DISABLED — Wildo never calculates tax locally, so the only question a provider is asked is\n * whether to calculate at all. A provider that cannot compute tax ignores this; one that can and\n * is not configured for the customer's jurisdiction will say so at the call, which is the right\n * place for that failure.\n *\n * Distinct from a price's `taxBehavior`, which says whether a displayed amount INCLUDES tax.\n * That one has always reached the provider; this one decides whether tax is computed.\n */\n automaticTax?: boolean;\n /**\n * Require a payment method up front for a trial (#408, 2026-09-08).\n *\n * Set from the product's `behaviorPolicy.trial.requirePaymentMethod`, which was declared,\n * labelled, rendered on billing screens and passed to no provider call — so a trial declared as\n * requiring a card behaved identically to one that did not. Wonder Todos' enterprise plan\n * (`true`) and professional plan (`false`) were indistinguishable at the provider.\n *\n * Two provider-side consequences follow and a connector should honour both: collect the payment\n * method during checkout, and decide what happens if the trial ends without one.\n */\n requirePaymentMethodForTrial?: boolean;\n metadata?: Record<string, string>;\n}\n\nexport interface StandardBilling_CreateCheckoutSessionResponse {\n /** Redirect URL for the hosted checkout page */\n url: string;\n sessionId: string;\n}\n\nexport interface StandardBilling_CreateCustomerPortalSessionResponse {\n /** Redirect URL for the customer portal */\n url: string;\n}\n\n// ── Usage Reporting (METERED products via Billing Meter Events) ─\n\nexport interface StandardBilling_ReportUsageRequest {\n /** Meter event name (corresponds to the meter's event_name) */\n meterEventName: string;\n /** Provider customer ID (maps to payload.stripe_customer_id in Stripe) */\n providerCustomerId: string;\n /** Usage value to report */\n value: number;\n /** Optional event timestamp */\n timestamp?: Date;\n /** Optional unique event identifier (for idempotency) */\n identifier?: string;\n}\n\n// ── Promotions ──────────────────────────────────────────────────\n\nexport interface StandardBilling_CreateCouponRequest {\n /** Discount amount in smallest currency unit (for fixed discounts) */\n amountOff?: number;\n /** Discount percentage (for percentage discounts) */\n percentOff?: number;\n currency?: string;\n duration: 'once' | 'repeating' | 'forever';\n durationInMonths?: number;\n maxRedemptions?: number;\n metadata?: Record<string, string>;\n}\n\nexport interface StandardBilling_CreateCouponResponse {\n providerCouponId: string;\n}\n\nexport interface StandardBilling_CreatePromotionCodeResponse {\n providerPromotionId: string;\n}\n\n// ===============================================================\n// Standard Billing Interface\n// ===============================================================\n\n/**\n * Provider-agnostic billing interface.\n * Each billing provider (Stripe, Paddle, etc.) implements this interface\n * through a transformer that maps canonical operations to provider SDK calls.\n */\nexport interface StandardBilling_Interface {\n // ── Customer (maps to BillingAccount) ──\n createCustomer(request: StandardBilling_CreateCustomerRequest): Promise<StandardBilling_CreateCustomerResponse>;\n updateCustomer(providerCustomerId: string, request: StandardBilling_UpdateCustomerRequest): Promise<void>;\n /**\n * Hard-delete the provider customer.\n *\n * ⚠️ NOT the subject-erasure path. Erasing a subject ANONYMIZES this customer (blank the personal\n * fields, keep the record) because the financial history hanging off it — invoices, subscriptions,\n * usage — is retained under a legal obligation and must stay attributable to its provider record.\n * Deleting the customer would strand exactly the audit trail retention exists to preserve.\n * Reserve this for a genuine account teardown with no retained history.\n */\n deleteCustomer(providerCustomerId: string): Promise<void>;\n\n // ── Payment instruments ──\n /**\n * Stored payment instruments for a customer. Used by subject erasure to enumerate what must be\n * detached; day-to-day management belongs in the provider-hosted portal.\n */\n listPaymentMethods(providerCustomerId: string): Promise<StandardBilling_PaymentMethodSummary[]>;\n /**\n * Detach an instrument from its customer. Detaching does NOT delete the instrument's transaction\n * history at the provider — it stops future charges and unlinks it from the customer, which is\n * what erasure needs and what the retained invoice record requires.\n */\n detachPaymentMethod(providerPaymentMethodId: string): Promise<void>;\n\n // ── Product/Price sync (Wildo → Provider) ──\n syncProduct(request: StandardBilling_SyncProductRequest): Promise<StandardBilling_SyncProductResponse>;\n syncPrice(request: StandardBilling_SyncPriceRequest): Promise<StandardBilling_SyncPriceResponse>;\n\n // ── Subscription lifecycle ──\n // NOTE: User-initiated plan changes, cancellation, and payment method management\n // should use createCustomerPortalSession() instead of calling these directly.\n // These methods are for: initial checkout completion, backend-driven upgrades,\n // admin-triggered changes, and webhook-driven updates.\n createSubscription(request: StandardBilling_CreateSubscriptionRequest): Promise<StandardBilling_CreateSubscriptionResponse>;\n updateSubscription(providerSubscriptionId: string, request: StandardBilling_UpdateSubscriptionRequest): Promise<void>;\n cancelSubscription(providerSubscriptionId: string, options?: StandardBilling_CancelSubscriptionOptions): Promise<void>;\n pauseSubscription(providerSubscriptionId: string): Promise<void>;\n resumeSubscription(providerSubscriptionId: string): Promise<void>;\n\n // ── Read/sync (for reconciliation and upcoming cost preview) ──\n /** On-demand retrieval for reconciliation (if webhook missed) */\n retrieveSubscription(providerSubscriptionId: string): Promise<StandardBilling_SubscriptionData>;\n /** Preview prorated cost of a plan change before user commits */\n retrieveUpcomingInvoice(providerSubscriptionId: string, newPriceId?: string): Promise<StandardBilling_InvoicePreview>;\n /**\n * Invoices the provider holds for one customer, newest first.\n *\n * The RECOVERY read for {@link StandardBilling_EventType.INVOICE_PAID} and its siblings. Wildo\n * never creates an invoice — every local `invoiceRefs` row exists because a webhook arrived — so a\n * delivery that is lost, or that arrives while the application is down and exhausts the provider's\n * retries, leaves an invoice with no local trace and nothing that could notice. This is the only\n * call that can find one.\n *\n * `limit` bounds one page and an adapter may cap it lower; the sweep asks for a recent window\n * rather than the whole history, because an invoice older than the window has either been\n * reconciled already or is a backlog no single tick should try to drain.\n */\n listInvoices(providerCustomerId: string, options?: { limit?: number }): Promise<StandardBilling_InvoiceData[]>;\n\n // ── Provider-hosted UI (primary user-facing interactions) ──\n /** Hosted checkout page — NO Stripe Elements needed, no PCI scope */\n createCheckoutSession(request: StandardBilling_CreateCheckoutSessionRequest): Promise<StandardBilling_CreateCheckoutSessionResponse>;\n /** Customer portal for: invoices, payment methods, billing address, cancel */\n createCustomerPortalSession(providerCustomerId: string, returnUrl: string): Promise<StandardBilling_CreateCustomerPortalSessionResponse>;\n\n // ── Usage reporting (for METERED products) ──\n reportUsage(request: StandardBilling_ReportUsageRequest): Promise<void>;\n\n // ── Webhooks ──\n /** HTTP header name that carries the webhook signature (e.g., 'stripe-signature') */\n readonly webhookSignatureHeaderName: string;\n verifyWebhookSignature(payload: string | Uint8Array, signature: string, secret: string): boolean;\n /** Parse a raw webhook payload into a canonical event. Returns null for unknown/unhandled event types. */\n parseWebhookEvent(payload: string | Uint8Array): StandardBilling_WebhookEvent | null;\n\n // ── Promotions (synced to provider) ──\n createCoupon(request: StandardBilling_CreateCouponRequest): Promise<StandardBilling_CreateCouponResponse>;\n createPromotionCode(providerCouponId: string, code: string): Promise<StandardBilling_CreatePromotionCodeResponse>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"billing.standard-interface.schemas.js","sourceRoot":"","sources":["../../../../src/protocols/billing.standard-interface.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,kEAAkE;AAClE,yEAAyE;AACzE,kEAAkE;AAElE;;GAEG;AACH,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,qCAAqB,CAAA;IACrB,+CAA+C;IAC/C,iCAAiB,CAAA;IACjB,mDAAmD;IACnD,uCAAuB,CAAA;IACvB,mCAAmC;IACnC,mCAAmB,CAAA;AACrB,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,gCAAa,CAAA;AACf,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,mDAAmD;IACnD,yCAAuB,C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ACb,yDAAyD;IACzD,gDAA+B,CAAA;AACjC,CAAC,EAXW,aAAa,KAAb,aAAa,QAWxB;AAED,kEAAkE;AAClE,+BAA+B;AAC/B,kEAAkE;AAElE;;;;GAIG;AACH,MAAM,CAAN,IAAY,yBAkCX;AAlCD,WAAY,yBAAyB;IACnC,0CAA0C;IAC1C,0EAA6C,CAAA;IAC7C,0EAA6C,CAAA;IAC7C,0EAA6C,CAAA;IAC7C,wFAA2D,CAAA;IAE3D,iEAAiE;IACjE,0DAA6B,CAAA;IAC7B,8EAAiD,CAAA;IACjD,oEAAuC,CAAA;IAEvC,oFAAoF;IACpF,sFAAyD,CAAA;IAEzD,oCAAoC;IACpC,kEAAqC,CAAA;IACrC,kEAAqC,CAAA;IAErC,mFAAmF;IACnF,qFAAqF;IACrF,8DAAiC,CAAA;IACjC,8DAAiC,CAAA;IACjC,8DAAiC,CAAA;IAEjC,yEAAyE;IACzE,oFAAuD,CAAA;IACvD,oFAAuD,CAAA;IACvD,oFAAuD,CAAA;IAEvD,kFAAkF;IAClF,qFAAqF;IACrF,gFAAmD,CAAA;IACnD,gFAAmD,CAAA;AACrD,CAAC,EAlCW,yBAAyB,KAAzB,yBAAyB,QAkCpC","sourcesContent":["/**\n * Standard Billing Interface\n * --------\n * This is the canonical interface that Wildo uses internally for all billing\n * operations. The ETL layer transforms these standard requests into\n * provider-specific API calls (e.g., Stripe, Paddle, LemonSqueezy).\n *\n * Design Principles:\n * 1. Provider-agnostic — works with any billing provider\n * 2. Hosted-first — uses provider-hosted checkout and portals (no PCI scope)\n * 3. Webhook-driven — state changes flow in via webhooks, not polling\n * 4. Scope-agnostic — billing accounts map to any Wildo scope (org, user)\n *\n * @see billing-and-features-system.md §7.1 (Standard Billing Interface)\n */\n\n// ===============================================================\n// Billing Interface Enums (canonical source, re-exported by saas-models)\n// ===============================================================\n\n/**\n * Pricing model for a price entry.\n */\nexport enum PricingModel {\n FLAT = 'flat',\n PER_UNIT = 'per_unit',\n /** Volume pricing (all units at tier price) */\n TIERED = 'tiered',\n /** Incremental (each tier priced independently) */\n GRADUATED = 'graduated',\n /** Price per package of N units */\n PACKAGE = 'package',\n}\n\n/**\n * Billing interval for recurring prices.\n */\nexport enum BillingInterval {\n MONTH = 'month',\n YEAR = 'year',\n}\n\n/**\n * Tax display mode: how prices are displayed (HT vs TTC).\n */\nexport enum TaxDisplayMode {\n /** Price amounts are HT (tax added at checkout) */\n EXCLUSIVE = 'exclusive',\n /** Price amounts are TTC (tax embedded) */\n INCLUSIVE = 'inclusive',\n}\n\n/**\n * How a mid-cycle subscription change is settled.\n *\n * A PROTOCOL vocabulary, and it lives here for the same reason {@link TaxDisplayMode} does: these three\n * values are the wire values a billing provider accepts. It was declared in `@wildo-ai/saas-models`\n * until 2026-09-08 and re-exported the other way round, which is why an authored proration could be\n * resolved by the engine and had no field on the request to travel in — the request contract could not\n * name the type without a package cycle, so the resolved value was sent as provider METADATA and\n * ignored (#516).\n *\n * `@wildo-ai/saas-models` re-exports it, so every existing consumer is unchanged.\n */\nexport enum ProrationBehavior {\n /** Credit the unused time and charge the new price pro rata, settled on the next invoice. */\n CREATE_PRORATIONS = 'create_prorations',\n /** No proration: the change takes effect and the next invoice is the new price in full. */\n NONE = 'none',\n /** Prorate and invoice the difference IMMEDIATELY rather than at the next cycle. */\n ALWAYS_INVOICE = 'always_invoice',\n}\n\n/**\n * How the provider treats a subscription change whose resulting payment does not succeed (#535, decision D6).\n *\n * Wildo applies a confirmed plan change IMMEDIATELY: entitlements move at local completion, and a failed proration\n * payment moves the subscription to `past_due` through the webhook projection, where dunning owns what happens next.\n * The value is DECLARED on every engine-issued change rather than left to the provider's default, so a change of that\n * default can never silently change the semantics.\n *\n * Deliberately a one-member vocabulary. `pending_if_incomplete` (apply only after payment, expire after 23 h) was\n * weighed and rejected in #535; add a member only with a decision that changes D6.\n *\n * spec-cite: https://docs.stripe.com/api/subscriptions/update — `payment_behavior`; the value equals Stripe's wire value,\n * so the Stripe adapter passes it untranslated, as it does `ProrationBehavior`.\n */\nexport enum StandardBilling_SubscriptionPaymentBehavior {\n /** Apply the change now; an unpaid resulting invoice leaves the subscription `past_due`. */\n ALLOW_INCOMPLETE = 'allow_incomplete',\n}\n\n/**\n * What a FAILED provider mutation tells the caller about whether the change took effect (#535, decision D3).\n *\n * The distinction that matters is not the HTTP status but what may be recorded next: a conclusive refusal and a request\n * that never executed may both be recorded as \"no effect\", while an indeterminate outcome must NEVER be — the provider\n * may have applied it, or may still apply it. Only the adapter can read its vendor's error shape, so each adapter\n * classifies (`StandardBilling_Interface.classifyMutationError`) and the engine decides on the class alone.\n *\n * spec-cite: https://docs.stripe.com/error-low-level — \"Network errors\", \"Server errors\", \"Content errors\" (the\n * source of the classes for the Stripe adapter; other adapters map their own vendor's equivalents).\n */\nexport enum StandardBilling_MutationErrorClass {\n /** The provider evaluated the request and refused it (e.g. a declined card, a missing object). No effect. */\n CONCLUSIVE_REJECTION = 'conclusive_rejection',\n /** Refused before execution (rate limit, authentication). No effect; a later attempt must use a NEW idempotency key. */\n NOT_EXECUTED = 'not_executed',\n /** Another request with the same idempotency key is still being processed. The outcome is not known yet. */\n IN_FLIGHT_CONFLICT = 'in_flight_conflict',\n /** Timeout, connection loss, server error, or a failure after the provider answered. The change may have applied. */\n INDETERMINATE = 'indeterminate',\n}\n\n/**\n * Subscription status values (maps to Stripe subscription statuses).\n */\nexport enum SubscriptionStatus {\n ACTIVE = 'active',\n PAST_DUE = 'past_due',\n UNPAID = 'unpaid',\n CANCELLED = 'cancelled',\n /** Stripe: first payment never completed within 23h window */\n INCOMPLETE = 'incomplete',\n INCOMPLETE_EXPIRED = 'incomplete_expired',\n TRIALING = 'trialing',\n PAUSED = 'paused',\n}\n\n/**\n * Invoice lifecycle status, as the PROVIDER reports it.\n *\n * A PROTOCOL vocabulary for the same reason {@link SubscriptionStatus} is one: these are the states\n * a billing provider puts an invoice in, and the adapter's job is to map its own wire values onto\n * them. It was declared in `@wildo-ai/saas-models` until 2026-09-09 and could not be named by this\n * package at all, so `listInvoices` — the read the reconciliation sweep needs — had no way to type\n * the one field the sweep compares.\n *\n * Moved rather than duplicated: a second enum with the same five members would be two sources for\n * one closed vocabulary, which is what `CLAUDE.md` forbids. `@wildo-ai/saas-models` re-exports it\n * exactly as it already re-exports `SubscriptionStatus`, `TaxDisplayMode` and `ProrationBehavior`,\n * so every existing consumer — including the `invoiceRefs` schema, the badge palette and the\n * documentation catalogue — imports the same specifier it always did.\n */\nexport enum InvoiceStatus {\n /** Not finalized: the provider has not issued it for collection and it may still change. */\n DRAFT = 'draft',\n /** Finalized and awaiting payment. */\n OPEN = 'open',\n /** Settled. */\n PAID = 'paid',\n /** Cancelled by the provider or the merchant; never collectable. */\n VOID = 'void',\n /** Written off — payment was attempted and abandoned. */\n UNCOLLECTIBLE = 'uncollectible',\n}\n\n// ===============================================================\n// Standard Billing Event Types\n// ===============================================================\n\n/**\n * Canonical billing events the system cares about.\n * Provider-specific events are mapped to these types by the transformer.\n * Only events that affect local state (features, status) need to be handled.\n */\nexport enum StandardBilling_EventType {\n // Subscription lifecycle (→ feature sync)\n SUBSCRIPTION_CREATED = 'subscription.created',\n SUBSCRIPTION_UPDATED = 'subscription.updated',\n SUBSCRIPTION_DELETED = 'subscription.deleted',\n SUBSCRIPTION_TRIAL_WILL_END = 'subscription.trial_will_end',\n\n // Invoice status (→ billing status tracking, past_due detection)\n INVOICE_PAID = 'invoice.paid',\n INVOICE_PAYMENT_FAILED = 'invoice.payment_failed',\n INVOICE_FINALIZED = 'invoice.finalized',\n\n // Checkout (→ one-off purchase completion for ONE_TIME, CREDIT_PACK, ITEM products)\n CHECKOUT_SESSION_COMPLETED = 'checkout.session.completed',\n\n // Customer (→ billing account sync)\n CUSTOMER_UPDATED = 'customer.updated',\n CUSTOMER_DELETED = 'customer.deleted',\n\n // Coupon (→ no local action; coupons are managed through Wildo's promotion system.\n // Included for logging/audit in case coupons are modified directly on the provider.)\n COUPON_CREATED = 'coupon.created',\n COUPON_UPDATED = 'coupon.updated',\n COUPON_DELETED = 'coupon.deleted',\n\n // Customer discount (→ subscription re-sync to pick up discount changes)\n CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created',\n CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated',\n CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted',\n\n // Payment method (→ no local action needed; provider manages via Customer Portal.\n // Included for completeness: apps can optionally log these events for audit trails.)\n PAYMENT_METHOD_ATTACHED = 'payment_method.attached',\n PAYMENT_METHOD_DETACHED = 'payment_method.detached',\n}\n\n// ===============================================================\n// Standard Billing Webhook Event\n// ===============================================================\n\n/**\n * Canonical webhook event representation.\n * Provider transformers parse raw webhook payloads into this shape.\n */\nexport interface StandardBilling_WebhookEvent {\n /** Canonical event type */\n type: StandardBilling_EventType;\n /** Provider-assigned event ID (for idempotency) */\n providerEventId: string;\n /** Event payload — shape varies by event type */\n data: Record<string, unknown>;\n /** When the event occurred at the provider */\n createdAt: Date;\n}\n\n// ===============================================================\n// Request/Response Types\n// ===============================================================\n\n// ── Customer ────────────────────────────────────────────────────\n\nexport interface StandardBilling_CreateCustomerRequest {\n /**\n * Descriptive name — the organisation's name for an org-scoped account, the person's display name\n * for a user-scoped one.\n *\n * OPTIONAL, and that is the point (issue #486). It was required, and a caller that could not\n * resolve one therefore had to INVENT it: the engine sent the literal `'Unknown'` for every\n * customer it ever created. A contract that cannot express \"we do not know\" forces every caller to\n * lie, and a fabricated value is worse than an absent one — an operator reading the provider\n * dashboard cannot tell it from a real answer.\n */\n name?: string;\n /**\n * Contact email for invoices and receipts.\n *\n * OPTIONAL for the same reason as `name`, and additionally because **an organisation frequently has\n * no billing email at all**. Sending a natural person's address for an ORGANISATION's customer\n * record would put personal data on a record that is not about a person — the opposite of data\n * minimisation, which asks that personal data be \"adequate, relevant and limited to what is\n * necessary\".\n * spec-cite: GDPR Art. 5(1)(c) — https://gdpr-info.eu/art-5-gdpr/\n *\n * It also makes the later erasure story cheap: an organisation record carrying no individual's\n * identity never has to be visited when that individual exercises their right to erasure, so the\n * obligation to inform recipients of an erasure does not reach it.\n * spec-cite: GDPR Art. 17(2) — https://gdpr-info.eu/art-17-gdpr/\n *\n * Absent is a legitimate value at the provider: Stripe's own customer `email` is optional.\n * spec-cite: N/A — describes the Stripe Customer object's declared optionality in this\n * repository's own words (https://docs.stripe.com/api/customers/object).\n */\n email?: string;\n /** Arbitrary key-value metadata stored on the provider customer */\n metadata?: Record<string, string>;\n}\n\nexport interface StandardBilling_CreateCustomerResponse {\n providerCustomerId: string;\n}\n\n/**\n * Postal address on a provider customer record.\n *\n * Every field is independently clearable (`null`) rather than merely omittable: `undefined` means\n * \"leave whatever the provider already has\", `null` means \"blank it\". Subject erasure needs the\n * second meaning — an address that is silently preserved because the request could only express\n * \"no change\" is personal data surviving an erasure.\n */\nexport interface StandardBilling_CustomerAddress {\n line1?: string | null;\n line2?: string | null;\n city?: string | null;\n state?: string | null;\n postalCode?: string | null;\n /** ISO 3166-1 alpha-2 country code. */\n country?: string | null;\n}\n\nexport interface StandardBilling_UpdateCustomerRequest {\n name?: string;\n email?: string;\n metadata?: Record<string, string>;\n /**\n * Contact phone. `null` clears it at the provider — see {@link StandardBilling_CustomerAddress}\n * for why clearability is expressed separately from omission.\n */\n phone?: string | null;\n /**\n * Billing address. `null` clears the whole address; a partial object clears only the fields it\n * sets to `null` and leaves the rest untouched.\n */\n address?: StandardBilling_CustomerAddress | null;\n}\n\n/**\n * A stored payment instrument attached to a provider customer.\n *\n * Deliberately thin: enough to identify an instrument for detachment and to render a\n * \"•••• 4242\"-style hint, and nothing more. Wildo never handles raw instrument data — that is the\n * whole point of routing users through the provider-hosted portal — so this carries no PAN, no\n * expiry, and no billing details.\n */\nexport interface StandardBilling_PaymentMethodSummary {\n providerPaymentMethodId: string;\n /**\n * Instrument kind as the provider names it (`'card'`, `'sepa_debit'`, `'us_bank_account'`, …).\n * Intentionally an OPEN provider identifier, not a closed Wildo vocabulary: the set differs per\n * provider and grows without our involvement, and nothing in the framework branches on it — it\n * is carried for display and diagnostics only.\n */\n type: string;\n /** Last four digits, when the instrument exposes them. */\n last4?: string;\n}\n\n// ── Product/Price Sync ──────────────────────────────────────────\n\nexport interface StandardBilling_SyncProductRequest {\n /** Internal Wildo product key (stored in metadata for reverse lookup) */\n productKey: string;\n name: string;\n description?: string;\n /** If set, updates existing provider product instead of creating new */\n providerProductId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface StandardBilling_SyncProductResponse {\n providerProductId: string;\n}\n\nexport interface StandardBilling_SyncPriceRequest {\n providerProductId: string;\n model: PricingModel;\n /** Amount in smallest currency unit (cents) */\n amount: number;\n currency: string;\n interval?: BillingInterval;\n /** Multiplier of the recurring interval (3 months = quarterly). Omitted means 1; ignored for one-time prices. */\n intervalCount?: number;\n /** For TIERED/VOLUME pricing models */\n tiers?: Array<{\n upTo: number | null;\n unitAmount: number;\n flatAmount?: number;\n }>;\n /** For PACKAGE pricing */\n packageSize?: number;\n /** Tax behavior */\n taxBehavior?: TaxDisplayMode;\n /** If set, updates existing provider price instead of creating new */\n providerPriceId?: string;\n metadata?: Record<string, string>;\n}\n\nexport interface StandardBilling_SyncPriceResponse {\n providerPriceId: string;\n}\n\n// ── Subscription Lifecycle ──────────────────────────────────────\n\nexport interface StandardBilling_CreateSubscriptionRequest {\n providerCustomerId: string;\n items: Array<{\n providerPriceId: string;\n quantity?: number;\n }>;\n trialPeriodDays?: number;\n /** Provider promotion code to apply */\n providerPromotionCodeId?: string;\n /**\n * Ask the provider to compute tax on this purchase (#408, 2026-09-08).\n *\n * Set from the application's `billing.tax.calculationMode`, which is PROVIDER_MANAGED or\n * DISABLED — Wildo never calculates tax locally, so the only question a provider is asked is\n * whether to calculate at all. A provider that cannot compute tax ignores this; one that can and\n * is not configured for the customer's jurisdiction will say so at the call, which is the right\n * place for that failure.\n *\n * Distinct from a price's `taxBehavior`, which says whether a displayed amount INCLUDES tax.\n * That one has always reached the provider; this one decides whether tax is computed.\n */\n automaticTax?: boolean;\n /**\n * Require a payment method up front for a trial (#408, 2026-09-08).\n *\n * Set from the product's `behaviorPolicy.trial.requirePaymentMethod`, which was declared,\n * labelled, rendered on billing screens and passed to no provider call — so a trial declared as\n * requiring a card behaved identically to one that did not. Wonder Todos' enterprise plan\n * (`true`) and professional plan (`false`) were indistinguishable at the provider.\n *\n * Two provider-side consequences follow and a connector should honour both: collect the payment\n * method during checkout, and decide what happens if the trial ends without one.\n */\n requirePaymentMethodForTrial?: boolean;\n metadata?: Record<string, string>;\n}\n\nexport interface StandardBilling_CreateSubscriptionResponse {\n providerSubscriptionId: string;\n status: string;\n}\n\n/** Provider-confirmed identities of correlated additions from the same update operation. */\nexport interface StandardBilling_UpdateSubscriptionResponse {\n createdItems: Array<{ clientItemKey: string; providerSubscriptionItemId: string }>;\n}\n\nexport interface StandardBilling_UpdateSubscriptionRequest {\n /**\n * Server-owned identity of one attempted change, reused with the SAME subscription and payload\n * when recovering a lost response. Never generate a new key for a retry. Provider retention is\n * bounded: this does not replace confirmation consumption, freshness checks or reconciliation.\n * This is request transport metadata, not subscription metadata or a browser authoring field.\n */\n idempotencyKey?: string;\n /** Item patches: omitted existing items are retained; an item without an ID is added. */\n items?: Array<{\n /** Provider-side subscription item ID to update. Omit only when adding a new item. */\n providerSubscriptionItemId?: string;\n /** Backend-generated correlation key for an intentional new item; echoed with its created provider ID. */\n clientItemKey?: string;\n providerPriceId: string;\n quantity?: number;\n }>;\n /** Explicit provider-side item IDs to remove. Omitting an item from `items` never removes it. */\n removedProviderSubscriptionItemIds?: string[];\n /** Provider promotion code to apply */\n providerPromotionCodeId?: string;\n /**\n * How the provider settles this mid-cycle change (#516).\n *\n * The engine resolves it from the target product's `upgrade`/`downgrade` behaviour policy and it\n * had nowhere to travel: it was put in `metadata`, a free-form bag the provider does not read, so a\n * product declaring `NONE` for a downgrade was still prorated by the provider's own default. Absent\n * means \"do not send one\" — the provider applies its account default, which is what every\n * subscription update did before this field existed.\n */\n prorationBehavior?: ProrationBehavior;\n /**\n * How the provider treats an unpaid resulting invoice (#535, D6). Absent sends none, so the provider's default\n * applies; the engine's own plan-change dispatch always declares it.\n */\n paymentBehavior?: StandardBilling_SubscriptionPaymentBehavior;\n /** Unix seconds used for proration. Reuse the preview instant when confirming the same change. */\n prorationDate?: number;\n metadata?: Record<string, string>;\n}\n\n/**\n * Hypothetical item patch for an upcoming invoice. Item identity, quantity and proration must match\n * the eventual update; selecting the first provider item can accidentally preview an addon change.\n * Omitted items remain on the subscription. This request never changes the subscription itself.\n */\nexport type StandardBilling_SubscriptionPreviewRequest = Pick<StandardBilling_UpdateSubscriptionRequest,\n 'items' | 'removedProviderSubscriptionItemIds' | 'prorationBehavior' | 'prorationDate'>;\n\n/**\n * Request transport options shared by the subscription mutations that carry no payload of their own.\n *\n * `idempotencyKey` has the same contract as on {@link StandardBilling_UpdateSubscriptionRequest}: a server-owned\n * identity of ONE attempted change, reused with the same subscription and options only to recover a lost response.\n */\nexport interface StandardBilling_SubscriptionMutationOptions {\n idempotencyKey?: string;\n}\n\nexport interface StandardBilling_CancelSubscriptionOptions extends StandardBilling_SubscriptionMutationOptions {\n /** If true, subscription remains active until current period ends */\n atPeriodEnd?: boolean;\n}\n\n// ── Read/Sync (Reconciliation) ──────────────────────────────────\n\n/**\n * StandardBilling_SubscriptionData: canonical subscription representation\n * returned by the provider adapter's retrieveSubscription().\n * Used for reconciliation when webhooks may have been missed.\n */\nexport interface StandardBilling_SubscriptionData {\n providerSubscriptionId: string;\n status: SubscriptionStatus;\n currentPeriodStart: Date;\n currentPeriodEnd: Date;\n cancelAtPeriodEnd: boolean;\n trialEnd?: Date;\n items: Array<{\n providerSubscriptionItemId: string;\n providerProductId: string;\n providerPriceId: string;\n quantity: number;\n }>;\n /** Active discount on this subscription (from coupon/promotion code) */\n discount?: {\n providerCouponId: string;\n percentOff?: number;\n amountOff?: number;\n currency?: string;\n duration: string;\n durationInMonths?: number;\n end?: Date;\n };\n}\n\n/**\n * StandardBilling_InvoicePreview: canonical upcoming invoice from provider.\n * Returned by retrieveUpcomingInvoice() for plan change previews.\n */\nexport interface StandardBilling_InvoicePreview {\n /** Upcoming invoice amount due, in currency minor units; not a promise of an immediate charge. */\n amount: number;\n currency: string;\n lineItems: Array<{\n description: string;\n amount: number;\n quantity: number;\n providerPriceId?: string;\n }>;\n periodStart: Date;\n periodEnd: Date;\n}\n\n/**\n * StandardBilling_InvoiceData: an invoice the provider ALREADY holds.\n *\n * Distinct from {@link StandardBilling_InvoicePreview}, and the distinction is the point: a preview\n * is a hypothetical the provider computes on request and never stores, while this is a record that\n * exists at the provider whether or not Wildo ever heard about it. The second is what a\n * reconciliation sweep needs — a webhook that was never delivered leaves an invoice that exists\n * there and nowhere here, and no amount of previewing finds it.\n *\n * Deliberately thin. It carries what `invoiceRefs` stores and nothing else: line items, tax\n * breakdowns and payment attempts live at the provider, and the customer reaches them through the\n * provider-hosted portal.\n */\nexport interface StandardBilling_InvoiceData {\n providerInvoiceId: string;\n /** The customer the invoice was billed to — the key that maps it back to a local billing account. */\n providerCustomerId: string;\n status: InvoiceStatus;\n /**\n * The invoice TOTAL, in the CURRENCY's smallest unit.\n *\n * The total, not the amount PAID: an invoice's value does not depend on whether it has been\n * settled, and an unpaid invoice recorded at zero is indistinguishable from a zero invoice.\n */\n total: number;\n currency: string;\n hostedInvoiceUrl?: string;\n invoicePdfUrl?: string;\n /** When the provider created the invoice — used to bound how far back a sweep looks. */\n createdAt: Date;\n}\n\n// ── Checkout / Portal (Provider-Hosted UI) ──────────────────────\n\nexport interface StandardBilling_CreateCheckoutSessionRequest {\n providerCustomerId: string;\n lineItems: Array<{\n providerPriceId: string;\n quantity?: number;\n }>;\n /** Checkout mode: 'subscription' for recurring, 'payment' for one-time */\n mode: 'subscription' | 'payment';\n successUrl: string;\n cancelUrl: string;\n /** Allow promotion codes in checkout */\n allowPromotionCodes?: boolean;\n /** Pre-fill promotion code */\n providerPromotionCodeId?: string;\n /** Trial period for subscriptions */\n trialPeriodDays?: number;\n /**\n * Ask the provider to compute tax on this purchase (#408, 2026-09-08).\n *\n * Set from the application's `billing.tax.calculationMode`, which is PROVIDER_MANAGED or\n * DISABLED — Wildo never calculates tax locally, so the only question a provider is asked is\n * whether to calculate at all. A provider that cannot compute tax ignores this; one that can and\n * is not configured for the customer's jurisdiction will say so at the call, which is the right\n * place for that failure.\n *\n * Distinct from a price's `taxBehavior`, which says whether a displayed amount INCLUDES tax.\n * That one has always reached the provider; this one decides whether tax is computed.\n */\n automaticTax?: boolean;\n /**\n * Require a payment method up front for a trial (#408, 2026-09-08).\n *\n * Set from the product's `behaviorPolicy.trial.requirePaymentMethod`, which was declared,\n * labelled, rendered on billing screens and passed to no provider call — so a trial declared as\n * requiring a card behaved identically to one that did not. Wonder Todos' enterprise plan\n * (`true`) and professional plan (`false`) were indistinguishable at the provider.\n *\n * Two provider-side consequences follow and a connector should honour both: collect the payment\n * method during checkout, and decide what happens if the trial ends without one.\n */\n requirePaymentMethodForTrial?: boolean;\n metadata?: Record<string, string>;\n}\n\nexport interface StandardBilling_CreateCheckoutSessionResponse {\n /** Redirect URL for the hosted checkout page */\n url: string;\n sessionId: string;\n}\n\nexport interface StandardBilling_CreateCustomerPortalSessionResponse {\n /** Redirect URL for the customer portal */\n url: string;\n}\n\n// ── Usage Reporting (METERED products via Billing Meter Events) ─\n\nexport interface StandardBilling_ReportUsageRequest {\n /** Meter event name (corresponds to the meter's event_name) */\n meterEventName: string;\n /** Provider customer ID (maps to payload.stripe_customer_id in Stripe) */\n providerCustomerId: string;\n /** Usage value to report */\n value: number;\n /** Optional event timestamp */\n timestamp?: Date;\n /** Optional unique event identifier (for idempotency) */\n identifier?: string;\n}\n\n// ── Promotions ──────────────────────────────────────────────────\n\nexport interface StandardBilling_CreateCouponRequest {\n /** Discount amount in smallest currency unit (for fixed discounts) */\n amountOff?: number;\n /** Discount percentage (for percentage discounts) */\n percentOff?: number;\n currency?: string;\n duration: 'once' | 'repeating' | 'forever';\n durationInMonths?: number;\n maxRedemptions?: number;\n metadata?: Record<string, string>;\n}\n\nexport interface StandardBilling_CreateCouponResponse {\n providerCouponId: string;\n}\n\nexport interface StandardBilling_CreatePromotionCodeResponse {\n providerPromotionId: string;\n}\n\n// ===============================================================\n// Standard Billing Interface\n// ===============================================================\n\n/**\n * Provider-agnostic billing interface.\n * Each billing provider (Stripe, Paddle, etc.) implements this interface\n * through a transformer that maps canonical operations to provider SDK calls.\n */\nexport interface StandardBilling_Interface {\n // ── Customer (maps to BillingAccount) ──\n createCustomer(request: StandardBilling_CreateCustomerRequest): Promise<StandardBilling_CreateCustomerResponse>;\n updateCustomer(providerCustomerId: string, request: StandardBilling_UpdateCustomerRequest): Promise<void>;\n /**\n * Hard-delete the provider customer.\n *\n * ⚠️ NOT the subject-erasure path. Erasing a subject ANONYMIZES this customer (blank the personal\n * fields, keep the record) because the financial history hanging off it — invoices, subscriptions,\n * usage — is retained under a legal obligation and must stay attributable to its provider record.\n * Deleting the customer would strand exactly the audit trail retention exists to preserve.\n * Reserve this for a genuine account teardown with no retained history.\n */\n deleteCustomer(providerCustomerId: string): Promise<void>;\n\n // ── Payment instruments ──\n /**\n * Stored payment instruments for a customer. Used by subject erasure to enumerate what must be\n * detached; day-to-day management belongs in the provider-hosted portal.\n */\n listPaymentMethods(providerCustomerId: string): Promise<StandardBilling_PaymentMethodSummary[]>;\n /**\n * Detach an instrument from its customer. Detaching does NOT delete the instrument's transaction\n * history at the provider — it stops future charges and unlinks it from the customer, which is\n * what erasure needs and what the retained invoice record requires.\n */\n detachPaymentMethod(providerPaymentMethodId: string): Promise<void>;\n\n // ── Product/Price sync (Wildo → Provider) ──\n syncProduct(request: StandardBilling_SyncProductRequest): Promise<StandardBilling_SyncProductResponse>;\n syncPrice(request: StandardBilling_SyncPriceRequest): Promise<StandardBilling_SyncPriceResponse>;\n\n // ── Subscription lifecycle ──\n // NOTE: User-initiated plan changes, cancellation, and payment method management\n // should use createCustomerPortalSession() instead of calling these directly.\n // These methods are for: initial checkout completion, backend-driven upgrades,\n // admin-triggered changes, and webhook-driven updates.\n createSubscription(request: StandardBilling_CreateSubscriptionRequest): Promise<StandardBilling_CreateSubscriptionResponse>;\n updateSubscription(providerSubscriptionId: string, request: StandardBilling_UpdateSubscriptionRequest): Promise<StandardBilling_UpdateSubscriptionResponse>;\n cancelSubscription(providerSubscriptionId: string, options?: StandardBilling_CancelSubscriptionOptions): Promise<void>;\n pauseSubscription(providerSubscriptionId: string): Promise<void>;\n /** Resume paused payment collection; does not undo a scheduled cancellation. */\n resumeSubscription(providerSubscriptionId: string): Promise<void>;\n /** Remove a pending period-end cancellation without changing collection or lifecycle status. */\n removeScheduledCancellation(providerSubscriptionId: string, options?: StandardBilling_SubscriptionMutationOptions): Promise<void>;\n /**\n * Classify an error thrown by `updateSubscription`, `cancelSubscription` or `removeScheduledCancellation` (#535, D3).\n *\n * Must answer {@link StandardBilling_MutationErrorClass.INDETERMINATE} for anything the adapter cannot positively place\n * — including an error the adapter itself threw AFTER the provider answered — because every other class licenses the\n * caller to record that the change did not happen.\n */\n classifyMutationError(error: unknown): StandardBilling_MutationErrorClass;\n\n // ── Read/sync (for reconciliation and upcoming cost preview) ──\n /** On-demand retrieval for reconciliation (if webhook missed) */\n retrieveSubscription(providerSubscriptionId: string): Promise<StandardBilling_SubscriptionData>;\n /** Preview the upcoming invoice for an optional item change; the amount is not necessarily charged immediately. */\n retrieveUpcomingInvoice(providerSubscriptionId: string, request?: StandardBilling_SubscriptionPreviewRequest): Promise<StandardBilling_InvoicePreview>;\n /**\n * Invoices the provider holds for one customer, newest first.\n *\n * The RECOVERY read for {@link StandardBilling_EventType.INVOICE_PAID} and its siblings. Wildo\n * never creates an invoice — every local `invoiceRefs` row exists because a webhook arrived — so a\n * delivery that is lost, or that arrives while the application is down and exhausts the provider's\n * retries, leaves an invoice with no local trace and nothing that could notice. This is the only\n * call that can find one.\n *\n * `limit` bounds one page and an adapter may cap it lower; the sweep asks for a recent window\n * rather than the whole history, because an invoice older than the window has either been\n * reconciled already or is a backlog no single tick should try to drain.\n */\n listInvoices(providerCustomerId: string, options?: { limit?: number }): Promise<StandardBilling_InvoiceData[]>;\n\n // ── Provider-hosted UI (primary user-facing interactions) ──\n /** Hosted checkout page — NO Stripe Elements needed, no PCI scope */\n createCheckoutSession(request: StandardBilling_CreateCheckoutSessionRequest): Promise<StandardBilling_CreateCheckoutSessionResponse>;\n /** Customer portal for: invoices, payment methods, billing address, cancel */\n createCustomerPortalSession(providerCustomerId: string, returnUrl: string): Promise<StandardBilling_CreateCustomerPortalSessionResponse>;\n\n // ── Usage reporting (for METERED products) ──\n reportUsage(request: StandardBilling_ReportUsageRequest): Promise<void>;\n\n // ── Webhooks ──\n /** HTTP header name that carries the webhook signature (e.g., 'stripe-signature') */\n readonly webhookSignatureHeaderName: string;\n verifyWebhookSignature(payload: string | Uint8Array, signature: string, secret: string): boolean;\n /** Parse a raw webhook payload into a canonical event. Returns null for unknown/unhandled event types. */\n parseWebhookEvent(payload: string | Uint8Array): StandardBilling_WebhookEvent | null;\n\n // ── Promotions (synced to provider) ──\n createCoupon(request: StandardBilling_CreateCouponRequest): Promise<StandardBilling_CreateCouponResponse>;\n createPromotionCode(providerCouponId: string, code: string): Promise<StandardBilling_CreatePromotionCodeResponse>;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { ExternalProvider_ExchangeProtocol_Kind } from "../core/commons.external-connectors-models.schemas";
|
|
3
3
|
/**
|
|
4
4
|
* Concrete document-extraction model ids the framework knows.
|
|
5
5
|
*
|
|
@@ -103,14 +103,6 @@ export declare const resolveDocumentExtractionModelForApplicability: (input: {
|
|
|
103
103
|
applicability: DocumentExtraction_Applicability;
|
|
104
104
|
providerRef: string;
|
|
105
105
|
}, catalog?: Record<DocumentExtractionProvider_Model, DocumentExtraction_ModelCatalogEntry>) => DocumentExtraction_ModelResolution;
|
|
106
|
-
export type DocumentExtractionProvider_Profile = ExternalProvider_ExchangeProtocol_Profile_Base & {
|
|
107
|
-
baseURL?: string;
|
|
108
|
-
/** Model ids this provider serves (advertised for validation/UX). */
|
|
109
|
-
supportedModels?: string[];
|
|
110
|
-
};
|
|
111
|
-
export type DocumentExtractionProvider_Configuration = ExternalProvider_ExchangeProtocol_Configuration_Base & {
|
|
112
|
-
customLocation?: string;
|
|
113
|
-
};
|
|
114
106
|
/**
|
|
115
107
|
* Usage of one extraction call.
|
|
116
108
|
*
|
|
@@ -241,11 +233,4 @@ export type DocumentExtraction_ProviderExtraction = {
|
|
|
241
233
|
* - 5xx is the provider's fault, never the document's.
|
|
242
234
|
*/
|
|
243
235
|
export declare const classifyDocumentExtractionHttpStatus: (status: number) => DocumentExtraction_FailureClass;
|
|
244
|
-
export declare const DocumentExtractionProvider_StatusSchema: z.ZodObject<{
|
|
245
|
-
status: z.ZodEnum<typeof import("..").ExternalProvider_Status>;
|
|
246
|
-
lastCheckedAt: z.ZodString;
|
|
247
|
-
errorReason: z.ZodOptional<z.ZodString>;
|
|
248
|
-
protocolKind: z.ZodLiteral<ExternalProvider_ExchangeProtocol_Kind.DOCUMENT_EXTRACTION_PROVIDER>;
|
|
249
|
-
}, z.core.$strip>;
|
|
250
|
-
export type DocumentExtractionProvider_Status = z.infer<typeof DocumentExtractionProvider_StatusSchema>;
|
|
251
236
|
//# sourceMappingURL=document-extraction.external-connectors-models.schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-extraction.external-connectors-models.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"document-extraction.external-connectors-models.schemas.d.ts","sourceRoot":"","sources":["../../../../src/protocols/document-extraction.external-connectors-models.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EACL,sCAAsC,EACrC,MAAM,oDAAoD,CAAA;AAmC7D;;;;GAIG;AACH,oBAAY,gCAAgC;IAC1C;;;;;;OA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ol_Kind,
|
|
2
|
+
import { ExternalProvider_ExchangeProtocol_Kind, } from "../core/commons.external-connectors-models.schemas.js";
|
|
3
3
|
//===============================================================
|
|
4
4
|
// Document Extraction Provider
|
|
5
5
|
// --------
|
|
@@ -283,10 +283,4 @@ export const classifyDocumentExtractionHttpStatus = (status) => {
|
|
|
283
283
|
? DocumentExtraction_FailureClass.PROVIDER_UNAVAILABLE
|
|
284
284
|
: DocumentExtraction_FailureClass.UNREADABLE_DOCUMENT;
|
|
285
285
|
};
|
|
286
|
-
// ===============================================================
|
|
287
|
-
// STATUS
|
|
288
|
-
// ===============================================================
|
|
289
|
-
export const DocumentExtractionProvider_StatusSchema = ExternalProvider_ExchangeProtocol_Status_BaseSchema.extend({
|
|
290
|
-
protocolKind: z.literal(ExternalProvider_ExchangeProtocol_Kind.DOCUMENT_EXTRACTION_PROVIDER),
|
|
291
|
-
});
|
|
292
286
|
//# sourceMappingURL=document-extraction.external-connectors-models.schemas.js.map
|