@soltech/fluid-common 0.4.38 → 0.4.39

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/.editorconfig ADDED
@@ -0,0 +1,21 @@
1
+ # EditorConfig is awesome: https://EditorConfig.org
2
+
3
+ # top-most EditorConfig file
4
+ root = true
5
+
6
+ # Unix-style newlines with a newline ending every file
7
+ [*]
8
+ charset = utf-8
9
+ indent_style = tab
10
+ indent_size = 4
11
+ end_of_line = lf
12
+ max_line_length = 140
13
+ insert_final_newline = true
14
+ trim_trailing_whitespace = true
15
+
16
+ [*.md]
17
+ trim_trailing_whitespace = false
18
+ max_line_length = off
19
+
20
+ [{package.json,package-lock.json}]
21
+ max_line_length = off
package/.eslintignore ADDED
@@ -0,0 +1,2 @@
1
+ lib
2
+ node_modules
package/.eslintrc ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "root": true,
3
+ "extends": [
4
+ "@soltech"
5
+ ],
6
+ "parserOptions": {
7
+ "project": "./tsconfig.json",
8
+ "ecmaVersion": 2020,
9
+ "sourceType": "module"
10
+ }
11
+ }
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npx lint-staged
package/lib/index.d.ts CHANGED
@@ -184,10 +184,7 @@ export declare enum WithdrawalState {
184
184
  }
185
185
  export interface AvailableBonusWithPaymentMethods {
186
186
  code: string;
187
- paymentMethodFilter?: {
188
- applyTo?: BonusPaymentMethod[];
189
- excludeFrom?: BonusPaymentMethod[];
190
- };
187
+ paymentMethodFilter?: BonusPaymentMethod[];
191
188
  }
192
189
  export interface BonusPaymentMethod {
193
190
  providerType: string;
package/package.json CHANGED
@@ -1,21 +1,35 @@
1
1
  {
2
- "name": "@soltech/fluid-common",
3
- "version": "0.4.38",
4
- "type": "module",
5
- "description": "Fluid frontend and API commons",
6
- "main": "lib/index.js",
7
- "types:": "lib/index.d.ts",
8
- "scripts": {
9
- "build": "tsc",
10
- "pub": "npm run build && npm publish && git push"
11
- },
12
- "repository": {
13
- "type": "git",
14
- "url": "git+https://github.com/soltechno/cashin-common.git"
15
- },
16
- "author": "Sol Technologies",
17
- "license": "ISC",
18
- "devDependencies": {
19
- "typescript": "^5.0.4"
20
- }
2
+ "name": "@soltech/fluid-common",
3
+ "version": "0.4.39",
4
+ "type": "module",
5
+ "description": "Fluid frontend and API commons",
6
+ "main": "lib/index.js",
7
+ "types:": "lib/index.d.ts",
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "pub": "npm run build && npm publish && git push",
11
+ "lint": "npx eslint .",
12
+ "lint:fix": "npx eslint . --fix",
13
+ "prepare": "husky install"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/soltechno/cashin-common.git"
18
+ },
19
+ "author": "Sol Technologies",
20
+ "license": "ISC",
21
+ "devDependencies": {
22
+ "@soltech/eslint-config": "^0.1.0",
23
+ "@stylistic/eslint-plugin": "^1.5.1",
24
+ "@typescript-eslint/eslint-plugin": "^6.15.0",
25
+ "@typescript-eslint/parser": "^6.15.0",
26
+ "eslint": ">=8.50",
27
+ "eslint-plugin-smarter-tabs": "^1.2.0",
28
+ "husky": "^8.0.0",
29
+ "lint-staged": "^15.2.0",
30
+ "typescript": "^5.0.4"
31
+ },
32
+ "lint-staged": {
33
+ "*.{ts}": "eslint --fix"
34
+ }
21
35
  }
package/src/index.ts CHANGED
@@ -17,10 +17,10 @@ export enum TraitType {
17
17
  }
18
18
 
19
19
  export enum PaymentType {
20
- BANK_TRANSFER = 'BankTransfer',
21
- CREDIT_CARD = 'CreditCard',
22
- CRYPTO = 'Crypto',
23
- EWALLET = 'EWallet'
20
+ BANK_TRANSFER = 'BankTransfer',
21
+ CREDIT_CARD = 'CreditCard',
22
+ CRYPTO = 'Crypto',
23
+ EWALLET = 'EWallet'
24
24
  }
25
25
 
