@miteradar/contracts 1.0.2 → 1.0.3
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/auth.d.ts +37 -0
- package/dist/gen/auth.js +35 -0
- package/dist/gen/index.d.ts +1 -0
- package/dist/gen/index.js +17 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +6 -3
- package/gen/auth.ts +0 -73
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "auth.v1";
|
|
3
|
+
export declare enum Role {
|
|
4
|
+
ADMIN = 0,
|
|
5
|
+
MODERATOR = 1,
|
|
6
|
+
USER = 2,
|
|
7
|
+
UNRECOGNIZED = -1
|
|
8
|
+
}
|
|
9
|
+
export interface RegisterRequest {
|
|
10
|
+
login: string;
|
|
11
|
+
password: string;
|
|
12
|
+
role: Role;
|
|
13
|
+
}
|
|
14
|
+
export interface LoginRequest {
|
|
15
|
+
login: string;
|
|
16
|
+
password: string;
|
|
17
|
+
}
|
|
18
|
+
export interface RefreshRequest {
|
|
19
|
+
refreshToken: string;
|
|
20
|
+
}
|
|
21
|
+
export interface TokensResponse {
|
|
22
|
+
accessToken: string;
|
|
23
|
+
refreshToken: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
26
|
+
export interface AuthServiceClient {
|
|
27
|
+
login(request: LoginRequest): Observable<TokensResponse>;
|
|
28
|
+
register(request: RegisterRequest): Observable<TokensResponse>;
|
|
29
|
+
refresh(request: RefreshRequest): Observable<TokensResponse>;
|
|
30
|
+
}
|
|
31
|
+
export interface AuthServiceController {
|
|
32
|
+
login(request: LoginRequest): Promise<TokensResponse> | Observable<TokensResponse> | TokensResponse;
|
|
33
|
+
register(request: RegisterRequest): Promise<TokensResponse> | Observable<TokensResponse> | TokensResponse;
|
|
34
|
+
refresh(request: RefreshRequest): Promise<TokensResponse> | Observable<TokensResponse> | TokensResponse;
|
|
35
|
+
}
|
|
36
|
+
export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
|
|
37
|
+
export declare const AUTH_SERVICE_NAME = "AuthService";
|
package/dist/gen/auth.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.6
|
|
5
|
+
// protoc v6.33.2
|
|
6
|
+
// source: auth.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.AUTH_SERVICE_NAME = exports.AUTH_V1_PACKAGE_NAME = exports.Role = exports.protobufPackage = void 0;
|
|
9
|
+
exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "auth.v1";
|
|
13
|
+
var Role;
|
|
14
|
+
(function (Role) {
|
|
15
|
+
Role[Role["ADMIN"] = 0] = "ADMIN";
|
|
16
|
+
Role[Role["MODERATOR"] = 1] = "MODERATOR";
|
|
17
|
+
Role[Role["USER"] = 2] = "USER";
|
|
18
|
+
Role[Role["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
19
|
+
})(Role || (exports.Role = Role = {}));
|
|
20
|
+
exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
21
|
+
function AuthServiceControllerMethods() {
|
|
22
|
+
return function (constructor) {
|
|
23
|
+
const grpcMethods = ["login", "register", "refresh"];
|
|
24
|
+
for (const method of grpcMethods) {
|
|
25
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
26
|
+
(0, microservices_1.GrpcMethod)("AuthService", 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)("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
exports.AUTH_SERVICE_NAME = "AuthService";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './auth';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./auth"), exports);
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miteradar/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Protobuf definitions and generated ts types",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit",
|
|
8
|
+
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./src/gen --ts_proto_opt=nestJs=true,package=omit",
|
|
9
9
|
"build": "tsc -p tsconfig.build.json"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"proto",
|
|
13
|
-
"gen",
|
|
14
13
|
"dist"
|
|
15
14
|
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./dist/index.js",
|
|
17
|
+
"./gen/*": "./dist/gen/*"
|
|
18
|
+
},
|
|
16
19
|
"publishConfig": {
|
|
17
20
|
"access": "public"
|
|
18
21
|
},
|
package/gen/auth.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.6
|
|
4
|
-
// protoc v3.21.12
|
|
5
|
-
// source: auth.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
-
import { Observable } from "rxjs";
|
|
10
|
-
|
|
11
|
-
export const protobufPackage = "auth.v1";
|
|
12
|
-
|
|
13
|
-
export enum Role {
|
|
14
|
-
ADMIN = 0,
|
|
15
|
-
MODERATOR = 1,
|
|
16
|
-
USER = 2,
|
|
17
|
-
UNRECOGNIZED = -1,
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface RegisterRequest {
|
|
21
|
-
login: string;
|
|
22
|
-
password: string;
|
|
23
|
-
role: Role;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface LoginRequest {
|
|
27
|
-
login: string;
|
|
28
|
-
password: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface RefreshRequest {
|
|
32
|
-
refreshToken: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface TokensResponse {
|
|
36
|
-
accessToken: string;
|
|
37
|
-
refreshToken: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
41
|
-
|
|
42
|
-
export interface AuthServiceClient {
|
|
43
|
-
login(request: LoginRequest): Observable<TokensResponse>;
|
|
44
|
-
|
|
45
|
-
register(request: RegisterRequest): Observable<TokensResponse>;
|
|
46
|
-
|
|
47
|
-
refresh(request: RefreshRequest): Observable<TokensResponse>;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface AuthServiceController {
|
|
51
|
-
login(request: LoginRequest): Promise<TokensResponse> | Observable<TokensResponse> | TokensResponse;
|
|
52
|
-
|
|
53
|
-
register(request: RegisterRequest): Promise<TokensResponse> | Observable<TokensResponse> | TokensResponse;
|
|
54
|
-
|
|
55
|
-
refresh(request: RefreshRequest): Promise<TokensResponse> | Observable<TokensResponse> | TokensResponse;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function AuthServiceControllerMethods() {
|
|
59
|
-
return function (constructor: Function) {
|
|
60
|
-
const grpcMethods: string[] = ["login", "register", "refresh"];
|
|
61
|
-
for (const method of grpcMethods) {
|
|
62
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
63
|
-
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
64
|
-
}
|
|
65
|
-
const grpcStreamMethods: string[] = [];
|
|
66
|
-
for (const method of grpcStreamMethods) {
|
|
67
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
68
|
-
GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export const AUTH_SERVICE_NAME = "AuthService";
|