@soltech/fluid-common 0.11.0 → 1.0.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.
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;
@@ -87,6 +95,7 @@ export interface AllPaymentMethodsByTransactionType {
87
95
  export interface PaymentMethod {
88
96
  id: string;
89
97
  name: string;
98
+ paymentGatewayId: string;
90
99
  description: string;
91
100
  termsAndConditions: string;
92
101
  logo: PaymentMethodLogo;
@@ -95,12 +104,15 @@ export interface PaymentMethod {
95
104
  maxAmount: number;
96
105
  info: string;
97
106
  paymentType: PaymentType;
98
- providerType: string;
99
107
  inputFields?: InputField[];
100
108
  bonusCodes?: string[];
101
109
  instructions?: string;
102
110
  fees?: PaymentMethodFees;
103
111
  popupWindowRedirect: boolean;
112
+ voucherAmounts?: number[];
113
+ depositHandledByHostSite?: boolean;
114
+ withdrawalHandledByHostSite?: boolean;
115
+ withdrawalInputsShownWhenMethodIsStored: boolean;
104
116
  }
105
117
  export interface PaymentMethodFees {
106
118
  fixedAmount?: number;
@@ -117,8 +129,10 @@ export interface InputField {
117
129
  text: string;
118
130
  placeholderText: string;
119
131
  errorText: string;
132
+ optional: boolean;
120
133
  options: InputFieldOption[];
121
134
  prefillKey?: string;
135
+ removePrefixPlusSign?: boolean;
122
136
  }
123
137
  export interface InputFieldOption {
124
138
  label: string;
@@ -192,6 +206,7 @@ export interface TransactionOptions {
192
206
  originalActivityId?: string;
193
207
  userData?: UserData;
194
208
  trackingData?: object;
209
+ transactionAttributes?: Record<string, string>;
195
210
  }
196
211
  export interface TransactionResult {
197
212
  error?: ProviderTransactionError;
@@ -199,7 +214,6 @@ export interface TransactionResult {
199
214
  state: TransactionState;
200
215
  statusCode: string;
201
216
  transactionId: string;
202
- suggestedAmounts?: DepositAmountsSettings;
203
217
  }
204
218
  export interface RedirectOutput {
205
219
  container: RedirectContainer;
@@ -284,4 +298,25 @@ export interface UserData {
284
298
  timeOfDay?: string;
285
299
  lifetimeDeposit?: number;
286
300
  kycStatus?: KycStatus;
301
+ affiliateId?: string;
302
+ tags?: string[];
287
303
  }
304
+ export interface TrackingEventData {
305
+ id: string;
306
+ event: string;
307
+ operatorId?: string;
308
+ timestamp?: string | number | Date;
309
+ activityId?: string;
310
+ originalActivityId?: string;
311
+ bonusesOffered?: boolean;
312
+ country?: string;
313
+ sessionId?: string;
314
+ userAgent?: string;
315
+ userId?: string;
316
+ [key: string]: unknown;
317
+ }
318
+ export type TrackingEventDataEnvelope = {
319
+ id: string;
320
+ environment: 'production' | 'staging' | 'demo';
321
+ body: TrackingEventData;
322
+ };
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.0",
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;
@@ -100,6 +109,7 @@ export interface AllPaymentMethodsByTransactionType {
100
109
  export interface PaymentMethod {
101
110
  id: string;
102
111
  name: string;
112
+ paymentGatewayId: string;
103
113
  description: string;
104
114
  termsAndConditions: string;
105
115
  logo: PaymentMethodLogo;
@@ -108,12 +118,15 @@ export interface PaymentMethod {
108
118
  maxAmount: number;
109
119
  info: string;
110
120
  paymentType: PaymentType;
111
- providerType: string;
112
121
  inputFields?: InputField[];
113
122
  bonusCodes?: string[];
114
123
  instructions?: string;
115
124
  fees?: PaymentMethodFees;
116
125
  popupWindowRedirect: boolean;
126
+ voucherAmounts?: number[];
127
+ depositHandledByHostSite?: boolean;
128
+ withdrawalHandledByHostSite?: boolean;
129
+ withdrawalInputsShownWhenMethodIsStored: boolean;
117
130
  }
118
131
 
119
132
  export interface PaymentMethodFees {
@@ -133,8 +146,10 @@ export interface InputField {
133
146
  text: string;
134
147
  placeholderText: string;
135
148
  errorText: string;
149
+ optional: boolean;
136
150
  options: InputFieldOption[];
137
151
  prefillKey?: string;
152
+ removePrefixPlusSign?: boolean;
138
153
  }
139
154
 
140
155
  export interface InputFieldOption {
@@ -217,6 +232,7 @@ export interface TransactionOptions {
217
232
  originalActivityId?: string;
218
233
  userData?: UserData;
219
234
  trackingData?: object;
235
+ transactionAttributes?: Record<string, string>;
220
236
  }
221
237
 
222
238
  export interface TransactionResult {
@@ -225,7 +241,6 @@ export interface TransactionResult {
225
241
  state: TransactionState;
226
242
  statusCode: string;
227
243
  transactionId: string;
228
- suggestedAmounts?: DepositAmountsSettings;
229
244
  }
230
245
 
231
246
  export interface RedirectOutput {
@@ -288,7 +303,7 @@ export enum WithdrawalState {
288
303
  }
289
304
 
290
305
  export interface AvailableBonusWithPaymentMethods {
291
- code: string;
306
+ code: string;
292
307
  paymentMethodFilter?: {
293
308
  applyTo?: BonusPaymentMethod[];
294
309
  excludeFrom?: BonusPaymentMethod[];
@@ -323,4 +338,28 @@ export interface UserData {
323
338
  timeOfDay?: string;
324
339
  lifetimeDeposit?: number;
325
340
  kycStatus?: KycStatus;
341
+ affiliateId?: string;
342
+ tags?: string[];
343
+ }
344
+
345
+ export interface TrackingEventData {
346
+ id: string;
347
+ event: string;
348
+ operatorId?: string;
349
+ timestamp?: string | number | Date;
350
+ activityId?: string;
351
+ originalActivityId?: string;
352
+ bonusesOffered?: boolean;
353
+ country?: string;
354
+ sessionId?: string;
355
+ userAgent?: string;
356
+ userId?: string;
357
+
358
+ [key: string]: unknown;
326
359
  }
360
+
361
+ export type TrackingEventDataEnvelope = {
362
+ id: string;
363
+ environment: 'production' | 'staging' | 'demo';
364
+ body: TrackingEventData;
365
+ };