26
26
  export interface WalletRequestBody {
@@ -40,7 +40,7 @@ export interface WalletConfig {
40
40
  defaultDepositAmount: number;
41
41
  integration: Integration;
42
42
  logo: string;
43
- suggestedDepositAmounts: number[];
43
+ suggestedDepositAmounts: number[];
44
44
  theme: Record<string, string>;
45
45
  }
46
46
 
@@ -69,32 +69,32 @@ export interface PaymentMethod {
69
69
  minAmount: number;
70
70
  maxAmount: number;
71
71
  info: string;
72
- paymentType: PaymentType;
73
- providerType: string;
74
- inputFields?: InputField[];
75
- bonusCodes?: string[];
72
+ paymentType: PaymentType;
73
+ providerType: string;
74
+ inputFields?: InputField[];
75
+ bonusCodes?: string[];
76
76
  instructions?: string;
77
77
  }
78
78
 
79
79
  export interface PaymentMethodLogo {
80
- height: number;
81
- url: string;
82
- width: number;
80
+ height: number;
81
+ url: string;
82
+ width: number;
83
83
  }
84
84
 
85
85
  export interface InputField {
86
86
  paramName: string;
87
87
  format: string;
88
88
  text: string;
89
- placeholderText: string;
90
- errorText: string;
91
- options: InputFieldOption[];
89
+ placeholderText: string;
90
+ errorText: string;
91
+ options: InputFieldOption[];
92
92
  }
93
93
 
94
94
  export interface InputFieldOption {
95
- label: string;
96
- code: string;
97
- logo?: PaymentMethodLogo;
95
+ label: string;
96
+ code: string;
97
+ logo?: PaymentMethodLogo;
98
98
  }
99
99
 
100
100
  export interface RecentMethod extends PaymentMethod {
@@ -119,38 +119,38 @@ export interface CreditcardTransactionParams extends TransactionParams {
119
119
  }
120
120
 
121
121
  export interface BankTransferTransactionParams extends TransactionParams {
122
- accountName?: string;
123
- accountNumber?: string;
124
- accountType?: string;
125
- bankCode?: string;
126
- bankName?: string;
127
- beneficiaryCity?: string;
128
- beneficiaryCountry?: string;
129
- beneficiaryName?: string;
130
- beneficiaryState?: string;
131
- beneficiaryStreet?: string;
132
- beneficiaryZip?: string;
133
- bic?: string;
134
- branchAddress?: string;
135
- branchCode?: string;
136
- branchName?: string;
137
- clearingNumber?: string;
138
- countryCode?: string;
139
- iban?: string;
140
- nationalId?: string;
122
+ accountName?: string;
123
+ accountNumber?: string;
124
+ accountType?: string;
125
+ bankCode?: string;
126
+ bankName?: string;
127
+ beneficiaryCity?: string;
128
+ beneficiaryCountry?: string;
129
+ beneficiaryName?: string;
130
+ beneficiaryState?: string;
131
+ beneficiaryStreet?: string;
132
+ beneficiaryZip?: string;
133
+ bic?: string;
134
+ branchAddress?: string;
135
+ branchCode?: string;
136
+ branchName?: string;
137
+ clearingNumber?: string;
138
+ countryCode?: string;
139
+ iban?: string;
140
+ nationalId?: string;
141
141
  }
142
142
 
143
143
  export interface CryptoTransactionParams extends TransactionParams {
144
- cryptoCurrency?: string;
145
- destinationTag?: string;
146
- walletAddress?: string;
144
+ cryptoCurrency?: string;
145
+ destinationTag?: string;
146
+ walletAddress?: string;
147
147
  }
148
148
 
149
149
  export interface EWalletTransactionParams extends TransactionParams {
150
- customerNumber?: string;
150
+ customerNumber?: string;
151
151
  email?: string;
152
- mobile?: string;
153
- phoneNumber?: string;
152
+ mobile?: string;
153
+ phoneNumber?: string;
154
154
  service?: string;
155
155
  }
156
156
 
@@ -160,7 +160,7 @@ export interface TransactionOptions {
160
160
  }
161
161
 
162
162
  export interface TransactionResult {
163
- error?: ProviderTransactionError;
163
+ error?: ProviderTransactionError;
164
164
  redirectOutput?: RedirectOutput;
165
165
  state: TransactionState;
166
166
  statusCode: string;
@@ -178,16 +178,16 @@ export interface RedirectOutput {
178
178
  export enum TransactionState {
179
179
  SUCCESS = 'SUCCESS',
180
180
  FAIL = 'FAIL',
181
- PROCESSING = 'PROCESSING',
182
- WAITING_APPROVAL = 'WAITING_APPROVAL',
181
+ PROCESSING = 'PROCESSING',
182
+ WAITING_APPROVAL = 'WAITING_APPROVAL',
183
183
  WAITING_INPUT = 'WAITING_INPUT'
184
184
  }
185
185
 
186
186
  export interface ProviderTransactionError {
187
- code: string;
187
+ code: string;
188
188
  textTitle: string;
189
- text: string;
190
- action: Action;
189
+ text: string;
190
+ action: Action;
191
191
  }
192
192
 
193
193
  export enum Action {
@@ -195,28 +195,25 @@ export enum Action {
195
195
  RESTART_CLEARING_DETAILS = 'RESTART_CLEARING_DETAILS',
196
196
  SHOW_DETAILS_STEP_PRESERVING_DETAILS = 'SHOW_DETAILS_STEP_PRESERVING_DETAILS',
197
197
  SHOW_DETAILS_STEP_CLEARING_DETAILS = 'SHOW_DETAILS_STEP_CLEARING_DETAILS',
198
- SHOW_CVC_EDIT = 'SHOW_CVC_EDIT',
198
+ SHOW_CVC_EDIT = 'SHOW_CVC_EDIT'
199
199
  }
200
200
 
201
201
  export interface PendingWithdrawal {
202
202
  amount: string;
203
- creationDate: string;
203
+ creationDate: string;
204
204
  providerType: string;
205
205
  state: WithdrawalState;
206
206
  transactionId: string;
207
207
  }
208
208
 
209
209
  export enum WithdrawalState {
210
- REQUESTED = 'REQUESTED',
211
- PROCESSING = 'PROCESSING'
210
+ REQUESTED = 'REQUESTED',
211
+ PROCESSING = 'PROCESSING'
212
212
  }
213
213
 
214
214
  export interface AvailableBonusWithPaymentMethods {
215
- code: string;
216
- paymentMethodFilter?: {
217
- applyTo?: BonusPaymentMethod[];
218
- excludeFrom?: BonusPaymentMethod[];
219
- }
215
+ code: string;
216
+ paymentMethodFilter?: BonusPaymentMethod[];
220
217
  }
221
218
 
222
219
  export interface BonusPaymentMethod {
@@ -226,5 +223,5 @@ export interface BonusPaymentMethod {
226
223
 
227
224
  export interface TrackingEvent {
228
225
  eventId: string;
229
- data: object;
226
+ data: object;
230
227
  }