@leatcom/portal-sessions 0.0.24 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,374 @@
1
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
2
+ import { ReactElement } from 'react';
3
+
4
+ export declare type Attribute = {
5
+ attribute: {
6
+ field_type: string;
7
+ id: number;
8
+ is_hard_read_only: boolean;
9
+ is_soft_read_only: boolean;
10
+ label: string;
11
+ name: string;
12
+ options: [];
13
+ type: any;
14
+ };
15
+ value: string;
16
+ };
17
+
18
+ declare type Column = {
19
+ align?: "left" | "center" | "right";
20
+ value: ColumnValue;
21
+ };
22
+
23
+ declare type ColumnValue = {
24
+ id: number;
25
+ type: string;
26
+ title?: string;
27
+ subtitle?: string;
28
+ label?: string;
29
+ hidden?: boolean;
30
+ disabled?: boolean;
31
+ };
32
+
33
+ export declare type ContactAttributeFormElement = {
34
+ bottom_helper: any | undefined;
35
+ defaultValue: string;
36
+ dimensions: [];
37
+ disabled: boolean;
38
+ hidden: boolean;
39
+ hide_label: boolean;
40
+ id: string;
41
+ is_clearable: boolean;
42
+ label: string;
43
+ max_amount: number;
44
+ max_length: number;
45
+ meta: [];
46
+ min_amount: number;
47
+ name: string;
48
+ options: Array<Option_2>;
49
+ placeholder: string;
50
+ prefix: string | undefined;
51
+ render_as: string;
52
+ required: boolean;
53
+ search: Search;
54
+ searchable: boolean;
55
+ sort_type: any | undefined;
56
+ status: any | undefined;
57
+ step: string | number | undefined;
58
+ suffix: string | null;
59
+ tooltip: string;
60
+ top_helper: any | undefined;
61
+ type: any;
62
+ };
63
+
64
+ export declare type ContactResource = {
65
+ id: number;
66
+ uuid: string;
67
+ email: string;
68
+ attributes: Array<Attribute>;
69
+ tier: Tier | null;
70
+ subscriptions: Array<Subscription>;
71
+ credit_balance: CreditBalance;
72
+ prepaid_balance: PrepaidBalance;
73
+ current_values: {
74
+ [key: string]: string | boolean | number;
75
+ };
76
+ current_display_values: {
77
+ [key: string]: string;
78
+ };
79
+ };
80
+
81
+ export declare type CreditBalance = {
82
+ balance: number;
83
+ id: number;
84
+ };
85
+
86
+ export declare type CreditReceptionTransactionResource = {
87
+ type: string;
88
+ credits: number;
89
+ contact: {
90
+ uuid: string;
91
+ };
92
+ shop: {
93
+ name: string;
94
+ uuid: string;
95
+ };
96
+ contact_identifier: string;
97
+ created_at: string;
98
+ uuid: string;
99
+ unit_value: string;
100
+ unit: string;
101
+ };
102
+
103
+ export declare function DefaultSession({ uuid, host }: DefaultSessionProps): JSX_2.Element;
104
+
105
+ export declare type DefaultSessionProps = {
106
+ uuid: string;
107
+ host?: string;
108
+ };
109
+
110
+ declare type Event_2 = {
111
+ data: {
112
+ [p: string]: never;
113
+ };
114
+ type: string;
115
+ };
116
+ export { Event_2 as Event }
117
+
118
+ export declare type GiftcardProgram = {
119
+ id: number;
120
+ name: string;
121
+ uuid: string;
122
+ max_amount_in_cents: number;
123
+ };
124
+
125
+ export declare type GiftcardRecipient = {
126
+ id: number;
127
+ email: string;
128
+ status: number;
129
+ opens: number;
130
+ clicks: number;
131
+ };
132
+
133
+ export declare type GiftcardResource = {
134
+ id: number;
135
+ uuid: string;
136
+ type: string;
137
+ hash: string;
138
+ amount_in_cents: number;
139
+ upgradeable: boolean;
140
+ active: boolean;
141
+ expiration_date: string;
142
+ amount: number;
143
+ url: string;
144
+ display_amount: string;
145
+ formatted_expiration_date: string;
146
+ giftcard_program: GiftcardProgram;
147
+ giftcard_recipients: Array<GiftcardRecipient>;
148
+ };
149
+
150
+ export declare type GiftcardTransactionResource = {
151
+ id: number;
152
+ uuid: string;
153
+ amount_in_cents: number;
154
+ type: string;
155
+ settled: boolean;
156
+ card: {
157
+ id: number;
158
+ uuid: string;
159
+ };
160
+ shop: {
161
+ id: number;
162
+ uuid: string;
163
+ name: string;
164
+ };
165
+ settlements: [];
166
+ created_at: string;
167
+ };
168
+
169
+ declare type Header = {
170
+ items: HeaderItem[];
171
+ };
172
+
173
+ declare type HeaderItem = {
174
+ value?: string;
175
+ align?: "left" | "center" | "right";
176
+ };
177
+
178
+ export declare type InputData = {
179
+ scanner_type?: ScannerType;
180
+ enable_on_screen_keyboard?: boolean;
181
+ enable_email_identification?: boolean;
182
+ enable_registration?: boolean;
183
+ amount_in_cents?: number;
184
+ allow_multiple_giftcards?: boolean;
185
+ };
186
+
187
+ export declare type LoyaltyProgram = {
188
+ name: string;
189
+ max_amount: number;
190
+ custom_credit_name: string;
191
+ };
192
+
193
+ declare type Option_2 = {
194
+ value: string;
195
+ label: string;
196
+ };
197
+ export { Option_2 as Option }
198
+
199
+ export declare enum PortalRoute {
200
+ REDEEM_GIFTCARD = "/redeem_giftcard",
201
+ TOP_UP_GIFTCARD = "/top_up_giftcard",
202
+ PORTAL = "/portal",
203
+ PREPAID = "/prepaid",
204
+ SAVE = "/save",
205
+ VOUCHER = "/voucher"
206
+ }
207
+
208
+ export declare function PortalSession(props: PortalSessionProps): ReactElement;
209
+
210
+ export declare type PortalSessionApiResource = {
211
+ type: PortalType;
212
+ uuid: string;
213
+ contact: {
214
+ uuid: string;
215
+ };
216
+ input_data: InputData;
217
+ events: Array<Event_2>;
218
+ currency: string;
219
+ loyalty_program: LoyaltyProgram;
220
+ };
221
+
222
+ export declare type PortalSessionPayload = {
223
+ api_key: string;
224
+ shop_uuid: string;
225
+ scanner_type?: string;
226
+ enable_on_screen_keyboard?: boolean;
227
+ enable_email_identification?: boolean;
228
+ enable_registration?: boolean;
229
+ amount_in_cents?: number;
230
+ allow_multiple_giftcards?: boolean;
231
+ };
232
+
233
+ export declare type PortalSessionProps = {
234
+ type?: PortalType;
235
+ host?: string;
236
+ apiKey: string;
237
+ shopUuid: string;
238
+ scannerType?: string;
239
+ enableRegistration?: boolean;
240
+ enableEmailIdentification?: boolean;
241
+ enableOnScreenKeyboard?: boolean;
242
+ allowMultipleGiftcards?: boolean;
243
+ amountInCents?: number;
244
+ onClaimReward?: (reward: RewardResource) => void;
245
+ onRedeemVoucher?: (voucher: VoucherResource) => void;
246
+ onUseGiftcard?: (giftcardTransaction: GiftcardTransactionResource) => void;
247
+ onCreateTransaction?: (creditReceptionId: number) => void;
248
+ };
249
+
250
+ export declare enum PortalType {
251
+ REDEEM_GIFTCARD = "REDEEM_GIFTCARD",
252
+ TOP_UP_GIFTCARD = "TOP_UP_GIFTCARD",
253
+ PORTAL = "PORTAL",
254
+ PREPAID = "PREPAID",
255
+ SAVE = "SAVE",
256
+ VOUCHER = "VOUCHER"
257
+ }
258
+
259
+ export declare type PrepaidBalance = {
260
+ balance_in_cents: number;
261
+ };
262
+
263
+ export declare type PrepaidBalanceResource = {
264
+ balance_in_cents: number;
265
+ balance: string;
266
+ };
267
+
268
+ export declare type Promotion = {
269
+ [p: string]: string | boolean | number;
270
+ uuid: string;
271
+ name: string;
272
+ description: string;
273
+ voucher_limit: number;
274
+ limit_per_contact: number;
275
+ expiration_duration: number;
276
+ };
277
+
278
+ export declare type RewardResource = {
279
+ uuid: string;
280
+ title: string;
281
+ description: string;
282
+ cost_price: number;
283
+ required_credits: number;
284
+ active: boolean;
285
+ reward_type: string;
286
+ stock: number;
287
+ [attributeKey: string]: string | number | boolean;
288
+ };
289
+
290
+ declare type RowType = {
291
+ columns: Column[];
292
+ id: number;
293
+ };
294
+
295
+ export declare enum ScannerType {
296
+ HAND_SCANNER = "hand_scanner",
297
+ CAMERA = "camera"
298
+ }
299
+
300
+ export declare type Search = {
301
+ api_url: string;
302
+ token: string;
303
+ debounceInMilSec: number;
304
+ json_key: string;
305
+ };
306
+
307
+ export declare type Subscription = {
308
+ is_subscribed: boolean;
309
+ status: SubscriptionStatus;
310
+ subscription_type: {
311
+ active: boolean;
312
+ description: string;
313
+ id: number;
314
+ name: string;
315
+ strategy: SubscriptionStrategy;
316
+ uuid: string;
317
+ };
318
+ };
319
+
320
+ export declare enum SubscriptionStatus {
321
+ SUBSCRIBED = "SUBSCRIBED",
322
+ UNSUBSCRIBED = "UNSUBSCRIBED",
323
+ PENDING_CONFIRMATION = "PENDING_CONFIRMATION"
324
+ }
325
+
326
+ export declare enum SubscriptionStrategy {
327
+ OPT_OUT = "OPT_OUT",
328
+ OPT_IN = "OPT_IN",
329
+ DOUBLE_OPT_IN = "DOUBLE_OPT_IN",
330
+ FUNCTIONAL = "FUNCTIONAL"
331
+ }
332
+
333
+ export declare type TableResponse = {
334
+ header: Header;
335
+ rows: RowType[];
336
+ empty_state_url: string;
337
+ };
338
+
339
+ export declare type Tier = {
340
+ description: string;
341
+ name: string;
342
+ position: number;
343
+ uuid: string;
344
+ };
345
+
346
+ export declare type VoucherResource = {
347
+ uuid: string;
348
+ code: string;
349
+ status: VoucherStatus;
350
+ name: string;
351
+ description: string;
352
+ expiration_date: string;
353
+ redeemed_at: string;
354
+ is_redeemed: boolean;
355
+ attributes: {
356
+ [key: string]: any;
357
+ };
358
+ contact: {
359
+ uuid: string;
360
+ email: string;
361
+ };
362
+ promotion: Promotion;
363
+ };
364
+
365
+ export declare enum VoucherStatus {
366
+ INACTIVE = "INACTIVE",
367
+ ACTIVE = "ACTIVE",
368
+ EXPIRED = "EXPIRED",
369
+ LOCKED = "LOCKED",
370
+ REDEEMED = "REDEEMED",
371
+ DEACTIVATED = "DEACTIVATED"
372
+ }
373
+
374
+ export { }