@znaika/contracts 1.0.0 → 1.0.1
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/telegram.d.ts +31 -0
- package/gen/telegram.js +35 -0
- package/package.json +2 -2
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "telegram.v1";
|
|
3
|
+
export declare enum ParseMode {
|
|
4
|
+
PARSE_MODE_UNSPECIFIED = 0,
|
|
5
|
+
PARSE_MODE_MARKDOWN_V2 = 1,
|
|
6
|
+
PARSE_MODE_HTML = 2,
|
|
7
|
+
UNRECOGNIZED = -1
|
|
8
|
+
}
|
|
9
|
+
export interface SendMessageRequest {
|
|
10
|
+
chatId: number;
|
|
11
|
+
text: string;
|
|
12
|
+
parseMode: ParseMode;
|
|
13
|
+
disableNotification: boolean;
|
|
14
|
+
disableWebPagePreview: boolean;
|
|
15
|
+
replyToMessageId: number;
|
|
16
|
+
}
|
|
17
|
+
export interface SendMessageResponse {
|
|
18
|
+
success: boolean;
|
|
19
|
+
messageId: number;
|
|
20
|
+
statusCode: number;
|
|
21
|
+
error: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const TELEGRAM_V1_PACKAGE_NAME = "telegram.v1";
|
|
24
|
+
export interface TelegramServiceClient {
|
|
25
|
+
sendMessage(request: SendMessageRequest): Observable<SendMessageResponse>;
|
|
26
|
+
}
|
|
27
|
+
export interface TelegramServiceController {
|
|
28
|
+
sendMessage(request: SendMessageRequest): Promise<SendMessageResponse> | Observable<SendMessageResponse> | SendMessageResponse;
|
|
29
|
+
}
|
|
30
|
+
export declare function TelegramServiceControllerMethods(): (constructor: Function) => void;
|
|
31
|
+
export declare const TELEGRAM_SERVICE_NAME = "TelegramService";
|
package/gen/telegram.js
ADDED
|
@@ -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.9
|
|
5
|
+
// protoc v3.21.12
|
|
6
|
+
// source: telegram.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.TELEGRAM_SERVICE_NAME = exports.TELEGRAM_V1_PACKAGE_NAME = exports.ParseMode = exports.protobufPackage = void 0;
|
|
9
|
+
exports.TelegramServiceControllerMethods = TelegramServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "telegram.v1";
|
|
13
|
+
var ParseMode;
|
|
14
|
+
(function (ParseMode) {
|
|
15
|
+
ParseMode[ParseMode["PARSE_MODE_UNSPECIFIED"] = 0] = "PARSE_MODE_UNSPECIFIED";
|
|
16
|
+
ParseMode[ParseMode["PARSE_MODE_MARKDOWN_V2"] = 1] = "PARSE_MODE_MARKDOWN_V2";
|
|
17
|
+
ParseMode[ParseMode["PARSE_MODE_HTML"] = 2] = "PARSE_MODE_HTML";
|
|
18
|
+
ParseMode[ParseMode["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
19
|
+
})(ParseMode || (exports.ParseMode = ParseMode = {}));
|
|
20
|
+
exports.TELEGRAM_V1_PACKAGE_NAME = "telegram.v1";
|
|
21
|
+
function TelegramServiceControllerMethods() {
|
|
22
|
+
return function (constructor) {
|
|
23
|
+
const grpcMethods = ["sendMessage"];
|
|
24
|
+
for (const method of grpcMethods) {
|
|
25
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
26
|
+
(0, microservices_1.GrpcMethod)("TelegramService", 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)("TelegramService", method)(constructor.prototype[method], method, descriptor);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
exports.TELEGRAM_SERVICE_NAME = "TelegramService";
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@znaika/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Protobuf definitions for microservices and TypeScript types",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"generate": "mkdir -p gen && protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit",
|
|
9
|
-
"build": "tsc -p tsconfig.build.json"
|
|
9
|
+
"build": "tsc -p tsconfig.build.json && tsc -p tsconfig.gen.build.json"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"proto",
|