@fiado/type-kit 3.623.0 → 3.624.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.
@@ -25,6 +25,16 @@ describe('WalletProvisioningRequest', () => {
25
25
  expect(await errorsOf(WalletProvisioningRequest, { wallet: 'GOOGLE_PAY', google: { serverSessionId: 'ssid' } })).toHaveLength(0);
26
26
  });
27
27
 
28
+ it('Google con deviceId y walletAccountId (Visa) es válido', async () => {
29
+ const body = { wallet: 'GOOGLE_PAY', google: { serverSessionId: 'ssid', deviceId: 'dev-1', walletAccountId: 'wal-1' } };
30
+ expect(await errorsOf(WalletProvisioningRequest, body)).toHaveLength(0);
31
+ });
32
+
33
+ it('Google con deviceId vacío es inválido', async () => {
34
+ const body = { wallet: 'GOOGLE_PAY', google: { serverSessionId: 'ssid', deviceId: '' } };
35
+ expect((await errorsOf(WalletProvisioningRequest, body)).length).toBeGreaterThan(0);
36
+ });
37
+
28
38
  it('Google sin serverSessionId es inválido', async () => {
29
39
  expect((await errorsOf(WalletProvisioningRequest, { wallet: 'GOOGLE_PAY', google: {} })).length).toBeGreaterThan(0);
30
40
  });
@@ -6,6 +6,8 @@ export declare class AppleWalletProvisioningData {
6
6
  }
7
7
  export declare class GoogleWalletProvisioningData {
8
8
  serverSessionId: string;
9
+ deviceId?: string;
10
+ walletAccountId?: string;
9
11
  }
10
12
  export declare class WalletProvisioningRequest {
11
13
  wallet: WalletProvider;
@@ -33,7 +33,7 @@ __decorate([
33
33
  (0, class_validator_1.IsNotEmpty)(),
34
34
  __metadata("design:type", String)
35
35
  ], AppleWalletProvisioningData.prototype, "nonceSignature", void 0);
36
- // Dato que entrega el SDK TapAndPay de Google a la app.
36
+ // Datos que entrega el SDK TapAndPay de Google a la app (PaymentCredentialsGenerator.generate).
37
37
  class GoogleWalletProvisioningData {
38
38
  }
39
39
  exports.GoogleWalletProvisioningData = GoogleWalletProvisioningData;
@@ -42,6 +42,18 @@ __decorate([
42
42
  (0, class_validator_1.IsNotEmpty)(),
43
43
  __metadata("design:type", String)
44
44
  ], GoogleWalletProvisioningData.prototype, "serverSessionId", void 0);
45
+ __decorate([
46
+ (0, class_validator_1.IsOptional)(),
47
+ (0, class_validator_1.IsString)(),
48
+ (0, class_validator_1.IsNotEmpty)(),
49
+ __metadata("design:type", String)
50
+ ], GoogleWalletProvisioningData.prototype, "deviceId", void 0);
51
+ __decorate([
52
+ (0, class_validator_1.IsOptional)(),
53
+ (0, class_validator_1.IsString)(),
54
+ (0, class_validator_1.IsNotEmpty)(),
55
+ __metadata("design:type", String)
56
+ ], GoogleWalletProvisioningData.prototype, "walletAccountId", void 0);
45
57
  class WalletProvisioningRequest {
46
58
  }
47
59
  exports.WalletProvisioningRequest = WalletProvisioningRequest;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.623.0",
3
+ "version": "3.624.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -1,5 +1,5 @@
1
1
  import { Type } from 'class-transformer';
2
- import { ArrayNotEmpty, IsArray, IsDefined, IsEnum, IsNotEmpty, IsString, ValidateIf, ValidateNested } from 'class-validator';
2
+ import { ArrayNotEmpty, IsArray, IsDefined, IsEnum, IsNotEmpty, IsOptional, IsString, ValidateIf, ValidateNested } from 'class-validator';
3
3
  import { WalletProvider } from '../enums/WalletProvider';
4
4
 
5
5
  // Datos que entrega Apple (PKAddPaymentPassViewController) a la app. Se reenvían tal cual a Pomelo.
@@ -18,11 +18,23 @@ export class AppleWalletProvisioningData {
18
18
  nonceSignature: string;
19
19
  }
20
20
 
21
- // Dato que entrega el SDK TapAndPay de Google a la app.
21
+ // Datos que entrega el SDK TapAndPay de Google a la app (PaymentCredentialsGenerator.generate).
22
22
  export class GoogleWalletProvisioningData {
23
23
  @IsString()
24
24
  @IsNotEmpty()
25
25
  serverSessionId: string;
26
+
27
+ // stableHardwareId de Google. Pomelo lo exige solo para Visa; la marca se valida en pomelo-v2.
28
+ @IsOptional()
29
+ @IsString()
30
+ @IsNotEmpty()
31
+ deviceId?: string;
32
+
33
+ // walletId de Google. Pomelo lo exige solo para Visa.
34
+ @IsOptional()
35
+ @IsString()
36
+ @IsNotEmpty()
37
+ walletAccountId?: string;
26
38
  }
27
39
 
28
40
  export class WalletProvisioningRequest {