@arbiwallet/contracts 1.0.111 → 1.0.113

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 CHANGED
@@ -203,6 +203,18 @@ export interface ExecuteCreateWithLedgerResponse {
203
203
  sufficientBalance: boolean;
204
204
  }
205
205
 
206
+ export interface ScanGiftCardQrRequest {
207
+ accountId: number;
208
+ uid: number;
209
+ bin: string;
210
+ }
211
+
212
+ export interface ScanGiftCardQrResponse {
213
+ success: boolean;
214
+ requiredAmount: string;
215
+ cardId: number;
216
+ }
217
+
206
218
  export interface ListCardsRequest {
207
219
  accountId: number;
208
220
  }
@@ -428,6 +440,8 @@ export interface CardServiceClient {
428
440
 
429
441
  executeCreateWithLedger(request: ExecuteCreateWithLedgerRequest): Observable<ExecuteCreateWithLedgerResponse>;
430
442
 
443
+ scanGiftCardQr(request: ScanGiftCardQrRequest): Observable<ScanGiftCardQrResponse>;
444
+
431
445
  listCards(request: ListCardsRequest): Observable<ListCardsResponse>;
432
446
 
433
447
  listCardsPaginated(request: ListCardsPaginatedRequest): Observable<ListCardsPaginatedResponse>;
@@ -496,6 +510,10 @@ export interface CardServiceController {
496
510
  | Observable<ExecuteCreateWithLedgerResponse>
497
511
  | ExecuteCreateWithLedgerResponse;
498
512
 
513
+ scanGiftCardQr(
514
+ request: ScanGiftCardQrRequest,
515
+ ): Promise<ScanGiftCardQrResponse> | Observable<ScanGiftCardQrResponse> | ScanGiftCardQrResponse;
516
+
499
517
  listCards(request: ListCardsRequest): Promise<ListCardsResponse> | Observable<ListCardsResponse> | ListCardsResponse;
500
518
 
501
519
  listCardsPaginated(
@@ -561,6 +579,7 @@ export function CardServiceControllerMethods() {
561
579
  "quoteTopupByTarget",
562
580
  "executeTopupWithLedger",
563
581
  "executeCreateWithLedger",
582
+ "scanGiftCardQr",
564
583
  "listCards",
565
584
  "listCardsPaginated",
566
585
  "getCard",
package/gen/content.ts CHANGED
@@ -32,6 +32,21 @@ export interface GetPublicBlogsResponse {
32
32
  blogs: Blog[];
33
33
  }
34
34
 
35
+ export interface GetPublicDocumentsRequest {
36
+ }
37
+
38
+ export interface GetPublicDocumentsResponse {
39
+ documents: Document[];
40
+ }
41
+
42
+ export interface GetPublicDocumentBySlugRequest {
43
+ slug: string;
44
+ }
45
+
46
+ export interface GetPublicDocumentBySlugResponse {
47
+ document: Document | undefined;
48
+ }
49
+
35
50
  export interface GetPublicStoriesRequest {
36
51
  }
37
52
 
@@ -265,6 +280,46 @@ export interface ReorderBlogsRequest {
265
280
  export interface ReorderBlogsResponse {
266
281
  }
267
282
 
283
+ export interface CreateDocumentRequest {
284
+ title: string;
285
+ slug: string;
286
+ body: string;
287
+ }
288
+
289
+ export interface CreateDocumentResponse {
290
+ document: Document | undefined;
291
+ }
292
+
293
+ export interface GetDocumentsRequest {
294
+ }
295
+
296
+ export interface GetDocumentsResponse {
297
+ documents: Document[];
298
+ }
299
+
300
+ export interface GetDocumentBySlugRequest {
301
+ slug: string;
302
+ }
303
+
304
+ export interface GetDocumentBySlugResponse {
305
+ document: Document | undefined;
306
+ }
307
+
308
+ export interface UpdateDocumentRequest {
309
+ document: Document | undefined;
310
+ }
311
+
312
+ export interface UpdateDocumentResponse {
313
+ document: Document | undefined;
314
+ }
315
+
316
+ export interface DeleteDocumentRequest {
317
+ id: number;
318
+ }
319
+
320
+ export interface DeleteDocumentResponse {
321
+ }
322
+
268
323
  export interface CreateStoryRequest {
269
324
  iconUrl: string;
270
325
  title: string;
@@ -354,6 +409,15 @@ export interface Blog {
354
409
  order: number;
355
410
  }
356
411
 
412
+ export interface Document {
413
+ id: number;
414
+ title: string;
415
+ slug: string;
416
+ body: string;
417
+ createdAt: string;
418
+ updatedAt: string;
419
+ }
420
+
357
421
  export interface Story {
358
422
  id: number;
359
423
  iconUrl: string;
@@ -476,6 +540,10 @@ export interface PublicContentServiceClient {
476
540
 
477
541
  getPublicBlogs(request: GetPublicBlogsRequest): Observable<GetPublicBlogsResponse>;
478
542
 
543
+ getPublicDocuments(request: GetPublicDocumentsRequest): Observable<GetPublicDocumentsResponse>;
544
+
545
+ getPublicDocumentBySlug(request: GetPublicDocumentBySlugRequest): Observable<GetPublicDocumentBySlugResponse>;
546
+
479
547
  getPublicStories(request: GetPublicStoriesRequest): Observable<GetPublicStoriesResponse>;
480
548
  }
481
549
 
@@ -500,6 +568,17 @@ export interface PublicContentServiceController {
500
568
  request: GetPublicBlogsRequest,
501
569
  ): Promise<GetPublicBlogsResponse> | Observable<GetPublicBlogsResponse> | GetPublicBlogsResponse;
502
570
 
571
+ getPublicDocuments(
572
+ request: GetPublicDocumentsRequest,
573
+ ): Promise<GetPublicDocumentsResponse> | Observable<GetPublicDocumentsResponse> | GetPublicDocumentsResponse;
574
+
575
+ getPublicDocumentBySlug(
576
+ request: GetPublicDocumentBySlugRequest,
577
+ ):
578
+ | Promise<GetPublicDocumentBySlugResponse>
579
+ | Observable<GetPublicDocumentBySlugResponse>
580
+ | GetPublicDocumentBySlugResponse;
581
+
503
582
  getPublicStories(
504
583
  request: GetPublicStoriesRequest,
505
584
  ): Promise<GetPublicStoriesResponse> | Observable<GetPublicStoriesResponse> | GetPublicStoriesResponse;
@@ -513,6 +592,8 @@ export function PublicContentServiceControllerMethods() {
513
592
  "getPublicFilials",
514
593
  "getPublicPartners",
515
594
  "getPublicBlogs",
595
+ "getPublicDocuments",
596
+ "getPublicDocumentBySlug",
516
597
  "getPublicStories",
517
598
  ];
518
599
  for (const method of grpcMethods) {
@@ -711,6 +792,63 @@ export function BlogServiceControllerMethods() {
711
792
 
712
793
  export const BLOG_SERVICE_NAME = "BlogService";
713
794
 
795
+ export interface DocumentServiceClient {
796
+ createDocument(request: CreateDocumentRequest): Observable<CreateDocumentResponse>;
797
+
798
+ getDocuments(request: GetDocumentsRequest): Observable<GetDocumentsResponse>;
799
+
800
+ getDocumentBySlug(request: GetDocumentBySlugRequest): Observable<GetDocumentBySlugResponse>;
801
+
802
+ updateDocument(request: UpdateDocumentRequest): Observable<UpdateDocumentResponse>;
803
+
804
+ deleteDocument(request: DeleteDocumentRequest): Observable<DeleteDocumentResponse>;
805
+ }
806
+
807
+ export interface DocumentServiceController {
808
+ createDocument(
809
+ request: CreateDocumentRequest,
810
+ ): Promise<CreateDocumentResponse> | Observable<CreateDocumentResponse> | CreateDocumentResponse;
811
+
812
+ getDocuments(
813
+ request: GetDocumentsRequest,
814
+ ): Promise<GetDocumentsResponse> | Observable<GetDocumentsResponse> | GetDocumentsResponse;
815
+
816
+ getDocumentBySlug(
817
+ request: GetDocumentBySlugRequest,
818
+ ): Promise<GetDocumentBySlugResponse> | Observable<GetDocumentBySlugResponse> | GetDocumentBySlugResponse;
819
+
820
+ updateDocument(
821
+ request: UpdateDocumentRequest,
822
+ ): Promise<UpdateDocumentResponse> | Observable<UpdateDocumentResponse> | UpdateDocumentResponse;
823
+
824
+ deleteDocument(
825
+ request: DeleteDocumentRequest,
826
+ ): Promise<DeleteDocumentResponse> | Observable<DeleteDocumentResponse> | DeleteDocumentResponse;
827
+ }
828
+
829
+ export function DocumentServiceControllerMethods() {
830
+ return function (constructor: Function) {
831
+ const grpcMethods: string[] = [
832
+ "createDocument",
833
+ "getDocuments",
834
+ "getDocumentBySlug",
835
+ "updateDocument",
836
+ "deleteDocument",
837
+ ];
838
+ for (const method of grpcMethods) {
839
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
840
+ GrpcMethod("DocumentService", method)(constructor.prototype[method], method, descriptor);
841
+ }
842
+ const grpcStreamMethods: string[] = [];
843
+ for (const method of grpcStreamMethods) {
844
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
845
+ GrpcStreamMethod("DocumentService", method)(constructor.prototype[method], method, descriptor);
846
+ }
847
+ };
848
+ }
849
+
850
+ export const DOCUMENT_SERVICE_NAME = "DocumentService";
851
+
714
852
  export interface StoryServiceClient {
715
853
  createStory(request: CreateStoryRequest): Observable<CreateStoryResponse>;
716
854
 
@@ -0,0 +1,99 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.4
4
+ // protoc v7.34.0
5
+ // source: crm_gift_card.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "crm_gift_card";
12
+
13
+ export interface ScanGiftCardQrRequest {
14
+ qrPayload: string;
15
+ }
16
+
17
+ export interface ScanGiftCardQrResponse {
18
+ success: boolean;
19
+ status: string;
20
+ error: string;
21
+ scanId: string;
22
+ userId: number;
23
+ uid: number;
24
+ cardBin: string;
25
+ cardId: number;
26
+ }
27
+
28
+ export interface GetGiftCardStatsRequest {
29
+ }
30
+
31
+ export interface GetGiftCardStatsResponse {
32
+ sumGiftedSpends: string;
33
+ countGifted: number;
34
+ }
35
+
36
+ export interface ListGiftCardScansRequest {
37
+ page: number;
38
+ limit: number;
39
+ }
40
+
41
+ export interface GiftCardScanItem {
42
+ id: string;
43
+ userId: number;
44
+ uid: number;
45
+ cardBin: string;
46
+ status: string;
47
+ error: string;
48
+ createdAtUnixMs: number;
49
+ finalizedAtUnixMs: number;
50
+ }
51
+
52
+ export interface ListGiftCardScansResponse {
53
+ items: GiftCardScanItem[];
54
+ total: number;
55
+ page: number;
56
+ limit: number;
57
+ pages: number;
58
+ }
59
+
60
+ export const CRM_GIFT_CARD_PACKAGE_NAME = "crm_gift_card";
61
+
62
+ export interface CrmGiftCardServiceClient {
63
+ scanGiftCardQr(request: ScanGiftCardQrRequest): Observable<ScanGiftCardQrResponse>;
64
+
65
+ getGiftCardStats(request: GetGiftCardStatsRequest): Observable<GetGiftCardStatsResponse>;
66
+
67
+ listGiftCardScans(request: ListGiftCardScansRequest): Observable<ListGiftCardScansResponse>;
68
+ }
69
+
70
+ export interface CrmGiftCardServiceController {
71
+ scanGiftCardQr(
72
+ request: ScanGiftCardQrRequest,
73
+ ): Promise<ScanGiftCardQrResponse> | Observable<ScanGiftCardQrResponse> | ScanGiftCardQrResponse;
74
+
75
+ getGiftCardStats(
76
+ request: GetGiftCardStatsRequest,
77
+ ): Promise<GetGiftCardStatsResponse> | Observable<GetGiftCardStatsResponse> | GetGiftCardStatsResponse;
78
+
79
+ listGiftCardScans(
80
+ request: ListGiftCardScansRequest,
81
+ ): Promise<ListGiftCardScansResponse> | Observable<ListGiftCardScansResponse> | ListGiftCardScansResponse;
82
+ }
83
+
84
+ export function CrmGiftCardServiceControllerMethods() {
85
+ return function (constructor: Function) {
86
+ const grpcMethods: string[] = ["scanGiftCardQr", "getGiftCardStats", "listGiftCardScans"];
87
+ for (const method of grpcMethods) {
88
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
89
+ GrpcMethod("CrmGiftCardService", method)(constructor.prototype[method], method, descriptor);
90
+ }
91
+ const grpcStreamMethods: string[] = [];
92
+ for (const method of grpcStreamMethods) {
93
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
94
+ GrpcStreamMethod("CrmGiftCardService", method)(constructor.prototype[method], method, descriptor);
95
+ }
96
+ };
97
+ }
98
+
99
+ export const CRM_GIFT_CARD_SERVICE_NAME = "CrmGiftCardService";
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.111",
4
+ "version": "1.0.113",
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
@@ -15,6 +15,7 @@ service CardService {
15
15
  rpc QuoteTopupByTarget(QuoteTopupByTargetRequest) returns (QuoteTopupByTargetResponse);
16
16
  rpc ExecuteTopupWithLedger(ExecuteTopupWithLedgerRequest) returns (ExecuteTopupWithLedgerResponse);
17
17
  rpc ExecuteCreateWithLedger(ExecuteCreateWithLedgerRequest) returns (ExecuteCreateWithLedgerResponse);
18
+ rpc ScanGiftCardQr(ScanGiftCardQrRequest) returns (ScanGiftCardQrResponse);
18
19
 
19
20
  rpc ListCards(ListCardsRequest) returns (ListCardsResponse);
20
21
  rpc ListCardsPaginated(ListCardsPaginatedRequest) returns (ListCardsPaginatedResponse);
@@ -230,6 +231,18 @@ message ExecuteCreateWithLedgerResponse {
230
231
  }
231
232
 
232
233
 
234
+ message ScanGiftCardQrRequest {
235
+ int64 account_id = 1;
236
+ int64 uid = 2;
237
+ string bin = 3;
238
+ }
239
+
240
+ message ScanGiftCardQrResponse {
241
+ bool success = 1;
242
+ string required_amount = 2;
243
+ int64 card_id = 3;
244
+ }
245
+
233
246
  message ListCardsRequest {
234
247
  int64 account_id = 1;
235
248
  }
@@ -23,6 +23,8 @@ service PublicContentService {
23
23
  rpc GetPublicFilials (GetPublicFilialsRequest) returns (GetPublicFilialsResponse);
24
24
  rpc GetPublicPartners (GetPublicPartnersRequest) returns (GetPublicPartnersResponse);
25
25
  rpc GetPublicBlogs (GetPublicBlogsRequest) returns (GetPublicBlogsResponse);
26
+ rpc GetPublicDocuments (GetPublicDocumentsRequest) returns (GetPublicDocumentsResponse);
27
+ rpc GetPublicDocumentBySlug (GetPublicDocumentBySlugRequest) returns (GetPublicDocumentBySlugResponse);
26
28
  rpc GetPublicStories (GetPublicStoriesRequest) returns (GetPublicStoriesResponse);
27
29
  }
28
30
 
@@ -55,6 +57,14 @@ service BlogService {
55
57
  rpc ReorderBlogs (ReorderBlogsRequest) returns (ReorderBlogsResponse);
56
58
  }
57
59
 
60
+ service DocumentService {
61
+ rpc CreateDocument (CreateDocumentRequest) returns (CreateDocumentResponse);
62
+ rpc GetDocuments (GetDocumentsRequest) returns (GetDocumentsResponse);
63
+ rpc GetDocumentBySlug (GetDocumentBySlugRequest) returns (GetDocumentBySlugResponse);
64
+ rpc UpdateDocument (UpdateDocumentRequest) returns (UpdateDocumentResponse);
65
+ rpc DeleteDocument (DeleteDocumentRequest) returns (DeleteDocumentResponse);
66
+ }
67
+
58
68
  service StoryService {
59
69
  rpc CreateStory (CreateStoryRequest) returns (CreateStoryResponse);
60
70
  rpc GetStories (GetStoriesRequest) returns (GetStoriesResponse);
@@ -82,6 +92,20 @@ message GetPublicBlogsResponse {
82
92
  repeated Blog blogs = 1;
83
93
  }
84
94
 
95
+ message GetPublicDocumentsRequest {}
96
+
97
+ message GetPublicDocumentsResponse {
98
+ repeated Document documents = 1;
99
+ }
100
+
101
+ message GetPublicDocumentBySlugRequest {
102
+ string slug = 1;
103
+ }
104
+
105
+ message GetPublicDocumentBySlugResponse {
106
+ Document document = 1;
107
+ }
108
+
85
109
  message GetPublicStoriesRequest {}
86
110
 
87
111
  message GetPublicStoriesResponse {
@@ -305,6 +329,46 @@ message ReorderBlogsRequest {
305
329
 
306
330
  message ReorderBlogsResponse {}
307
331
 
332
+ // --- DOCUMENT ---
333
+
334
+ message CreateDocumentRequest {
335
+ string title = 1;
336
+ string slug = 2;
337
+ string body = 3;
338
+ }
339
+
340
+ message CreateDocumentResponse {
341
+ Document document = 1;
342
+ }
343
+
344
+ message GetDocumentsRequest {}
345
+
346
+ message GetDocumentsResponse {
347
+ repeated Document documents = 1;
348
+ }
349
+
350
+ message GetDocumentBySlugRequest {
351
+ string slug = 1;
352
+ }
353
+
354
+ message GetDocumentBySlugResponse {
355
+ Document document = 1;
356
+ }
357
+
358
+ message UpdateDocumentRequest {
359
+ Document document = 1;
360
+ }
361
+
362
+ message UpdateDocumentResponse {
363
+ Document document = 1;
364
+ }
365
+
366
+ message DeleteDocumentRequest {
367
+ int32 id = 1;
368
+ }
369
+
370
+ message DeleteDocumentResponse {}
371
+
308
372
  // --- STORY ---
309
373
 
310
374
  message CreateStoryRequest {
@@ -395,6 +459,15 @@ message Blog {
395
459
  int32 order = 8;
396
460
  }
397
461
 
462
+ message Document {
463
+ int32 id = 1;
464
+ string title = 2;
465
+ string slug = 3;
466
+ string body = 4;
467
+ string created_at = 5;
468
+ string updated_at = 6;
469
+ }
470
+
398
471
  message Story {
399
472
  int32 id = 1;
400
473
  string icon_url = 2;
@@ -0,0 +1,54 @@
1
+ syntax = "proto3";
2
+ package crm_gift_card;
3
+
4
+ service CrmGiftCardService {
5
+ rpc ScanGiftCardQr (ScanGiftCardQrRequest) returns (ScanGiftCardQrResponse);
6
+ rpc GetGiftCardStats (GetGiftCardStatsRequest) returns (GetGiftCardStatsResponse);
7
+ rpc ListGiftCardScans (ListGiftCardScansRequest) returns (ListGiftCardScansResponse);
8
+ }
9
+
10
+ message ScanGiftCardQrRequest {
11
+ string qr_payload = 1;
12
+ }
13
+
14
+ message ScanGiftCardQrResponse {
15
+ bool success = 1;
16
+ string status = 2;
17
+ string error = 3;
18
+ string scan_id = 4;
19
+ int64 user_id = 5;
20
+ int64 uid = 6;
21
+ string card_bin = 7;
22
+ int64 card_id = 8;
23
+ }
24
+
25
+ message GetGiftCardStatsRequest {}
26
+
27
+ message GetGiftCardStatsResponse {
28
+ string sum_gifted_spends = 1;
29
+ int64 count_gifted = 2;
30
+ }
31
+
32
+ message ListGiftCardScansRequest {
33
+ int32 page = 1;
34
+ int32 limit = 2;
35
+ }
36
+
37
+ message GiftCardScanItem {
38
+ string id = 1;
39
+ int64 user_id = 2;
40
+ int64 uid = 3;
41
+ string card_bin = 4;
42
+ string status = 5;
43
+ string error = 6;
44
+ int64 created_at_unix_ms = 7;
45
+ int64 finalized_at_unix_ms = 8;
46
+ }
47
+
48
+ message ListGiftCardScansResponse {
49
+ repeated GiftCardScanItem items = 1;
50
+ int32 total = 2;
51
+ int32 page = 3;
52
+ int32 limit = 4;
53
+ int32 pages = 5;
54
+ }