Skip to content

Commit f5fe03c

Browse files
committed
fix: update tsconfig
1 parent 5587e2f commit f5fe03c

File tree

5 files changed

+138
-130
lines changed

5 files changed

+138
-130
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ npx react-native run-android
148148

149149
> While developing, you can run the [CompassRNSampleApp](/CompassRNSampleApp/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the CompassRNSampleApp without a rebuild. If you change any native code, then you'll need to rebuild the CompassRNSampleAppp.
150150
151+
5. After you are done making changes, run the following command to
152+
153+
```sh
154+
npm pack
155+
```
156+
151157
## 5 Quality Expectations
152158

153159
Please ensure any contributions include unit tests. The project maintains a high level of test coverage for its functionality. Submissions are expected to maintain a similar level of coverage.
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
11
{
22
"collectionInfo": {
33
"fifthCollection": {
4-
"amount": 1900.0,
5-
"amountPerGram": 400.0,
4+
"amount": 1900,
5+
"amountPerGram": 400,
66
"id": "5",
77
"produceId": "975",
88
"produceName": "Maize",
99
"timeStamp": 1681382463864,
1010
"weightInGrams": 1500
1111
},
1212
"firstCollection": {
13-
"amount": 1200.0,
14-
"amountPerGram": 300.0,
13+
"amount": 1200,
14+
"amountPerGram": 300,
1515
"id": "1",
1616
"produceId": "316",
1717
"produceName": "Beans",
1818
"timeStamp": 1681382463864,
1919
"weightInGrams": 3676
2020
},
2121
"fourthCollection": {
22-
"amount": 3000.0,
23-
"amountPerGram": 100.0,
22+
"amount": 3000,
23+
"amountPerGram": 100,
2424
"id": "4",
2525
"produceId": "425",
2626
"produceName": "Peas",
2727
"timeStamp": 1681382463864,
2828
"weightInGrams": 2199
2929
},
30-
"lastAmountPaidOut": 700.0,
30+
"lastAmountPaidOut": 700,
3131
"lastPayoutTimeStamp": 1681382463863,
3232
"noOfPaidCollections": 2,
3333
"secondCollection": {
34-
"amount": 4556.0,
35-
"amountPerGram": 200.0,
34+
"amount": 4556,
35+
"amountPerGram": 200,
3636
"id": "2",
3737
"produceId": "432",
3838
"produceName": "Oats",
3939
"timeStamp": 1681382463864,
4040
"weightInGrams": 1000
4141
},
4242
"thirdCollection": {
43-
"amount": 1400.0,
44-
"amountPerGram": 600.0,
43+
"amount": 1400,
44+
"amountPerGram": 600,
4545
"id": "3",
4646
"produceId": "534",
4747
"produceName": "Potatoes",
4848
"timeStamp": 1681382463864,
4949
"weightInGrams": 1300
5050
},
51-
"totalAmountPaid": 6000.0
51+
"totalAmountPaid": 6000
5252
},
5353
"user": {
5454
"address": "Street 123",
@@ -59,6 +59,6 @@
5959
"identifier": "144",
6060
"lastName": "Doe",
6161
"mobileNumber": "11234245343",
62-
"rId": "1fa97fd3b394609528520301d04860c4d53e620b"
62+
"rId": "e726618ee6cd86f8af04fa0eac8d9b34c77fbd44"
6363
}
6464
}

CompassRNSampleApp/src/types/batchOperationDataTypes.ts

Lines changed: 0 additions & 116 deletions
This file was deleted.

android/src/main/java/com/mastercard/compass/cp3/lib/react_native_wrapper/ui/util/DefaultCryptoService.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ class DefaultCryptoService(private val helper: CompassKernelUIController.Compass
4242
}
4343
resultBytes += cache
4444
}
45+
Log.d("RNProgramSpaceDataSize", "Original JSON size: ${data.size} bytes")
46+
Log.d("RNProgramSpaceDataSize", "Encrypted JSON size: ${resultBytes.size} bytes")
4547
return resultBytes
4648
} catch (e: InvalidKeyException){
4749
Log.e(TAG, "cipherOperations: Public Key passed does not match algorithm or parameters required for the operation", e)

src/index.ts

Lines changed: 117 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { BatchOperationsSchema } from 'CompassRNSampleApp/src/types/batchOperationDataTypes';
21
import { NativeModules, Platform } from 'react-native';
32

43
const LINKING_ERROR =
@@ -482,3 +481,120 @@ export interface BatchOperationsV1ParamType {
482481
programGUID: string;
483482
listOfOperations: BatchOperationsSchema;
484483
}
484+
485+
export interface BatchOperationsSchema {
486+
registrationData?: BasicRegistrationDifferentProgram;
487+
basicRegistrationDifferentProgram?: BasicRegistrationDifferentProgram;
488+
consumerDeviceNumber?: BasicRegistrationDifferentProgram;
489+
updateCardProfile?: UpdateCardProfile;
490+
writePasscode?: UpdateCardProfile;
491+
verifyPasscode?: VerifyPasscode;
492+
writeProgramSpace?: WriteProgramSpace;
493+
svaList?: BasicRegistrationDifferentProgram;
494+
svaOperation?: PokedexSvaOperation;
495+
readSVA?: ReadSVA;
496+
createFinancialSva?: CreateFinancialSva;
497+
createEVoucherSva?: CreateEVoucherSva;
498+
writeApplicationDataRecord?: WriteApplicationDataRecord;
499+
readApplicationDataBlob?: BasicRegistrationDifferentProgram;
500+
writeApplicationDataBlob?: WriteApplicationDataBlob;
501+
readAppDataChunk?: ReadAppDataChunk;
502+
readProgramSpace?: BasicRegistrationDifferentProgram;
503+
}
504+
505+
export interface BasicRegistrationDifferentProgram {
506+
programGUID: string;
507+
name: string;
508+
}
509+
510+
export interface CreateEVoucherSva {
511+
sva: CreateEVoucherSvaSva;
512+
programGUID: string;
513+
name: string;
514+
}
515+
516+
export interface CreateEVoucherSvaSva {
517+
EVoucherSva: EVoucherSva;
518+
}
519+
520+
export interface EVoucherSva {
521+
unit: string;
522+
eVoucherType: string;
523+
}
524+
525+
export interface CreateFinancialSva {
526+
sva: CreateFinancialSvaSva;
527+
programGUID: string;
528+
name: string;
529+
}
530+
531+
export interface CreateFinancialSvaSva {
532+
FinancialSVA: FinancialSVA;
533+
}
534+
535+
export interface FinancialSVA {
536+
unit: string;
537+
}
538+
539+
export interface ReadAppDataChunk {
540+
indexes: number[];
541+
programGUID: string;
542+
name: string;
543+
}
544+
545+
export interface ReadSVA {
546+
svaUnit: string;
547+
programGUID: string;
548+
name: string;
549+
}
550+
551+
export interface PokedexSvaOperation {
552+
svaOperation: SvaOperationSvaOperation;
553+
programGUID: string;
554+
name: string;
555+
}
556+
557+
export interface SvaOperationSvaOperation {
558+
unit: string;
559+
amount: number;
560+
operationType: string;
561+
}
562+
563+
export interface UpdateCardProfile {
564+
rid: string;
565+
programGUID: string;
566+
name: string;
567+
passcode?: string;
568+
}
569+
570+
export interface VerifyPasscode {
571+
passcode: string;
572+
programGUID: string;
573+
name: string;
574+
shouldContinueOnVerificationFail: boolean;
575+
}
576+
577+
export interface WriteApplicationDataBlob {
578+
dataBlob: string;
579+
programGUID: string;
580+
name: string;
581+
}
582+
583+
export interface WriteApplicationDataRecord {
584+
appDataRecord: AppDataRecord[];
585+
programGUID: string;
586+
name: string;
587+
}
588+
589+
export interface AppDataRecord {
590+
index: number;
591+
chunk: string;
592+
isShared: boolean;
593+
}
594+
595+
export interface WriteProgramSpace {
596+
rId: string;
597+
data: string;
598+
programGUID: string;
599+
name: string;
600+
}

0 commit comments

Comments
 (0)