weave-typescript 0.4.5 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,167 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "weaveapi.payment.v1";
3
+ export interface SubscriptionStatus {
4
+ /** Stripe subscription ID */
5
+ id: string;
6
+ /** active, past_due, canceled, trialing, incomplete */
7
+ status: string;
8
+ /** free, pro */
9
+ tier: string;
10
+ /** Billing details */
11
+ plan: PricingPlan | undefined;
12
+ currentPeriodStart: Date | undefined;
13
+ currentPeriodEnd: Date | undefined;
14
+ /** Set if cancellation scheduled */
15
+ cancelAt: Date | undefined;
16
+ /** When it was canceled */
17
+ canceledAt: Date | undefined;
18
+ cancelAtPeriodEnd: boolean;
19
+ /** Payment */
20
+ defaultPaymentMethod: PaymentMethod | undefined;
21
+ currency: string;
22
+ /** Amount in cents */
23
+ amountCents: number;
24
+ /** Trial */
25
+ isTrial: boolean;
26
+ trialStart: Date | undefined;
27
+ trialEnd: Date | undefined;
28
+ /** Discount */
29
+ activeDiscount: Discount | undefined;
30
+ /** Metadata */
31
+ createdAt: Date | undefined;
32
+ updatedAt: Date | undefined;
33
+ /** Additional features */
34
+ features: SubscriptionFeatures | undefined;
35
+ }
36
+ export interface PricingPlan {
37
+ /** Stripe price ID */
38
+ id: string;
39
+ /** Stripe product ID */
40
+ productId: string;
41
+ /** "Free", "Pro" */
42
+ name: string;
43
+ description: string;
44
+ /** Monthly price in cents */
45
+ amountCents: number;
46
+ currency: string;
47
+ /** month, year */
48
+ interval: string;
49
+ /** 1 for monthly, 12 for yearly */
50
+ intervalCount: number;
51
+ /** Features */
52
+ features: SubscriptionFeatures | undefined;
53
+ /** Metadata */
54
+ isDefault: boolean;
55
+ isPopular: boolean;
56
+ /** Key selling points */
57
+ highlights: string[];
58
+ }
59
+ export interface SubscriptionFeatures {
60
+ apiRequestsPerHour: number;
61
+ apiRequestsPerDay: number;
62
+ apiRequestsPerMonth: number;
63
+ unlimitedRequests: boolean;
64
+ apiKeysLimit: number;
65
+ unlimitedApiKeys: boolean;
66
+ webhookAccess: boolean;
67
+ exportAccess: boolean;
68
+ prioritySupport: boolean;
69
+ customLimits: boolean;
70
+ /** Advanced features */
71
+ teamAccess: boolean;
72
+ teamMembersLimit: number;
73
+ ssoAccess: boolean;
74
+ auditLogs: boolean;
75
+ slaGuarantee: boolean;
76
+ }
77
+ export interface PaymentMethod {
78
+ /** Stripe payment method ID */
79
+ id: string;
80
+ /** card, bank_account */
81
+ type: string;
82
+ isDefault: boolean;
83
+ /** Card details (if type == "card") */
84
+ card: CardDetails | undefined;
85
+ /** Bank details (if type == "bank_account") */
86
+ bank: BankDetails | undefined;
87
+ /** Billing details */
88
+ billingDetails: BillingDetails | undefined;
89
+ createdAt: Date | undefined;
90
+ }
91
+ export interface CardDetails {
92
+ /** visa, mastercard, amex, etc */
93
+ brand: string;
94
+ last4: string;
95
+ expMonth: number;
96
+ expYear: number;
97
+ /** credit, debit, prepaid */
98
+ funding: string;
99
+ country: string;
100
+ /** Unique card identifier */
101
+ fingerprint: string;
102
+ }
103
+ export interface BankDetails {
104
+ bankName: string;
105
+ last4: string;
106
+ accountType: string;
107
+ country: string;
108
+ currency: string;
109
+ }
110
+ export interface BillingDetails {
111
+ name: string;
112
+ email: string;
113
+ phone: string;
114
+ address: Address | undefined;
115
+ }
116
+ export interface Address {
117
+ line1: string;
118
+ line2: string;
119
+ city: string;
120
+ state: string;
121
+ postalCode: string;
122
+ /** ISO country code */
123
+ country: string;
124
+ }
125
+ export interface Discount {
126
+ /** Stripe coupon ID */
127
+ id: string;
128
+ name: string;
129
+ /** percentage, fixed_amount */
130
+ type: string;
131
+ percentOff: number;
132
+ amountOffCents: number;
133
+ /** forever, once, repeating */
134
+ duration: string;
135
+ /** If duration is "repeating" */
136
+ durationInMonths: number;
137
+ validUntil: Date | undefined;
138
+ appliedAt: Date | undefined;
139
+ }
140
+ export declare const SubscriptionStatus: MessageFns<SubscriptionStatus>;
141
+ export declare const PricingPlan: MessageFns<PricingPlan>;
142
+ export declare const SubscriptionFeatures: MessageFns<SubscriptionFeatures>;
143
+ export declare const PaymentMethod: MessageFns<PaymentMethod>;
144
+ export declare const CardDetails: MessageFns<CardDetails>;
145
+ export declare const BankDetails: MessageFns<BankDetails>;
146
+ export declare const BillingDetails: MessageFns<BillingDetails>;
147
+ export declare const Address: MessageFns<Address>;
148
+ export declare const Discount: MessageFns<Discount>;
149
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
150
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
151
+ [K in keyof T]?: DeepPartial<T[K]>;
152
+ } : Partial<T>;
153
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
154
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
155
+ [K in keyof P]: Exact<P[K], I[K]>;
156
+ } & {
157
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
158
+ };
159
+ export interface MessageFns<T> {
160
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
161
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
162
+ fromJSON(object: any): T;
163
+ toJSON(message: T): unknown;
164
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
165
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
166
+ }
167
+ export {};