@leatcom/portal-sessions 0.0.74 → 0.0.75-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { JSX as JSX_2 } from 'react/jsx-runtime';
2
2
  import { ReactElement } from 'react';
3
3
 
4
- export declare type Attribute = {
4
+ declare type Attribute = {
5
5
  attribute: {
6
6
  field_type: string;
7
7
  id: number;
@@ -15,53 +15,7 @@ export declare type Attribute = {
15
15
  value: string;
16
16
  };
17
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 = {
18
+ declare type ContactResource = {
65
19
  id: number;
66
20
  uuid: string;
67
21
  email: string;
@@ -78,28 +32,11 @@ export declare type ContactResource = {
78
32
  };
79
33
  };
80
34
 
81
- export declare type CreditBalance = {
35
+ declare type CreditBalance = {
82
36
  balance: number;
83
37
  id: number;
84
38
  };
85
39
 
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
40
  export declare function DefaultSession({ uuid, host }: DefaultSessionProps): JSX_2.Element;
104
41
 
105
42
  export declare type DefaultSessionProps = {
@@ -107,65 +44,12 @@ export declare type DefaultSessionProps = {
107
44
  host?: string;
108
45
  };
109
46
 
110
- export declare enum ErrorCodes {
111
- INPUT_INVALID = 1003,
112
- CONTACT_NOT_FOUND = 55031
113
- }
114
-
115
- declare type Event_2 = {
116
- data: {
117
- [p: string]: any;
118
- };
119
- type: string;
120
- created_at: string;
121
- };
122
- export { Event_2 as Event }
123
-
124
- export declare enum EventType {
125
- GIFTCARD_TRANSACTION = "giftcard_transaction",
126
- VOUCHER_REDEEMED = "voucher_redeemed",
127
- REWARD_RECEPTION = "reward_reception",
128
- PREPAID_TRANSACTION = "prepaid_transaction"
129
- }
130
-
131
- export declare enum FacingMode {
47
+ declare enum FacingMode {
132
48
  USER = "user",
133
49
  ENVIRONMENT = "environment"
134
50
  }
135
51
 
136
- export declare type GiftcardProgram = {
137
- id: number;
138
- name: string;
139
- uuid: string;
140
- max_amount_in_cents: number;
141
- };
142
-
143
- export declare type GiftcardRecipient = {
144
- id: number;
145
- email: string;
146
- status: number;
147
- opens: number;
148
- clicks: number;
149
- };
150
-
151
- export declare type GiftcardResource = {
152
- id: number;
153
- uuid: string;
154
- type: string;
155
- hash: string;
156
- amount_in_cents: number;
157
- upgradeable: boolean;
158
- active: boolean;
159
- expiration_date: string;
160
- amount: number;
161
- url: string;
162
- display_amount: string;
163
- formatted_expiration_date: string;
164
- giftcard_program: GiftcardProgram;
165
- giftcard_recipients: Array<GiftcardRecipient>;
166
- };
167
-
168
- export declare type GiftcardTransactionResource = {
52
+ declare type GiftcardTransactionResource = {
169
53
  id: number;
170
54
  uuid: string;
171
55
  amount_in_cents: number;
@@ -184,86 +68,22 @@ export declare type GiftcardTransactionResource = {
184
68
  created_at: string;
185
69
  };
186
70
 
187
- declare type Header = {
188
- items: HeaderItem[];
189
- };
190
-
191
- declare type HeaderItem = {
192
- value?: string;
193
- align?: "left" | "center" | "right";
194
- };
195
-
196
71
  declare type Image_2 = {
197
72
  id: string;
198
73
  type: string;
199
74
  value: string;
200
75
  };
201
- export { Image_2 as Image }
202
-
203
- export declare type InputData = {
204
- enable_on_screen_keyboard?: boolean;
205
- enable_email_identification?: boolean;
206
- enable_registration?: boolean;
207
- amount_in_cents?: number;
208
- allow_multiple_giftcards?: boolean;
209
- primary_identification_method?: PrimaryIdentificationMethod;
210
- };
211
-
212
- export declare type LoyaltyProgram = {
213
- name: string;
214
- max_amount: number;
215
- custom_credit_name: string;
216
- };
217
76
 
218
- export declare type Media = {
77
+ declare type Media = {
219
78
  id: number;
220
79
  type: string;
221
80
  value: string;
222
81
  };
223
82
 
224
- declare type Option_2 = {
225
- value: string;
226
- label: string;
227
- };
228
- export { Option_2 as Option }
229
-
230
- export declare enum PortalRoute {
231
- GENERIC = "/generic",
232
- GIFTCARD = "/giftcard",
233
- PORTAL = "/portal",
234
- PAY_PREPAID = "/pay-prepaid",
235
- TOP_UP_PREPAID = "/top-up-prepaid",
236
- POINTS_TRANSACTION = "/points-transaction",
237
- VOUCHER = "/voucher"
238
- }
239
-
240
83
  export declare function PortalSession(props: PortalSessionProps): ReactElement;
241
84
 
242
- export declare type PortalSessionApiResource = {
243
- type: PortalType;
244
- uuid: string;
245
- contact: {
246
- uuid: string;
247
- };
248
- input_data: InputData;
249
- results: Record<string, any>;
250
- events: Array<Event_2>;
251
- currency: string;
252
- loyalty_program: LoyaltyProgram;
253
- };
254
-
255
- export declare type PortalSessionPayload = {
256
- api_key: string;
257
- shop_uuid: string;
258
- enable_on_screen_keyboard?: boolean;
259
- enable_email_identification?: boolean;
260
- enable_registration?: boolean;
261
- amount_in_cents?: number;
262
- allow_multiple_giftcards?: boolean;
263
- };
264
-
265
85
  export declare type PortalSessionProps = {
266
- type?: PortalType;
86
+ type?: keyof typeof PortalType;
267
87
  host?: string;
268
88
  apiKey: string;
269
89
  shopUuid: string;
@@ -282,7 +102,7 @@ export declare type PortalSessionProps = {
282
102
  primaryIdentificationMethod?: PrimaryIdentificationMethod;
283
103
  };
284
104
 
285
- export declare enum PortalType {
105
+ declare enum PortalType {
286
106
  GENERIC = "GENERIC",
287
107
  GIFTCARD = "GIFTCARD",
288
108
  REDEEM_GIFTCARD = "REDEEM_GIFTCARD",
@@ -294,21 +114,16 @@ export declare enum PortalType {
294
114
  VOUCHER = "VOUCHER"
295
115
  }
296
116
 
297
- export declare type PrepaidBalance = {
117
+ declare type PrepaidBalance = {
298
118
  balance_in_cents: number;
299
119
  };
300
120
 
301
- export declare type PrepaidBalanceResource = {
302
- balance_in_cents: number;
303
- balance: string;
304
- };
305
-
306
- export declare enum PrimaryIdentificationMethod {
121
+ declare enum PrimaryIdentificationMethod {
307
122
  IDENTIFIER = "identifier",
308
123
  EMAIL = "email"
309
124
  }
310
125
 
311
- export declare type Promotion = {
126
+ declare type Promotion = {
312
127
  uuid: string;
313
128
  name: string;
314
129
  description: string;
@@ -320,7 +135,7 @@ export declare type Promotion = {
320
135
  [p: string]: string | boolean | number;
321
136
  };
322
137
 
323
- export declare type RewardResource = {
138
+ declare type RewardResource = {
324
139
  uuid: string;
325
140
  title: string;
326
141
  description: string;
@@ -334,19 +149,7 @@ export declare type RewardResource = {
334
149
  [attributeKey: string]: string | number | boolean;
335
150
  };
336
151
 
337
- declare type RowType = {
338
- columns: Column[];
339
- id: number;
340
- };
341
-
342
- export declare type Search = {
343
- api_url: string;
344
- token: string;
345
- debounceInMilSec: number;
346
- json_key: string;
347
- };
348
-
349
- export declare type Subscription = {
152
+ declare type Subscription = {
350
153
  is_subscribed: boolean;
351
154
  status: SubscriptionStatus;
352
155
  subscription_type: {
@@ -359,43 +162,27 @@ export declare type Subscription = {
359
162
  };
360
163
  };
361
164
 
362
- export declare enum SubscriptionStatus {
165
+ declare enum SubscriptionStatus {
363
166
  SUBSCRIBED = "SUBSCRIBED",
364
167
  UNSUBSCRIBED = "UNSUBSCRIBED",
365
168
  PENDING_CONFIRMATION = "PENDING_CONFIRMATION"
366
169
  }
367
170
 
368
- export declare enum SubscriptionStrategy {
171
+ declare enum SubscriptionStrategy {
369
172
  OPT_OUT = "OPT_OUT",
370
173
  OPT_IN = "OPT_IN",
371
174
  DOUBLE_OPT_IN = "DOUBLE_OPT_IN",
372
175
  FUNCTIONAL = "FUNCTIONAL"
373
176
  }
374
177
 
375
- export declare type SubscriptionType = {
376
- id: number;
377
- uuid: string;
378
- name: string;
379
- description: string;
380
- is_piggy_defined: boolean;
381
- strategy: string;
382
- active: boolean;
383
- };
384
-
385
- export declare type TableResponse = {
386
- header: Header;
387
- rows: RowType[];
388
- empty_state_url: string;
389
- };
390
-
391
- export declare type Tier = {
178
+ declare type Tier = {
392
179
  description: string;
393
180
  name: string;
394
181
  position: number;
395
182
  uuid: string;
396
183
  };
397
184
 
398
- export declare type VoucherResource = {
185
+ declare type VoucherResource = {
399
186
  uuid: string;
400
187
  code: string;
401
188
  status: VoucherStatus;
@@ -414,7 +201,7 @@ export declare type VoucherResource = {
414
201
  promotion: Promotion;
415
202
  };
416
203
 
417
- export declare enum VoucherStatus {
204
+ declare enum VoucherStatus {
418
205
  INACTIVE = "INACTIVE",
419
206
  ACTIVE = "ACTIVE",
420
207
  EXPIRED = "EXPIRED",