@soltech/fluid-common 1.10.0-beta.1 → 1.10.0-sc23269.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.
package/lib/index.d.ts CHANGED
@@ -1,7 +1,447 @@
1
- export * from './wallet.js';
2
- export * from './wallet-config-keys.js';
3
- export * from './payment-methods.js';
4
- export * from './transactions.js';
5
- export * from './user.js';
6
- export * from './bonus.js';
7
- export * from './tracking.js';
1
+ export declare enum Integration {
2
+ LEFT = "LEFT",
3
+ CENTER = "CENTER",
4
+ RIGHT = "RIGHT",
5
+ INLINE = "INLINE"
6
+ }
7
+ export declare enum ContentType {
8
+ PLAIN_TEXT = "PLAIN_TEXT",
9
+ HTML = "HTML"
10
+ }
11
+ export declare enum TraitType {
12
+ COLOR = "COLOR",
13
+ IMAGE = "IMAGE",
14
+ TEXT = "TEXT",
15
+ SOUND = "SOUND"
16
+ }
17
+ export declare enum PaymentType {
18
+ APPLE_PAY = "ApplePay",
19
+ BANK_TRANSFER = "BankTransfer",
20
+ CREDIT_CARD = "CreditCard",
21
+ CRYPTO = "Crypto",
22
+ EWALLET = "EWallet",
23
+ VOUCHER = "Voucher"
24
+ }
25
+ export declare enum WindowRedirectType {
26
+ POPUP_WINDOW = "popupWindow",
27
+ BROWSER_TAB = "browserTab",
28
+ NONE = "none"
29
+ }
30
+ export interface WalletRequestBody {
31
+ payload?: object | string;
32
+ payloadOptions?: TransactionOptions;
33
+ }
34
+ export interface WalletInitParams {
35
+ country: string;
36
+ ipAddress: string;
37
+ locale: string;
38
+ currency: string;
39
+ operatorId: number;
40
+ sessionId: string;
41
+ userId: string | number;
42
+ /** @deprecated Use browserInfo.userAgent instead */
43
+ userAgent: string;
44
+ /** @deprecated Use browserInfo.viewport instead */
45
+ viewport: Viewport;
46
+ browserInfo?: BrowserInfo;
47
+ userData?: UserData;
48
+ timestamp: string;
49
+ buildDate: string;
50
+ hostSiteUrl: string;
51
+ virtual: boolean;
52
+ }
53
+ export interface Viewport {
54
+ innerWidth: number;
55
+ innerHeight: number;
56
+ }
57
+ export interface ScreenDimensions {
58
+ height: number;
59
+ width: number;
60
+ }
61
+ export interface BrowserInfo {
62
+ userAgent: string;
63
+ acceptHeader: string;
64
+ javaEnabled: boolean;
65
+ colorDepth: number;
66
+ screen: ScreenDimensions;
67
+ viewport: Viewport;
68
+ timezoneOffset: number;
69
+ }
70
+ export interface WalletConfig {
71
+ allowCustomAmount: boolean;
72
+ autofillCreditCardName: boolean;
73
+ balanceDisplayed: boolean;
74
+ banner?: Banner;
75
+ bonusOutlined: boolean;
76
+ campaign?: Campaign;
77
+ cardHolderNameRegex: string | null;
78
+ contactSupportEnabled: boolean;
79
+ contactSupportLink: string;
80
+ contentText: Record<string, string>;
81
+ expressFlowEnabled: boolean;
82
+ defaultDepositAmount: number;
83
+ fullListOfDepositMethodsDisplayed: boolean;
84
+ hideMinMaxEnabled: boolean;
85
+ integration: Integration;
86
+ kycDepositLimit: number | null;
87
+ manualBonusCodesEnabled?: boolean;
88
+ pendingWithdrawalsReminder: {
89
+ threshold: number;
90
+ userResponseRequired: boolean;
91
+ };
92
+ successScreen: {
93
+ promotion: Promotion | null;
94
+ };
95
+ suggestedDepositAmounts: number[];
96
+ theme: Record<string, string>;
97
+ transactionToggleDisplayed: boolean;
98
+ withdrawalInFiatCurrency: boolean;
99
+ }
100
+ export interface Promotion {
101
+ title: string;
102
+ description: string;
103
+ tag: string;
104
+ ctaLinkLabel: string;
105
+ ctaLinkUrl: string;
106
+ thumbnail: string;
107
+ }
108
+ export interface WalletConfigParams {
109
+ contentText: Record<string, ContentType>;
110
+ theme: Record<string, TraitType>;
111
+ }
112
+ export interface DepositAmountsSettings {
113
+ id?: string;
114
+ defaultDepositAmount: number;
115
+ suggestedDepositAmounts: number[];
116
+ }
117
+ export type TransactionStatusSource = 'gateway' | 'fluid';
118
+ export interface TransactionStatusCheck {
119
+ url: string;
120
+ intervalSeconds: number;
121
+ source?: TransactionStatusSource;
122
+ }
123
+ export interface AllPaymentMethods {
124
+ recentPaymentMethods: RecentMethod[];
125
+ paymentMethods: PaymentMethod[];
126
+ }
127
+ export interface AllPaymentMethodsByTransactionType {
128
+ deposit: AllPaymentMethods;
129
+ withdrawal: AllPaymentMethods;
130
+ }
131
+ export interface PaymentMethod {
132
+ id: string;
133
+ name: string;
134
+ paymentGatewayId: string;
135
+ description: string;
136
+ termsAndConditions: string;
137
+ logo: PaymentMethodLogo;
138
+ logoLight?: PaymentMethodLogo;
139
+ minAmount: number;
140
+ maxAmount: number;
141
+ info: string;
142
+ paymentType: PaymentType;
143
+ inputFields?: InputField[];
144
+ storedMethodInputFields?: InputField[];
145
+ bonusCodes?: string[];
146
+ instructions?: string;
147
+ withdrawalInstructions?: string;
148
+ fees?: PaymentMethodFees;
149
+ windowRedirectType?: WindowRedirectType;
150
+ voucherAmounts?: number[];
151
+ depositHandledByHostSite?: boolean;
152
+ withdrawalHandledByHostSite?: boolean;
153
+ withdrawalInputsShownWhenMethodIsStored: boolean;
154
+ transactionStatusCheck?: TransactionStatusCheck;
155
+ finalTransactionResultCheckEnabled?: boolean;
156
+ encryptionSettings?: EncryptionSettings;
157
+ hostedFields?: HostedFieldsSettings;
158
+ deviceProtection?: DeviceProtectionSettings;
159
+ }
160
+ /**
161
+ * What the gateway's browser SDK needs to start profiling the payer's device. Its presence is
162
+ * also how the client decides the gateway behind this method profiles at all — it describes the
163
+ * gateway rather than the method, so every method of that gateway carries the same values.
164
+ */
165
+ export interface DeviceProtectionSettings {
166
+ merchantId: string;
167
+ env: string;
168
+ }
169
+ export interface EncryptionSettings {
170
+ encryptionType: EncryptionType;
171
+ expiryDateEncryptionMode: ExpiryDateEncryptionMode;
172
+ encryptCardholderName: boolean;
173
+ }
174
+ export type HostedFieldsSettings = CardValuesSettings | CardTokenSettings;
175
+ interface HostedFieldsBase {
176
+ url: string;
177
+ }
178
+ export interface CardValuesSettings extends HostedFieldsBase {
179
+ protocol?: HostedFieldsProtocol.CARD_VALUES;
180
+ }
181
+ export interface CardTokenSettings extends HostedFieldsBase {
182
+ protocol: HostedFieldsProtocol.CARD_TOKEN;
183
+ params: CardTokenParams;
184
+ }
185
+ export interface CardTokenParams {
186
+ merchantId: string;
187
+ env: string;
188
+ }
189
+ export declare enum HostedFieldsProtocol {
190
+ CARD_VALUES = "CardValues",
191
+ CARD_TOKEN = "CardToken"
192
+ }
193
+ export declare enum EncryptionType {
194
+ NO_ENCRYPTION = "NO_ENCRYPTION",
195
+ RSA_PKCS1 = "RSA_PKCS1",// RSA with PKCS#1 v1.5 padding (jsencrypt default)
196
+ RSA_OAEP = "RSA_OAEP",// RSA with OAEP padding (crypto/Web Crypto)
197
+ SHA384_SIGNATURE = "SHA384_SIGNATURE"
198
+ }
199
+ export declare enum ExpiryDateEncryptionMode {
200
+ NONE = "NONE",
201
+ SEPARATE_FIELDS = "SEPARATE_FIELDS",
202
+ SINGLE_FIELD = "SINGLE_FIELD"
203
+ }
204
+ export type PaymentMethodFees = {
205
+ fixed?: number;
206
+ percentage?: number;
207
+ applyToRange?: {
208
+ min?: number;
209
+ max?: number;
210
+ };
211
+ }[];
212
+ export interface PaymentMethodLogo {
213
+ height: number;
214
+ url: string;
215
+ width: number;
216
+ }
217
+ export interface InputField {
218
+ paramName: string;
219
+ format: string;
220
+ text: string;
221
+ placeholderText: string;
222
+ errorText: string;
223
+ optional: boolean;
224
+ options: InputFieldOption[];
225
+ prefillKey?: string;
226
+ removePrefixPlusSign?: boolean;
227
+ relatesTo?: string;
228
+ showForValues?: string[];
229
+ isPassword?: boolean;
230
+ }
231
+ export interface InputFieldOption {
232
+ label: string;
233
+ code: string;
234
+ relatesTo?: string;
235
+ showForValues?: string[];
236
+ }
237
+ export declare enum RecentMethodMaskedAccountFormat {
238
+ DEFAULT = "Default",
239
+ LAST_8_DIGITS = "Last8Digits",
240
+ FULL_VALUE = "FullValue",
241
+ NOTHING = "Nothing"
242
+ }
243
+ export interface RecentMethod extends PaymentMethod {
244
+ accountId: string;
245
+ maskedAccount: string;
246
+ lastSuccess?: string;
247
+ expiryDate?: string;
248
+ maskedAccountFormat?: RecentMethodMaskedAccountFormat;
249
+ }
250
+ export interface TransactionParams {
251
+ accountId?: string;
252
+ amount: number;
253
+ paymentMethodId: string;
254
+ }
255
+ /**
256
+ * What a gateway's own browser SDK profiled the payer's device with, forwarded as request
257
+ * headers. It cannot live on `TransactionParams` itself: `DynamicTransactionParams` narrows
258
+ * every property to `string | number | undefined` with an index signature.
259
+ */
260
+ export interface GatewayProtectionParams {
261
+ protectionHeaders?: Record<string, string>;
262
+ }
263
+ export interface CreditcardTransactionParams extends TransactionParams, GatewayProtectionParams {
264
+ cardHolder?: string;
265
+ cardNumber?: string;
266
+ cvc: string;
267
+ expiryMonth?: string;
268
+ expiryYear?: string;
269
+ expiryDate?: string;
270
+ cardToken?: string;
271
+ }
272
+ /**
273
+ * Transaction params for any payment method whose payload is keyed dynamically by
274
+ * CMS-defined input fields (bank transfer, crypto, e-wallet, voucher).
275
+ * Field keys typically come from `PaymentMethod.inputFields[].paramName`.
276
+ */
277
+ export interface DynamicTransactionParams extends TransactionParams {
278
+ [key: string]: string | number | undefined;
279
+ }
280
+ export interface ApplePayTransactionParams extends TransactionParams, GatewayProtectionParams {
281
+ /** The authorised `ApplePayPaymentToken`, serialised, opaque to everything but the gateway. */
282
+ token: string;
283
+ billingContact?: ApplePayContact;
284
+ /** Apple returns the payer's email here, not on the billing contact. */
285
+ shippingContact?: ApplePayContact;
286
+ }
287
+ /**
288
+ * Apple's own `ApplePayPaymentContact` shape, carried through unchanged: a gateway that wants
289
+ * it expects the field names Apple uses. Only present when the method asks the sheet for it.
290
+ */
291
+ export interface ApplePayContact {
292
+ addressLines?: string[];
293
+ administrativeArea?: string;
294
+ country?: string;
295
+ countryCode?: string;
296
+ emailAddress?: string;
297
+ familyName?: string;
298
+ givenName?: string;
299
+ locality?: string;
300
+ phoneNumber?: string;
301
+ postalCode?: string;
302
+ subAdministrativeArea?: string;
303
+ subLocality?: string;
304
+ }
305
+ export interface TransactionOptions {
306
+ bonusCode?: string;
307
+ activityId?: string;
308
+ originalActivityId?: string;
309
+ userData?: UserData;
310
+ trackingData?: object;
311
+ transactionAttributes?: Record<string, string>;
312
+ }
313
+ export interface TransactionResult {
314
+ error?: ProviderTransactionError;
315
+ redirectOutput?: RedirectOutput;
316
+ state: TransactionState;
317
+ statusCode: string;
318
+ transactionId: string;
319
+ pspStatusCode?: string;
320
+ details?: Record<string, unknown>;
321
+ }
322
+ export interface RedirectOutput {
323
+ container: RedirectContainer;
324
+ height?: number;
325
+ html?: string;
326
+ method?: HttpVerb;
327
+ parameters?: Record<string, string>;
328
+ sizeUnit?: string;
329
+ url: string;
330
+ width?: number;
331
+ }
332
+ export type RedirectContainer = 'iframe' | 'window' | 'redirect';
333
+ export declare enum TransactionState {
334
+ SUCCESS = "SUCCESS",
335
+ FAIL = "FAIL",
336
+ PROCESSING = "PROCESSING",
337
+ WAITING_APPROVAL = "WAITING_APPROVAL",
338
+ WAITING_INPUT = "WAITING_INPUT",
339
+ CANCELLED = "CANCELLED"
340
+ }
341
+ export interface ProviderTransactionError {
342
+ action: Action;
343
+ code: string;
344
+ providerCode: string;
345
+ text: string;
346
+ textTitle: string;
347
+ iconSelection: string;
348
+ }
349
+ export declare enum HttpVerb {
350
+ DELETE = "DELETE",
351
+ GET = "GET",
352
+ POST = "POST",
353
+ PUT = "PUT"
354
+ }
355
+ export declare enum Action {
356
+ RESTART_PRESERVING_DETAILS = "RESTART_PRESERVING_DETAILS",
357
+ RESTART_CLEARING_DETAILS = "RESTART_CLEARING_DETAILS",
358
+ SHOW_DETAILS_STEP_PRESERVING_DETAILS = "SHOW_DETAILS_STEP_PRESERVING_DETAILS",
359
+ SHOW_DETAILS_STEP_CLEARING_DETAILS = "SHOW_DETAILS_STEP_CLEARING_DETAILS",
360
+ SHOW_CVC_EDIT = "SHOW_CVC_EDIT",
361
+ DISMISS = "DISMISS"
362
+ }
363
+ export interface PendingWithdrawal {
364
+ amount: string;
365
+ creationDate: string;
366
+ state: WithdrawalState;
367
+ transactionId: string;
368
+ paymentGatewayId: string;
369
+ }
370
+ export declare enum WithdrawalState {
371
+ REQUESTED = "REQUESTED",
372
+ PROCESSING = "PROCESSING"
373
+ }
374
+ export interface AvailableBonusWithPaymentMethods {
375
+ code: string;
376
+ paymentMethodFilter?: {
377
+ applyTo?: BonusPaymentMethod[];
378
+ excludeFrom?: BonusPaymentMethod[];
379
+ };
380
+ }
381
+ export interface BonusPaymentMethod {
382
+ providerType: string;
383
+ service?: string;
384
+ }
385
+ export interface TrackingEvent {
386
+ eventId: string;
387
+ data: object;
388
+ }
389
+ export declare enum KycStatus {
390
+ VERIFIED = "verified",
391
+ UNVERIFIED = "unverified",
392
+ PROCESSING = "processing"
393
+ }
394
+ export interface UserData {
395
+ fullName?: string;
396
+ age?: number;
397
+ dayOfMonth?: number;
398
+ dayOfWeek?: string;
399
+ depositLimit?: number;
400
+ minimumDeposit?: number;
401
+ maximumDeposit?: number;
402
+ previousDeposit?: number;
403
+ timeOfDay?: string;
404
+ lifetimeDeposit?: number;
405
+ depositCount?: number;
406
+ daysSinceRegistration?: number;
407
+ kycStatus?: KycStatus;
408
+ affiliateId?: string;
409
+ tags?: string[];
410
+ }
411
+ export interface TrackingEventData {
412
+ id: string;
413
+ event: string;
414
+ operatorId?: string;
415
+ timestamp?: string | number | Date;
416
+ activityId?: string;
417
+ originalActivityId?: string;
418
+ bonusesOffered?: boolean;
419
+ country?: string;
420
+ sessionId?: string;
421
+ userAgent?: string;
422
+ userId?: string;
423
+ [key: string]: unknown;
424
+ }
425
+ export type TrackingEventDataEnvelope = {
426
+ id: string;
427
+ environment: 'production' | 'staging' | 'demo';
428
+ body: TrackingEventData;
429
+ };
430
+ export interface Banner {
431
+ title: string;
432
+ body: string;
433
+ ctaLabel: string;
434
+ iconUrl: string;
435
+ }
436
+ export interface CampaignChatIcons {
437
+ amount?: string;
438
+ bonus?: string;
439
+ paymentMethod?: string;
440
+ paymentDetails?: string;
441
+ securePayment?: string;
442
+ }
443
+ export interface Campaign {
444
+ enableSuccessAnimation: boolean;
445
+ customChatIcons?: CampaignChatIcons;
446
+ }
447
+ export {};
package/lib/index.js CHANGED
@@ -1,7 +1,97 @@
1
- export * from './wallet.js';
2
- export * from './wallet-config-keys.js';
3
- export * from './payment-methods.js';
4
- export * from './transactions.js';
5
- export * from './user.js';
6
- export * from './bonus.js';
7
- export * from './tracking.js';
1
+ export var Integration;
2
+ (function (Integration) {
3
+ Integration["LEFT"] = "LEFT";
4
+ Integration["CENTER"] = "CENTER";
5
+ Integration["RIGHT"] = "RIGHT";
6
+ Integration["INLINE"] = "INLINE";
7
+ })(Integration || (Integration = {}));
8
+ export var ContentType;
9
+ (function (ContentType) {
10
+ ContentType["PLAIN_TEXT"] = "PLAIN_TEXT";
11
+ ContentType["HTML"] = "HTML";
12
+ })(ContentType || (ContentType = {}));
13
+ export var TraitType;
14
+ (function (TraitType) {
15
+ TraitType["COLOR"] = "COLOR";
16
+ TraitType["IMAGE"] = "IMAGE";
17
+ TraitType["TEXT"] = "TEXT";
18
+ TraitType["SOUND"] = "SOUND";
19
+ })(TraitType || (TraitType = {}));
20
+ export var PaymentType;
21
+ (function (PaymentType) {
22
+ PaymentType["APPLE_PAY"] = "ApplePay";
23
+ PaymentType["BANK_TRANSFER"] = "BankTransfer";
24
+ PaymentType["CREDIT_CARD"] = "CreditCard";
25
+ PaymentType["CRYPTO"] = "Crypto";
26
+ PaymentType["EWALLET"] = "EWallet";
27
+ PaymentType["VOUCHER"] = "Voucher";
28
+ })(PaymentType || (PaymentType = {}));
29
+ export var WindowRedirectType;
30
+ (function (WindowRedirectType) {
31
+ WindowRedirectType["POPUP_WINDOW"] = "popupWindow";
32
+ WindowRedirectType["BROWSER_TAB"] = "browserTab";
33
+ WindowRedirectType["NONE"] = "none";
34
+ })(WindowRedirectType || (WindowRedirectType = {}));
35
+ // Which message contract the client must speak to the hosted fields, not which gateway
36
+ // is behind them — the gateway's identity stays server-side.
37
+ export var HostedFieldsProtocol;
38
+ (function (HostedFieldsProtocol) {
39
+ HostedFieldsProtocol["CARD_VALUES"] = "CardValues";
40
+ HostedFieldsProtocol["CARD_TOKEN"] = "CardToken";
41
+ })(HostedFieldsProtocol || (HostedFieldsProtocol = {}));
42
+ export var EncryptionType;
43
+ (function (EncryptionType) {
44
+ EncryptionType["NO_ENCRYPTION"] = "NO_ENCRYPTION";
45
+ EncryptionType["RSA_PKCS1"] = "RSA_PKCS1";
46
+ EncryptionType["RSA_OAEP"] = "RSA_OAEP";
47
+ EncryptionType["SHA384_SIGNATURE"] = "SHA384_SIGNATURE"; // SHA-384-based signature (headers)
48
+ })(EncryptionType || (EncryptionType = {}));
49
+ export var ExpiryDateEncryptionMode;
50
+ (function (ExpiryDateEncryptionMode) {
51
+ ExpiryDateEncryptionMode["NONE"] = "NONE";
52
+ ExpiryDateEncryptionMode["SEPARATE_FIELDS"] = "SEPARATE_FIELDS";
53
+ ExpiryDateEncryptionMode["SINGLE_FIELD"] = "SINGLE_FIELD";
54
+ })(ExpiryDateEncryptionMode || (ExpiryDateEncryptionMode = {}));
55
+ export var RecentMethodMaskedAccountFormat;
56
+ (function (RecentMethodMaskedAccountFormat) {
57
+ RecentMethodMaskedAccountFormat["DEFAULT"] = "Default";
58
+ RecentMethodMaskedAccountFormat["LAST_8_DIGITS"] = "Last8Digits";
59
+ RecentMethodMaskedAccountFormat["FULL_VALUE"] = "FullValue";
60
+ RecentMethodMaskedAccountFormat["NOTHING"] = "Nothing";
61
+ })(RecentMethodMaskedAccountFormat || (RecentMethodMaskedAccountFormat = {}));
62
+ export var TransactionState;
63
+ (function (TransactionState) {
64
+ TransactionState["SUCCESS"] = "SUCCESS";
65
+ TransactionState["FAIL"] = "FAIL";
66
+ TransactionState["PROCESSING"] = "PROCESSING";
67
+ TransactionState["WAITING_APPROVAL"] = "WAITING_APPROVAL";
68
+ TransactionState["WAITING_INPUT"] = "WAITING_INPUT";
69
+ TransactionState["CANCELLED"] = "CANCELLED";
70
+ })(TransactionState || (TransactionState = {}));
71
+ export var HttpVerb;
72
+ (function (HttpVerb) {
73
+ HttpVerb["DELETE"] = "DELETE";
74
+ HttpVerb["GET"] = "GET";
75
+ HttpVerb["POST"] = "POST";
76
+ HttpVerb["PUT"] = "PUT";
77
+ })(HttpVerb || (HttpVerb = {}));
78
+ export var Action;
79
+ (function (Action) {
80
+ Action["RESTART_PRESERVING_DETAILS"] = "RESTART_PRESERVING_DETAILS";
81
+ Action["RESTART_CLEARING_DETAILS"] = "RESTART_CLEARING_DETAILS";
82
+ Action["SHOW_DETAILS_STEP_PRESERVING_DETAILS"] = "SHOW_DETAILS_STEP_PRESERVING_DETAILS";
83
+ Action["SHOW_DETAILS_STEP_CLEARING_DETAILS"] = "SHOW_DETAILS_STEP_CLEARING_DETAILS";
84
+ Action["SHOW_CVC_EDIT"] = "SHOW_CVC_EDIT";
85
+ Action["DISMISS"] = "DISMISS";
86
+ })(Action || (Action = {}));
87
+ export var WithdrawalState;
88
+ (function (WithdrawalState) {
89
+ WithdrawalState["REQUESTED"] = "REQUESTED";
90
+ WithdrawalState["PROCESSING"] = "PROCESSING";
91
+ })(WithdrawalState || (WithdrawalState = {}));
92
+ export var KycStatus;
93
+ (function (KycStatus) {
94
+ KycStatus["VERIFIED"] = "verified";
95
+ KycStatus["UNVERIFIED"] = "unverified";
96
+ KycStatus["PROCESSING"] = "processing";
97
+ })(KycStatus || (KycStatus = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soltech/fluid-common",
3
- "version": "1.10.0-beta.1",
3
+ "version": "1.10.0-sc23269.2",
4
4
  "type": "module",
5
5
  "description": "Fluid frontend, API and AI common interfaces & enums",
6
6
  "main": "lib/index.js",