@ciganov/contracts 1.1.10 → 1.1.11
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/dist/gen/bonus.d.ts +54 -0
- package/dist/gen/bonus.js +35 -0
- package/dist/proto/contracts/bonus.proto +56 -0
- package/dist/proto/paths.d.ts +1 -0
- package/dist/proto/paths.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { Empty } from "./google/protobuf/empty";
|
|
3
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
4
|
+
export declare const protobufPackage = "bonus.v1";
|
|
5
|
+
export declare enum PromoType {
|
|
6
|
+
FIXED = 0,
|
|
7
|
+
PERCENTAGE = 1,
|
|
8
|
+
FREE_BET = 2,
|
|
9
|
+
UNRECOGNIZED = -1
|
|
10
|
+
}
|
|
11
|
+
export interface ActivatePromoCodeRequest {
|
|
12
|
+
userId: string;
|
|
13
|
+
code: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ActivatePromoCodeResponse {
|
|
16
|
+
ok: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface GetPromoCodesResponse {
|
|
19
|
+
promocodes: PromoCode[];
|
|
20
|
+
}
|
|
21
|
+
export interface CreatePromoCodeRequest {
|
|
22
|
+
code: string;
|
|
23
|
+
amount: number;
|
|
24
|
+
type: PromoType;
|
|
25
|
+
description?: string | undefined;
|
|
26
|
+
expiresAt: Timestamp | undefined;
|
|
27
|
+
activationCount: number;
|
|
28
|
+
}
|
|
29
|
+
export interface CreatePromoCodeResponse {
|
|
30
|
+
ok: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface PromoCode {
|
|
33
|
+
id: string;
|
|
34
|
+
code: string;
|
|
35
|
+
amount: number;
|
|
36
|
+
type: PromoType;
|
|
37
|
+
description: string;
|
|
38
|
+
activationCount: number;
|
|
39
|
+
expiresAt: Timestamp | undefined;
|
|
40
|
+
isActive: boolean;
|
|
41
|
+
}
|
|
42
|
+
export declare const BONUS_V1_PACKAGE_NAME = "bonus.v1";
|
|
43
|
+
export interface BonusServiceClient {
|
|
44
|
+
activatePromoCode(request: ActivatePromoCodeRequest): Observable<ActivatePromoCodeResponse>;
|
|
45
|
+
getPromoCodes(request: Empty): Observable<GetPromoCodesResponse>;
|
|
46
|
+
createPromoCode(request: CreatePromoCodeRequest): Observable<CreatePromoCodeResponse>;
|
|
47
|
+
}
|
|
48
|
+
export interface BonusServiceController {
|
|
49
|
+
activatePromoCode(request: ActivatePromoCodeRequest): Promise<ActivatePromoCodeResponse> | Observable<ActivatePromoCodeResponse> | ActivatePromoCodeResponse;
|
|
50
|
+
getPromoCodes(request: Empty): Promise<GetPromoCodesResponse> | Observable<GetPromoCodesResponse> | GetPromoCodesResponse;
|
|
51
|
+
createPromoCode(request: CreatePromoCodeRequest): Promise<CreatePromoCodeResponse> | Observable<CreatePromoCodeResponse> | CreatePromoCodeResponse;
|
|
52
|
+
}
|
|
53
|
+
export declare function BonusServiceControllerMethods(): (constructor: Function) => void;
|
|
54
|
+
export declare const BONUS_SERVICE_NAME = "BonusService";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.6
|
|
5
|
+
// protoc v3.21.12
|
|
6
|
+
// source: bonus.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.BONUS_SERVICE_NAME = exports.BONUS_V1_PACKAGE_NAME = exports.PromoType = exports.protobufPackage = void 0;
|
|
9
|
+
exports.BonusServiceControllerMethods = BonusServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "bonus.v1";
|
|
13
|
+
var PromoType;
|
|
14
|
+
(function (PromoType) {
|
|
15
|
+
PromoType[PromoType["FIXED"] = 0] = "FIXED";
|
|
16
|
+
PromoType[PromoType["PERCENTAGE"] = 1] = "PERCENTAGE";
|
|
17
|
+
PromoType[PromoType["FREE_BET"] = 2] = "FREE_BET";
|
|
18
|
+
PromoType[PromoType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
19
|
+
})(PromoType || (exports.PromoType = PromoType = {}));
|
|
20
|
+
exports.BONUS_V1_PACKAGE_NAME = "bonus.v1";
|
|
21
|
+
function BonusServiceControllerMethods() {
|
|
22
|
+
return function (constructor) {
|
|
23
|
+
const grpcMethods = ["activatePromoCode", "getPromoCodes", "createPromoCode"];
|
|
24
|
+
for (const method of grpcMethods) {
|
|
25
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
26
|
+
(0, microservices_1.GrpcMethod)("BonusService", method)(constructor.prototype[method], method, descriptor);
|
|
27
|
+
}
|
|
28
|
+
const grpcStreamMethods = [];
|
|
29
|
+
for (const method of grpcStreamMethods) {
|
|
30
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
31
|
+
(0, microservices_1.GrpcStreamMethod)("BonusService", method)(constructor.prototype[method], method, descriptor);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
exports.BONUS_SERVICE_NAME = "BonusService";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package bonus.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/empty.proto";
|
|
6
|
+
import "google/protobuf/timestamp.proto";
|
|
7
|
+
|
|
8
|
+
service BonusService {
|
|
9
|
+
rpc ActivatePromoCode(ActivatePromoCodeRequest) returns (ActivatePromoCodeResponse);
|
|
10
|
+
rpc GetPromoCodes(google.protobuf.Empty) returns (GetPromoCodesResponse);
|
|
11
|
+
rpc CreatePromoCode(CreatePromoCodeRequest) returns (CreatePromoCodeResponse);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message ActivatePromoCodeRequest {
|
|
15
|
+
string userId = 1;
|
|
16
|
+
string code = 2;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message ActivatePromoCodeResponse {
|
|
20
|
+
bool ok = 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message GetPromoCodesResponse {
|
|
24
|
+
repeated PromoCode promocodes = 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message CreatePromoCodeRequest {
|
|
28
|
+
string code = 1;
|
|
29
|
+
int32 amount = 2;
|
|
30
|
+
PromoType type = 3;
|
|
31
|
+
optional string description = 4;
|
|
32
|
+
google.protobuf.Timestamp expiresAt = 5;
|
|
33
|
+
int32 activationCount = 6;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message CreatePromoCodeResponse {
|
|
37
|
+
bool ok = 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message PromoCode {
|
|
41
|
+
string id = 1;
|
|
42
|
+
string code = 2;
|
|
43
|
+
int32 amount = 3;
|
|
44
|
+
PromoType type = 4;
|
|
45
|
+
string description = 5;
|
|
46
|
+
int32 activationCount = 6;
|
|
47
|
+
google.protobuf.Timestamp expiresAt = 7;
|
|
48
|
+
bool isActive = 8;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
enum PromoType {
|
|
53
|
+
FIXED = 0;
|
|
54
|
+
PERCENTAGE = 1;
|
|
55
|
+
FREE_BET = 2;
|
|
56
|
+
}
|
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -8,5 +8,6 @@ exports.PROTO_PATHS = {
|
|
|
8
8
|
USER: (0, node_path_1.join)(__dirname, './contracts/user.proto'),
|
|
9
9
|
BALANCE: (0, node_path_1.join)(__dirname, './contracts/balance.proto'),
|
|
10
10
|
ODD: (0, node_path_1.join)(__dirname, './contracts/odd.proto'),
|
|
11
|
-
BETTING: (0, node_path_1.join)(__dirname, './contracts/betting.proto')
|
|
11
|
+
BETTING: (0, node_path_1.join)(__dirname, './contracts/betting.proto'),
|
|
12
|
+
BONUS: (0, node_path_1.join)(__dirname, './contracts/bonus.proto')
|
|
12
13
|
};
|