@soltech/fluid-common 1.10.0-sc23736.2 → 1.10.1-sc23265.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.
@@ -1,12 +1,7 @@
1
1
  {
2
2
  "enabledMcpjsonServers": [
3
- "handbook",
4
- "webstorm",
5
3
  "shortcut",
6
- "chrome-devtools",
7
- "mcp-clickhouse",
8
- "notion",
9
- "datocms",
10
- "sentry"
11
- ]
4
+ "playwright"
5
+ ],
6
+ "enableAllProjectMcpServers": true
12
7
  }
@@ -7,9 +7,11 @@ export declare enum PaymentType {
7
7
  EWALLET = "EWallet",
8
8
  VOUCHER = "Voucher"
9
9
  }
10
+ export type TransactionStatusSource = 'gateway' | 'fluid';
10
11
  export interface TransactionStatusCheck {
11
12
  url: string;
12
13
  intervalSeconds: number;
14
+ source?: TransactionStatusSource;
13
15
  }
14
16
  export interface AllPaymentMethods {
15
17
  recentPaymentMethods: RecentMethod[];
@@ -52,9 +54,25 @@ export interface EncryptionSettings {
52
54
  expiryDateEncryptionMode: ExpiryDateEncryptionMode;
53
55
  encryptCardholderName: boolean;
54
56
  }
55
- export interface HostedFieldsSettings {
57
+ export type HostedFieldsSettings = CardValuesSettings | CardTokenSettings;
58
+ interface HostedFieldsBase {
56
59
  url: string;
57
60
  }
61
+ export interface CardValuesSettings extends HostedFieldsBase {
62
+ protocol?: HostedFieldsProtocol.CARD_VALUES;
63
+ }
64
+ export interface CardTokenSettings extends HostedFieldsBase {
65
+ protocol: HostedFieldsProtocol.CARD_TOKEN;
66
+ params: CardTokenParams;
67
+ }
68
+ export interface CardTokenParams {
69
+ merchantId: string;
70
+ env: string;
71
+ }
72
+ export declare enum HostedFieldsProtocol {
73
+ CARD_VALUES = "CardValues",
74
+ CARD_TOKEN = "CardToken"
75
+ }
58
76
  export declare enum EncryptionType {
59
77
  NO_ENCRYPTION = "NO_ENCRYPTION",
60
78
  RSA_PKCS1 = "RSA_PKCS1",// RSA with PKCS#1 v1.5 padding (jsencrypt default)
@@ -112,3 +130,4 @@ export interface RecentMethod extends PaymentMethod {
112
130
  expiryDate?: string;
113
131
  maskedAccountFormat?: RecentMethodMaskedAccountFormat;
114
132
  }
133
+ export {};
@@ -7,6 +7,13 @@ export var PaymentType;
7
7
  PaymentType["EWALLET"] = "EWallet";
8
8
  PaymentType["VOUCHER"] = "Voucher";
9
9
  })(PaymentType || (PaymentType = {}));
10
+ // Which message contract the client must speak to the hosted fields, not which gateway
11
+ // is behind them — the gateway's identity stays server-side.
12
+ export var HostedFieldsProtocol;
13
+ (function (HostedFieldsProtocol) {
14
+ HostedFieldsProtocol["CARD_VALUES"] = "CardValues";
15
+ HostedFieldsProtocol["CARD_TOKEN"] = "CardToken";
16
+ })(HostedFieldsProtocol || (HostedFieldsProtocol = {}));
10
17
  export var EncryptionType;
11
18
  (function (EncryptionType) {
12
19
  EncryptionType["NO_ENCRYPTION"] = "NO_ENCRYPTION";
@@ -16,6 +16,8 @@ export interface CreditcardTransactionParams extends TransactionParams {
16
16
  expiryMonth?: string;
17
17
  expiryYear?: string;
18
18
  expiryDate?: string;
19
+ cardToken?: string;
20
+ protectionHeaders?: Record<string, string>;
19
21
  }
20
22
  /**
21
23
  * Transaction params for any payment method whose payload is keyed dynamically:
package/lib/wallet.d.ts CHANGED
@@ -10,6 +10,19 @@ export interface Viewport {
10
10
  innerWidth: number;
11
11
  innerHeight: number;
12
12
  }
13
+ export interface ScreenDimensions {
14
+ height: number;
15
+ width: number;
16
+ }
17
+ export interface BrowserInfo {
18
+ userAgent: string;
19
+ acceptHeader: string;
20
+ javaEnabled: boolean;
21
+ colorDepth: number;
22
+ screen: ScreenDimensions;
23
+ viewport: Viewport;
24
+ timezoneOffset: number;
25
+ }
13
26
  export interface WalletRequestBody {
14
27
  payload?: object | string;
15
28
  payloadOptions?: TransactionOptions;
@@ -22,8 +35,11 @@ export interface WalletInitParams {
22
35
  operatorId: number;
23
36
  sessionId: string;
24
37
  userId: string | number;
38
+ /** @deprecated Use browserInfo.userAgent instead */
25
39
  userAgent: string;
40
+ /** @deprecated Use browserInfo.viewport instead */
26
41
  viewport: Viewport;
42
+ browserInfo?: BrowserInfo;
27
43
  userData?: UserData;
28
44
  timestamp: string;
29
45
  buildDate: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soltech/fluid-common",
3
- "version": "1.10.0-sc23736.2",
3
+ "version": "1.10.1-sc23265.0",
4
4
  "type": "module",
5
5
  "description": "Fluid frontend, API and AI common interfaces & enums",
6
6
  "main": "lib/index.js",
@@ -9,9 +9,12 @@ export enum PaymentType {
9
9
  VOUCHER = 'Voucher'
10
10
  }
11
11
 
12
+ export type TransactionStatusSource = 'gateway' | 'fluid';
13
+
12
14
  export interface TransactionStatusCheck {
13
15
  url: string;
14
16
  intervalSeconds: number;
17
+ source?: TransactionStatusSource;
15
18
  }
16
19
 
17
20
  export interface AllPaymentMethods {
@@ -59,10 +62,35 @@ export interface EncryptionSettings {
59
62
  encryptCardholderName: boolean;
60
63
  }
61
64
 
62
- export interface HostedFieldsSettings {
65
+ export type HostedFieldsSettings = CardValuesSettings | CardTokenSettings;
66
+
67
+ interface HostedFieldsBase {
68
+ // Its presence is also how the client decides a method uses hosted fields at all.
63
69
  url: string;
64
70
  }
65
71
 
72
+ export interface CardValuesSettings extends HostedFieldsBase {
73
+ // Absent selects this protocol, so responses composed before the field existed keep working.
74
+ protocol?: HostedFieldsProtocol.CARD_VALUES;
75
+ }
76
+
77
+ export interface CardTokenSettings extends HostedFieldsBase {
78
+ protocol: HostedFieldsProtocol.CARD_TOKEN;
79
+ params: CardTokenParams;
80
+ }
81
+
82
+ export interface CardTokenParams {
83
+ merchantId: string;
84
+ env: string;
85
+ }
86
+
87
+ // Which message contract the client must speak to the hosted fields, not which gateway
88
+ // is behind them — the gateway's identity stays server-side.
89
+ export enum HostedFieldsProtocol {
90
+ CARD_VALUES = 'CardValues',
91
+ CARD_TOKEN = 'CardToken'
92
+ }
93
+
66
94
  export enum EncryptionType {
67
95
  NO_ENCRYPTION = 'NO_ENCRYPTION',
68
96
  RSA_PKCS1 = 'RSA_PKCS1', // RSA with PKCS#1 v1.5 padding (jsencrypt default)
@@ -19,6 +19,8 @@ export interface CreditcardTransactionParams extends TransactionParams {
19
19
  expiryMonth?: string;
20
20
  expiryYear?: string;
21
21
  expiryDate?: string;
22
+ cardToken?: string;
23
+ protectionHeaders?: Record<string, string>;
22
24
  }
23
25
  /**
24
26
  * Transaction params for any payment method whose payload is keyed dynamically:
package/src/wallet.ts CHANGED
@@ -13,6 +13,21 @@ export interface Viewport {
13
13
  innerHeight: number;
14
14
  }
15
15
 
16
+ export interface ScreenDimensions {
17
+ height: number;
18
+ width: number;
19
+ }
20
+
21
+ export interface BrowserInfo {
22
+ userAgent: string;
23
+ acceptHeader: string;
24
+ javaEnabled: boolean;
25
+ colorDepth: number;
26
+ screen: ScreenDimensions;
27
+ viewport: Viewport;
28
+ timezoneOffset: number;
29
+ }
30
+
16
31
  export interface WalletRequestBody {
17
32
  payload?: object | string;
18
33
  payloadOptions?: TransactionOptions;
@@ -26,8 +41,11 @@ export interface WalletInitParams {
26
41
  operatorId: number;
27
42
  sessionId: string;
28
43
  userId: string | number;
44
+ /** @deprecated Use browserInfo.userAgent instead */
29
45
  userAgent: string;
46
+ /** @deprecated Use browserInfo.viewport instead */
30
47
  viewport: Viewport;
48
+ browserInfo?: BrowserInfo;
31
49
  userData?: UserData;
32
50
  timestamp: string;
33
51
  buildDate: string;