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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/models.ts"],"sourcesContent":["import * as z from \"zod\";\n\nexport namespace BitsnapModels {\n export const BaselinkerFieldsSchema = z.object({\n storageID: z.string().optional(),\n });\n export type BaselinkerFields = z.infer<typeof BaselinkerFieldsSchema>;\n\n export const MetadataSchema = z.record(z.string(), z.any());\n\n export const VariantSchema = z.object({\n id: z.string(),\n name: z.string(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n images: z.array(z.string()),\n availableQuantity: z.number().optional(),\n isDeliverable: z.boolean().optional(),\n estimatedDeliveryAt: z.number().optional(),\n });\n export type Variant = z.infer<typeof VariantSchema>;\n\n export const AdditionalSchema = z.object({\n sku: z.string().optional(),\n baselinkerFields: BaselinkerFieldsSchema.optional(),\n isPresale: z.boolean().optional(),\n });\n export type Additional = z.infer<typeof AdditionalSchema>;\n\n export const ItemSchema = z.object({\n id: z.string(),\n ownerID: z.string().optional(),\n name: z.string(),\n description: z.union([z.string(), z.null()]).optional(),\n createdAt: z.number().optional(),\n updatedAt: z.number().optional(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n image_url: z.string(),\n images: z.array(z.string()),\n isDeliverable: z.boolean().optional(),\n availableQuantity: z.number().optional(),\n additional: AdditionalSchema.optional(),\n variants: z.array(VariantSchema).optional(),\n estimatedDeliveryAt: z.number().optional(),\n });\n export type Item = z.infer<typeof ItemSchema>;\n\n export const DataSchema = z.object({\n success: z.boolean(),\n result: z.array(ItemSchema),\n totalCount: z.number(),\n });\n export type Data = z.infer<typeof DataSchema>;\n\n export const ProductsResultResultSchema = z.object({\n data: DataSchema,\n });\n export type ProductsResultResult = z.infer<typeof ProductsResultResultSchema>;\n\n export const ProductsResultElementSchema = z.array(\n z.object({\n result: ProductsResultResultSchema,\n }),\n );\n export type ProductsResultElement = z.infer<\n typeof ProductsResultElementSchema\n >;\n\n export const ProductResultSchema = z.array(\n z.object({\n result: z.object({\n data: z.object({\n success: z.boolean(),\n message: z.string().optional(),\n result: ItemSchema.optional(),\n }),\n }),\n }),\n );\n}\n"],"mappings":"6BAAA,UAAYA,MAAO,MAEZ,IAAUC,OACFA,EAAA,uBAA2B,SAAO,CAC7C,UAAa,SAAO,EAAE,SAAS,CACjC,CAAC,EAGYA,EAAA,eAAmB,SAAS,SAAO,EAAK,MAAI,CAAC,EAE7CA,EAAA,cAAkB,SAAO,CACpC,GAAM,SAAO,EACb,KAAQ,SAAO,EACf,MAAS,SAAO,EAChB,SAAY,SAAO,EACnB,SAAUA,EAAA,eAAe,SAAS,EAClC,OAAU,QAAQ,SAAO,CAAC,EAC1B,kBAAqB,SAAO,EAAE,SAAS,EACvC,cAAiB,UAAQ,EAAE,SAAS,EACpC,oBAAuB,SAAO,EAAE,SAAS,CAC3C,CAAC,EAGYA,EAAA,iBAAqB,SAAO,CACvC,IAAO,SAAO,EAAE,SAAS,EACzB,iBAAkBA,EAAA,uBAAuB,SAAS,EAClD,UAAa,UAAQ,EAAE,SAAS,CAClC,CAAC,EAGYA,EAAA,WAAe,SAAO,CACjC,GAAM,SAAO,EACb,QAAW,SAAO,EAAE,SAAS,EAC7B,KAAQ,SAAO,EACf,YAAe,QAAM,CAAG,SAAO,EAAK,OAAK,CAAC,CAAC,EAAE,SAAS,EACtD,UAAa,SAAO,EAAE,SAAS,EAC/B,UAAa,SAAO,EAAE,SAAS,EAC/B,MAAS,SAAO,EAChB,SAAY,SAAO,EACnB,SAAUA,EAAA,eAAe,SAAS,EAClC,UAAa,SAAO,EACpB,OAAU,QAAQ,SAAO,CAAC,EAC1B,cAAiB,UAAQ,EAAE,SAAS,EACpC,kBAAqB,SAAO,EAAE,SAAS,EACvC,WAAYA,EAAA,iBAAiB,SAAS,EACtC,SAAY,QAAMA,EAAA,aAAa,EAAE,SAAS,EAC1C,oBAAuB,SAAO,EAAE,SAAS,CAC3C,CAAC,EAGYA,EAAA,WAAe,SAAO,CACjC,QAAW,UAAQ,EACnB,OAAU,QAAMA,EAAA,UAAU,EAC1B,WAAc,SAAO,CACvB,CAAC,EAGYA,EAAA,2BAA+B,SAAO,CACjD,KAAMA,EAAA,UACR,CAAC,EAGYA,EAAA,4BAAgC,QACzC,SAAO,CACP,OAAQA,EAAA,0BACV,CAAC,CACH,EAKaA,EAAA,oBAAwB,QACjC,SAAO,CACP,OAAU,SAAO,CACf,KAAQ,SAAO,CACb,QAAW,UAAQ,EACnB,QAAW,SAAO,EAAE,SAAS,EAC7B,OAAQA,EAAA,WAAW,SAAS,CAC9B,CAAC,CACH,CAAC,CACH,CAAC,CACH,IA/EeA,MAAA","names":["z","BitsnapModels"]}
1
+ {"version":3,"sources":["../src/models.ts"],"sourcesContent":["import * as z from \"zod\";\n\nexport namespace BitsnapModels {\n export const BaselinkerFieldsSchema = z.object({\n storageID: z.string().optional(),\n });\n export type BaselinkerFields = z.infer<typeof BaselinkerFieldsSchema>;\n\n export const MetadataSchema = z.record(z.string(), z.any());\n\n export const ProductPricingSchema = z.object({\n regularPrice: z.number(),\n effectivePrice: z.number(),\n currency: z.string(),\n discount: z.object({\n id: z.string(),\n type: z.enum([\"FIXED\", \"PERCENTAGE\"]),\n value: z.number(),\n status: z.enum([\"ACTIVE\", \"SCHEDULED\", \"EXPIRED\", \"DISABLED\"]),\n startsAt: z.number().optional(),\n endsAt: z.number().optional(),\n }).optional(),\n referencePrice: z.object({\n amount: z.number().optional(),\n windowDays: z.literal(30),\n asOf: z.number(),\n basis: z.literal(\"observed-history\"),\n historyAvailable: z.boolean(),\n }),\n priceVersion: z.string(),\n nextPriceChangeAt: z.number().optional(),\n });\n export type ProductPricing = z.infer<typeof ProductPricingSchema>;\n\n export const VariantSchema = z.object({\n id: z.string(),\n name: z.string(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n images: z.array(z.string()),\n availableQuantity: z.number().optional(),\n isDeliverable: z.boolean().optional(),\n estimatedDeliveryAt: z.number().optional(),\n pricing: ProductPricingSchema.optional(),\n });\n export type Variant = z.infer<typeof VariantSchema>;\n\n export const AdditionalSchema = z.object({\n sku: z.string().optional(),\n baselinkerFields: BaselinkerFieldsSchema.optional(),\n isPresale: z.boolean().optional(),\n });\n export type Additional = z.infer<typeof AdditionalSchema>;\n\n export const ItemSchema = z.object({\n id: z.string(),\n ownerID: z.string().optional(),\n name: z.string(),\n description: z.union([z.string(), z.null()]).optional(),\n createdAt: z.number().optional(),\n updatedAt: z.number().optional(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n image_url: z.string(),\n images: z.array(z.string()),\n isDeliverable: z.boolean().optional(),\n availableQuantity: z.number().optional(),\n additional: AdditionalSchema.optional(),\n variants: z.array(VariantSchema).optional(),\n estimatedDeliveryAt: z.number().optional(),\n pricing: ProductPricingSchema.optional(),\n });\n export type Item = z.infer<typeof ItemSchema>;\n\n export const DataSchema = z.object({\n success: z.boolean(),\n result: z.array(ItemSchema),\n totalCount: z.number(),\n });\n export type Data = z.infer<typeof DataSchema>;\n\n export const ProductsResultResultSchema = z.object({\n data: DataSchema,\n });\n export type ProductsResultResult = z.infer<typeof ProductsResultResultSchema>;\n\n export const ProductsResultElementSchema = z.array(\n z.object({\n result: ProductsResultResultSchema,\n }),\n );\n export type ProductsResultElement = z.infer<\n typeof ProductsResultElementSchema\n >;\n\n export const ProductResultSchema = z.array(\n z.object({\n result: z.object({\n data: z.object({\n success: z.boolean(),\n message: z.string().optional(),\n result: ItemSchema.optional(),\n }),\n }),\n }),\n );\n}\n"],"mappings":"6BAAA,UAAYA,MAAO,MAEZ,IAAUC,OACFA,EAAA,uBAA2B,SAAO,CAC7C,UAAa,SAAO,EAAE,SAAS,CACjC,CAAC,EAGYA,EAAA,eAAmB,SAAS,SAAO,EAAK,MAAI,CAAC,EAE7CA,EAAA,qBAAyB,SAAO,CAC3C,aAAgB,SAAO,EACvB,eAAkB,SAAO,EACzB,SAAY,SAAO,EACnB,SAAY,SAAO,CACjB,GAAM,SAAO,EACb,KAAQ,OAAK,CAAC,QAAS,YAAY,CAAC,EACpC,MAAS,SAAO,EAChB,OAAU,OAAK,CAAC,SAAU,YAAa,UAAW,UAAU,CAAC,EAC7D,SAAY,SAAO,EAAE,SAAS,EAC9B,OAAU,SAAO,EAAE,SAAS,CAC9B,CAAC,EAAE,SAAS,EACZ,eAAkB,SAAO,CACvB,OAAU,SAAO,EAAE,SAAS,EAC5B,WAAc,UAAQ,EAAE,EACxB,KAAQ,SAAO,EACf,MAAS,UAAQ,kBAAkB,EACnC,iBAAoB,UAAQ,CAC9B,CAAC,EACD,aAAgB,SAAO,EACvB,kBAAqB,SAAO,EAAE,SAAS,CACzC,CAAC,EAGYA,EAAA,cAAkB,SAAO,CACpC,GAAM,SAAO,EACb,KAAQ,SAAO,EACf,MAAS,SAAO,EAChB,SAAY,SAAO,EACnB,SAAUA,EAAA,eAAe,SAAS,EAClC,OAAU,QAAQ,SAAO,CAAC,EAC1B,kBAAqB,SAAO,EAAE,SAAS,EACvC,cAAiB,UAAQ,EAAE,SAAS,EACpC,oBAAuB,SAAO,EAAE,SAAS,EACzC,QAASA,EAAA,qBAAqB,SAAS,CACzC,CAAC,EAGYA,EAAA,iBAAqB,SAAO,CACvC,IAAO,SAAO,EAAE,SAAS,EACzB,iBAAkBA,EAAA,uBAAuB,SAAS,EAClD,UAAa,UAAQ,EAAE,SAAS,CAClC,CAAC,EAGYA,EAAA,WAAe,SAAO,CACjC,GAAM,SAAO,EACb,QAAW,SAAO,EAAE,SAAS,EAC7B,KAAQ,SAAO,EACf,YAAe,QAAM,CAAG,SAAO,EAAK,OAAK,CAAC,CAAC,EAAE,SAAS,EACtD,UAAa,SAAO,EAAE,SAAS,EAC/B,UAAa,SAAO,EAAE,SAAS,EAC/B,MAAS,SAAO,EAChB,SAAY,SAAO,EACnB,SAAUA,EAAA,eAAe,SAAS,EAClC,UAAa,SAAO,EACpB,OAAU,QAAQ,SAAO,CAAC,EAC1B,cAAiB,UAAQ,EAAE,SAAS,EACpC,kBAAqB,SAAO,EAAE,SAAS,EACvC,WAAYA,EAAA,iBAAiB,SAAS,EACtC,SAAY,QAAMA,EAAA,aAAa,EAAE,SAAS,EAC1C,oBAAuB,SAAO,EAAE,SAAS,EACzC,QAASA,EAAA,qBAAqB,SAAS,CACzC,CAAC,EAGYA,EAAA,WAAe,SAAO,CACjC,QAAW,UAAQ,EACnB,OAAU,QAAMA,EAAA,UAAU,EAC1B,WAAc,SAAO,CACvB,CAAC,EAGYA,EAAA,2BAA+B,SAAO,CACjD,KAAMA,EAAA,UACR,CAAC,EAGYA,EAAA,4BAAgC,QACzC,SAAO,CACP,OAAQA,EAAA,0BACV,CAAC,CACH,EAKaA,EAAA,oBAAwB,QACjC,SAAO,CACP,OAAU,SAAO,CACf,KAAQ,SAAO,CACb,QAAW,UAAQ,EACnB,QAAW,SAAO,EAAE,SAAS,EAC7B,OAAQA,EAAA,WAAW,SAAS,CAC9B,CAAC,CACH,CAAC,CACH,CAAC,CACH,IAzGeA,IAAA","names":["z","BitsnapModels"]}
@@ -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 };