@arbiwallet/contracts 1.0.116 → 1.0.118
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/gen/card.ts +24 -0
- package/gen/crm_gift_card.ts +20 -1
- package/package.json +1 -1
- package/proto/card.proto +16 -0
- package/proto/crm_gift_card.proto +14 -0
package/gen/card.ts
CHANGED
|
@@ -421,6 +421,20 @@ export interface GetRegionsResponse {
|
|
|
421
421
|
regions: string[];
|
|
422
422
|
}
|
|
423
423
|
|
|
424
|
+
export interface HandleBincentricWebhookRequest {
|
|
425
|
+
rawBody: Uint8Array;
|
|
426
|
+
webhookTimestamp: string;
|
|
427
|
+
webhookSignature: string;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export interface HandleBincentricWebhookResponse {
|
|
431
|
+
ok: boolean;
|
|
432
|
+
handled: boolean;
|
|
433
|
+
eventType: string;
|
|
434
|
+
cardId: number;
|
|
435
|
+
reason: string;
|
|
436
|
+
}
|
|
437
|
+
|
|
424
438
|
export const CARD_V1_PACKAGE_NAME = "card.v1";
|
|
425
439
|
|
|
426
440
|
export interface CardServiceClient {
|
|
@@ -473,6 +487,8 @@ export interface CardServiceClient {
|
|
|
473
487
|
getAreaCodes(request: GetAreaCodesRequest): Observable<GetAreaCodesResponse>;
|
|
474
488
|
|
|
475
489
|
getRegions(request: GetRegionsRequest): Observable<GetRegionsResponse>;
|
|
490
|
+
|
|
491
|
+
handleBincentricWebhook(request: HandleBincentricWebhookRequest): Observable<HandleBincentricWebhookResponse>;
|
|
476
492
|
}
|
|
477
493
|
|
|
478
494
|
export interface CardServiceController {
|
|
@@ -566,6 +582,13 @@ export interface CardServiceController {
|
|
|
566
582
|
getRegions(
|
|
567
583
|
request: GetRegionsRequest,
|
|
568
584
|
): Promise<GetRegionsResponse> | Observable<GetRegionsResponse> | GetRegionsResponse;
|
|
585
|
+
|
|
586
|
+
handleBincentricWebhook(
|
|
587
|
+
request: HandleBincentricWebhookRequest,
|
|
588
|
+
):
|
|
589
|
+
| Promise<HandleBincentricWebhookResponse>
|
|
590
|
+
| Observable<HandleBincentricWebhookResponse>
|
|
591
|
+
| HandleBincentricWebhookResponse;
|
|
569
592
|
}
|
|
570
593
|
|
|
571
594
|
export function CardServiceControllerMethods() {
|
|
@@ -596,6 +619,7 @@ export function CardServiceControllerMethods() {
|
|
|
596
619
|
"getBinsExists",
|
|
597
620
|
"getAreaCodes",
|
|
598
621
|
"getRegions",
|
|
622
|
+
"handleBincentricWebhook",
|
|
599
623
|
];
|
|
600
624
|
for (const method of grpcMethods) {
|
|
601
625
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/gen/crm_gift_card.ts
CHANGED
|
@@ -10,6 +10,19 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "crm_gift_card";
|
|
12
12
|
|
|
13
|
+
export interface PreviewGiftCardQrRequest {
|
|
14
|
+
qrPayload: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface PreviewGiftCardQrResponse {
|
|
18
|
+
success: boolean;
|
|
19
|
+
status: string;
|
|
20
|
+
error: string;
|
|
21
|
+
userId: number;
|
|
22
|
+
uid: number;
|
|
23
|
+
cardBin: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
13
26
|
export interface ScanGiftCardQrRequest {
|
|
14
27
|
qrPayload: string;
|
|
15
28
|
}
|
|
@@ -60,6 +73,8 @@ export interface ListGiftCardScansResponse {
|
|
|
60
73
|
export const CRM_GIFT_CARD_PACKAGE_NAME = "crm_gift_card";
|
|
61
74
|
|
|
62
75
|
export interface CrmGiftCardServiceClient {
|
|
76
|
+
previewGiftCardQr(request: PreviewGiftCardQrRequest): Observable<PreviewGiftCardQrResponse>;
|
|
77
|
+
|
|
63
78
|
scanGiftCardQr(request: ScanGiftCardQrRequest): Observable<ScanGiftCardQrResponse>;
|
|
64
79
|
|
|
65
80
|
getGiftCardStats(request: GetGiftCardStatsRequest): Observable<GetGiftCardStatsResponse>;
|
|
@@ -68,6 +83,10 @@ export interface CrmGiftCardServiceClient {
|
|
|
68
83
|
}
|
|
69
84
|
|
|
70
85
|
export interface CrmGiftCardServiceController {
|
|
86
|
+
previewGiftCardQr(
|
|
87
|
+
request: PreviewGiftCardQrRequest,
|
|
88
|
+
): Promise<PreviewGiftCardQrResponse> | Observable<PreviewGiftCardQrResponse> | PreviewGiftCardQrResponse;
|
|
89
|
+
|
|
71
90
|
scanGiftCardQr(
|
|
72
91
|
request: ScanGiftCardQrRequest,
|
|
73
92
|
): Promise<ScanGiftCardQrResponse> | Observable<ScanGiftCardQrResponse> | ScanGiftCardQrResponse;
|
|
@@ -83,7 +102,7 @@ export interface CrmGiftCardServiceController {
|
|
|
83
102
|
|
|
84
103
|
export function CrmGiftCardServiceControllerMethods() {
|
|
85
104
|
return function (constructor: Function) {
|
|
86
|
-
const grpcMethods: string[] = ["scanGiftCardQr", "getGiftCardStats", "listGiftCardScans"];
|
|
105
|
+
const grpcMethods: string[] = ["previewGiftCardQr", "scanGiftCardQr", "getGiftCardStats", "listGiftCardScans"];
|
|
87
106
|
for (const method of grpcMethods) {
|
|
88
107
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
89
108
|
GrpcMethod("CrmGiftCardService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbiwallet/contracts",
|
|
3
3
|
"descriptions": "Generate and manage smart contracts for ArbiWallet",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.118",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
7
7
|
},
|
package/proto/card.proto
CHANGED
|
@@ -36,6 +36,8 @@ service CardService {
|
|
|
36
36
|
rpc GetBinsExists(GetBinsExistsRequest) returns (GetBinsExistsResponse);
|
|
37
37
|
rpc GetAreaCodes(GetAreaCodesRequest) returns (GetAreaCodesResponse);
|
|
38
38
|
rpc GetRegions(GetRegionsRequest) returns (GetRegionsResponse);
|
|
39
|
+
|
|
40
|
+
rpc HandleBincentricWebhook(HandleBincentricWebhookRequest) returns (HandleBincentricWebhookResponse);
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
enum CardStatus {
|
|
@@ -448,3 +450,17 @@ message GetAreaCodesResponse {
|
|
|
448
450
|
message GetRegionsResponse {
|
|
449
451
|
repeated string regions = 1;
|
|
450
452
|
}
|
|
453
|
+
|
|
454
|
+
message HandleBincentricWebhookRequest {
|
|
455
|
+
bytes raw_body = 1;
|
|
456
|
+
string webhook_timestamp = 2;
|
|
457
|
+
string webhook_signature = 3;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
message HandleBincentricWebhookResponse {
|
|
461
|
+
bool ok = 1;
|
|
462
|
+
bool handled = 2;
|
|
463
|
+
string event_type = 3;
|
|
464
|
+
int64 card_id = 4;
|
|
465
|
+
string reason = 5;
|
|
466
|
+
}
|
|
@@ -2,11 +2,25 @@ syntax = "proto3";
|
|
|
2
2
|
package crm_gift_card;
|
|
3
3
|
|
|
4
4
|
service CrmGiftCardService {
|
|
5
|
+
rpc PreviewGiftCardQr (PreviewGiftCardQrRequest) returns (PreviewGiftCardQrResponse);
|
|
5
6
|
rpc ScanGiftCardQr (ScanGiftCardQrRequest) returns (ScanGiftCardQrResponse);
|
|
6
7
|
rpc GetGiftCardStats (GetGiftCardStatsRequest) returns (GetGiftCardStatsResponse);
|
|
7
8
|
rpc ListGiftCardScans (ListGiftCardScansRequest) returns (ListGiftCardScansResponse);
|
|
8
9
|
}
|
|
9
10
|
|
|
11
|
+
message PreviewGiftCardQrRequest {
|
|
12
|
+
string qr_payload = 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message PreviewGiftCardQrResponse {
|
|
16
|
+
bool success = 1;
|
|
17
|
+
string status = 2;
|
|
18
|
+
string error = 3;
|
|
19
|
+
int64 user_id = 4;
|
|
20
|
+
int64 uid = 5;
|
|
21
|
+
string card_bin = 6;
|
|
22
|
+
}
|
|
23
|
+
|
|
10
24
|
message ScanGiftCardQrRequest {
|
|
11
25
|
string qr_payload = 1;
|
|
12
26
|
}
|