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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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;
@@ -70,36 +24,15 @@ export declare type ContactResource = {
70
24
  subscriptions: Array<Subscription>;
71
25
  credit_balance: CreditBalance;
72
26
  prepaid_balance: PrepaidBalance;
73
- current_values: {
74
- [key: string]: string | number;
75
- };
76
- current_display_values: {
77
- [key: string]: string;
78
- };
27
+ current_values: { [key: string]: string | number };
28
+ current_display_values: { [key: string]: string };
79
29
  };
80
30
 
81
- export declare type CreditBalance = {
31
+ declare type CreditBalance = {
82
32
  balance: number;
83
33
  id: number;
84
34
  };
85
35
 
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
36
  export declare function DefaultSession({ uuid, host }: DefaultSessionProps): JSX_2.Element;
104
37
 
105
38
  export declare type DefaultSessionProps = {
@@ -107,163 +40,39 @@ export declare type DefaultSessionProps = {
107
40
  host?: string;
108
41
  };
109
42
 
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 {
43
+ declare enum FacingMode {
132
44
  USER = "user",
133
- ENVIRONMENT = "environment"
45
+ ENVIRONMENT = "environment",
134
46
  }
135
47
 
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 = {
48
+ declare type GiftcardTransactionResource = {
169
49
  id: number;
170
50
  uuid: string;
171
51
  amount_in_cents: number;
172
52
  type: string;
173
53
  settled: boolean;
174
- card: {
175
- id: number;
176
- uuid: string;
177
- };
178
- shop: {
179
- id: number;
180
- uuid: string;
181
- name: string;
182
- };
183
- settlements: [];
54
+ card: { id: number; uuid: string };
55
+ shop: { id: number; uuid: string; name: string };
56
+ settlements: []; // GiftcardTransactionSettlementResource
184
57
  created_at: string;
185
58
  };
186
59
 
187
- declare type Header = {
188
- items: HeaderItem[];
189
- };
190
-
191
- declare type HeaderItem = {
192
- value?: string;
193
- align?: "left" | "center" | "right";
194
- };
195
-
196
60
  declare type Image_2 = {
197
61
  id: string;
198
62
  type: string;
199
63
  value: string;
200
64
  };
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
65
 
218
- export declare type Media = {
66
+ declare type Media = {
219
67
  id: number;
220
68
  type: string;
221
69
  value: string;
222
70
  };
223
71
 
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
72
  export declare function PortalSession(props: PortalSessionProps): ReactElement;
241
73
 
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
74
  export declare type PortalSessionProps = {
266
- type?: PortalType;
75
+ type?: keyof typeof PortalType;
267
76
  host?: string;
268
77
  apiKey: string;
269
78
  shopUuid: string;
@@ -282,7 +91,7 @@ export declare type PortalSessionProps = {
282
91
  primaryIdentificationMethod?: PrimaryIdentificationMethod;
283
92
  };
284
93
 
285
- export declare enum PortalType {
94
+ declare enum PortalType {
286
95
  GENERIC = "GENERIC",
287
96
  GIFTCARD = "GIFTCARD",
288
97
  REDEEM_GIFTCARD = "REDEEM_GIFTCARD",
@@ -291,24 +100,19 @@ export declare enum PortalType {
291
100
  PAY_PREPAID = "PAY_PREPAID",
292
101
  TOP_UP_PREPAID = "TOP_UP_PREPAID",
293
102
  POINTS_TRANSACTION = "POINTS_TRANSACTION",
294
- VOUCHER = "VOUCHER"
103
+ VOUCHER = "VOUCHER",
295
104
  }
296
105
 
297
- export declare type PrepaidBalance = {
298
- balance_in_cents: number;
299
- };
300
-
301
- export declare type PrepaidBalanceResource = {
106
+ declare type PrepaidBalance = {
302
107
  balance_in_cents: number;
303
- balance: string;
304
108
  };
305
109
 
306
- export declare enum PrimaryIdentificationMethod {
110
+ declare enum PrimaryIdentificationMethod {
307
111
  IDENTIFIER = "identifier",
308
- EMAIL = "email"
112
+ EMAIL = "email",
309
113
  }
310
114
 
311
- export declare type Promotion = {
115
+ declare type Promotion = {
312
116
  uuid: string;
313
117
  name: string;
314
118
  description: string;
@@ -316,11 +120,9 @@ export declare type Promotion = {
316
120
  limit_per_contact: number;
317
121
  expiration_duration: number;
318
122
  image: Image_2;
319
- } & {
320
- [p: string]: string | boolean | number;
321
- };
123
+ } & { [p: string]: string | boolean | number };
322
124
 
323
- export declare type RewardResource = {
125
+ declare type RewardResource = {
324
126
  uuid: string;
325
127
  title: string;
326
128
  description: string;
@@ -330,23 +132,9 @@ export declare type RewardResource = {
330
132
  media: Media;
331
133
  reward_type: string;
332
134
  stock: number;
333
- } & {
334
- [attributeKey: string]: string | number | boolean;
335
- };
336
-
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
- };
135
+ } & { [attributeKey: string]: string | number | boolean };
348
136
 
349
- export declare type Subscription = {
137
+ declare type Subscription = {
350
138
  is_subscribed: boolean;
351
139
  status: SubscriptionStatus;
352
140
  subscription_type: {
@@ -359,43 +147,28 @@ export declare type Subscription = {
359
147
  };
360
148
  };
361
149
 
362
- export declare enum SubscriptionStatus {
150
+ declare enum SubscriptionStatus {
363
151
  SUBSCRIBED = "SUBSCRIBED",
364
152
  UNSUBSCRIBED = "UNSUBSCRIBED",
365
- PENDING_CONFIRMATION = "PENDING_CONFIRMATION"
153
+ PENDING_CONFIRMATION = "PENDING_CONFIRMATION",
366
154
  }
367
155
 
368
- export declare enum SubscriptionStrategy {
156
+ declare enum SubscriptionStrategy {
369
157
  OPT_OUT = "OPT_OUT",
370
158
  OPT_IN = "OPT_IN",
371
159
  DOUBLE_OPT_IN = "DOUBLE_OPT_IN",
372
- FUNCTIONAL = "FUNCTIONAL"
160
+ FUNCTIONAL = "FUNCTIONAL",
373
161
  }
374
162
 
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 = {
163
+ declare type Tier = {
392
164
  description: string;
165
+ // media:
393
166
  name: string;
394
167
  position: number;
395
168
  uuid: string;
396
169
  };
397
170
 
398
- export declare type VoucherResource = {
171
+ declare type VoucherResource = {
399
172
  uuid: string;
400
173
  code: string;
401
174
  status: VoucherStatus;
@@ -414,13 +187,13 @@ export declare type VoucherResource = {
414
187
  promotion: Promotion;
415
188
  };
416
189
 
417
- export declare enum VoucherStatus {
190
+ declare enum VoucherStatus {
418
191
  INACTIVE = "INACTIVE",
419
192
  ACTIVE = "ACTIVE",
420
193
  EXPIRED = "EXPIRED",
421
194
  LOCKED = "LOCKED",
422
195
  REDEEMED = "REDEEMED",
423
- DEACTIVATED = "DEACTIVATED"
196
+ DEACTIVATED = "DEACTIVATED",
424
197
  }
425
198
 
426
199
  export { }