@ledewire/browser 0.2.1 → 0.2.2
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/index.d.ts +1344 -33
- package/package.json +2 -2
- package/dist/client.d.ts +0 -89
- package/dist/client.d.ts.map +0 -1
- package/dist/client.test.d.ts +0 -2
- package/dist/client.test.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/local-storage-adapter.d.ts +0 -27
- package/dist/local-storage-adapter.d.ts.map +0 -1
- package/dist/local-storage-adapter.test.d.ts +0 -2
- package/dist/local-storage-adapter.test.d.ts.map +0 -1
- package/dist/resources/auth.d.ts +0 -45
- package/dist/resources/auth.d.ts.map +0 -1
- package/dist/resources/auth.test.d.ts +0 -2
- package/dist/resources/auth.test.d.ts.map +0 -1
- package/dist/resources/checkout.d.ts +0 -31
- package/dist/resources/checkout.d.ts.map +0 -1
- package/dist/resources/checkout.test.d.ts +0 -2
- package/dist/resources/checkout.test.d.ts.map +0 -1
- package/dist/resources/content.d.ts +0 -27
- package/dist/resources/content.d.ts.map +0 -1
- package/dist/resources/content.test.d.ts +0 -2
- package/dist/resources/content.test.d.ts.map +0 -1
- package/dist/resources/purchases.d.ts +0 -38
- package/dist/resources/purchases.d.ts.map +0 -1
- package/dist/resources/purchases.test.d.ts +0 -2
- package/dist/resources/purchases.test.d.ts.map +0 -1
- package/dist/resources/wallet.d.ts +0 -44
- package/dist/resources/wallet.d.ts.map +0 -1
- package/dist/resources/wallet.test.d.ts +0 -2
- package/dist/resources/wallet.test.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,33 +1,1344 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @ledewire/browser
|
|
3
|
-
*
|
|
4
|
-
* LedeWire SDK for browser environments.
|
|
5
|
-
* Enables buyer authentication, content checkout, wallet funding,
|
|
6
|
-
* and purchases — embeddable with a single `<script>` tag.
|
|
7
|
-
*
|
|
8
|
-
* **CDN usage (no build step required):**
|
|
9
|
-
* ```html
|
|
10
|
-
* <script src="https://cdn.jsdelivr.net/npm/@ledewire/browser@1/dist/ledewire.min.js"></script>
|
|
11
|
-
* <script>
|
|
12
|
-
* const lw = Ledewire.init({ apiKey: 'your_api_key' })
|
|
13
|
-
* const state = await lw.checkout.state('content-id')
|
|
14
|
-
* // state.checkout_state.next_required_action:
|
|
15
|
-
* // 'authenticate' | 'fund_wallet' | 'purchase' | 'view_content'
|
|
16
|
-
* </script>
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* **npm / bundler usage:**
|
|
20
|
-
* ```ts
|
|
21
|
-
* import { init } from '@ledewire/browser'
|
|
22
|
-
* const lw = init({ apiKey: 'your_api_key' })
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* @see {@link https://docs.ledewire.org} for guides and examples
|
|
26
|
-
* @packageDocumentation
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @ledewire/browser
|
|
3
|
+
*
|
|
4
|
+
* LedeWire SDK for browser environments.
|
|
5
|
+
* Enables buyer authentication, content checkout, wallet funding,
|
|
6
|
+
* and purchases — embeddable with a single `<script>` tag.
|
|
7
|
+
*
|
|
8
|
+
* **CDN usage (no build step required):**
|
|
9
|
+
* ```html
|
|
10
|
+
* <script src="https://cdn.jsdelivr.net/npm/@ledewire/browser@1/dist/ledewire.min.js"></script>
|
|
11
|
+
* <script>
|
|
12
|
+
* const lw = Ledewire.init({ apiKey: 'your_api_key' })
|
|
13
|
+
* const state = await lw.checkout.state('content-id')
|
|
14
|
+
* // state.checkout_state.next_required_action:
|
|
15
|
+
* // 'authenticate' | 'fund_wallet' | 'purchase' | 'view_content'
|
|
16
|
+
* </script>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* **npm / bundler usage:**
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { init } from '@ledewire/browser'
|
|
22
|
+
* const lw = init({ apiKey: 'your_api_key' })
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @see {@link https://docs.ledewire.org} for guides and examples
|
|
26
|
+
* @packageDocumentation
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Core TypeScript types for the LedeWire SDK.
|
|
31
|
+
*
|
|
32
|
+
* API shape types are generated from `ledewire.yml`
|
|
33
|
+
* (run `pnpm --filter @ledewire/core generate:types` to regenerate).
|
|
34
|
+
* SDK-internal types (token storage, stored tokens) are hand-written below.
|
|
35
|
+
*
|
|
36
|
+
* @module
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/** JWT bearer token response returned by all buyer authentication endpoints. */
|
|
40
|
+
export declare type AuthenticationResponse = components['schemas']['AuthenticationResponse'];
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Thrown when the request lacks valid authentication credentials,
|
|
44
|
+
* or when a token refresh fails and re-authentication is required.
|
|
45
|
+
*/
|
|
46
|
+
export declare class AuthError extends LedewireError {
|
|
47
|
+
constructor(message: string, code?: number);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Request body for buyer email/password login. */
|
|
51
|
+
declare type AuthLoginEmailRequest = components['schemas']['AuthLoginEmailRequest'];
|
|
52
|
+
|
|
53
|
+
/** Request body for buyer Google OAuth login. */
|
|
54
|
+
declare type AuthLoginOAuthRequest = components['schemas']['AuthLoginOAuthRequest'];
|
|
55
|
+
|
|
56
|
+
/** Request body for buyer email/password signup. */
|
|
57
|
+
declare type AuthSignupRequest = components['schemas']['AuthSignupRequest'];
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Buyer authentication: signup, email/password login, Google OAuth.
|
|
61
|
+
*
|
|
62
|
+
* Obtain via `lw.auth` — do not construct directly.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* const lw = Ledewire.init({ apiKey: 'your_api_key' })
|
|
67
|
+
* await lw.auth.loginWithEmail({ email: 'u@example.com', password: 'pw' })
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
declare class BrowserAuthNamespace {
|
|
71
|
+
private readonly http;
|
|
72
|
+
private readonly tokenManager;
|
|
73
|
+
/* Excluded from this release type: __constructor */
|
|
74
|
+
/**
|
|
75
|
+
* Register a new buyer account with email and password.
|
|
76
|
+
* Tokens are stored automatically after successful signup.
|
|
77
|
+
*
|
|
78
|
+
* @param body - Signup credentials and display name.
|
|
79
|
+
* @returns The authentication token response.
|
|
80
|
+
*/
|
|
81
|
+
signup(body: AuthSignupRequest): Promise<AuthenticationResponse>;
|
|
82
|
+
/**
|
|
83
|
+
* Log in with email and password.
|
|
84
|
+
* Tokens are stored automatically after successful login.
|
|
85
|
+
*
|
|
86
|
+
* @param body - Email and password credentials.
|
|
87
|
+
* @returns The authentication token response.
|
|
88
|
+
*/
|
|
89
|
+
loginWithEmail(body: AuthLoginEmailRequest): Promise<AuthenticationResponse>;
|
|
90
|
+
/**
|
|
91
|
+
* Log in with a Google ID token obtained from the Google OAuth flow.
|
|
92
|
+
* Tokens are stored automatically after successful login.
|
|
93
|
+
*
|
|
94
|
+
* @param body - The Google ID token.
|
|
95
|
+
* @returns The authentication token response.
|
|
96
|
+
*/
|
|
97
|
+
loginWithGoogle(body: AuthLoginOAuthRequest): Promise<AuthenticationResponse>;
|
|
98
|
+
private storeTokens;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The LedeWire browser client.
|
|
103
|
+
* Access buyer flows through the namespaced properties.
|
|
104
|
+
*
|
|
105
|
+
* @remarks
|
|
106
|
+
* Instantiate with {@link init} rather than constructing directly.
|
|
107
|
+
*/
|
|
108
|
+
declare class BrowserClient {
|
|
109
|
+
readonly _http: HttpClient;
|
|
110
|
+
readonly _tokenManager: TokenManager;
|
|
111
|
+
readonly _config: BrowserClientConfig;
|
|
112
|
+
/** Buyer authentication: email/password signup/login, Google, password reset */
|
|
113
|
+
readonly auth: BrowserAuthNamespace;
|
|
114
|
+
/** Checkout state machine: determines next action for a piece of content */
|
|
115
|
+
readonly checkout: CheckoutNamespace;
|
|
116
|
+
/** Wallet: balance, fund via payment session, transaction history */
|
|
117
|
+
readonly wallet: BrowserWalletNamespace;
|
|
118
|
+
/** Content purchases for the authenticated buyer */
|
|
119
|
+
readonly purchases: BrowserPurchasesNamespace;
|
|
120
|
+
/** Public content with per-user access information */
|
|
121
|
+
readonly content: BrowserContentNamespace;
|
|
122
|
+
/* Excluded from this release type: __constructor */
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Configuration options for the LedeWire browser client.
|
|
127
|
+
*/
|
|
128
|
+
export declare interface BrowserClientConfig {
|
|
129
|
+
/**
|
|
130
|
+
* LedeWire API key that identifies the store.
|
|
131
|
+
* Obtained from the LedeWire merchant dashboard.
|
|
132
|
+
*/
|
|
133
|
+
apiKey: string;
|
|
134
|
+
/**
|
|
135
|
+
* Override the API base URL.
|
|
136
|
+
* Defaults to `https://api.ledewire.com`.
|
|
137
|
+
*/
|
|
138
|
+
baseUrl?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Token storage adapter.
|
|
141
|
+
* Defaults to {@link MemoryTokenStorage} (in-memory, most secure).
|
|
142
|
+
*
|
|
143
|
+
* To persist sessions across page reloads, use the built-in
|
|
144
|
+
* `localStorageAdapter`:
|
|
145
|
+
* ```ts
|
|
146
|
+
* import { init, localStorageAdapter } from '@ledewire/browser'
|
|
147
|
+
* const lw = init({ apiKey: '...', storage: localStorageAdapter() })
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
storage?: TokenStorage;
|
|
151
|
+
/**
|
|
152
|
+
* Called when the user's session expires and cannot be refreshed.
|
|
153
|
+
* Use this to show a re-authentication prompt.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```ts
|
|
157
|
+
* onAuthExpired: () => showLoginModal()
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
onAuthExpired?: () => void;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Buyer content namespace — fetch content with real-time access information.
|
|
165
|
+
*
|
|
166
|
+
* Obtain via `lw.content` — do not construct directly.
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* ```ts
|
|
170
|
+
* const { content, access } = await lw.content.getWithAccess('content-id')
|
|
171
|
+
* if (access.has_access) showFullContent(content)
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
declare class BrowserContentNamespace {
|
|
175
|
+
protected readonly http: HttpClient;
|
|
176
|
+
constructor(http: HttpClient);
|
|
177
|
+
/**
|
|
178
|
+
* Returns a content item together with access information for the
|
|
179
|
+
* authenticated buyer (or a generic access response when unauthenticated).
|
|
180
|
+
*
|
|
181
|
+
* @param id - The content ID.
|
|
182
|
+
* @param userId - Optional user ID to check a specific user's access status.
|
|
183
|
+
* @returns The content item with access information.
|
|
184
|
+
*/
|
|
185
|
+
getWithAccess(id: string, userId?: string): Promise<ContentWithAccessResponse>;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Buyer purchases namespace — create and retrieve content purchases.
|
|
190
|
+
*
|
|
191
|
+
* Obtain via `lw.purchases` — do not construct directly.
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```ts
|
|
195
|
+
* await lw.purchases.create({ content_id: 'content-id' })
|
|
196
|
+
* const all = await lw.purchases.list()
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
199
|
+
declare class BrowserPurchasesNamespace {
|
|
200
|
+
protected readonly http: HttpClient;
|
|
201
|
+
constructor(http: HttpClient);
|
|
202
|
+
/**
|
|
203
|
+
* Completes a content purchase using the buyer's wallet balance.
|
|
204
|
+
*
|
|
205
|
+
* @param body - The content ID and expected price in cents.
|
|
206
|
+
* @returns The completed purchase record.
|
|
207
|
+
*/
|
|
208
|
+
create(body: PurchaseCreateRequest): Promise<PurchaseResponse>;
|
|
209
|
+
/**
|
|
210
|
+
* Returns all purchases made by the authenticated buyer.
|
|
211
|
+
*
|
|
212
|
+
* @returns A list of purchase records, newest first.
|
|
213
|
+
*/
|
|
214
|
+
list(): Promise<PurchaseResponse[]>;
|
|
215
|
+
/**
|
|
216
|
+
* Returns a single purchase by ID.
|
|
217
|
+
*
|
|
218
|
+
* @param id - The purchase ID.
|
|
219
|
+
* @returns The purchase record.
|
|
220
|
+
*/
|
|
221
|
+
get(id: string): Promise<PurchaseResponse>;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Buyer wallet namespace — balance, transactions, and payment session management.
|
|
226
|
+
*
|
|
227
|
+
* Obtain via `lw.wallet` — do not construct directly.
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* ```ts
|
|
231
|
+
* const { balance_cents } = await lw.wallet.balance()
|
|
232
|
+
* const session = await lw.wallet.createPaymentSession({ amount_cents: 500 })
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
declare class BrowserWalletNamespace {
|
|
236
|
+
protected readonly http: HttpClient;
|
|
237
|
+
constructor(http: HttpClient);
|
|
238
|
+
/**
|
|
239
|
+
* Returns the authenticated buyer's current wallet balance.
|
|
240
|
+
*
|
|
241
|
+
* @returns The current wallet balance in cents.
|
|
242
|
+
*/
|
|
243
|
+
balance(): Promise<WalletBalanceResponse>;
|
|
244
|
+
/**
|
|
245
|
+
* Returns the authenticated buyer's wallet transaction history, newest first.
|
|
246
|
+
*
|
|
247
|
+
* @returns A list of completed wallet transaction entries.
|
|
248
|
+
*/
|
|
249
|
+
transactions(): Promise<WalletTransactionItem[]>;
|
|
250
|
+
/**
|
|
251
|
+
* Creates a payment session for funding the buyer's wallet.
|
|
252
|
+
*
|
|
253
|
+
* @param body - The amount and currency to fund.
|
|
254
|
+
* @returns Payment session details for use with the payment provider widget.
|
|
255
|
+
*/
|
|
256
|
+
createPaymentSession(body: WalletPaymentSessionRequest): Promise<WalletPaymentSessionResponse>;
|
|
257
|
+
/**
|
|
258
|
+
* Polls the status of a wallet funding payment session.
|
|
259
|
+
*
|
|
260
|
+
* @param sessionId - The session ID returned by `createPaymentSession`.
|
|
261
|
+
* @returns The current payment status.
|
|
262
|
+
*/
|
|
263
|
+
getPaymentStatus(sessionId: string): Promise<WalletPaymentStatusResponse>;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Checkout namespace — buyer checkout state for a specific content item.
|
|
268
|
+
*
|
|
269
|
+
* Obtain via `lw.checkout` — do not construct directly.
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* ```ts
|
|
273
|
+
* const state = await lw.checkout.state('content-id')
|
|
274
|
+
* // state.checkout_state.next_required_action:
|
|
275
|
+
* // 'authenticate' | 'fund_wallet' | 'purchase' | 'view_content'
|
|
276
|
+
* ```
|
|
277
|
+
*/
|
|
278
|
+
declare class CheckoutNamespace {
|
|
279
|
+
protected readonly http: HttpClient;
|
|
280
|
+
constructor(http: HttpClient);
|
|
281
|
+
/**
|
|
282
|
+
* Returns the authenticated buyer's checkout readiness for a given piece of
|
|
283
|
+
* content. Indicates whether the buyer needs to authenticate, fund their
|
|
284
|
+
* wallet, or purchase before accessing the content.
|
|
285
|
+
*
|
|
286
|
+
* Works without authentication — returns anonymous checkout state when the
|
|
287
|
+
* buyer is not logged in.
|
|
288
|
+
*
|
|
289
|
+
* @param contentId - The content item ID.
|
|
290
|
+
* @returns The checkout state, including what action is required next.
|
|
291
|
+
*/
|
|
292
|
+
state(contentId: string): Promise<CheckoutStateResponse>;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Next step in a content checkout flow.
|
|
297
|
+
* Extends `NextRequiredAction` with the terminal `view_content` state
|
|
298
|
+
* (returned once the buyer has purchased and can view the content).
|
|
299
|
+
*/
|
|
300
|
+
export declare type CheckoutNextAction = 'authenticate' | 'fund_wallet' | 'purchase' | 'view_content';
|
|
301
|
+
|
|
302
|
+
/** Checkout state machine result for a specific content item. */
|
|
303
|
+
export declare interface CheckoutState {
|
|
304
|
+
content_id: string;
|
|
305
|
+
checkout_state: {
|
|
306
|
+
is_authenticated: boolean;
|
|
307
|
+
has_sufficient_funds: boolean;
|
|
308
|
+
has_purchased: boolean;
|
|
309
|
+
next_required_action: CheckoutNextAction;
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/** Full checkout state for a buyer/content pair, including auth and fund status. */
|
|
314
|
+
export declare type CheckoutStateResponse = components['schemas']['CheckoutStateResponse'];
|
|
315
|
+
|
|
316
|
+
declare interface components {
|
|
317
|
+
schemas: {
|
|
318
|
+
ContentAccessInfo: {
|
|
319
|
+
user_id: string | null;
|
|
320
|
+
has_purchased: boolean;
|
|
321
|
+
has_sufficient_funds: boolean;
|
|
322
|
+
wallet_balance_cents: number;
|
|
323
|
+
/** @enum {string} */
|
|
324
|
+
next_required_action: 'authenticate' | 'fund_wallet' | 'purchase' | 'none';
|
|
325
|
+
};
|
|
326
|
+
AuthenticationResponse: {
|
|
327
|
+
/** @enum {string} */
|
|
328
|
+
token_type: 'Bearer';
|
|
329
|
+
/** @example eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIwOTM1N2MyMi0zODlhLTRmYWItYjE2Ni04MjJlNTJhNWJmNWUiLCJyb2xlIjoiYnV5ZXIiLCJidXllcl9jbGFpbXMiOnsidXNlcl9pZCI6IjA5MzU3YzIyLTM4OWEtNGZhYi1iMTY2LTgyMmU1MmE1YmY1ZSIsImVtYWlsIjoidGVzdC0xM0BleGFtcGxlLmNvbSJ9LCJpc3MiOiJMZWRlV2lyZSBBUEkiLCJhdWQiOiJ3ZWIiLCJleHAiOjE3NDc0OTk5NzMsImlhdCI6MTc0NzQ5ODE3MywibmJmIjoxNzQ3NDk4MTczLCJqdGkiOiIwZTMyYzNkNi02OWQwLTRmNTItYTczNS1hZTJiOGNlMmY1MmQiLCJ0b2tlbl9tZXRhZGF0YSI6eyJjcmVhdGVkX2F0IjoiMjAyNS0wNS0xN1QxNjowOTozM1oiLCJleHBpcmVzX2F0IjoiMjAyNS0wNS0xN1QxNjozOTozM1oiLCJ0b2tlbl9pZCI6IjBlMzJjM2Q2LTY5ZDAtNGY1Mi1hNzM1LWFlMmI4Y2UyZjUyZCJ9fQ.VSFsm5ysjtZLheVfhv6DWwH1A9zn_WA6rnGOlPR1R3U */
|
|
330
|
+
access_token: string;
|
|
331
|
+
refresh_token: string;
|
|
332
|
+
/**
|
|
333
|
+
* Format: date-time
|
|
334
|
+
* @description When the Access Token expires
|
|
335
|
+
*/
|
|
336
|
+
expires_at: string;
|
|
337
|
+
};
|
|
338
|
+
/** @description Token response for merchant authentication. Tokens are store-agnostic — no store_context is embedded. */
|
|
339
|
+
MerchantAuthenticationResponse: {
|
|
340
|
+
/** @enum {string} */
|
|
341
|
+
token_type: 'Bearer';
|
|
342
|
+
access_token: string;
|
|
343
|
+
refresh_token: string;
|
|
344
|
+
/** Format: date-time */
|
|
345
|
+
expires_at: string;
|
|
346
|
+
};
|
|
347
|
+
JWTClaims: {
|
|
348
|
+
/** @description User or Store identifier */
|
|
349
|
+
sub?: string;
|
|
350
|
+
/** @enum {string} */
|
|
351
|
+
role?: 'buyer' | 'seller-view' | 'seller-full' | 'merchant';
|
|
352
|
+
seller_claims?: {
|
|
353
|
+
seller_id?: string;
|
|
354
|
+
};
|
|
355
|
+
buyer_claims?: {
|
|
356
|
+
user_id?: string;
|
|
357
|
+
email?: string;
|
|
358
|
+
};
|
|
359
|
+
/** @description Present on merchant tokens */
|
|
360
|
+
user_claims?: {
|
|
361
|
+
id?: string;
|
|
362
|
+
email?: string;
|
|
363
|
+
full_name?: string;
|
|
364
|
+
};
|
|
365
|
+
iat?: number;
|
|
366
|
+
exp?: number;
|
|
367
|
+
nbf?: number;
|
|
368
|
+
iss?: string;
|
|
369
|
+
aud?: string;
|
|
370
|
+
token_metadata?: {
|
|
371
|
+
/** Format: date-time */
|
|
372
|
+
created_at?: string;
|
|
373
|
+
/** Format: date-time */
|
|
374
|
+
expires_at?: string;
|
|
375
|
+
token_id?: string;
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
MessageResponse: {
|
|
379
|
+
message: string;
|
|
380
|
+
};
|
|
381
|
+
ErrorResponse: {
|
|
382
|
+
error: {
|
|
383
|
+
code: number;
|
|
384
|
+
message: string;
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
AuthSignupRequest: {
|
|
388
|
+
email: string;
|
|
389
|
+
password: string;
|
|
390
|
+
name: string;
|
|
391
|
+
};
|
|
392
|
+
AuthLoginEmailRequest: {
|
|
393
|
+
email?: string;
|
|
394
|
+
password?: string;
|
|
395
|
+
};
|
|
396
|
+
AuthLoginOAuthRequest: {
|
|
397
|
+
id_token?: string;
|
|
398
|
+
};
|
|
399
|
+
MerchantEmailLoginRequest: {
|
|
400
|
+
email: string;
|
|
401
|
+
password: string;
|
|
402
|
+
};
|
|
403
|
+
MerchantGoogleLoginRequest: {
|
|
404
|
+
id_token: string;
|
|
405
|
+
};
|
|
406
|
+
AuthLoginApiKeyRequest: {
|
|
407
|
+
key: string;
|
|
408
|
+
secret?: string;
|
|
409
|
+
};
|
|
410
|
+
AuthTokenRefreshRequest: {
|
|
411
|
+
refresh_token?: string;
|
|
412
|
+
};
|
|
413
|
+
ManageableStore: {
|
|
414
|
+
store_id: string;
|
|
415
|
+
store_name: string;
|
|
416
|
+
store_key: string;
|
|
417
|
+
/** @enum {string|null} */
|
|
418
|
+
role: 'owner' | null;
|
|
419
|
+
/** @description Whether the authenticated user has author permissions for this store. */
|
|
420
|
+
is_author: boolean;
|
|
421
|
+
logo: string | null;
|
|
422
|
+
};
|
|
423
|
+
MerchantUser: {
|
|
424
|
+
id: string;
|
|
425
|
+
user_id: string | null;
|
|
426
|
+
store_id: string;
|
|
427
|
+
/**
|
|
428
|
+
* @description Named role. `owner` is the only valid named role; non-owner authors have a null role.
|
|
429
|
+
* @enum {string|null}
|
|
430
|
+
*/
|
|
431
|
+
role: 'owner' | null;
|
|
432
|
+
/** @description Whether this user can create and manage their own content. */
|
|
433
|
+
is_author: boolean;
|
|
434
|
+
/** Format: date-time */
|
|
435
|
+
invited_at: string | null;
|
|
436
|
+
/** Format: date-time */
|
|
437
|
+
accepted_at: string | null;
|
|
438
|
+
email: string | null;
|
|
439
|
+
};
|
|
440
|
+
MerchantInviteRequest: {
|
|
441
|
+
/** @description Email address of the user to invite to the store. */
|
|
442
|
+
email: string;
|
|
443
|
+
/**
|
|
444
|
+
* @description Whether to grant author permissions. Defaults to `true`.
|
|
445
|
+
* @default true
|
|
446
|
+
*/
|
|
447
|
+
is_author: boolean;
|
|
448
|
+
};
|
|
449
|
+
MerchantInviteResponse: {
|
|
450
|
+
invitation_token: string;
|
|
451
|
+
email: string;
|
|
452
|
+
/** @enum {string|null} */
|
|
453
|
+
role: 'owner' | null;
|
|
454
|
+
is_author: boolean;
|
|
455
|
+
/** Format: date-time */
|
|
456
|
+
expires_at: string;
|
|
457
|
+
};
|
|
458
|
+
WalletPaymentSessionRequest: {
|
|
459
|
+
/** @description Amount to fund the wallet in cents */
|
|
460
|
+
amount_cents: number;
|
|
461
|
+
/**
|
|
462
|
+
* @description Currency code (defaults to USD)
|
|
463
|
+
* @default usd
|
|
464
|
+
*/
|
|
465
|
+
currency: string;
|
|
466
|
+
/** @description Additional metadata to include with the payment session */
|
|
467
|
+
metadata?: Record<string, never>;
|
|
468
|
+
};
|
|
469
|
+
WalletPaymentSessionResponse: {
|
|
470
|
+
/** @description The client secret used by the payment widget to confirm the payment */
|
|
471
|
+
client_secret: string;
|
|
472
|
+
/** @description The ID of the created payment session */
|
|
473
|
+
session_id: string;
|
|
474
|
+
/** @description The payment public key to be used during the payment processing */
|
|
475
|
+
public_key: string;
|
|
476
|
+
};
|
|
477
|
+
/** @description A payment provider webhook event object */
|
|
478
|
+
PaymentWebhookEvent: {
|
|
479
|
+
/** @description Unique identifier for the event */
|
|
480
|
+
id?: string;
|
|
481
|
+
/** @description Type of event (e.g., payment_intent.succeeded, payment_intent.payment_failed) */
|
|
482
|
+
type?: string;
|
|
483
|
+
/** @description Event data containing the object that triggered the event */
|
|
484
|
+
data?: Record<string, never>;
|
|
485
|
+
};
|
|
486
|
+
WalletBalanceResponse: {
|
|
487
|
+
balance_cents: number;
|
|
488
|
+
};
|
|
489
|
+
WalletTransactionItem: {
|
|
490
|
+
/** @description ID of the transaction entry (matches the source record) */
|
|
491
|
+
id: string;
|
|
492
|
+
/**
|
|
493
|
+
* @description Direction relative to the user's wallet
|
|
494
|
+
* @enum {string}
|
|
495
|
+
*/
|
|
496
|
+
type: 'credit' | 'debit';
|
|
497
|
+
/**
|
|
498
|
+
* @description What caused this wallet movement
|
|
499
|
+
* @enum {string}
|
|
500
|
+
*/
|
|
501
|
+
reason: 'wallet_funding' | 'purchase' | 'refund';
|
|
502
|
+
/** @description Always positive; direction expressed by `type` */
|
|
503
|
+
amount_cents: number;
|
|
504
|
+
/** @description Running wallet balance immediately after this event */
|
|
505
|
+
balance_after_cents: number;
|
|
506
|
+
/** @enum {string} */
|
|
507
|
+
status: 'completed' | 'pending' | 'failed' | 'cancelled';
|
|
508
|
+
/** @description ID of the source record (Purchase or FundingTransfer) */
|
|
509
|
+
reference_id: string;
|
|
510
|
+
/** @description Human-readable label suitable for display */
|
|
511
|
+
description: string;
|
|
512
|
+
/**
|
|
513
|
+
* Format: date-time
|
|
514
|
+
* @description created_at of the source record
|
|
515
|
+
*/
|
|
516
|
+
occurred_at: string;
|
|
517
|
+
};
|
|
518
|
+
PurchaseCreateRequest: {
|
|
519
|
+
content_id?: string;
|
|
520
|
+
price_cents?: number;
|
|
521
|
+
};
|
|
522
|
+
PurchaseVerifyResponse: {
|
|
523
|
+
has_purchased: boolean;
|
|
524
|
+
purchase_details?: {
|
|
525
|
+
purchase_id?: string;
|
|
526
|
+
/** Format: date-time */
|
|
527
|
+
purchase_date?: string;
|
|
528
|
+
};
|
|
529
|
+
checkout_readiness?: {
|
|
530
|
+
is_authenticated?: boolean;
|
|
531
|
+
has_sufficient_funds?: boolean;
|
|
532
|
+
};
|
|
533
|
+
};
|
|
534
|
+
/** @description Update request for content. `content_body` applies to `markdown` content; `content_uri` and `external_identifier` apply to `external_ref` content. */
|
|
535
|
+
ContentUpdateRequest: {
|
|
536
|
+
/** @description Content title */
|
|
537
|
+
title?: string;
|
|
538
|
+
/**
|
|
539
|
+
* Format: byte
|
|
540
|
+
* @description Full article body in markdown, base64 encoded. For `markdown` content only.
|
|
541
|
+
*/
|
|
542
|
+
content_body?: string;
|
|
543
|
+
/**
|
|
544
|
+
* @description URI of the external resource. For `external_ref` content only.
|
|
545
|
+
* @example https://vimeo.com/123456789
|
|
546
|
+
*/
|
|
547
|
+
content_uri?: string;
|
|
548
|
+
/**
|
|
549
|
+
* @description Namespaced platform ID, e.g. `vimeo:123456789`. For `external_ref` content only.
|
|
550
|
+
* @example vimeo:123456789
|
|
551
|
+
*/
|
|
552
|
+
external_identifier?: string | null;
|
|
553
|
+
/**
|
|
554
|
+
* Format: byte
|
|
555
|
+
* @description Content teaser, base64 encoded
|
|
556
|
+
*/
|
|
557
|
+
teaser?: string;
|
|
558
|
+
/** @description Price in cents (must be greater than 0) */
|
|
559
|
+
price_cents?: number;
|
|
560
|
+
/** @enum {string} */
|
|
561
|
+
visibility?: 'public' | 'unlisted';
|
|
562
|
+
metadata?: {
|
|
563
|
+
[key: string]: unknown;
|
|
564
|
+
};
|
|
565
|
+
/** @description Assign or clear content authorship. Provide the `id` of a `StoreUser` from `GET /v1/merchant/{store_id}/users` to assign an author, or `null` to clear attribution. Only available to `owner` role and API key auth. Users with `is_author: true` (non-owner) cannot reassign their own content. */
|
|
566
|
+
store_user_id?: string | null;
|
|
567
|
+
};
|
|
568
|
+
SalesStatisticsItem: {
|
|
569
|
+
content_id: string;
|
|
570
|
+
title: string;
|
|
571
|
+
total_sales: number;
|
|
572
|
+
total_revenue_cents: number;
|
|
573
|
+
};
|
|
574
|
+
/**
|
|
575
|
+
* @description Seller-scoped buyer aggregate statistics for reporting.
|
|
576
|
+
*
|
|
577
|
+
* Prefer `buyer_ref` over any global buyer identifier.
|
|
578
|
+
*/
|
|
579
|
+
BuyerStatisticsItem: {
|
|
580
|
+
/** @description Opaque, seller-scoped identifier for a buyer (not the global user id). */
|
|
581
|
+
buyer_ref: string;
|
|
582
|
+
/** @description Number of completed purchases by this buyer for this seller. */
|
|
583
|
+
purchases_count: number;
|
|
584
|
+
/** @description Total amount spent by this buyer for this seller, in cents. */
|
|
585
|
+
total_spent_cents: number;
|
|
586
|
+
/**
|
|
587
|
+
* Format: date-time
|
|
588
|
+
* @description Timestamp of the buyer's first completed purchase for this seller.
|
|
589
|
+
*/
|
|
590
|
+
first_purchase_at: string;
|
|
591
|
+
/**
|
|
592
|
+
* Format: date-time
|
|
593
|
+
* @description Timestamp of the buyer's most recent completed purchase for this seller.
|
|
594
|
+
*/
|
|
595
|
+
last_purchase_at: string;
|
|
596
|
+
/**
|
|
597
|
+
* @description Coarse segmentation label derived by the platform.
|
|
598
|
+
* @enum {string}
|
|
599
|
+
*/
|
|
600
|
+
buyer_status: 'new' | 'repeat' | 'inactive';
|
|
601
|
+
};
|
|
602
|
+
AhoyEvent: {
|
|
603
|
+
/** @description Name of the event being tracked */
|
|
604
|
+
name?: string;
|
|
605
|
+
/** @description Additional properties for the event */
|
|
606
|
+
properties?: {
|
|
607
|
+
[key: string]: unknown;
|
|
608
|
+
};
|
|
609
|
+
/**
|
|
610
|
+
* Format: date-time
|
|
611
|
+
* @description When the event occurred
|
|
612
|
+
*/
|
|
613
|
+
time?: string;
|
|
614
|
+
/**
|
|
615
|
+
* Format: uuid
|
|
616
|
+
* @description ID of the user associated with the event
|
|
617
|
+
*/
|
|
618
|
+
user_id?: string;
|
|
619
|
+
/**
|
|
620
|
+
* Format: uuid
|
|
621
|
+
* @description ID of the visit associated with the event
|
|
622
|
+
*/
|
|
623
|
+
visit_id?: string;
|
|
624
|
+
};
|
|
625
|
+
AhoyVisit: {
|
|
626
|
+
/** @description Unique token for this visit */
|
|
627
|
+
visit_token?: string;
|
|
628
|
+
/** @description Token identifying the visitor */
|
|
629
|
+
visitor_token?: string;
|
|
630
|
+
/**
|
|
631
|
+
* Format: uuid
|
|
632
|
+
* @description ID of the user associated with the visit
|
|
633
|
+
*/
|
|
634
|
+
user_id?: string;
|
|
635
|
+
/** @description IP address of the visitor */
|
|
636
|
+
ip?: string;
|
|
637
|
+
/** @description User agent string */
|
|
638
|
+
user_agent?: string;
|
|
639
|
+
/** @description Referrer URL */
|
|
640
|
+
referrer?: string;
|
|
641
|
+
/** @description Domain of the referrer */
|
|
642
|
+
referring_domain?: string;
|
|
643
|
+
/** @description Landing page URL */
|
|
644
|
+
landing_page?: string;
|
|
645
|
+
/** @description Browser name */
|
|
646
|
+
browser?: string;
|
|
647
|
+
/** @description Operating system */
|
|
648
|
+
os?: string;
|
|
649
|
+
/** @description Type of device */
|
|
650
|
+
device_type?: string;
|
|
651
|
+
/** @description Country of the visitor */
|
|
652
|
+
country?: string;
|
|
653
|
+
/** @description Region of the visitor */
|
|
654
|
+
region?: string;
|
|
655
|
+
/** @description City of the visitor */
|
|
656
|
+
city?: string;
|
|
657
|
+
/**
|
|
658
|
+
* Format: float
|
|
659
|
+
* @description Latitude coordinate
|
|
660
|
+
*/
|
|
661
|
+
latitude?: number;
|
|
662
|
+
/**
|
|
663
|
+
* Format: float
|
|
664
|
+
* @description Longitude coordinate
|
|
665
|
+
*/
|
|
666
|
+
longitude?: number;
|
|
667
|
+
/** @description UTM source parameter */
|
|
668
|
+
utm_source?: string;
|
|
669
|
+
/** @description UTM medium parameter */
|
|
670
|
+
utm_medium?: string;
|
|
671
|
+
/** @description UTM term parameter */
|
|
672
|
+
utm_term?: string;
|
|
673
|
+
/** @description UTM content parameter */
|
|
674
|
+
utm_content?: string;
|
|
675
|
+
/** @description UTM campaign parameter */
|
|
676
|
+
utm_campaign?: string;
|
|
677
|
+
/** @description App version (for native apps) */
|
|
678
|
+
app_version?: string;
|
|
679
|
+
/** @description OS version (for native apps) */
|
|
680
|
+
os_version?: string;
|
|
681
|
+
/** @description Platform (for native apps) */
|
|
682
|
+
platform?: string;
|
|
683
|
+
/**
|
|
684
|
+
* Format: date-time
|
|
685
|
+
* @description When the visit started
|
|
686
|
+
*/
|
|
687
|
+
started_at?: string;
|
|
688
|
+
};
|
|
689
|
+
AhoyEventRequest: {
|
|
690
|
+
/** @description Name of the event being tracked */
|
|
691
|
+
name: string;
|
|
692
|
+
/** @description Additional properties for the event */
|
|
693
|
+
properties?: {
|
|
694
|
+
[key: string]: unknown;
|
|
695
|
+
};
|
|
696
|
+
/**
|
|
697
|
+
* Format: date-time
|
|
698
|
+
* @description When the event occurred (defaults to current time)
|
|
699
|
+
*/
|
|
700
|
+
time?: string;
|
|
701
|
+
/**
|
|
702
|
+
* Format: uuid
|
|
703
|
+
* @description ID of the user associated with the event
|
|
704
|
+
*/
|
|
705
|
+
user_id?: string;
|
|
706
|
+
/**
|
|
707
|
+
* Format: uuid
|
|
708
|
+
* @description ID of the visit associated with the event
|
|
709
|
+
*/
|
|
710
|
+
visit_id?: string;
|
|
711
|
+
};
|
|
712
|
+
AhoyVisitRequest: {
|
|
713
|
+
/** @description Unique token for this visit */
|
|
714
|
+
visit_token?: string;
|
|
715
|
+
/** @description Token identifying the visitor */
|
|
716
|
+
visitor_token?: string;
|
|
717
|
+
/**
|
|
718
|
+
* Format: uuid
|
|
719
|
+
* @description ID of the user associated with the visit
|
|
720
|
+
*/
|
|
721
|
+
user_id?: string;
|
|
722
|
+
/** @description IP address of the visitor */
|
|
723
|
+
ip?: string;
|
|
724
|
+
/** @description User agent string */
|
|
725
|
+
user_agent?: string;
|
|
726
|
+
/** @description Referrer URL */
|
|
727
|
+
referrer?: string;
|
|
728
|
+
/** @description Domain of the referrer */
|
|
729
|
+
referring_domain?: string;
|
|
730
|
+
/** @description Landing page URL */
|
|
731
|
+
landing_page?: string;
|
|
732
|
+
/** @description Browser name */
|
|
733
|
+
browser?: string;
|
|
734
|
+
/** @description Operating system */
|
|
735
|
+
os?: string;
|
|
736
|
+
/** @description Type of device */
|
|
737
|
+
device_type?: string;
|
|
738
|
+
/** @description Country of the visitor */
|
|
739
|
+
country?: string;
|
|
740
|
+
/** @description Region of the visitor */
|
|
741
|
+
region?: string;
|
|
742
|
+
/** @description City of the visitor */
|
|
743
|
+
city?: string;
|
|
744
|
+
/**
|
|
745
|
+
* Format: float
|
|
746
|
+
* @description Latitude coordinate
|
|
747
|
+
*/
|
|
748
|
+
latitude?: number;
|
|
749
|
+
/**
|
|
750
|
+
* Format: float
|
|
751
|
+
* @description Longitude coordinate
|
|
752
|
+
*/
|
|
753
|
+
longitude?: number;
|
|
754
|
+
/** @description UTM source parameter */
|
|
755
|
+
utm_source?: string;
|
|
756
|
+
/** @description UTM medium parameter */
|
|
757
|
+
utm_medium?: string;
|
|
758
|
+
/** @description UTM term parameter */
|
|
759
|
+
utm_term?: string;
|
|
760
|
+
/** @description UTM content parameter */
|
|
761
|
+
utm_content?: string;
|
|
762
|
+
/** @description UTM campaign parameter */
|
|
763
|
+
utm_campaign?: string;
|
|
764
|
+
/** @description App version (for native apps) */
|
|
765
|
+
app_version?: string;
|
|
766
|
+
/** @description OS version (for native apps) */
|
|
767
|
+
os_version?: string;
|
|
768
|
+
/** @description Platform (for native apps) */
|
|
769
|
+
platform?: string;
|
|
770
|
+
/**
|
|
771
|
+
* Format: date-time
|
|
772
|
+
* @description When the visit started (defaults to current time)
|
|
773
|
+
*/
|
|
774
|
+
started_at?: string;
|
|
775
|
+
};
|
|
776
|
+
/** @description Create request body for content. Required fields vary by `content_type`: `markdown` requires `content_body`; `external_ref` requires `content_uri`. */
|
|
777
|
+
Content: {
|
|
778
|
+
/**
|
|
779
|
+
* @description The type of content being created.
|
|
780
|
+
* @enum {string}
|
|
781
|
+
*/
|
|
782
|
+
content_type: 'markdown' | 'external_ref';
|
|
783
|
+
/** @description Content title */
|
|
784
|
+
title: string;
|
|
785
|
+
/**
|
|
786
|
+
* Format: byte
|
|
787
|
+
* @description Full article body in markdown, base64 encoded. Required when `content_type` is `markdown`.
|
|
788
|
+
*/
|
|
789
|
+
content_body?: string;
|
|
790
|
+
/**
|
|
791
|
+
* @description URI of the external resource (Vimeo, YouTube, PDF, etc.). Required when `content_type` is `external_ref`.
|
|
792
|
+
* @example https://vimeo.com/123456789
|
|
793
|
+
*/
|
|
794
|
+
content_uri?: string;
|
|
795
|
+
/**
|
|
796
|
+
* @description Optional namespaced platform ID, e.g. `vimeo:123456789` or `youtube:dQw4w9WgXcQ`.
|
|
797
|
+
* @example vimeo:123456789
|
|
798
|
+
*/
|
|
799
|
+
external_identifier?: string;
|
|
800
|
+
/**
|
|
801
|
+
* Format: byte
|
|
802
|
+
* @description (Optional) Article teaser, written in markdown and base64 encoded.
|
|
803
|
+
*/
|
|
804
|
+
teaser?: string;
|
|
805
|
+
/** @description Price for the content in cents. */
|
|
806
|
+
price_cents: number;
|
|
807
|
+
/**
|
|
808
|
+
* @default public
|
|
809
|
+
* @enum {string}
|
|
810
|
+
*/
|
|
811
|
+
visibility: 'public' | 'unlisted';
|
|
812
|
+
/** @description Flexible metadata for additional context */
|
|
813
|
+
metadata?: {
|
|
814
|
+
author?: string;
|
|
815
|
+
/** Format: date-time */
|
|
816
|
+
publication_date?: string;
|
|
817
|
+
reading_time?: string;
|
|
818
|
+
} & {
|
|
819
|
+
[key: string]: unknown;
|
|
820
|
+
};
|
|
821
|
+
};
|
|
822
|
+
/** @description Response shape for a single content item. The presence of `content_body` vs `content_uri` depends on `content_type`: `markdown` includes `content_body`; `external_ref` includes `content_uri` (the external URI) and optionally `external_identifier`. */
|
|
823
|
+
ContentResponse: {
|
|
824
|
+
id: string;
|
|
825
|
+
/**
|
|
826
|
+
* @description The type of content.
|
|
827
|
+
* @enum {string}
|
|
828
|
+
*/
|
|
829
|
+
content_type: 'markdown' | 'external_ref';
|
|
830
|
+
/** @description Content title */
|
|
831
|
+
title: string;
|
|
832
|
+
/**
|
|
833
|
+
* Format: byte
|
|
834
|
+
* @description Full article body in markdown, base64 encoded. Present when `content_type` is `markdown`.
|
|
835
|
+
*/
|
|
836
|
+
content_body?: string | null;
|
|
837
|
+
/**
|
|
838
|
+
* @description URI of the external resource. Present when `content_type` is `external_ref`.
|
|
839
|
+
* @example https://vimeo.com/123456789
|
|
840
|
+
*/
|
|
841
|
+
content_uri?: string | null;
|
|
842
|
+
/**
|
|
843
|
+
* @description Namespaced platform ID, e.g. `vimeo:123456789`. Present on `external_ref` content.
|
|
844
|
+
* @example vimeo:123456789
|
|
845
|
+
*/
|
|
846
|
+
external_identifier?: string | null;
|
|
847
|
+
/**
|
|
848
|
+
* Format: byte
|
|
849
|
+
* @description Article teaser, base64 encoded.
|
|
850
|
+
*/
|
|
851
|
+
teaser: string;
|
|
852
|
+
/** @description Price for the content in cents. */
|
|
853
|
+
price_cents: number;
|
|
854
|
+
/**
|
|
855
|
+
* @default public
|
|
856
|
+
* @enum {string}
|
|
857
|
+
*/
|
|
858
|
+
visibility: 'public' | 'unlisted' | 'private';
|
|
859
|
+
/** @description Flexible metadata for additional context */
|
|
860
|
+
metadata?: {
|
|
861
|
+
author?: string;
|
|
862
|
+
/** Format: date-time */
|
|
863
|
+
publication_date?: string;
|
|
864
|
+
reading_time?: string;
|
|
865
|
+
/** Format: string */
|
|
866
|
+
tags?: unknown[];
|
|
867
|
+
/** @description flexible data for managing paywall location */
|
|
868
|
+
paywall?: {
|
|
869
|
+
/** @description Character position of the paywall */
|
|
870
|
+
position?: number;
|
|
871
|
+
/**
|
|
872
|
+
* @description The mechanism for determining how positioning is calculated
|
|
873
|
+
* @enum {string}
|
|
874
|
+
*/
|
|
875
|
+
positioning_type?: 'character' | 'paragraph';
|
|
876
|
+
/** @description Hash anchor of nearby text */
|
|
877
|
+
anchor?: string;
|
|
878
|
+
};
|
|
879
|
+
} & {
|
|
880
|
+
[key: string]: unknown;
|
|
881
|
+
};
|
|
882
|
+
};
|
|
883
|
+
/** @description Lightweight content representation returned by list and search endpoints. Omits body fields to keep list payloads small. Use the detail endpoint (`GET /v1/merchant/:store_id/content/:id`) to retrieve the full body or URI. */
|
|
884
|
+
ContentListItem: {
|
|
885
|
+
id: string;
|
|
886
|
+
/** @enum {string} */
|
|
887
|
+
content_type: 'markdown' | 'external_ref';
|
|
888
|
+
title: string;
|
|
889
|
+
price_cents: number;
|
|
890
|
+
/**
|
|
891
|
+
* Format: byte
|
|
892
|
+
* @description Article teaser, base64 encoded. Null when not set.
|
|
893
|
+
*/
|
|
894
|
+
teaser: string | null;
|
|
895
|
+
/** @enum {string} */
|
|
896
|
+
visibility: 'public' | 'unlisted' | 'private';
|
|
897
|
+
/** Format: date-time */
|
|
898
|
+
created_at: string;
|
|
899
|
+
/** @description Namespaced platform ID for `external_ref` content. Null for other types. */
|
|
900
|
+
external_identifier?: string | null;
|
|
901
|
+
};
|
|
902
|
+
/**
|
|
903
|
+
* @description Full content detail plus real-time access and wallet context for a specific user. Returned by the buyer-facing `GET /v1/content/:id/with-access` endpoint.
|
|
904
|
+
*
|
|
905
|
+
* **URI gating for `external_ref` content:** `content_uri` (the external URI) is only present in the response when `access_info.has_purchased` is `true`. For all other states (unauthenticated, insufficient funds, not yet purchased) it is omitted, ensuring buyers cannot access the Vimeo link, PDF URI, or other external resource without completing a purchase.
|
|
906
|
+
*/
|
|
907
|
+
ContentWithAccessResponse: components['schemas']['ContentResponse'] & {
|
|
908
|
+
access_info: components['schemas']['ContentAccessInfo'];
|
|
909
|
+
};
|
|
910
|
+
User: {
|
|
911
|
+
id?: string;
|
|
912
|
+
name?: string;
|
|
913
|
+
email?: string;
|
|
914
|
+
/** @enum {string} */
|
|
915
|
+
role?: 'buyer' | 'seller';
|
|
916
|
+
};
|
|
917
|
+
/** @enum {string} */
|
|
918
|
+
PurchaseStatus: 'completed' | 'refunded' | 'pending' | 'reverted' | 'failed';
|
|
919
|
+
PurchaseResponse: {
|
|
920
|
+
id: string;
|
|
921
|
+
content_id: string;
|
|
922
|
+
content: {
|
|
923
|
+
id: string;
|
|
924
|
+
content_type: string;
|
|
925
|
+
title: string;
|
|
926
|
+
};
|
|
927
|
+
buyer_id: string;
|
|
928
|
+
buyer: {
|
|
929
|
+
id: string;
|
|
930
|
+
name: string;
|
|
931
|
+
};
|
|
932
|
+
seller_id: string;
|
|
933
|
+
seller: {
|
|
934
|
+
id: string;
|
|
935
|
+
name: string;
|
|
936
|
+
};
|
|
937
|
+
amount_cents: number;
|
|
938
|
+
/** Format: date-time */
|
|
939
|
+
timestamp: string;
|
|
940
|
+
status: components['schemas']['PurchaseStatus'];
|
|
941
|
+
};
|
|
942
|
+
MerchantSaleResponse: {
|
|
943
|
+
id: string;
|
|
944
|
+
content_id: string;
|
|
945
|
+
content: {
|
|
946
|
+
id: string;
|
|
947
|
+
content_type: string;
|
|
948
|
+
title: string;
|
|
949
|
+
};
|
|
950
|
+
buyer_id: string;
|
|
951
|
+
buyer: {
|
|
952
|
+
id: string;
|
|
953
|
+
name: string;
|
|
954
|
+
};
|
|
955
|
+
seller_id: string;
|
|
956
|
+
seller: {
|
|
957
|
+
id: string;
|
|
958
|
+
name: string;
|
|
959
|
+
};
|
|
960
|
+
amount_cents: number;
|
|
961
|
+
/** @description Platform fee split. Values are 0 (not null) on non-completed purchases. */
|
|
962
|
+
fees: {
|
|
963
|
+
platform_fee_cents: number;
|
|
964
|
+
store_net_cents: number;
|
|
965
|
+
/** @description 0 for content without an author */
|
|
966
|
+
author_net_cents: number;
|
|
967
|
+
};
|
|
968
|
+
status: components['schemas']['PurchaseStatus'];
|
|
969
|
+
/** Format: date-time */
|
|
970
|
+
timestamp: string;
|
|
971
|
+
};
|
|
972
|
+
MonthlyData: {
|
|
973
|
+
[key: string]: {
|
|
974
|
+
[key: string]: {
|
|
975
|
+
cents?: number;
|
|
976
|
+
currency_iso?: string;
|
|
977
|
+
};
|
|
978
|
+
};
|
|
979
|
+
};
|
|
980
|
+
InviteInfoResponse: {
|
|
981
|
+
invited_email: string;
|
|
982
|
+
store_name: string;
|
|
983
|
+
/** @enum {string|null} */
|
|
984
|
+
role: 'owner' | null;
|
|
985
|
+
/** Format: date-time */
|
|
986
|
+
expires_at: string;
|
|
987
|
+
};
|
|
988
|
+
CheckoutStateResponse: {
|
|
989
|
+
content_id: string;
|
|
990
|
+
content_title: string;
|
|
991
|
+
price_cents: number;
|
|
992
|
+
checkout_state: {
|
|
993
|
+
is_authenticated: boolean;
|
|
994
|
+
has_sufficient_funds?: boolean | null;
|
|
995
|
+
has_purchased: boolean;
|
|
996
|
+
/** @enum {string} */
|
|
997
|
+
next_required_action: 'authenticate' | 'fund_wallet' | 'purchase' | 'view_content';
|
|
998
|
+
};
|
|
999
|
+
};
|
|
1000
|
+
WalletPaymentStatusResponse: {
|
|
1001
|
+
/** @enum {string} */
|
|
1002
|
+
status: 'pending' | 'completed' | 'failed';
|
|
1003
|
+
/** Format: date-time */
|
|
1004
|
+
updated_at: string;
|
|
1005
|
+
balance_cents: number;
|
|
1006
|
+
};
|
|
1007
|
+
SalesSummaryResponse: {
|
|
1008
|
+
/** @description Amount in cents */
|
|
1009
|
+
total_revenue_cents: number;
|
|
1010
|
+
/** @description Total number of sales */
|
|
1011
|
+
total_sales: number;
|
|
1012
|
+
/** @description Monthly revenue data grouped by year and month. First level key is year (string), second level key is month number (string, 1-12) */
|
|
1013
|
+
monthly_revenue_cents: {
|
|
1014
|
+
[key: string]: {
|
|
1015
|
+
[key: string]: number;
|
|
1016
|
+
};
|
|
1017
|
+
};
|
|
1018
|
+
/** @description Monthly sales count data grouped by year and month. First level key is year (string), second level key is month number (string, 1-12) */
|
|
1019
|
+
monthly_sales: {
|
|
1020
|
+
[key: string]: {
|
|
1021
|
+
[key: string]: number;
|
|
1022
|
+
};
|
|
1023
|
+
};
|
|
1024
|
+
};
|
|
1025
|
+
};
|
|
1026
|
+
responses: never;
|
|
1027
|
+
parameters: never;
|
|
1028
|
+
requestBodies: never;
|
|
1029
|
+
headers: never;
|
|
1030
|
+
pathItems: never;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/** Checkout state for a specific piece of content and user. */
|
|
1034
|
+
export declare type ContentAccessInfo = components['schemas']['ContentAccessInfo'];
|
|
1035
|
+
|
|
1036
|
+
/** A piece of content with buyer access information. */
|
|
1037
|
+
export declare type ContentWithAccessResponse = components['schemas']['ContentWithAccessResponse'];
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* Thrown when the authenticated user does not have permission
|
|
1041
|
+
* to perform the requested operation.
|
|
1042
|
+
*/
|
|
1043
|
+
export declare class ForbiddenError extends LedewireError {
|
|
1044
|
+
constructor(message: string, code?: number);
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* Core HTTP client used by all SDK packages.
|
|
1049
|
+
*
|
|
1050
|
+
* Features:
|
|
1051
|
+
* - Injects `Authorization: Bearer <token>` headers automatically
|
|
1052
|
+
* - Maps HTTP error responses to typed `LedewireError` subclasses
|
|
1053
|
+
* - On receiving a 401, calls `onUnauthorized` once and retries the request
|
|
1054
|
+
*
|
|
1055
|
+
* This is an internal class - consumers should use the
|
|
1056
|
+
* package-level client factories (`init` / `createClient`) instead.
|
|
1057
|
+
*/
|
|
1058
|
+
declare class HttpClient {
|
|
1059
|
+
private readonly baseUrl;
|
|
1060
|
+
private readonly getAccessToken;
|
|
1061
|
+
private readonly onUnauthorized;
|
|
1062
|
+
constructor(config?: HttpClientConfig);
|
|
1063
|
+
/**
|
|
1064
|
+
* GET request with optional query parameters.
|
|
1065
|
+
* @param path - API path (e.g. `/v1/wallet/balance`)
|
|
1066
|
+
* @param params - Query string parameters
|
|
1067
|
+
*/
|
|
1068
|
+
get<T>(path: string, params?: Record<string, string>): Promise<T>;
|
|
1069
|
+
/**
|
|
1070
|
+
* POST request.
|
|
1071
|
+
* @param path - API path
|
|
1072
|
+
* @param body - Request body (JSON-serialized)
|
|
1073
|
+
*/
|
|
1074
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
1075
|
+
/**
|
|
1076
|
+
* PUT request.
|
|
1077
|
+
* @param path - API path
|
|
1078
|
+
* @param body - Request body (JSON-serialized)
|
|
1079
|
+
*/
|
|
1080
|
+
put<T>(path: string, body?: unknown): Promise<T>;
|
|
1081
|
+
/**
|
|
1082
|
+
* PATCH request.
|
|
1083
|
+
* @param path - API path
|
|
1084
|
+
* @param body - Partial update body (JSON-serialized)
|
|
1085
|
+
*/
|
|
1086
|
+
patch<T>(path: string, body?: unknown): Promise<T>;
|
|
1087
|
+
/**
|
|
1088
|
+
* DELETE request.
|
|
1089
|
+
* @param path - API path
|
|
1090
|
+
*/
|
|
1091
|
+
delete<T = void>(path: string): Promise<T>;
|
|
1092
|
+
private buildUrl;
|
|
1093
|
+
private request;
|
|
1094
|
+
private throwApiError;
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
/**
|
|
1098
|
+
* Configuration options for `HttpClient`.
|
|
1099
|
+
*/
|
|
1100
|
+
declare interface HttpClientConfig {
|
|
1101
|
+
/** API base URL. Defaults to the production API. */
|
|
1102
|
+
baseUrl?: string;
|
|
1103
|
+
/**
|
|
1104
|
+
* Returns the current access token (or null) before each request.
|
|
1105
|
+
* If null, requests are sent without an Authorization header.
|
|
1106
|
+
*/
|
|
1107
|
+
getAccessToken?: () => string | null | Promise<string | null>;
|
|
1108
|
+
/**
|
|
1109
|
+
* Called when a 401 is received on the first attempt.
|
|
1110
|
+
* Should refresh and return the new access token, or null to propagate
|
|
1111
|
+
* an `AuthError` to the caller.
|
|
1112
|
+
*/
|
|
1113
|
+
onUnauthorized?: () => string | null | Promise<string | null>;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* Initialises a LedeWire browser client.
|
|
1118
|
+
* This is the primary entry point for the browser SDK.
|
|
1119
|
+
*
|
|
1120
|
+
* @example CDN usage:
|
|
1121
|
+
* ```html
|
|
1122
|
+
* <script src="https://cdn.jsdelivr.net/npm/@ledewire/browser@1/dist/ledewire.min.js"></script>
|
|
1123
|
+
* <script>
|
|
1124
|
+
* const lw = Ledewire.init({ apiKey: 'your_api_key' })
|
|
1125
|
+
* const state = await lw.checkout.state('content-id')
|
|
1126
|
+
* </script>
|
|
1127
|
+
* ```
|
|
1128
|
+
*
|
|
1129
|
+
* @example npm usage:
|
|
1130
|
+
* ```ts
|
|
1131
|
+
* import { init } from '@ledewire/browser'
|
|
1132
|
+
* const lw = init({ apiKey: 'your_api_key' })
|
|
1133
|
+
* ```
|
|
1134
|
+
*/
|
|
1135
|
+
export declare function init(config: BrowserClientConfig): BrowserClient;
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* Base error class for all LedeWire SDK errors.
|
|
1139
|
+
* All errors thrown by the SDK are instances of this class,
|
|
1140
|
+
* making it safe to use `err instanceof LedewireError` as a type guard.
|
|
1141
|
+
*
|
|
1142
|
+
* @example
|
|
1143
|
+
* ```ts
|
|
1144
|
+
* try {
|
|
1145
|
+
* await client.purchases.create({ contentId: '...' })
|
|
1146
|
+
* } catch (err) {
|
|
1147
|
+
* if (err instanceof LedewireError) {
|
|
1148
|
+
* console.error(err.statusCode, err.message)
|
|
1149
|
+
* }
|
|
1150
|
+
* }
|
|
1151
|
+
* ```
|
|
1152
|
+
*/
|
|
1153
|
+
export declare class LedewireError extends Error {
|
|
1154
|
+
/** HTTP status code returned by the API (e.g. 400, 401, 404, 422). */
|
|
1155
|
+
readonly statusCode: number;
|
|
1156
|
+
/** Machine-readable error code from the API error body, if present. */
|
|
1157
|
+
readonly code: number | undefined;
|
|
1158
|
+
constructor(message: string, statusCode: number, code?: number);
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
/**
|
|
1162
|
+
* A {@link TokenStorage} adapter that persists tokens in `localStorage`.
|
|
1163
|
+
*
|
|
1164
|
+
* Tokens survive page reloads and browser restarts, which is convenient
|
|
1165
|
+
* for sites where users expect persistent sessions.
|
|
1166
|
+
*
|
|
1167
|
+
* **Security note:** `localStorage` is accessible to any JavaScript on the
|
|
1168
|
+
* same origin. Only use this adapter on sites you fully control and trust.
|
|
1169
|
+
* The default in-memory storage is safer for high-security use cases.
|
|
1170
|
+
*
|
|
1171
|
+
* @param key - The `localStorage` key used to store tokens.
|
|
1172
|
+
* Defaults to `'lw:tokens'`. Override this if you have multiple
|
|
1173
|
+
* LedeWire integrations on the same origin.
|
|
1174
|
+
*
|
|
1175
|
+
* @example
|
|
1176
|
+
* ```ts
|
|
1177
|
+
* import { init, localStorageAdapter } from '@ledewire/browser'
|
|
1178
|
+
*
|
|
1179
|
+
* const lw = init({
|
|
1180
|
+
* apiKey: 'your_api_key',
|
|
1181
|
+
* storage: localStorageAdapter(),
|
|
1182
|
+
* })
|
|
1183
|
+
* ```
|
|
1184
|
+
*/
|
|
1185
|
+
export declare function localStorageAdapter(key?: string): TokenStorage;
|
|
1186
|
+
|
|
1187
|
+
/**
|
|
1188
|
+
* In-memory token storage (default for both packages).
|
|
1189
|
+
* Tokens are cleared when the page unloads or the process exits.
|
|
1190
|
+
* This is the most secure default for browser environments.
|
|
1191
|
+
*/
|
|
1192
|
+
export declare class MemoryTokenStorage implements TokenStorage {
|
|
1193
|
+
private tokens;
|
|
1194
|
+
getTokens(): StoredTokens | null;
|
|
1195
|
+
setTokens(tokens: StoredTokens): void;
|
|
1196
|
+
clearTokens(): void;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
/** The next action a buyer must take in the checkout flow. */
|
|
1200
|
+
export declare type NextRequiredAction = ContentAccessInfo['next_required_action'];
|
|
1201
|
+
|
|
1202
|
+
/**
|
|
1203
|
+
* Thrown when the requested resource does not exist.
|
|
1204
|
+
*/
|
|
1205
|
+
export declare class NotFoundError extends LedewireError {
|
|
1206
|
+
constructor(message: string, code?: number);
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
/**
|
|
1210
|
+
* Converts an `expires_at` ISO 8601 string from an API auth response
|
|
1211
|
+
* into a Unix timestamp (milliseconds) for use in `StoredTokens.expiresAt`.
|
|
1212
|
+
*
|
|
1213
|
+
* @param expiresAt - ISO 8601 datetime string, e.g. `"2026-01-01T12:00:00Z"`
|
|
1214
|
+
* @returns Unix timestamp in milliseconds
|
|
1215
|
+
*/
|
|
1216
|
+
export declare function parseExpiresAt(expiresAt: string): number;
|
|
1217
|
+
|
|
1218
|
+
/** Request body for creating a purchase. */
|
|
1219
|
+
export declare type PurchaseCreateRequest = components['schemas']['PurchaseCreateRequest'];
|
|
1220
|
+
|
|
1221
|
+
/**
|
|
1222
|
+
* Thrown when the purchase cannot be completed due to a validation
|
|
1223
|
+
* failure, such as a price mismatch or a duplicate purchase.
|
|
1224
|
+
*/
|
|
1225
|
+
export declare class PurchaseError extends LedewireError {
|
|
1226
|
+
constructor(message: string, statusCode: number, code?: number);
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
/** A purchase record. */
|
|
1230
|
+
export declare type PurchaseResponse = components['schemas']['PurchaseResponse'];
|
|
1231
|
+
|
|
1232
|
+
/** Internal representation of stored authentication tokens. */
|
|
1233
|
+
export declare interface StoredTokens {
|
|
1234
|
+
accessToken: string;
|
|
1235
|
+
refreshToken: string;
|
|
1236
|
+
/** Unix timestamp (ms) when the access token expires. */
|
|
1237
|
+
expiresAt: number;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* Manages the JWT token lifecycle transparently.
|
|
1242
|
+
*
|
|
1243
|
+
* - Proactively refreshes the access token when it expires within 60 seconds
|
|
1244
|
+
* - Handles reactive refresh on 401 responses from the HTTP client
|
|
1245
|
+
* - Deduplicates concurrent refresh calls (only one in-flight refresh at a time)
|
|
1246
|
+
* - Fires `onAuthExpired` when refresh fails so the UI can prompt re-login
|
|
1247
|
+
*
|
|
1248
|
+
* This is an internal class - use the package-level client factories instead.
|
|
1249
|
+
*/
|
|
1250
|
+
declare class TokenManager {
|
|
1251
|
+
private readonly storage;
|
|
1252
|
+
private readonly refreshFn;
|
|
1253
|
+
private readonly onTokenRefreshed;
|
|
1254
|
+
private readonly onAuthExpired;
|
|
1255
|
+
private refreshPromise;
|
|
1256
|
+
constructor(options: TokenManagerOptions);
|
|
1257
|
+
/**
|
|
1258
|
+
* Returns a valid access token, refreshing proactively if needed.
|
|
1259
|
+
* Returns `null` if no tokens are stored (user not authenticated).
|
|
1260
|
+
*/
|
|
1261
|
+
getAccessToken(): Promise<string | null>;
|
|
1262
|
+
/**
|
|
1263
|
+
* Called by `HttpClient` when a 401 is received.
|
|
1264
|
+
* Attempts one refresh; returns the new access token or null.
|
|
1265
|
+
*/
|
|
1266
|
+
handleUnauthorized(): Promise<string | null>;
|
|
1267
|
+
/** Store new tokens after a successful login or signup. */
|
|
1268
|
+
setTokens(tokens: StoredTokens): Promise<void>;
|
|
1269
|
+
/** Clear all stored tokens (call on logout). */
|
|
1270
|
+
clearTokens(): Promise<void>;
|
|
1271
|
+
private performRefresh;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
/**
|
|
1275
|
+
* Options for constructing a `TokenManager`.
|
|
1276
|
+
*/
|
|
1277
|
+
declare interface TokenManagerOptions {
|
|
1278
|
+
storage: TokenStorage;
|
|
1279
|
+
/**
|
|
1280
|
+
* Exchanges a refresh token for a new token pair.
|
|
1281
|
+
* Implemented by each package's client factory using the
|
|
1282
|
+
* `/v1/auth/token/refresh` endpoint.
|
|
1283
|
+
*/
|
|
1284
|
+
refreshFn: (refreshToken: string) => Promise<StoredTokens>;
|
|
1285
|
+
/**
|
|
1286
|
+
* Called after a successful token refresh.
|
|
1287
|
+
* Use in server environments to persist the new tokens to a database or cache.
|
|
1288
|
+
*
|
|
1289
|
+
* @example
|
|
1290
|
+
* ```ts
|
|
1291
|
+
* onTokenRefreshed: async (tokens) => {
|
|
1292
|
+
* await redis.set('session:tokens', JSON.stringify(tokens))
|
|
1293
|
+
* }
|
|
1294
|
+
* ```
|
|
1295
|
+
*/
|
|
1296
|
+
onTokenRefreshed?: (tokens: StoredTokens) => void | Promise<void>;
|
|
1297
|
+
/**
|
|
1298
|
+
* Called when a refresh attempt fails and the user must re-authenticate.
|
|
1299
|
+
* Typically used to redirect to login or emit a UI event.
|
|
1300
|
+
*
|
|
1301
|
+
* @example
|
|
1302
|
+
* ```ts
|
|
1303
|
+
* onAuthExpired: () => { window.location.href = '/login' }
|
|
1304
|
+
* ```
|
|
1305
|
+
*/
|
|
1306
|
+
onAuthExpired?: () => void | Promise<void>;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
/**
|
|
1310
|
+
* Interface for pluggable token storage adapters.
|
|
1311
|
+
* Implement this to persist tokens across page loads or in a server-side store.
|
|
1312
|
+
*
|
|
1313
|
+
* @example
|
|
1314
|
+
* ```ts
|
|
1315
|
+
* // Built-in localStorage adapter (browser only)
|
|
1316
|
+
* import { localStorageAdapter } from '@ledewire/browser'
|
|
1317
|
+
* const client = createBrowserClient({ apiKey, storage: localStorageAdapter() })
|
|
1318
|
+
* ```
|
|
1319
|
+
*/
|
|
1320
|
+
export declare interface TokenStorage {
|
|
1321
|
+
/** Retrieve stored token data, or null if none. */
|
|
1322
|
+
getTokens(): StoredTokens | null | Promise<StoredTokens | null>;
|
|
1323
|
+
/** Persist token data. */
|
|
1324
|
+
setTokens(tokens: StoredTokens): void | Promise<void>;
|
|
1325
|
+
/** Clear all stored token data (called on logout). */
|
|
1326
|
+
clearTokens(): void | Promise<void>;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
/** Current wallet balance for the authenticated buyer. */
|
|
1330
|
+
export declare type WalletBalanceResponse = components['schemas']['WalletBalanceResponse'];
|
|
1331
|
+
|
|
1332
|
+
/** Request body for creating a wallet payment session. */
|
|
1333
|
+
export declare type WalletPaymentSessionRequest = components['schemas']['WalletPaymentSessionRequest'];
|
|
1334
|
+
|
|
1335
|
+
/** Response from creating a wallet payment session. */
|
|
1336
|
+
export declare type WalletPaymentSessionResponse = components['schemas']['WalletPaymentSessionResponse'];
|
|
1337
|
+
|
|
1338
|
+
/** Status of a wallet payment session. */
|
|
1339
|
+
export declare type WalletPaymentStatusResponse = components['schemas']['WalletPaymentStatusResponse'];
|
|
1340
|
+
|
|
1341
|
+
/** A single wallet transaction entry. */
|
|
1342
|
+
export declare type WalletTransactionItem = components['schemas']['WalletTransactionItem'];
|
|
1343
|
+
|
|
1344
|
+
export { }
|