bitsnap-react 1.4.15 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +153 -0
- package/dist/chunk-O4ICBP4G.mjs +2 -0
- package/dist/chunk-O4ICBP4G.mjs.map +1 -0
- package/dist/chunk-U6FLIRIV.mjs +2 -0
- package/dist/errors.d.mts +2 -0
- package/dist/errors.d.ts +2 -0
- package/dist/errors.mjs +1 -1
- package/dist/errors.mjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +464 -0
- package/dist/index.d.ts +464 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.mts +2 -0
- package/dist/internal.d.ts +2 -0
- package/dist/internal.mjs +1 -1
- package/dist/internal.mjs.map +1 -1
- package/dist/models.d.mts +592 -0
- package/dist/models.d.ts +592 -0
- package/dist/models.js +1 -1
- package/dist/models.js.map +1 -1
- package/dist/models.mjs +1 -1
- package/dist/models.mjs.map +1 -1
- package/dist/returns.d.mts +417 -0
- package/dist/returns.d.ts +417 -0
- package/dist/returns.js +2 -0
- package/dist/returns.js.map +1 -0
- package/dist/returns.mjs +2 -0
- package/dist/returns.mjs.map +1 -0
- package/package.json +48 -7
- package/dist/chunk-43KBVYBT.mjs +0 -2
- /package/dist/{chunk-43KBVYBT.mjs.map → chunk-U6FLIRIV.mjs.map} +0 -0
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
+
import { Timestamp } from '@bufbuild/protobuf/wkt';
|
|
3
|
+
import { Message } from '@bufbuild/protobuf';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @generated from enum common.v1.Environment
|
|
9
|
+
*/
|
|
10
|
+
declare enum Environment {
|
|
11
|
+
/**
|
|
12
|
+
* @generated from enum value: PRODUCTION = 0;
|
|
13
|
+
*/
|
|
14
|
+
PRODUCTION = 0,
|
|
15
|
+
/**
|
|
16
|
+
* @generated from enum value: TEST = 1;
|
|
17
|
+
*/
|
|
18
|
+
TEST = 1
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @generated from message public.v1.StartReturnSessionResponse
|
|
23
|
+
*/
|
|
24
|
+
type StartReturnSessionResponse = Message<"public.v1.StartReturnSessionResponse"> & {
|
|
25
|
+
/**
|
|
26
|
+
* @generated from field: string challenge_id = 1;
|
|
27
|
+
*/
|
|
28
|
+
challengeId: string;
|
|
29
|
+
/**
|
|
30
|
+
* @generated from field: int32 resend_after_seconds = 2;
|
|
31
|
+
*/
|
|
32
|
+
resendAfterSeconds: number;
|
|
33
|
+
/**
|
|
34
|
+
* @generated from field: string message = 3;
|
|
35
|
+
*/
|
|
36
|
+
message: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @generated from message public.v1.VerifyReturnSessionResponse
|
|
40
|
+
*/
|
|
41
|
+
type VerifyReturnSessionResponse = Message<"public.v1.VerifyReturnSessionResponse"> & {
|
|
42
|
+
/**
|
|
43
|
+
* @generated from field: string session_token = 1;
|
|
44
|
+
*/
|
|
45
|
+
sessionToken: string;
|
|
46
|
+
/**
|
|
47
|
+
* @generated from field: google.protobuf.Timestamp expires_at = 2;
|
|
48
|
+
*/
|
|
49
|
+
expiresAt?: Timestamp;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* @generated from message public.v1.ReturnOrderSummary
|
|
53
|
+
*/
|
|
54
|
+
type ReturnOrderSummary = Message<"public.v1.ReturnOrderSummary"> & {
|
|
55
|
+
/**
|
|
56
|
+
* @generated from field: string canonical_order_id = 1;
|
|
57
|
+
*/
|
|
58
|
+
canonicalOrderId: string;
|
|
59
|
+
/**
|
|
60
|
+
* @generated from field: string display_reference = 2;
|
|
61
|
+
*/
|
|
62
|
+
displayReference: string;
|
|
63
|
+
/**
|
|
64
|
+
* @generated from field: string gateway = 3;
|
|
65
|
+
*/
|
|
66
|
+
gateway: string;
|
|
67
|
+
/**
|
|
68
|
+
* @generated from field: google.protobuf.Timestamp purchased_at = 4;
|
|
69
|
+
*/
|
|
70
|
+
purchasedAt?: Timestamp;
|
|
71
|
+
/**
|
|
72
|
+
* @generated from field: int64 total_minor = 5;
|
|
73
|
+
*/
|
|
74
|
+
totalMinor: bigint;
|
|
75
|
+
/**
|
|
76
|
+
* @generated from field: string currency = 6;
|
|
77
|
+
*/
|
|
78
|
+
currency: string;
|
|
79
|
+
/**
|
|
80
|
+
* @generated from field: int32 returnable_line_count = 7;
|
|
81
|
+
*/
|
|
82
|
+
returnableLineCount: number;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* @generated from message public.v1.ListReturnOrdersResponse
|
|
86
|
+
*/
|
|
87
|
+
type ListReturnOrdersResponse = Message<"public.v1.ListReturnOrdersResponse"> & {
|
|
88
|
+
/**
|
|
89
|
+
* @generated from field: repeated public.v1.ReturnOrderSummary orders = 1;
|
|
90
|
+
*/
|
|
91
|
+
orders: ReturnOrderSummary[];
|
|
92
|
+
/**
|
|
93
|
+
* @generated from field: string next_page_token = 2;
|
|
94
|
+
*/
|
|
95
|
+
nextPageToken: string;
|
|
96
|
+
/**
|
|
97
|
+
* @generated from field: int32 total = 3;
|
|
98
|
+
*/
|
|
99
|
+
total: number;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* @generated from message public.v1.ReturnOrderLine
|
|
103
|
+
*/
|
|
104
|
+
type ReturnOrderLine = Message<"public.v1.ReturnOrderLine"> & {
|
|
105
|
+
/**
|
|
106
|
+
* @generated from field: string line_id = 1;
|
|
107
|
+
*/
|
|
108
|
+
lineId: string;
|
|
109
|
+
/**
|
|
110
|
+
* @generated from field: string product_id = 2;
|
|
111
|
+
*/
|
|
112
|
+
productId: string;
|
|
113
|
+
/**
|
|
114
|
+
* @generated from field: string variant_id = 3;
|
|
115
|
+
*/
|
|
116
|
+
variantId: string;
|
|
117
|
+
/**
|
|
118
|
+
* @generated from field: string name = 4;
|
|
119
|
+
*/
|
|
120
|
+
name: string;
|
|
121
|
+
/**
|
|
122
|
+
* @generated from field: string fulfillment_type = 5;
|
|
123
|
+
*/
|
|
124
|
+
fulfillmentType: string;
|
|
125
|
+
/**
|
|
126
|
+
* @generated from field: int32 purchased_quantity = 6;
|
|
127
|
+
*/
|
|
128
|
+
purchasedQuantity: number;
|
|
129
|
+
/**
|
|
130
|
+
* @generated from field: int32 reserved_quantity = 7;
|
|
131
|
+
*/
|
|
132
|
+
reservedQuantity: number;
|
|
133
|
+
/**
|
|
134
|
+
* @generated from field: int32 returned_quantity = 8;
|
|
135
|
+
*/
|
|
136
|
+
returnedQuantity: number;
|
|
137
|
+
/**
|
|
138
|
+
* @generated from field: int32 available_quantity = 9;
|
|
139
|
+
*/
|
|
140
|
+
availableQuantity: number;
|
|
141
|
+
/**
|
|
142
|
+
* @generated from field: int64 regular_unit_minor = 10;
|
|
143
|
+
*/
|
|
144
|
+
regularUnitMinor: bigint;
|
|
145
|
+
/**
|
|
146
|
+
* @generated from field: int64 paid_unit_minor = 11;
|
|
147
|
+
*/
|
|
148
|
+
paidUnitMinor: bigint;
|
|
149
|
+
/**
|
|
150
|
+
* @generated from field: string currency = 12;
|
|
151
|
+
*/
|
|
152
|
+
currency: string;
|
|
153
|
+
/**
|
|
154
|
+
* @generated from field: bool eligible = 13;
|
|
155
|
+
*/
|
|
156
|
+
eligible: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* @generated from field: string exclusion_reason = 14;
|
|
159
|
+
*/
|
|
160
|
+
exclusionReason: string;
|
|
161
|
+
/**
|
|
162
|
+
* @generated from field: int64 paid_line_total_minor = 15;
|
|
163
|
+
*/
|
|
164
|
+
paidLineTotalMinor: bigint;
|
|
165
|
+
/**
|
|
166
|
+
* @generated from field: int64 coupon_allocation_minor = 16;
|
|
167
|
+
*/
|
|
168
|
+
couponAllocationMinor: bigint;
|
|
169
|
+
/**
|
|
170
|
+
* @generated from field: string access_source = 17;
|
|
171
|
+
*/
|
|
172
|
+
accessSource: string;
|
|
173
|
+
/**
|
|
174
|
+
* @generated from field: string access_reference = 18;
|
|
175
|
+
*/
|
|
176
|
+
accessReference: string;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* @generated from message public.v1.ReturnOrderDetail
|
|
180
|
+
*/
|
|
181
|
+
type ReturnOrderDetail = Message<"public.v1.ReturnOrderDetail"> & {
|
|
182
|
+
/**
|
|
183
|
+
* @generated from field: string canonical_order_id = 1;
|
|
184
|
+
*/
|
|
185
|
+
canonicalOrderId: string;
|
|
186
|
+
/**
|
|
187
|
+
* @generated from field: string display_reference = 2;
|
|
188
|
+
*/
|
|
189
|
+
displayReference: string;
|
|
190
|
+
/**
|
|
191
|
+
* @generated from field: string gateway = 3;
|
|
192
|
+
*/
|
|
193
|
+
gateway: string;
|
|
194
|
+
/**
|
|
195
|
+
* @generated from field: google.protobuf.Timestamp purchased_at = 4;
|
|
196
|
+
*/
|
|
197
|
+
purchasedAt?: Timestamp;
|
|
198
|
+
/**
|
|
199
|
+
* @generated from field: int64 total_minor = 5;
|
|
200
|
+
*/
|
|
201
|
+
totalMinor: bigint;
|
|
202
|
+
/**
|
|
203
|
+
* @generated from field: string currency = 6;
|
|
204
|
+
*/
|
|
205
|
+
currency: string;
|
|
206
|
+
/**
|
|
207
|
+
* @generated from field: repeated public.v1.ReturnOrderLine lines = 7;
|
|
208
|
+
*/
|
|
209
|
+
lines: ReturnOrderLine[];
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* @generated from message public.v1.ReturnHistoryEntry
|
|
213
|
+
*/
|
|
214
|
+
type ReturnHistoryEntry = Message<"public.v1.ReturnHistoryEntry"> & {
|
|
215
|
+
/**
|
|
216
|
+
* @generated from field: string id = 1;
|
|
217
|
+
*/
|
|
218
|
+
id: string;
|
|
219
|
+
/**
|
|
220
|
+
* @generated from field: string reference = 2;
|
|
221
|
+
*/
|
|
222
|
+
reference: string;
|
|
223
|
+
/**
|
|
224
|
+
* @generated from field: string status = 3;
|
|
225
|
+
*/
|
|
226
|
+
status: string;
|
|
227
|
+
/**
|
|
228
|
+
* @generated from field: google.protobuf.Timestamp created_at = 4;
|
|
229
|
+
*/
|
|
230
|
+
createdAt?: Timestamp;
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* @generated from message public.v1.ReturnRequestLineView
|
|
234
|
+
*/
|
|
235
|
+
type ReturnRequestLineView = Message<"public.v1.ReturnRequestLineView"> & {
|
|
236
|
+
/**
|
|
237
|
+
* @generated from field: string line_id = 1;
|
|
238
|
+
*/
|
|
239
|
+
lineId: string;
|
|
240
|
+
/**
|
|
241
|
+
* @generated from field: string name = 2;
|
|
242
|
+
*/
|
|
243
|
+
name: string;
|
|
244
|
+
/**
|
|
245
|
+
* @generated from field: string fulfillment_type = 3;
|
|
246
|
+
*/
|
|
247
|
+
fulfillmentType: string;
|
|
248
|
+
/**
|
|
249
|
+
* @generated from field: int32 requested_quantity = 4;
|
|
250
|
+
*/
|
|
251
|
+
requestedQuantity: number;
|
|
252
|
+
/**
|
|
253
|
+
* @generated from field: int32 approved_quantity = 5;
|
|
254
|
+
*/
|
|
255
|
+
approvedQuantity: number;
|
|
256
|
+
/**
|
|
257
|
+
* @generated from field: int32 received_quantity = 6;
|
|
258
|
+
*/
|
|
259
|
+
receivedQuantity: number;
|
|
260
|
+
/**
|
|
261
|
+
* @generated from field: string access_status = 7;
|
|
262
|
+
*/
|
|
263
|
+
accessStatus: string;
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* @generated from message public.v1.ReturnRequestView
|
|
267
|
+
*/
|
|
268
|
+
type ReturnRequestView = Message<"public.v1.ReturnRequestView"> & {
|
|
269
|
+
/**
|
|
270
|
+
* @generated from field: string id = 1;
|
|
271
|
+
*/
|
|
272
|
+
id: string;
|
|
273
|
+
/**
|
|
274
|
+
* @generated from field: string reference = 2;
|
|
275
|
+
*/
|
|
276
|
+
reference: string;
|
|
277
|
+
/**
|
|
278
|
+
* @generated from field: string canonical_order_id = 3;
|
|
279
|
+
*/
|
|
280
|
+
canonicalOrderId: string;
|
|
281
|
+
/**
|
|
282
|
+
* @generated from field: string status = 4;
|
|
283
|
+
*/
|
|
284
|
+
status: string;
|
|
285
|
+
/**
|
|
286
|
+
* @generated from field: string refund_status = 5;
|
|
287
|
+
*/
|
|
288
|
+
refundStatus: string;
|
|
289
|
+
/**
|
|
290
|
+
* @generated from field: int64 refund_amount_minor = 6;
|
|
291
|
+
*/
|
|
292
|
+
refundAmountMinor: bigint;
|
|
293
|
+
/**
|
|
294
|
+
* @generated from field: string currency = 7;
|
|
295
|
+
*/
|
|
296
|
+
currency: string;
|
|
297
|
+
/**
|
|
298
|
+
* @generated from field: string customer_note = 8;
|
|
299
|
+
*/
|
|
300
|
+
customerNote: string;
|
|
301
|
+
/**
|
|
302
|
+
* @generated from field: int64 version = 9;
|
|
303
|
+
*/
|
|
304
|
+
version: bigint;
|
|
305
|
+
/**
|
|
306
|
+
* @generated from field: google.protobuf.Timestamp created_at = 10;
|
|
307
|
+
*/
|
|
308
|
+
createdAt?: Timestamp;
|
|
309
|
+
/**
|
|
310
|
+
* @generated from field: repeated public.v1.ReturnRequestLineView lines = 11;
|
|
311
|
+
*/
|
|
312
|
+
lines: ReturnRequestLineView[];
|
|
313
|
+
/**
|
|
314
|
+
* @generated from field: repeated public.v1.ReturnHistoryEntry history = 12;
|
|
315
|
+
*/
|
|
316
|
+
history: ReturnHistoryEntry[];
|
|
317
|
+
/**
|
|
318
|
+
* @generated from field: string return_instructions = 13;
|
|
319
|
+
*/
|
|
320
|
+
returnInstructions: string;
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* @generated from message public.v1.GetReturnableOrderResponse
|
|
324
|
+
*/
|
|
325
|
+
type GetReturnableOrderResponse = Message<"public.v1.GetReturnableOrderResponse"> & {
|
|
326
|
+
/**
|
|
327
|
+
* @generated from field: public.v1.ReturnOrderDetail order = 1;
|
|
328
|
+
*/
|
|
329
|
+
order?: ReturnOrderDetail;
|
|
330
|
+
/**
|
|
331
|
+
* @generated from field: repeated public.v1.ReturnHistoryEntry return_history = 2;
|
|
332
|
+
*/
|
|
333
|
+
returnHistory: ReturnHistoryEntry[];
|
|
334
|
+
};
|
|
335
|
+
/**
|
|
336
|
+
* @generated from message public.v1.CreateReturnRequestResponse
|
|
337
|
+
*/
|
|
338
|
+
type CreateReturnRequestResponse = Message<"public.v1.CreateReturnRequestResponse"> & {
|
|
339
|
+
/**
|
|
340
|
+
* @generated from field: public.v1.ReturnRequestView request = 1;
|
|
341
|
+
*/
|
|
342
|
+
request?: ReturnRequestView;
|
|
343
|
+
};
|
|
344
|
+
/**
|
|
345
|
+
* @generated from message public.v1.ListMyReturnsResponse
|
|
346
|
+
*/
|
|
347
|
+
type ListMyReturnsResponse = Message<"public.v1.ListMyReturnsResponse"> & {
|
|
348
|
+
/**
|
|
349
|
+
* @generated from field: repeated public.v1.ReturnRequestView returns = 1;
|
|
350
|
+
*/
|
|
351
|
+
returns: ReturnRequestView[];
|
|
352
|
+
/**
|
|
353
|
+
* @generated from field: string next_page_token = 2;
|
|
354
|
+
*/
|
|
355
|
+
nextPageToken: string;
|
|
356
|
+
/**
|
|
357
|
+
* @generated from field: int32 total = 3;
|
|
358
|
+
*/
|
|
359
|
+
total: number;
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
type BitsnapReturnsProviderProps = {
|
|
363
|
+
projectID: string;
|
|
364
|
+
host?: string;
|
|
365
|
+
environment?: Environment;
|
|
366
|
+
children: React.ReactNode;
|
|
367
|
+
};
|
|
368
|
+
/** Provider for the returns hooks when building a custom customer flow. */
|
|
369
|
+
declare function BitsnapReturnsProvider({ projectID, host, environment, children, }: BitsnapReturnsProviderProps): react_jsx_runtime.JSX.Element;
|
|
370
|
+
declare function useReturnSession(): {
|
|
371
|
+
startSession: _tanstack_react_query.UseMutateAsyncFunction<StartReturnSessionResponse, Error, string, unknown>;
|
|
372
|
+
verifySession: _tanstack_react_query.UseMutateAsyncFunction<VerifyReturnSessionResponse, Error, {
|
|
373
|
+
challengeId: string;
|
|
374
|
+
code: string;
|
|
375
|
+
}, unknown>;
|
|
376
|
+
logout: () => void;
|
|
377
|
+
isAuthenticated: boolean;
|
|
378
|
+
starting: boolean;
|
|
379
|
+
verifying: boolean;
|
|
380
|
+
error: Error | null;
|
|
381
|
+
};
|
|
382
|
+
declare function useReturnOrders(pageSize?: number, pageToken?: string): _tanstack_react_query.UseQueryResult<void | ListReturnOrdersResponse, Error>;
|
|
383
|
+
declare function useReturnableOrder(canonicalOrderID?: string): _tanstack_react_query.UseQueryResult<void | GetReturnableOrderResponse, Error>;
|
|
384
|
+
declare function useCreateReturn(): _tanstack_react_query.UseMutationResult<void | CreateReturnRequestResponse, Error, {
|
|
385
|
+
canonicalOrderID: string;
|
|
386
|
+
items: {
|
|
387
|
+
lineId: string;
|
|
388
|
+
quantity: number;
|
|
389
|
+
}[];
|
|
390
|
+
note?: string;
|
|
391
|
+
idempotencyKey?: string;
|
|
392
|
+
}, unknown>;
|
|
393
|
+
declare function useMyReturns(pageSize?: number, pageToken?: string): _tanstack_react_query.UseQueryResult<void | ListMyReturnsResponse, Error>;
|
|
394
|
+
type BitsnapReturnsProps = {
|
|
395
|
+
projectID: string;
|
|
396
|
+
host?: string;
|
|
397
|
+
environment?: Environment;
|
|
398
|
+
texts?: Partial<{
|
|
399
|
+
title: string;
|
|
400
|
+
email: string;
|
|
401
|
+
sendCode: string;
|
|
402
|
+
code: string;
|
|
403
|
+
verify: string;
|
|
404
|
+
orders: string;
|
|
405
|
+
submit: string;
|
|
406
|
+
note: string;
|
|
407
|
+
loading: string;
|
|
408
|
+
history: string;
|
|
409
|
+
}>;
|
|
410
|
+
theme?: {
|
|
411
|
+
brandColor?: string;
|
|
412
|
+
};
|
|
413
|
+
className?: string;
|
|
414
|
+
};
|
|
415
|
+
declare function BitsnapReturns(props: BitsnapReturnsProps): react_jsx_runtime.JSX.Element;
|
|
416
|
+
|
|
417
|
+
export { BitsnapReturns, type BitsnapReturnsProps, BitsnapReturnsProvider, type BitsnapReturnsProviderProps, Environment, useCreateReturn, useMyReturns, useReturnOrders, useReturnSession, useReturnableOrder };
|
package/dist/returns.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var ne=Object.create;var Z=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var ue=(e,t)=>{for(var n in t)Z(e,n,{get:t[n],enumerable:!0})},T=(e,t,n,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of se(t))!ie.call(e,i)&&i!==n&&Z(e,i,{get:()=>t[i],enumerable:!(u=re(t,i))||u.enumerable});return e};var ae=(e,t,n)=>(n=e!=null?ne(oe(e)):{},T(t||!e||!e.__esModule?Z(n,"default",{value:e,enumerable:!0}):n,e)),ce=e=>T(Z({},"__esModule",{value:!0}),e);var Re={};ue(Re,{BitsnapReturns:()=>$,BitsnapReturnsProvider:()=>M,Environment:()=>B,useCreateReturn:()=>L,useMyReturns:()=>F,useReturnOrders:()=>W,useReturnSession:()=>E,useReturnableOrder:()=>k});module.exports=ce(Re);var g=require("@connectrpc/connect"),P=require("@connectrpc/connect-web");var Y=require("@bufbuild/protobuf/codegenv2"),Q=(0,Y.fileDesc)("Chtjb21tb24vdjEvZW52aXJvbm1lbnQucHJvdG8SCWNvbW1vbi52MSonCgtFbnZpcm9ubWVudBIOCgpQUk9EVUNUSU9OEAASCAoEVEVTVBABQk5aTGdpdGh1Yi5jb20vZW1tZW1zL3N1cGVyLWNhcnQvYXBwcy9zcnYtd29ya2VyL3V0aWxzL21vZGVscy9jb21tb24vdjE7Y29tbW9udjFiBnByb3RvMw"),B=(n=>(n[n.PRODUCTION=0]="PRODUCTION",n[n.TEST=1]="TEST",n))(B||{});var S=require("@bufbuild/protobuf/codegenv2");var U=require("@bufbuild/protobuf/wkt"),le=(0,S.fileDesc)("ChdwdWJsaWMvdjEvcmV0dXJucy5wcm90bxIJcHVibGljLnYxImsKGVN0YXJ0UmV0dXJuU2Vzc2lvblJlcXVlc3QSEgoKcHJvamVjdF9pZBgBIAEoCRINCgVlbWFpbBgCIAEoCRIrCgtlbnZpcm9ubWVudBgDIAEoDjIWLmNvbW1vbi52MS5FbnZpcm9ubWVudCJhChpTdGFydFJldHVyblNlc3Npb25SZXNwb25zZRIUCgxjaGFsbGVuZ2VfaWQYASABKAkSHAoUcmVzZW5kX2FmdGVyX3NlY29uZHMYAiABKAUSDwoHbWVzc2FnZRgDIAEoCSKBAQoaVmVyaWZ5UmV0dXJuU2Vzc2lvblJlcXVlc3QSEgoKcHJvamVjdF9pZBgBIAEoCRIUCgxjaGFsbGVuZ2VfaWQYAiABKAkSDAoEY29kZRgDIAEoCRIrCgtlbnZpcm9ubWVudBgEIAEoDjIWLmNvbW1vbi52MS5FbnZpcm9ubWVudCJkChtWZXJpZnlSZXR1cm5TZXNzaW9uUmVzcG9uc2USFQoNc2Vzc2lvbl90b2tlbhgBIAEoCRIuCgpleHBpcmVzX2F0GAIgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcCIzCgpSZXR1cm5QYWdlEhEKCXBhZ2Vfc2l6ZRgBIAEoBRISCgpwYWdlX3Rva2VuGAIgASgJItQBChJSZXR1cm5PcmRlclN1bW1hcnkSGgoSY2Fub25pY2FsX29yZGVyX2lkGAEgASgJEhkKEWRpc3BsYXlfcmVmZXJlbmNlGAIgASgJEg8KB2dhdGV3YXkYAyABKAkSMAoMcHVyY2hhc2VkX2F0GAQgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBITCgt0b3RhbF9taW5vchgFIAEoAxIQCghjdXJyZW5jeRgGIAEoCRIdChVyZXR1c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=(0,S.serviceDesc)(le,0);var c=require("@tanstack/react-query"),o=ae(require("react")),r=require("react/jsx-runtime"),_=(0,o.createContext)(null);function M({projectID:e,host:t="https://bitsnap.pl",environment:n=0,children:u}){let i=`${t.replace(/\/$/,"")}|${e}|${n}`,[a,l]=(0,o.useState)(),d=a?.scope===i?a.token:void 0,R=a?.scope===i?a.expiresAt:void 0,[x]=(0,o.useState)(()=>new c.QueryClient({defaultOptions:{queries:{staleTime:0,refetchOnWindowFocus:!0}}})),b=(0,o.useMemo)(()=>(0,g.createClient)(D,(0,P.createConnectTransport)({baseUrl:`${t.replace(/\/$/,"")}/api/rpc`,useBinaryFormat:!0})),[t]),V=(0,o.useMemo)(()=>({projectID:e,host:t.replace(/\/$/,""),environment:n,client:b,sessionToken:d,setSession:(m,f)=>l(m?{token:m,expiresAt:f,scope:i}:void 0),expiresAt:R}),[e,t,n,b,d,R,i]);return(0,r.jsx)(c.QueryClientProvider,{client:x,children:(0,r.jsx)(_.Provider,{value:V,children:u})})}function A(){let e=(0,o.useContext)(_);if(!e)throw new Error("Wrap returns hooks in BitsnapReturnsProvider.");return e}function X(e,t){throw e instanceof g.ConnectError&&e.code===g.Code.Unauthenticated&&t(),e}function E(){let e=A(),t=(0,c.useMutation)({mutationFn:i=>e.client.startReturnSession({projectId:e.projectID,email:i,environment:e.environment})}),n=(0,c.useMutation)({mutationFn:async({challengeId:i,code:a})=>{let l=await e.client.verifyReturnSession({projectId:e.projectID,challengeId:i,code:a,environment:e.environment}),d=l.expiresAt?Number(l.expiresAt.seconds)*1e3+l.expiresAt.nanos/1e6:void 0;return e.setSession(l.sessionToken,d),l}}),u=()=>{e.setSession(void 0),n.reset(),t.reset()};return{startSession:t.mutateAsync,verifySession:n.mutateAsync,logout:u,isAuthenticated:!!(e.sessionToken&&(!e.expiresAt||Date.now()<e.expiresAt)),starting:t.isPending,verifying:n.isPending,error:t.error??n.error}}function W(e=20,t=""){let n=A(),u=n.sessionToken;return(0,c.useQuery)({queryKey:["bitsnap-returns",n.host,n.projectID,n.environment,e,t,"orders"],enabled:!!(u&&(!n.expiresAt||Date.now()<n.expiresAt)),queryFn:()=>n.client.listReturnOrders({projectId:n.projectID,sessionToken:u,pageSize:e,pageToken:t}).catch(i=>X(i,()=>n.setSession(void 0)))})}function k(e){let t=A(),n=t.sessionToken;return(0,c.useQuery)({queryKey:["bitsnap-returns",t.host,t.projectID,t.environment,e,"order"],enabled:!!(n&&e&&(!t.expiresAt||Date.now()<t.expiresAt)),queryFn:()=>t.client.getReturnableOrder({projectId:t.projectID,sessionToken:n,canonicalOrderId:e}).catch(u=>X(u,()=>t.setSession(void 0)))})}function L(){let e=A(),t=e.sessionToken,n=(0,c.useQueryClient)();return(0,c.useMutation)({mutationFn:u=>{if(!t||e.expiresAt&&Date.now()>=e.expiresAt)throw e.setSession(void 0),new Error("Verify your email to continue.");return e.client.createReturnRequest({projectId:e.projectID,sessionToken:t,canonicalOrderId:u.canonicalOrderID,items:u.items,note:u.note??"",idempotencyKey:u.idempotencyKey??globalThis.crypto.randomUUID()}).catch(i=>X(i,()=>e.setSession(void 0)))},onSuccess:async()=>n.invalidateQueries({queryKey:["bitsnap-returns",e.host,e.projectID,e.environment]})})}function F(e=20,t=""){let n=A(),u=n.sessionToken;return(0,c.useQuery)({queryKey:["bitsnap-returns",n.host,n.projectID,n.environment,e,t,"mine"],enabled:!!(u&&(!n.expiresAt||Date.now()<n.expiresAt)),queryFn:()=>n.client.listMyReturns({projectId:n.projectID,sessionToken:u,pageSize:e,pageToken:t}).catch(i=>X(i,()=>n.setSession(void 0)))})}var de={title:"Request a return",email:"Email address",sendCode:"Send code",code:"Email code",verify:"Verify",orders:"Your orders",submit:"Submit return",note:"Note (optional)",loading:"Loading\u2026",history:"My return requests"};function $(e){return(0,r.jsx)(M,{projectID:e.projectID,host:e.host,environment:e.environment,children:(0,r.jsx)(pe,{...e})})}function pe(e){let t={...de,...e.texts},n=E(),[u,i]=(0,o.useState)(""),a=W(20,u),l=F(),d=L(),[R,x]=(0,o.useState)(""),[b,V]=(0,o.useState)(""),[m,f]=(0,o.useState)(""),[K,v]=(0,o.useState)(),[G,I]=(0,o.useState)(),[C,w]=(0,o.useState)({}),[q,ee]=(0,o.useState)(""),[p,H]=(0,o.useState)(),N=(0,o.useRef)(!1),j=(0,o.useRef)(void 0),h=k(K?.canonicalOrderId);o.default.useEffect(()=>{h.data?.order&&I(h.data.order)},[h.data]);let O=n.error??a.error??h.error??d.error,te={"--bitsnap-returns-brand":e.theme?.brandColor??"#111827"};return(0,r.jsxs)("section",{className:`bitsnap-returns ${e.className??""}`,style:te,"aria-live":"polite",children:[(0,r.jsx)("h2",{className:"mb-4 text-xl font-semibold",children:t.title}),!n.isAuthenticated&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("label",{className:"block text-sm",children:[t.email,(0,r.jsx)("input",{type:"email",autoComplete:"email",value:R,onChange:s=>x(s.target.value),className:"mt-1 block w-full rounded border p-2"})]}),b?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("label",{className:"block text-sm",children:[t.code,(0,r.jsx)("input",{inputMode:"numeric",autoComplete:"one-time-code",value:m,onChange:s=>f(s.target.value),className:"mt-1 block w-full rounded border p-2"})]}),(0,r.jsx)("button",{type:"button",disabled:n.verifying||!m,onClick:()=>n.verifySession({challengeId:b,code:m}),className:"rounded bg-[var(--bitsnap-returns-brand)] px-4 py-2 text-white disabled:opacity-50",children:n.verifying?t.loading:t.verify}),(0,r.jsx)("button",{type:"button",disabled:n.starting,onClick:async()=>{let s=await n.startSession(R);V(s.challengeId)},className:"ml-3 underline",children:"Resend code"})]}):(0,r.jsx)("button",{type:"button",disabled:n.starting||!R,onClick:async()=>{let s=await n.startSession(R);V(s.challengeId)},className:"rounded bg-[var(--bitsnap-returns-brand)] px-4 py-2 text-white disabled:opacity-50",children:n.starting?t.loading:t.sendCode})]}),a.isLoading&&(0,r.jsx)("p",{children:t.loading}),a.data!=null&&!K&&!p&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)("h3",{className:"font-medium",children:t.orders}),a.data.orders.length===0&&(0,r.jsx)("p",{children:"No eligible orders found."}),a.data.orders.map(s=>(0,r.jsxs)("button",{type:"button",onClick:()=>v(s),className:"block w-full rounded border p-3 text-left hover:border-[var(--bitsnap-returns-brand)]",children:[(0,r.jsx)("span",{className:"font-medium",children:s.displayReference}),(0,r.jsxs)("span",{className:"ml-2 text-sm text-gray-600",children:[s.currency," ",z(s.totalMinor)]})]},s.canonicalOrderId)),a.data.nextPageToken&&(0,r.jsx)("button",{type:"button",onClick:()=>i(a.data?.nextPageToken??""),className:"underline",children:"Next orders"})]}),G&&!p&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>{v(void 0),I(void 0)},className:"text-sm underline",children:["\u2190 ",t.orders]}),G.lines.map(s=>(0,r.jsxs)("label",{className:"flex items-center justify-between gap-3 rounded border p-3",children:[(0,r.jsxs)("span",{children:[s.name,(0,r.jsxs)("small",{className:"block text-gray-600",children:[s.availableQuantity," available \xB7 ",s.currency," ",z(s.paidUnitMinor)]})]}),(0,r.jsx)("input",{type:"number",min:0,max:s.availableQuantity,disabled:!s.eligible,value:C[s.lineId]??0,onChange:y=>w(J=>({...J,[s.lineId]:Math.max(0,Math.min(s.availableQuantity,Number(y.target.value)))})),className:"w-20 rounded border p-2"}),!s.eligible&&(0,r.jsx)("small",{children:s.exclusionReason})]},s.lineId)),(0,r.jsxs)("label",{className:"block text-sm",children:[t.note,(0,r.jsx)("textarea",{value:q,onChange:s=>ee(s.target.value),className:"mt-1 block w-full rounded border p-2"})]}),(0,r.jsx)("button",{type:"button",disabled:d.isPending||!Object.values(C).some(s=>s>0),onClick:async()=>{if(!N.current){N.current=!0,j.current??=globalThis.crypto.randomUUID();try{let s=await d.mutateAsync({canonicalOrderID:G.canonicalOrderId,items:Object.entries(C).filter(([,y])=>y>0).map(([y,J])=>({lineId:y,quantity:J})),note:q,idempotencyKey:j.current});s&&"request"in s&&s.request&&H(s.request)}finally{N.current=!1}}},className:"rounded bg-[var(--bitsnap-returns-brand)] px-4 py-2 text-white disabled:opacity-50",children:d.isPending?t.loading:t.submit})]}),p&&(0,r.jsxs)("div",{className:"rounded border p-4",children:[(0,r.jsx)("h3",{className:"font-semibold",children:"Return submitted"}),(0,r.jsxs)("p",{children:["Reference: ",(0,r.jsx)("strong",{children:p.reference})]}),(0,r.jsxs)("p",{children:["Status: ",p.status]}),p.returnInstructions&&(0,r.jsx)("p",{className:"mt-2",children:p.returnInstructions}),(0,r.jsx)("button",{type:"button",onClick:()=>{H(void 0),v(void 0),I(void 0),w({}),l.refetch()},className:"mt-3 underline",children:t.history})]}),l.data?.returns&&l.data.returns.length>0&&!p&&(0,r.jsxs)("div",{className:"mt-6",children:[(0,r.jsx)("h3",{className:"mb-2 font-medium",children:t.history}),l.data.returns.map(s=>(0,r.jsxs)("div",{className:"border-t py-2",children:[(0,r.jsx)("strong",{children:s.reference}),(0,r.jsx)("span",{className:"ml-2",children:s.status})]},s.id))]}),O&&(0,r.jsx)("p",{role:"alert",className:"mt-3 text-sm text-red-700",children:O.message})]})}function z(e){return(Number(e)/100).toFixed(2)}
|
|
2
|
+
//# sourceMappingURL=returns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/returns/index.ts","../src/returns/BitsnapReturns.tsx","../src/gen/proto/common/v1/environment_pb.ts","../src/gen/proto/public/v1/returns_pb.ts"],"sourcesContent":["export {\n BitsnapReturns,\n BitsnapReturnsProvider,\n useCreateReturn,\n useMyReturns,\n useReturnableOrder,\n useReturnOrders,\n useReturnSession,\n} from \"./BitsnapReturns\";\nexport type {\n BitsnapReturnsProps,\n BitsnapReturnsProviderProps,\n} from \"./BitsnapReturns\";\nexport { Environment } from \"../gen/proto/common/v1/environment_pb\";\n","\"use client\";\n\nimport { Code, ConnectError, createClient, type Client } from \"@connectrpc/connect\";\nimport { createConnectTransport } from \"@connectrpc/connect-web\";\nimport { Environment } from \"../gen/proto/common/v1/environment_pb\";\nimport { ReturnsService } from \"../gen/proto/public/v1/returns_pb\";\nimport type {\n ReturnOrderDetail,\n ReturnRequestView,\n ReturnOrderSummary,\n} from \"../gen/proto/public/v1/returns_pb\";\nimport { QueryClient, QueryClientProvider, useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport React, { createContext, useContext, useMemo, useRef, useState } from \"react\";\n\nexport type BitsnapReturnsProviderProps = {\n projectID: string;\n host?: string;\n environment?: Environment;\n children: React.ReactNode;\n};\n\ntype ReturnsContextValue = {\n projectID: string;\n host: string;\n environment: Environment;\n client: Client<typeof ReturnsService>;\n sessionToken?: string;\n setSession: (token?: string, expiresAt?: number) => void;\n expiresAt?: number;\n};\n\nconst ReturnsContext = createContext<ReturnsContextValue | null>(null);\n\n/** Provider for the returns hooks when building a custom customer flow. */\nexport function BitsnapReturnsProvider({\n projectID,\n host = \"https://bitsnap.pl\",\n environment = Environment.PRODUCTION,\n children,\n}: BitsnapReturnsProviderProps) {\n const scope = `${host.replace(/\\/$/, \"\")}|${projectID}|${environment}`;\n const [session, setSessionState] = useState<{ token: string; expiresAt?: number; scope: string }>();\n const sessionToken = session?.scope === scope ? session.token : undefined;\n const expiresAt = session?.scope === scope ? session.expiresAt : undefined;\n const [queryClient] = useState(() => new QueryClient({ defaultOptions: { queries: { staleTime: 0, refetchOnWindowFocus: true } } }));\n const client = useMemo(\n () =>\n createClient(\n ReturnsService,\n createConnectTransport({\n baseUrl: `${host.replace(/\\/$/, \"\")}/api/rpc`,\n useBinaryFormat: true,\n }),\n ),\n [host],\n );\n const contextValue = useMemo(\n () => ({\n projectID,\n host: host.replace(/\\/$/, \"\"),\n environment,\n client,\n sessionToken,\n setSession: (token?: string, expiry?: number) => setSessionState(\n token ? { token, expiresAt: expiry, scope } : undefined,\n ),\n expiresAt,\n }),\n [projectID, host, environment, client, sessionToken, expiresAt, scope],\n );\n\n return <QueryClientProvider client={queryClient}><ReturnsContext.Provider value={contextValue}>{children}</ReturnsContext.Provider></QueryClientProvider>;\n}\n\nfunction useReturnsContext() {\n const value = useContext(ReturnsContext);\n if (!value) throw new Error(\"Wrap returns hooks in BitsnapReturnsProvider.\");\n return value;\n}\n\nfunction handleSessionError(error: unknown, clear: () => void) {\n if (error instanceof ConnectError && error.code === Code.Unauthenticated) clear();\n throw error;\n}\n\nexport function useReturnSession() {\n const ctx = useReturnsContext();\n const start = useMutation({\n mutationFn: (email: string) =>\n ctx.client.startReturnSession({ projectId: ctx.projectID, email, environment: ctx.environment }),\n });\n const verify = useMutation({\n mutationFn: async ({ challengeId, code }: { challengeId: string; code: string }) => {\n const result = await ctx.client.verifyReturnSession({\n projectId: ctx.projectID,\n challengeId,\n code,\n environment: ctx.environment,\n });\n const expiry = result.expiresAt\n ? Number(result.expiresAt.seconds) * 1000 + result.expiresAt.nanos / 1_000_000\n : undefined;\n ctx.setSession(result.sessionToken, expiry);\n return result;\n },\n });\n const logout = () => {\n ctx.setSession(undefined);\n verify.reset();\n start.reset();\n };\n return { startSession: start.mutateAsync, verifySession: verify.mutateAsync, logout, isAuthenticated: Boolean(ctx.sessionToken && (!ctx.expiresAt || Date.now() < ctx.expiresAt)), starting: start.isPending, verifying: verify.isPending, error: start.error ?? verify.error };\n}\n\nexport function useReturnOrders(pageSize = 20, pageToken = \"\") {\n const ctx = useReturnsContext();\n const token = ctx.sessionToken;\n return useQuery({\n queryKey: [\"bitsnap-returns\", ctx.host, ctx.projectID, ctx.environment, pageSize, pageToken, \"orders\"],\n enabled: Boolean(token && (!ctx.expiresAt || Date.now() < ctx.expiresAt)),\n queryFn: () => ctx.client.listReturnOrders({ projectId: ctx.projectID, sessionToken: token!, pageSize, pageToken }).catch((e) => handleSessionError(e, () => ctx.setSession(undefined))),\n });\n}\n\nexport function useReturnableOrder(canonicalOrderID?: string) {\n const ctx = useReturnsContext();\n const token = ctx.sessionToken;\n return useQuery({\n queryKey: [\"bitsnap-returns\", ctx.host, ctx.projectID, ctx.environment, canonicalOrderID, \"order\"],\n enabled: Boolean(token && canonicalOrderID && (!ctx.expiresAt || Date.now() < ctx.expiresAt)),\n queryFn: () => ctx.client.getReturnableOrder({ projectId: ctx.projectID, sessionToken: token!, canonicalOrderId: canonicalOrderID! }).catch((e) => handleSessionError(e, () => ctx.setSession(undefined))),\n });\n}\n\nexport function useCreateReturn() {\n const ctx = useReturnsContext();\n const token = ctx.sessionToken;\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (input: { canonicalOrderID: string; items: { lineId: string; quantity: number }[]; note?: string; idempotencyKey?: string }) => {\n if (!token || (ctx.expiresAt && Date.now() >= ctx.expiresAt)) {\n ctx.setSession(undefined);\n throw new Error(\"Verify your email to continue.\");\n }\n return ctx.client.createReturnRequest({\n projectId: ctx.projectID,\n sessionToken: token,\n canonicalOrderId: input.canonicalOrderID,\n items: input.items,\n note: input.note ?? \"\",\n idempotencyKey: input.idempotencyKey ?? globalThis.crypto.randomUUID(),\n }).catch((e) => handleSessionError(e, () => ctx.setSession(undefined)));\n },\n onSuccess: async () => queryClient.invalidateQueries({ queryKey: [\"bitsnap-returns\", ctx.host, ctx.projectID, ctx.environment] }),\n });\n}\n\nexport function useMyReturns(pageSize = 20, pageToken = \"\") {\n const ctx = useReturnsContext();\n const token = ctx.sessionToken;\n return useQuery({\n queryKey: [\"bitsnap-returns\", ctx.host, ctx.projectID, ctx.environment, pageSize, pageToken, \"mine\"],\n enabled: Boolean(token && (!ctx.expiresAt || Date.now() < ctx.expiresAt)),\n queryFn: () => ctx.client.listMyReturns({ projectId: ctx.projectID, sessionToken: token!, pageSize, pageToken }).catch((e) => handleSessionError(e, () => ctx.setSession(undefined))),\n });\n}\n\nexport type BitsnapReturnsProps = {\n projectID: string;\n host?: string;\n environment?: Environment;\n texts?: Partial<{\n title: string; email: string; sendCode: string; code: string; verify: string;\n orders: string; submit: string; note: string; loading: string; history: string;\n }>;\n theme?: { brandColor?: string };\n className?: string;\n};\n\nconst defaultTexts = {\n title: \"Request a return\", email: \"Email address\", sendCode: \"Send code\", code: \"Email code\",\n verify: \"Verify\", orders: \"Your orders\", submit: \"Submit return\", note: \"Note (optional)\",\n loading: \"Loading…\", history: \"My return requests\",\n};\n\nexport function BitsnapReturns(props: BitsnapReturnsProps) {\n return (\n <BitsnapReturnsProvider projectID={props.projectID} host={props.host} environment={props.environment}>\n <BitsnapReturnsForm {...props} />\n </BitsnapReturnsProvider>\n );\n}\n\nfunction BitsnapReturnsForm(props: BitsnapReturnsProps) {\n const texts = { ...defaultTexts, ...props.texts };\n const session = useReturnSession();\n const [orderPageToken, setOrderPageToken] = useState(\"\");\n const ordersQuery = useReturnOrders(20, orderPageToken);\n const mineQuery = useMyReturns();\n const create = useCreateReturn();\n const [email, setEmail] = useState(\"\");\n const [challengeID, setChallengeID] = useState(\"\");\n const [code, setCode] = useState(\"\");\n const [selectedOrder, setSelectedOrder] = useState<ReturnOrderSummary>();\n const [orderDetail, setOrderDetail] = useState<ReturnOrderDetail>();\n const [quantities, setQuantities] = useState<Record<string, number>>({});\n const [note, setNote] = useState(\"\");\n const [created, setCreated] = useState<ReturnRequestView>();\n const submittingRef = useRef(false);\n const idempotencyKeyRef = useRef<string | undefined>(undefined);\n const orderQuery = useReturnableOrder(selectedOrder?.canonicalOrderId);\n React.useEffect(() => { if (orderQuery.data?.order) setOrderDetail(orderQuery.data.order); }, [orderQuery.data]);\n const error = session.error ?? ordersQuery.error ?? orderQuery.error ?? create.error;\n const style = { \"--bitsnap-returns-brand\": props.theme?.brandColor ?? \"#111827\" } as React.CSSProperties;\n\n return (\n <section className={`bitsnap-returns ${props.className ?? \"\"}`} style={style} aria-live=\"polite\">\n <h2 className=\"mb-4 text-xl font-semibold\">{texts.title}</h2>\n {!session.isAuthenticated && (\n <div className=\"space-y-3\">\n <label className=\"block text-sm\">{texts.email}<input type=\"email\" autoComplete=\"email\" value={email} onChange={(e) => setEmail(e.target.value)} className=\"mt-1 block w-full rounded border p-2\" /></label>\n {!challengeID ? <button type=\"button\" disabled={session.starting || !email} onClick={async () => { const response = await session.startSession(email); setChallengeID(response.challengeId); }} className=\"rounded bg-[var(--bitsnap-returns-brand)] px-4 py-2 text-white disabled:opacity-50\">{session.starting ? texts.loading : texts.sendCode}</button> : <>\n <label className=\"block text-sm\">{texts.code}<input inputMode=\"numeric\" autoComplete=\"one-time-code\" value={code} onChange={(e) => setCode(e.target.value)} className=\"mt-1 block w-full rounded border p-2\" /></label>\n <button type=\"button\" disabled={session.verifying || !code} onClick={() => session.verifySession({ challengeId: challengeID, code })} className=\"rounded bg-[var(--bitsnap-returns-brand)] px-4 py-2 text-white disabled:opacity-50\">{session.verifying ? texts.loading : texts.verify}</button>\n <button type=\"button\" disabled={session.starting} onClick={async () => { const response = await session.startSession(email); setChallengeID(response.challengeId); }} className=\"ml-3 underline\">Resend code</button>\n </>}\n </div>\n )}\n {ordersQuery.isLoading && <p>{texts.loading}</p>}\n {ordersQuery.data != null && !selectedOrder && !created && <div className=\"space-y-3\"><h3 className=\"font-medium\">{texts.orders}</h3>{ordersQuery.data.orders.length === 0 && <p>No eligible orders found.</p>}{ordersQuery.data.orders.map((order) => <button key={order.canonicalOrderId} type=\"button\" onClick={() => setSelectedOrder(order)} className=\"block w-full rounded border p-3 text-left hover:border-[var(--bitsnap-returns-brand)]\"><span className=\"font-medium\">{order.displayReference}</span><span className=\"ml-2 text-sm text-gray-600\">{order.currency} {formatMinor(order.totalMinor)}</span></button>)}{ordersQuery.data.nextPageToken && <button type=\"button\" onClick={() => setOrderPageToken(ordersQuery.data?.nextPageToken ?? \"\")} className=\"underline\">Next orders</button>}</div>}\n {orderDetail && !created && <div className=\"space-y-3\"><button type=\"button\" onClick={() => { setSelectedOrder(undefined); setOrderDetail(undefined); }} className=\"text-sm underline\">← {texts.orders}</button>{orderDetail.lines.map((line) => <label key={line.lineId} className=\"flex items-center justify-between gap-3 rounded border p-3\"><span>{line.name}<small className=\"block text-gray-600\">{line.availableQuantity} available · {line.currency} {formatMinor(line.paidUnitMinor)}</small></span><input type=\"number\" min={0} max={line.availableQuantity} disabled={!line.eligible} value={quantities[line.lineId] ?? 0} onChange={(e) => setQuantities((prev) => ({ ...prev, [line.lineId]: Math.max(0, Math.min(line.availableQuantity, Number(e.target.value))) }))} className=\"w-20 rounded border p-2\" />{!line.eligible && <small>{line.exclusionReason}</small>}</label>)}<label className=\"block text-sm\">{texts.note}<textarea value={note} onChange={(e) => setNote(e.target.value)} className=\"mt-1 block w-full rounded border p-2\" /></label><button type=\"button\" disabled={create.isPending || !Object.values(quantities).some((q) => q > 0)} onClick={async () => { if (submittingRef.current) return; submittingRef.current = true; idempotencyKeyRef.current ??= globalThis.crypto.randomUUID(); try { const result = await create.mutateAsync({ canonicalOrderID: orderDetail.canonicalOrderId, items: Object.entries(quantities).filter(([, quantity]) => quantity > 0).map(([lineId, quantity]) => ({ lineId, quantity })), note, idempotencyKey: idempotencyKeyRef.current }); if (result && \"request\" in result && result.request) setCreated(result.request); } finally { submittingRef.current = false; } }} className=\"rounded bg-[var(--bitsnap-returns-brand)] px-4 py-2 text-white disabled:opacity-50\">{create.isPending ? texts.loading : texts.submit}</button></div>}\n {created && <div className=\"rounded border p-4\"><h3 className=\"font-semibold\">Return submitted</h3><p>Reference: <strong>{created.reference}</strong></p><p>Status: {created.status}</p>{created.returnInstructions && <p className=\"mt-2\">{created.returnInstructions}</p>}<button type=\"button\" onClick={() => { setCreated(undefined); setSelectedOrder(undefined); setOrderDetail(undefined); setQuantities({}); void mineQuery.refetch(); }} className=\"mt-3 underline\">{texts.history}</button></div>}\n {mineQuery.data?.returns && mineQuery.data.returns.length > 0 && !created && <div className=\"mt-6\"><h3 className=\"mb-2 font-medium\">{texts.history}</h3>{mineQuery.data.returns.map((item) => <div key={item.id} className=\"border-t py-2\"><strong>{item.reference}</strong><span className=\"ml-2\">{item.status}</span></div>)}</div>}\n {error && <p role=\"alert\" className=\"mt-3 text-sm text-red-700\">{error.message}</p>}\n </section>\n );\n}\n\nfunction formatMinor(amount: bigint | number) {\n return (Number(amount) / 100).toFixed(2);\n}\n","// @generated by protoc-gen-es v2.11.0 with parameter \"target=ts\"\n// @generated from file common/v1/environment.proto (package common.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc } from \"@bufbuild/protobuf/codegenv2\";\n\n/**\n * Describes the file common/v1/environment.proto.\n */\nexport const file_common_v1_environment: GenFile = /*@__PURE__*/\n fileDesc(\"Chtjb21tb24vdjEvZW52aXJvbm1lbnQucHJvdG8SCWNvbW1vbi52MSonCgtFbnZpcm9ubWVudBIOCgpQUk9EVUNUSU9OEAASCAoEVEVTVBABQk5aTGdpdGh1Yi5jb20vZW1tZW1zL3N1cGVyLWNhcnQvYXBwcy9zcnYtd29ya2VyL3V0aWxzL21vZGVscy9jb21tb24vdjE7Y29tbW9udjFiBnByb3RvMw\");\n\n/**\n * @generated from enum common.v1.Environment\n */\nexport enum Environment {\n /**\n * @generated from enum value: PRODUCTION = 0;\n */\n PRODUCTION = 0,\n\n /**\n * @generated from enum value: TEST = 1;\n */\n TEST = 1,\n}\n\n/**\n * Describes the enum common.v1.Environment.\n */\nexport const EnvironmentSchema: GenEnum<Environment> = /*@__PURE__*/\n enumDesc(file_common_v1_environment, 0);\n\n","// @generated by protoc-gen-es v2.11.0 with parameter \"target=ts,ts_nocheck=true\"\n// @generated from file public/v1/returns.proto (package public.v1, syntax proto3)\n/* eslint-disable */\n// @ts-nocheck\n\nimport type { GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Environment } from \"../../common/v1/environment_pb\";\nimport { file_common_v1_environment } from \"../../common/v1/environment_pb\";\nimport type { Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file public/v1/returns.proto.\n */\nexport const file_public_v1_returns: GenFile = /*@__PURE__*/\n fileDesc(\"ChdwdWJsaWMvdjEvcmV0dXJucy5wcm90bxIJcHVibGljLnYxImsKGVN0YXJ0UmV0dXJuU2Vzc2lvblJlcXVlc3QSEgoKcHJvamVjdF9pZBgBIAEoCRINCgVlbWFpbBgCIAEoCRIrCgtlbnZpcm9ubWVudBgDIAEoDjIWLmNvbW1vbi52MS5FbnZpcm9ubWVudCJhChpTdGFydFJldHVyblNlc3Npb25SZXNwb25zZRIUCgxjaGFsbGVuZ2VfaWQYASABKAkSHAoUcmVzZW5kX2FmdGVyX3NlY29uZHMYAiABKAUSDwoHbWVzc2FnZRgDIAEoCSKBAQoaVmVyaWZ5UmV0dXJuU2Vzc2lvblJlcXVlc3QSEgoKcHJvamVjdF9pZBgBIAEoCRIUCgxjaGFsbGVuZ2VfaWQYAiABKAkSDAoEY29kZRgDIAEoCRIrCgtlbnZpcm9ubWVudBgEIAEoDjIWLmNvbW1vbi52MS5FbnZpcm9ubWVudCJkChtWZXJpZnlSZXR1cm5TZXNzaW9uUmVzcG9uc2USFQoNc2Vzc2lvbl90b2tlbhgBIAEoCRIuCgpleHBpcmVzX2F0GAIgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcCIzCgpSZXR1cm5QYWdlEhEKCXBhZ2Vfc2l6ZRgBIAEoBRISCgpwYWdlX3Rva2VuGAIgASgJItQBChJSZXR1cm5PcmRlclN1bW1hcnkSGgoSY2Fub25pY2FsX29yZGVyX2lkGAEgASgJEhkKEWRpc3BsYXlfcmVmZXJlbmNlGAIgASgJEg8KB2dhdGV3YXkYAyABKAkSMAoMcHVyY2hhc2VkX2F0GAQgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBITCgt0b3RhbF9taW5vchgFIAEoAxIQCghjdXJyZW5jeRgGIAEoCRIdChVyZXR1cm5hYmxlX2xpbmVfY291bnQYByABKAUiawoXTGlz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lbhgCIAEoCRIRCglyZXR1cm5faWQYAyABKAkiRAoTR2V0TXlSZXR1cm5SZXNwb25zZRItCgdyZXF1ZXN0GAEgASgLMhwucHVibGljLnYxLlJldHVyblJlcXVlc3RWaWV3MqEFCg5SZXR1cm5zU2VydmljZRJhChJTdGFydFJldHVyblNlc3Npb24SJC5wdWJsaWMudjEuU3RhcnRSZXR1cm5TZXNzaW9uUmVxdWVzdBolLnB1YmxpYy52MS5TdGFydFJldHVyblNlc3Npb25SZXNwb25zZRJkChNWZXJpZnlSZXR1cm5TZXNzaW9uEiUucHVibGljLnYxLlZlcmlmeVJldHVyblNlc3Npb25SZXF1ZXN0GiYucHVibGljLnYxLlZlcmlmeVJldHVyblNlc3Npb25SZXNwb25zZRJbChBMaXN0UmV0dXJuT3JkZXJzEiIucHVibGljLnYxLkxpc3RSZXR1cm5PcmRlcnNSZXF1ZXN0GiMucHVibGljLnYxLkxpc3RSZXR1cm5PcmRlcnNSZXNwb25zZRJhChJHZXRSZXR1cm5hYmxlT3JkZXISJC5wdWJsaWMudjEuR2V0UmV0dXJuYWJsZU9yZGVyUmVxdWVzdBolLnB1YmxpYy52MS5HZXRSZXR1cm5hYmxlT3JkZXJSZXNwb25zZRJkChNDcmVhdGVSZXR1cm5SZXF1ZXN0EiUucHVibGljLnYxLkNyZWF0ZVJldHVyblJlcXVlc3RSZXF1ZXN0GiYucHVibGljLnYxLkNyZWF0ZVJldHVyblJlcXVlc3RSZXNwb25zZRJSCg1MaXN0TXlSZXR1cm5zEh8ucHVibGljLnYxLkxpc3RNeVJldHVybnNSZXF1ZXN0GiAucHVibGljLnYxLkxpc3RNeVJldHVybnNSZXNwb25zZRJMCgtHZXRNeVJldHVybhIdLnB1YmxpYy52MS5HZXRNeVJldHVyblJlcXVlc3QaHi5wdWJsaWMudjEuR2V0TXlSZXR1cm5SZXNwb25zZWIGcHJvdG8z\", [file_common_v1_environment, file_google_protobuf_timestamp]);\n\n/**\n * @generated from message public.v1.StartReturnSessionRequest\n */\nexport type StartReturnSessionRequest = Message<\"public.v1.StartReturnSessionRequest\"> & {\n /**\n * @generated from field: string project_id = 1;\n */\n projectId: string;\n\n /**\n * @generated from field: string email = 2;\n */\n email: string;\n\n /**\n * @generated from field: common.v1.Environment environment = 3;\n */\n environment: Environment;\n};\n\n/**\n * Describes the message public.v1.StartReturnSessionRequest.\n * Use `create(StartReturnSessionRequestSchema)` to create a new message.\n */\nexport const StartReturnSessionRequestSchema: GenMessage<StartReturnSessionRequest> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 0);\n\n/**\n * @generated from message public.v1.StartReturnSessionResponse\n */\nexport type StartReturnSessionResponse = Message<\"public.v1.StartReturnSessionResponse\"> & {\n /**\n * @generated from field: string challenge_id = 1;\n */\n challengeId: string;\n\n /**\n * @generated from field: int32 resend_after_seconds = 2;\n */\n resendAfterSeconds: number;\n\n /**\n * @generated from field: string message = 3;\n */\n message: string;\n};\n\n/**\n * Describes the message public.v1.StartReturnSessionResponse.\n * Use `create(StartReturnSessionResponseSchema)` to create a new message.\n */\nexport const StartReturnSessionResponseSchema: GenMessage<StartReturnSessionResponse> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 1);\n\n/**\n * @generated from message public.v1.VerifyReturnSessionRequest\n */\nexport type VerifyReturnSessionRequest = Message<\"public.v1.VerifyReturnSessionRequest\"> & {\n /**\n * @generated from field: string project_id = 1;\n */\n projectId: string;\n\n /**\n * @generated from field: string challenge_id = 2;\n */\n challengeId: string;\n\n /**\n * @generated from field: string code = 3;\n */\n code: string;\n\n /**\n * @generated from field: common.v1.Environment environment = 4;\n */\n environment: Environment;\n};\n\n/**\n * Describes the message public.v1.VerifyReturnSessionRequest.\n * Use `create(VerifyReturnSessionRequestSchema)` to create a new message.\n */\nexport const VerifyReturnSessionRequestSchema: GenMessage<VerifyReturnSessionRequest> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 2);\n\n/**\n * @generated from message public.v1.VerifyReturnSessionResponse\n */\nexport type VerifyReturnSessionResponse = Message<\"public.v1.VerifyReturnSessionResponse\"> & {\n /**\n * @generated from field: string session_token = 1;\n */\n sessionToken: string;\n\n /**\n * @generated from field: google.protobuf.Timestamp expires_at = 2;\n */\n expiresAt?: Timestamp;\n};\n\n/**\n * Describes the message public.v1.VerifyReturnSessionResponse.\n * Use `create(VerifyReturnSessionResponseSchema)` to create a new message.\n */\nexport const VerifyReturnSessionResponseSchema: GenMessage<VerifyReturnSessionResponse> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 3);\n\n/**\n * @generated from message public.v1.ReturnPage\n */\nexport type ReturnPage = Message<\"public.v1.ReturnPage\"> & {\n /**\n * @generated from field: int32 page_size = 1;\n */\n pageSize: number;\n\n /**\n * @generated from field: string page_token = 2;\n */\n pageToken: string;\n};\n\n/**\n * Describes the message public.v1.ReturnPage.\n * Use `create(ReturnPageSchema)` to create a new message.\n */\nexport const ReturnPageSchema: GenMessage<ReturnPage> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 4);\n\n/**\n * @generated from message public.v1.ReturnOrderSummary\n */\nexport type ReturnOrderSummary = Message<\"public.v1.ReturnOrderSummary\"> & {\n /**\n * @generated from field: string canonical_order_id = 1;\n */\n canonicalOrderId: string;\n\n /**\n * @generated from field: string display_reference = 2;\n */\n displayReference: string;\n\n /**\n * @generated from field: string gateway = 3;\n */\n gateway: string;\n\n /**\n * @generated from field: google.protobuf.Timestamp purchased_at = 4;\n */\n purchasedAt?: Timestamp;\n\n /**\n * @generated from field: int64 total_minor = 5;\n */\n totalMinor: bigint;\n\n /**\n * @generated from field: string currency = 6;\n */\n currency: string;\n\n /**\n * @generated from field: int32 returnable_line_count = 7;\n */\n returnableLineCount: number;\n};\n\n/**\n * Describes the message public.v1.ReturnOrderSummary.\n * Use `create(ReturnOrderSummarySchema)` to create a new message.\n */\nexport const ReturnOrderSummarySchema: GenMessage<ReturnOrderSummary> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 5);\n\n/**\n * @generated from message public.v1.ListReturnOrdersRequest\n */\nexport type ListReturnOrdersRequest = Message<\"public.v1.ListReturnOrdersRequest\"> & {\n /**\n * @generated from field: string project_id = 1;\n */\n projectId: string;\n\n /**\n * @generated from field: string session_token = 2;\n */\n sessionToken: string;\n\n /**\n * @generated from field: int32 page_size = 3;\n */\n pageSize: number;\n\n /**\n * @generated from field: string page_token = 4;\n */\n pageToken: string;\n};\n\n/**\n * Describes the message public.v1.ListReturnOrdersRequest.\n * Use `create(ListReturnOrdersRequestSchema)` to create a new message.\n */\nexport const ListReturnOrdersRequestSchema: GenMessage<ListReturnOrdersRequest> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 6);\n\n/**\n * @generated from message public.v1.ListReturnOrdersResponse\n */\nexport type ListReturnOrdersResponse = Message<\"public.v1.ListReturnOrdersResponse\"> & {\n /**\n * @generated from field: repeated public.v1.ReturnOrderSummary orders = 1;\n */\n orders: ReturnOrderSummary[];\n\n /**\n * @generated from field: string next_page_token = 2;\n */\n nextPageToken: string;\n\n /**\n * @generated from field: int32 total = 3;\n */\n total: number;\n};\n\n/**\n * Describes the message public.v1.ListReturnOrdersResponse.\n * Use `create(ListReturnOrdersResponseSchema)` to create a new message.\n */\nexport const ListReturnOrdersResponseSchema: GenMessage<ListReturnOrdersResponse> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 7);\n\n/**\n * @generated from message public.v1.ReturnOrderLine\n */\nexport type ReturnOrderLine = Message<\"public.v1.ReturnOrderLine\"> & {\n /**\n * @generated from field: string line_id = 1;\n */\n lineId: string;\n\n /**\n * @generated from field: string product_id = 2;\n */\n productId: string;\n\n /**\n * @generated from field: string variant_id = 3;\n */\n variantId: string;\n\n /**\n * @generated from field: string name = 4;\n */\n name: string;\n\n /**\n * @generated from field: string fulfillment_type = 5;\n */\n fulfillmentType: string;\n\n /**\n * @generated from field: int32 purchased_quantity = 6;\n */\n purchasedQuantity: number;\n\n /**\n * @generated from field: int32 reserved_quantity = 7;\n */\n reservedQuantity: number;\n\n /**\n * @generated from field: int32 returned_quantity = 8;\n */\n returnedQuantity: number;\n\n /**\n * @generated from field: int32 available_quantity = 9;\n */\n availableQuantity: number;\n\n /**\n * @generated from field: int64 regular_unit_minor = 10;\n */\n regularUnitMinor: bigint;\n\n /**\n * @generated from field: int64 paid_unit_minor = 11;\n */\n paidUnitMinor: bigint;\n\n /**\n * @generated from field: string currency = 12;\n */\n currency: string;\n\n /**\n * @generated from field: bool eligible = 13;\n */\n eligible: boolean;\n\n /**\n * @generated from field: string exclusion_reason = 14;\n */\n exclusionReason: string;\n\n /**\n * @generated from field: int64 paid_line_total_minor = 15;\n */\n paidLineTotalMinor: bigint;\n\n /**\n * @generated from field: int64 coupon_allocation_minor = 16;\n */\n couponAllocationMinor: bigint;\n\n /**\n * @generated from field: string access_source = 17;\n */\n accessSource: string;\n\n /**\n * @generated from field: string access_reference = 18;\n */\n accessReference: string;\n};\n\n/**\n * Describes the message public.v1.ReturnOrderLine.\n * Use `create(ReturnOrderLineSchema)` to create a new message.\n */\nexport const ReturnOrderLineSchema: GenMessage<ReturnOrderLine> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 8);\n\n/**\n * @generated from message public.v1.ReturnOrderDetail\n */\nexport type ReturnOrderDetail = Message<\"public.v1.ReturnOrderDetail\"> & {\n /**\n * @generated from field: string canonical_order_id = 1;\n */\n canonicalOrderId: string;\n\n /**\n * @generated from field: string display_reference = 2;\n */\n displayReference: string;\n\n /**\n * @generated from field: string gateway = 3;\n */\n gateway: string;\n\n /**\n * @generated from field: google.protobuf.Timestamp purchased_at = 4;\n */\n purchasedAt?: Timestamp;\n\n /**\n * @generated from field: int64 total_minor = 5;\n */\n totalMinor: bigint;\n\n /**\n * @generated from field: string currency = 6;\n */\n currency: string;\n\n /**\n * @generated from field: repeated public.v1.ReturnOrderLine lines = 7;\n */\n lines: ReturnOrderLine[];\n};\n\n/**\n * Describes the message public.v1.ReturnOrderDetail.\n * Use `create(ReturnOrderDetailSchema)` to create a new message.\n */\nexport const ReturnOrderDetailSchema: GenMessage<ReturnOrderDetail> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 9);\n\n/**\n * @generated from message public.v1.ReturnRequestLineInput\n */\nexport type ReturnRequestLineInput = Message<\"public.v1.ReturnRequestLineInput\"> & {\n /**\n * @generated from field: string line_id = 1;\n */\n lineId: string;\n\n /**\n * @generated from field: int32 quantity = 2;\n */\n quantity: number;\n};\n\n/**\n * Describes the message public.v1.ReturnRequestLineInput.\n * Use `create(ReturnRequestLineInputSchema)` to create a new message.\n */\nexport const ReturnRequestLineInputSchema: GenMessage<ReturnRequestLineInput> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 10);\n\n/**\n * @generated from message public.v1.ReturnHistoryEntry\n */\nexport type ReturnHistoryEntry = Message<\"public.v1.ReturnHistoryEntry\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * @generated from field: string reference = 2;\n */\n reference: string;\n\n /**\n * @generated from field: string status = 3;\n */\n status: string;\n\n /**\n * @generated from field: google.protobuf.Timestamp created_at = 4;\n */\n createdAt?: Timestamp;\n};\n\n/**\n * Describes the message public.v1.ReturnHistoryEntry.\n * Use `create(ReturnHistoryEntrySchema)` to create a new message.\n */\nexport const ReturnHistoryEntrySchema: GenMessage<ReturnHistoryEntry> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 11);\n\n/**\n * @generated from message public.v1.ReturnRequestLineView\n */\nexport type ReturnRequestLineView = Message<\"public.v1.ReturnRequestLineView\"> & {\n /**\n * @generated from field: string line_id = 1;\n */\n lineId: string;\n\n /**\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * @generated from field: string fulfillment_type = 3;\n */\n fulfillmentType: string;\n\n /**\n * @generated from field: int32 requested_quantity = 4;\n */\n requestedQuantity: number;\n\n /**\n * @generated from field: int32 approved_quantity = 5;\n */\n approvedQuantity: number;\n\n /**\n * @generated from field: int32 received_quantity = 6;\n */\n receivedQuantity: number;\n\n /**\n * @generated from field: string access_status = 7;\n */\n accessStatus: string;\n};\n\n/**\n * Describes the message public.v1.ReturnRequestLineView.\n * Use `create(ReturnRequestLineViewSchema)` to create a new message.\n */\nexport const ReturnRequestLineViewSchema: GenMessage<ReturnRequestLineView> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 12);\n\n/**\n * @generated from message public.v1.ReturnRequestView\n */\nexport type ReturnRequestView = Message<\"public.v1.ReturnRequestView\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * @generated from field: string reference = 2;\n */\n reference: string;\n\n /**\n * @generated from field: string canonical_order_id = 3;\n */\n canonicalOrderId: string;\n\n /**\n * @generated from field: string status = 4;\n */\n status: string;\n\n /**\n * @generated from field: string refund_status = 5;\n */\n refundStatus: string;\n\n /**\n * @generated from field: int64 refund_amount_minor = 6;\n */\n refundAmountMinor: bigint;\n\n /**\n * @generated from field: string currency = 7;\n */\n currency: string;\n\n /**\n * @generated from field: string customer_note = 8;\n */\n customerNote: string;\n\n /**\n * @generated from field: int64 version = 9;\n */\n version: bigint;\n\n /**\n * @generated from field: google.protobuf.Timestamp created_at = 10;\n */\n createdAt?: Timestamp;\n\n /**\n * @generated from field: repeated public.v1.ReturnRequestLineView lines = 11;\n */\n lines: ReturnRequestLineView[];\n\n /**\n * @generated from field: repeated public.v1.ReturnHistoryEntry history = 12;\n */\n history: ReturnHistoryEntry[];\n\n /**\n * @generated from field: string return_instructions = 13;\n */\n returnInstructions: string;\n};\n\n/**\n * Describes the message public.v1.ReturnRequestView.\n * Use `create(ReturnRequestViewSchema)` to create a new message.\n */\nexport const ReturnRequestViewSchema: GenMessage<ReturnRequestView> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 13);\n\n/**\n * @generated from message public.v1.GetReturnableOrderRequest\n */\nexport type GetReturnableOrderRequest = Message<\"public.v1.GetReturnableOrderRequest\"> & {\n /**\n * @generated from field: string project_id = 1;\n */\n projectId: string;\n\n /**\n * @generated from field: string session_token = 2;\n */\n sessionToken: string;\n\n /**\n * @generated from field: string canonical_order_id = 3;\n */\n canonicalOrderId: string;\n};\n\n/**\n * Describes the message public.v1.GetReturnableOrderRequest.\n * Use `create(GetReturnableOrderRequestSchema)` to create a new message.\n */\nexport const GetReturnableOrderRequestSchema: GenMessage<GetReturnableOrderRequest> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 14);\n\n/**\n * @generated from message public.v1.GetReturnableOrderResponse\n */\nexport type GetReturnableOrderResponse = Message<\"public.v1.GetReturnableOrderResponse\"> & {\n /**\n * @generated from field: public.v1.ReturnOrderDetail order = 1;\n */\n order?: ReturnOrderDetail;\n\n /**\n * @generated from field: repeated public.v1.ReturnHistoryEntry return_history = 2;\n */\n returnHistory: ReturnHistoryEntry[];\n};\n\n/**\n * Describes the message public.v1.GetReturnableOrderResponse.\n * Use `create(GetReturnableOrderResponseSchema)` to create a new message.\n */\nexport const GetReturnableOrderResponseSchema: GenMessage<GetReturnableOrderResponse> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 15);\n\n/**\n * @generated from message public.v1.CreateReturnRequestRequest\n */\nexport type CreateReturnRequestRequest = Message<\"public.v1.CreateReturnRequestRequest\"> & {\n /**\n * @generated from field: string project_id = 1;\n */\n projectId: string;\n\n /**\n * @generated from field: string session_token = 2;\n */\n sessionToken: string;\n\n /**\n * @generated from field: string canonical_order_id = 3;\n */\n canonicalOrderId: string;\n\n /**\n * @generated from field: repeated public.v1.ReturnRequestLineInput items = 4;\n */\n items: ReturnRequestLineInput[];\n\n /**\n * @generated from field: string note = 5;\n */\n note: string;\n\n /**\n * @generated from field: string idempotency_key = 6;\n */\n idempotencyKey: string;\n};\n\n/**\n * Describes the message public.v1.CreateReturnRequestRequest.\n * Use `create(CreateReturnRequestRequestSchema)` to create a new message.\n */\nexport const CreateReturnRequestRequestSchema: GenMessage<CreateReturnRequestRequest> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 16);\n\n/**\n * @generated from message public.v1.CreateReturnRequestResponse\n */\nexport type CreateReturnRequestResponse = Message<\"public.v1.CreateReturnRequestResponse\"> & {\n /**\n * @generated from field: public.v1.ReturnRequestView request = 1;\n */\n request?: ReturnRequestView;\n};\n\n/**\n * Describes the message public.v1.CreateReturnRequestResponse.\n * Use `create(CreateReturnRequestResponseSchema)` to create a new message.\n */\nexport const CreateReturnRequestResponseSchema: GenMessage<CreateReturnRequestResponse> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 17);\n\n/**\n * @generated from message public.v1.ListMyReturnsRequest\n */\nexport type ListMyReturnsRequest = Message<\"public.v1.ListMyReturnsRequest\"> & {\n /**\n * @generated from field: string project_id = 1;\n */\n projectId: string;\n\n /**\n * @generated from field: string session_token = 2;\n */\n sessionToken: string;\n\n /**\n * @generated from field: int32 page_size = 3;\n */\n pageSize: number;\n\n /**\n * @generated from field: string page_token = 4;\n */\n pageToken: string;\n};\n\n/**\n * Describes the message public.v1.ListMyReturnsRequest.\n * Use `create(ListMyReturnsRequestSchema)` to create a new message.\n */\nexport const ListMyReturnsRequestSchema: GenMessage<ListMyReturnsRequest> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 18);\n\n/**\n * @generated from message public.v1.ListMyReturnsResponse\n */\nexport type ListMyReturnsResponse = Message<\"public.v1.ListMyReturnsResponse\"> & {\n /**\n * @generated from field: repeated public.v1.ReturnRequestView returns = 1;\n */\n returns: ReturnRequestView[];\n\n /**\n * @generated from field: string next_page_token = 2;\n */\n nextPageToken: string;\n\n /**\n * @generated from field: int32 total = 3;\n */\n total: number;\n};\n\n/**\n * Describes the message public.v1.ListMyReturnsResponse.\n * Use `create(ListMyReturnsResponseSchema)` to create a new message.\n */\nexport const ListMyReturnsResponseSchema: GenMessage<ListMyReturnsResponse> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 19);\n\n/**\n * @generated from message public.v1.GetMyReturnRequest\n */\nexport type GetMyReturnRequest = Message<\"public.v1.GetMyReturnRequest\"> & {\n /**\n * @generated from field: string project_id = 1;\n */\n projectId: string;\n\n /**\n * @generated from field: string session_token = 2;\n */\n sessionToken: string;\n\n /**\n * @generated from field: string return_id = 3;\n */\n returnId: string;\n};\n\n/**\n * Describes the message public.v1.GetMyReturnRequest.\n * Use `create(GetMyReturnRequestSchema)` to create a new message.\n */\nexport const GetMyReturnRequestSchema: GenMessage<GetMyReturnRequest> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 20);\n\n/**\n * @generated from message public.v1.GetMyReturnResponse\n */\nexport type GetMyReturnResponse = Message<\"public.v1.GetMyReturnResponse\"> & {\n /**\n * @generated from field: public.v1.ReturnRequestView request = 1;\n */\n request?: ReturnRequestView;\n};\n\n/**\n * Describes the message public.v1.GetMyReturnResponse.\n * Use `create(GetMyReturnResponseSchema)` to create a new message.\n */\nexport const GetMyReturnResponseSchema: GenMessage<GetMyReturnResponse> = /*@__PURE__*/\n messageDesc(file_public_v1_returns, 21);\n\n/**\n * @generated from service public.v1.ReturnsService\n */\nexport const ReturnsService: GenService<{\n /**\n * @generated from rpc public.v1.ReturnsService.StartReturnSession\n */\n startReturnSession: {\n methodKind: \"unary\";\n input: typeof StartReturnSessionRequestSchema;\n output: typeof StartReturnSessionResponseSchema;\n },\n /**\n * @generated from rpc public.v1.ReturnsService.VerifyReturnSession\n */\n verifyReturnSession: {\n methodKind: \"unary\";\n input: typeof VerifyReturnSessionRequestSchema;\n output: typeof VerifyReturnSessionResponseSchema;\n },\n /**\n * @generated from rpc public.v1.ReturnsService.ListReturnOrders\n */\n listReturnOrders: {\n methodKind: \"unary\";\n input: typeof ListReturnOrdersRequestSchema;\n output: typeof ListReturnOrdersResponseSchema;\n },\n /**\n * @generated from rpc public.v1.ReturnsService.GetReturnableOrder\n */\n getReturnableOrder: {\n methodKind: \"unary\";\n input: typeof GetReturnableOrderRequestSchema;\n output: typeof GetReturnableOrderResponseSchema;\n },\n /**\n * @generated from rpc public.v1.ReturnsService.CreateReturnRequest\n */\n createReturnRequest: {\n methodKind: \"unary\";\n input: typeof CreateReturnRequestRequestSchema;\n output: typeof CreateReturnRequestResponseSchema;\n },\n /**\n * @generated from rpc public.v1.ReturnsService.ListMyReturns\n */\n listMyReturns: {\n methodKind: \"unary\";\n input: typeof ListMyReturnsRequestSchema;\n output: typeof ListMyReturnsResponseSchema;\n },\n /**\n * @generated from rpc public.v1.ReturnsService.GetMyReturn\n */\n getMyReturn: {\n methodKind: \"unary\";\n input: typeof GetMyReturnRequestSchema;\n output: typeof GetMyReturnResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_public_v1_returns, 0);\n\n"],"mappings":"ukBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,oBAAAE,EAAA,2BAAAC,EAAA,gBAAAC,EAAA,oBAAAC,EAAA,iBAAAC,EAAA,oBAAAC,EAAA,qBAAAC,EAAA,uBAAAC,IAAA,eAAAC,GAAAV,ICEA,IAAAW,EAA8D,+BAC9DC,EAAuC,mCCEvC,IAAAC,EAAmC,wCAKtBC,KACX,YAAS,oOAAoO,EAKnOC,OAIVA,IAAA,WAAa,GAAb,aAKAA,IAAA,KAAO,GAAP,OATUA,OAAA,ICVZ,IAAAC,EAAmD,wCAInD,IAAAC,EAA+C,kCAMlCC,MACX,YAAS,2pKAA4pK,CAACC,EAA4B,gCAA8B,CAAC,EA2wB5tK,IAAMC,KA0DX,eAAYC,GAAwB,CAAC,EF30BvC,IAAAC,EAAwF,iCACxFC,EAA4E,qBA2DzBC,EAAA,6BAxC7CC,KAAiB,iBAA0C,IAAI,EAG9D,SAASC,EAAuB,CACrC,UAAAC,EACA,KAAAC,EAAO,qBACP,YAAAC,IACA,SAAAC,CACF,EAAgC,CAC9B,IAAMC,EAAQ,GAAGH,EAAK,QAAQ,MAAO,EAAE,CAAC,IAAID,CAAS,IAAIE,CAAW,GAC9D,CAACG,EAASC,CAAe,KAAI,YAA+D,EAC5FC,EAAeF,GAAS,QAAUD,EAAQC,EAAQ,MAAQ,OAC1DG,EAAYH,GAAS,QAAUD,EAAQC,EAAQ,UAAY,OAC3D,C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AAQ,SAAAA,EAAQ,UAAU,GAAS,KAAI,QAAC,KAAE,qBAASA,EAAQ,QAAO,EAAKA,EAAQ,uBAAsB,OAAC,KAAE,UAAU,OAAQ,SAAAA,EAAQ,mBAAmB,KAAK,OAAC,UAAO,KAAK,SAAS,QAAS,IAAM,CAAEC,EAAW,MAAS,EAAGR,EAAiB,MAAS,EAAGE,EAAe,MAAS,EAAGE,EAAc,CAAC,CAAC,EAAQX,EAAU,QAAQ,CAAG,EAAG,UAAU,iBAAkB,SAAAJ,EAAM,QAAQ,GAAS,EACpeI,EAAU,MAAM,SAAWA,EAAU,KAAK,QAAQ,OAAS,GAAK,CAACc,MAAW,QAAC,OAAI,UAAU,OAAO,oBAAC,MAAG,UAAU,mBAAoB,SAAAlB,EAAM,QAAQ,EAAMI,EAAU,KAAK,QAAQ,IAAK6B,MAAS,QAAC,OAAkB,UAAU,gBAAgB,oBAAC,UAAQ,SAAAA,EAAK,UAAU,KAAS,OAAC,QAAK,UAAU,OAAQ,SAAAA,EAAK,OAAO,IAAxGA,EAAK,EAA0G,CAAM,GAAE,EAC9TzD,MAAS,OAAC,KAAE,KAAK,QAAQ,UAAU,4BAA6B,SAAAA,EAAM,QAAQ,GACjF,CAEJ,CAEA,SAASmD,EAAYO,EAAyB,CAC5C,OAAQ,OAAOA,CAAM,EAAI,KAAK,QAAQ,CAAC,CACzC","names":["returns_exports","__export","BitsnapReturns","BitsnapReturnsProvider","Environment","useCreateReturn","useMyReturns","useReturnOrders","useReturnSession","useReturnableOrder","__toCommonJS","import_connect","import_connect_web","import_codegenv2","file_common_v1_environment","Environment","import_codegenv2","import_wkt","file_public_v1_returns","file_common_v1_environment","ReturnsService","file_public_v1_returns","import_react_query","import_react","import_jsx_runtime","ReturnsContext","BitsnapReturnsProvider","projectID","host","environment","children","scope","session","setSessionState","sessionToken","expiresAt","queryClient","client","ReturnsService","contextValue","token","expiry","useReturnsContext","value","handleSessionError","error","clear","useReturnSession","ctx","start","email","verify","challengeId","code","result","logout","useReturnOrders","pageSize","pageToken","e","useReturnableOrder","canonicalOrderID","useCreateReturn","input","useMyReturns","defaultTexts","BitsnapReturns","props","BitsnapReturnsForm","texts","orderPageToken","setOrderPageToken","ordersQuery","mineQuery","create","setEmail","challengeID","setChallengeID","setCode","selectedOrder","setSelectedOrder","orderDetail","setOrderDetail","quantities","setQuantities","note","setNote","created","setCreated","submittingRef","idempotencyKeyRef","orderQuery","React","style","response","order","formatMinor","line","prev","q","quantity","lineId","item","amount"]}
|
package/dist/returns.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,c as r,d as s,e as t,f as n,g as u,h as o,i as p}from"./chunk-O4ICBP4G.mjs";import"./chunk-U6FLIRIV.mjs";export{p as BitsnapReturns,r as BitsnapReturnsProvider,e as Environment,u as useCreateReturn,o as useMyReturns,t as useReturnOrders,s as useReturnSession,n as useReturnableOrder};
|
|
2
|
+
//# sourceMappingURL=returns.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|