@soltech/fluid-common 0.11.0 → 1.0.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.
package/.nvmrc CHANGED
@@ -1,2 +1,2 @@
1
- v20.11.0
1
+ v22.12.0
2
2
 
package/lib/index.d.ts CHANGED
@@ -33,16 +33,24 @@ export interface WalletInitParams {
33
33
  sessionId: string;
34
34
  userId: string | number;
35
35
  userAgent: string;
36
+ viewport: Viewport;
36
37
  userData?: UserData;
37
38
  timestamp: string;
38
- transactionAttributes?: Record<string, string>;
39
+ buildDate: string;
40
+ hostSiteUrl: string;
41
+ }
42
+ export interface Viewport {
43
+ innerWidth: number;
44
+ innerHeight: number;
39
45
  }
40
46
  export interface WalletConfig {
41
47
  autofillCreditCardName: boolean;
42
48
  balanceDisplayed: boolean;
49
+ contactSupportEnabled: boolean;
43
50
  contactSupportLink: string;
44
51
  contentText: Record<string, string>;
45
52
  defaultDepositAmount: number;
53
+ fullListOfDepositMethodsDisplayed: boolean;
46
54
  integration: Integration;
47
55
  kycDepositLimit: number | null;
48
56
  logo: string;
@@ -53,7 +61,6 @@ export interface WalletConfig {
53
61
  suggestedDepositAmounts: number[];
54
62
  theme: Record<string, string>;
55
63
  transactionToggleDisplayed: boolean;
56
- transactionStatusCheck?: TransactionStatusCheck;
57
64
  }
58
65
  export interface Promotion {
59
66
  title: string;
@@ -95,12 +102,16 @@ export interface PaymentMethod {
95
102
  maxAmount: number;
96
103
  info: string;
97
104
  paymentType: PaymentType;
98
- providerType: string;
99
105
  inputFields?: InputField[];
100
106
  bonusCodes?: string[];
101
107
  instructions?: string;
102
108
  fees?: PaymentMethodFees;
103
109
  popupWindowRedirect: boolean;
110
+ voucherAmounts?: number[];
111
+ depositHandledByHostSite?: boolean;
112
+ withdrawalHandledByHostSite?: boolean;
113
+ withdrawalInputsShownWhenMethodIsStored: boolean;
114
+ transactionStatusCheck?: TransactionStatusCheck;
104
115
  }
105
116
  export interface PaymentMethodFees {
106
117
  fixedAmount?: number;
@@ -117,8 +128,10 @@ export interface InputField {
117
128
  text: string;
118
129
  placeholderText: string;
119
130
  errorText: string;
131
+ optional: boolean;
120
132
  options: InputFieldOption[];
121
133
  prefillKey?: string;
134
+ removePrefixPlusSign?: boolean;
122
135
  }
123
136
  export interface InputFieldOption {
124
137
  label: string;
@@ -192,6 +205,7 @@ export interface TransactionOptions {
192
205
  originalActivityId?: string;
193
206
  userData?: UserData;
194
207
  trackingData?: object;
208
+ transactionAttributes?: Record<string, string>;
195
209
  }
196
210
  export interface TransactionResult {
197
211
  error?: ProviderTransactionError;
@@ -199,7 +213,6 @@ export interface TransactionResult {
199
213
  state: TransactionState;
200
214
  statusCode: string;
201
215
  transactionId: string;
202
- suggestedAmounts?: DepositAmountsSettings;
203
216
  }
204
217
  export interface RedirectOutput {
205
218
  container: RedirectContainer;
@@ -284,4 +297,25 @@ export interface UserData {
284
297
  timeOfDay?: string;
285
298
  lifetimeDeposit?: number;
286
299
  kycStatus?: KycStatus;
300
+ affiliateId?: string;
301
+ tags?: string[];
287
302
  }
303
+ export interface TrackingEventData {
304
+ id: string;
305
+ event: string;
306
+ operatorId?: string;
307
+ timestamp?: string | number | Date;
308
+ activityId?: string;
309
+ originalActivityId?: string;
310
+ bonusesOffered?: boolean;
311
+ country?: string;
312
+ sessionId?: string;
313
+ userAgent?: string;
314
+ userId?: string;
315
+ [key: string]: unknown;
316
+ }
317
+ export type TrackingEventDataEnvelope = {
318
+ id: string;
319
+ environment: 'production' | 'staging' | 'demo';
320
+ body: TrackingEventData;
321
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soltech/fluid-common",
3
- "version": "0.11.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "description": "Fluid frontend, API and AI common interfaces & enums",
6
6
  "main": "lib/index.js",
@@ -8,7 +8,7 @@
8
8
  "scripts": {
9
9
  "dev": "tsc --watch",
10
10
  "build": "tsc",
11
- "pub": "npm run build && npm publish && git push",
11
+ "pub": "npm run build && npm publish && git push --set-upstream origin HEAD",
12
12
  "lint": "npx eslint .",
13
13
  "lint:fix": "npx eslint . --fix",
14
14
  "prepare": "husky"
@@ -20,11 +20,11 @@
20
20
  "author": "Sol Technologies",
21
21
  "license": "ISC",
22
22
  "devDependencies": {
23
- "@soltech/eslint-config": "^0.3.0",
24
- "@stylistic/eslint-plugin": "^2.12.1",
25
- "@typescript-eslint/eslint-plugin": "^8.18.1",
26
- "@typescript-eslint/parser": "^8.18.1",
27
- "eslint": "^9.17.0",
23
+ "@soltech/eslint-config": "0.2.4",
24
+ "@stylistic/eslint-plugin": "^1.6.0",
25
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
26
+ "@typescript-eslint/parser": "^6.21.0",
27
+ "eslint": ">=7.0.0",
28
28
  "eslint-plugin-smarter-tabs": "^1.2.0",
29
29
  "husky": "^9.1.7",
30
30
  "lint-staged": "^15.2.11",
package/src/index.ts CHANGED
@@ -38,17 +38,26 @@ export interface WalletInitParams {
38
38
  sessionId: string;
39
39
  userId: string | number;
40
40
  userAgent: string;
41
+ viewport: Viewport;
41
42
  userData?: UserData;
42
43
  timestamp: string;
43
- transactionAttributes?: Record<string, string>;
44
+ buildDate: string;
45
+ hostSiteUrl: string;
46
+ }
47
+
48
+ export interface Viewport {
49
+ innerWidth: number;
50
+ innerHeight: number;
44
51
  }
45
52
 
46
53
  export interface WalletConfig {
47
54
  autofillCreditCardName: boolean;
48
55
  balanceDisplayed: boolean;
56
+ contactSupportEnabled: boolean;
49
57
  contactSupportLink: string;
50
58
  contentText: Record<string, string>;
51
59
  defaultDepositAmount: number;
60
+ fullListOfDepositMethodsDisplayed: boolean;
52
61
  integration: Integration;
53
62
  kycDepositLimit: number | null;
54
63
  logo: string;
@@ -59,7 +68,6 @@ export interface WalletConfig {
59
68
  suggestedDepositAmounts: number[];
60
69
  theme: Record<string, string>;
61
70
  transactionToggleDisplayed: boolean;
62
- transactionStatusCheck?: TransactionStatusCheck;
63
71
  }
64
72
 
65
73
  export interface Promotion {
@@ -108,12 +116,16 @@ export interface PaymentMethod {
108
116
  maxAmount: number;
109
117
  info: string;
110
118
  paymentType: PaymentType;
111
- providerType: string;
112
119
  inputFields?: InputField[];
113
120
  bonusCodes?: string[];
114
121
  instructions?: string;
115
122
  fees?: PaymentMethodFees;
116
123
  popupWindowRedirect: boolean;
124
+ voucherAmounts?: number[];
125
+ depositHandledByHostSite?: boolean;
126
+ withdrawalHandledByHostSite?: boolean;
127
+ withdrawalInputsShownWhenMethodIsStored: boolean;
128
+ transactionStatusCheck?: TransactionStatusCheck;
117
129
  }
118
130
 
119
131
  export interface PaymentMethodFees {
@@ -133,8 +145,10 @@ export interface InputField {
133
145
  text: string;
134
146
  placeholderText: string;
135
147
  errorText: string;
148
+ optional: boolean;
136
149
  options: InputFieldOption[];
137
150
  prefillKey?: string;
151
+ removePrefixPlusSign?: boolean;
138
152
  }
139
153
 
140
154
  export interface InputFieldOption {
@@ -217,6 +231,7 @@ export interface TransactionOptions {
217
231
  originalActivityId?: string;
218
232
  userData?: UserData;
219
233
  trackingData?: object;
234
+ transactionAttributes?: Record<string, string>;
220
235
  }
221
236
 
222
237
  export interface TransactionResult {
@@ -225,7 +240,6 @@ export interface TransactionResult {
225
240
  state: TransactionState;
226
241
  statusCode: string;
227
242
  transactionId: string;
228
- suggestedAmounts?: DepositAmountsSettings;
229
243
  }
230
244
 
231
245
  export interface RedirectOutput {
@@ -288,7 +302,7 @@ export enum WithdrawalState {
288
302
  }
289
303
 
290
304
  export interface AvailableBonusWithPaymentMethods {
291
- code: string;
305
+ code: string;
292
306
  paymentMethodFilter?: {
293
307
  applyTo?: BonusPaymentMethod[];
294
308
  excludeFrom?: BonusPaymentMethod[];
@@ -323,4 +337,28 @@ export interface UserData {
323
337
  timeOfDay?: string;
324
338
  lifetimeDeposit?: number;
325
339
  kycStatus?: KycStatus;
340
+ affiliateId?: string;
341
+ tags?: string[];
326
342
  }
343
+
344
+ export interface TrackingEventData {
345
+ id: string;
346
+ event: string;
347
+ operatorId?: string;
348
+ timestamp?: string | number | Date;
349
+ activityId?: string;
350
+ originalActivityId?: string;
351
+ bonusesOffered?: boolean;
352
+ country?: string;
353
+ sessionId?: string;
354
+ userAgent?: string;
355
+ userId?: string;
356
+
357
+ [key: string]: unknown;
358
+ }
359
+
360
+ export type TrackingEventDataEnvelope = {
361
+ id: string;
362
+ environment: 'production' | 'staging' | 'demo';
363
+ body: TrackingEventData;
364
+ };