@aleshacinema/contracts 1.0.10 → 1.0.12
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/account.d.ts +28 -0
- package/dist/gen/account.js +33 -0
- package/dist/gen/auth.d.ts +39 -0
- package/dist/gen/auth.js +27 -0
- package/gen/account.ts +63 -0
- package/gen/auth.ts +79 -0
- package/package.json +6 -12
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{index.js → src/index.js} +0 -0
- /package/dist/{proto → src/proto}/index.d.ts +0 -0
- /package/dist/{proto → src/proto}/index.js +0 -0
- /package/dist/{proto → src/proto}/paths.d.ts +0 -0
- /package/dist/{proto → src/proto}/paths.js +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "account.v1";
|
|
3
|
+
export declare const protobufFileName = "account.proto";
|
|
4
|
+
export declare enum Role {
|
|
5
|
+
USER = 0,
|
|
6
|
+
ADMIN = 1,
|
|
7
|
+
UNRECOGNIZED = -1
|
|
8
|
+
}
|
|
9
|
+
export interface GetAccountRequest {
|
|
10
|
+
id: string;
|
|
11
|
+
}
|
|
12
|
+
export interface GetAccountResponse {
|
|
13
|
+
id: string;
|
|
14
|
+
phone: string;
|
|
15
|
+
email: string;
|
|
16
|
+
isPhoneVerified: boolean;
|
|
17
|
+
isEmailVerified: boolean;
|
|
18
|
+
role: Role;
|
|
19
|
+
}
|
|
20
|
+
export declare const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
21
|
+
export interface AccountServiceClient {
|
|
22
|
+
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
23
|
+
}
|
|
24
|
+
export interface AccountServiceController {
|
|
25
|
+
getAccount(request: GetAccountRequest): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
26
|
+
}
|
|
27
|
+
export declare function AccountServiceControllerMethods(): (constructor: Function) => void;
|
|
28
|
+
export declare const ACCOUNT_SERVICE_NAME = "AccountService";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.18.1
|
|
4
|
+
// protoc v4.25.9
|
|
5
|
+
// source: account.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
8
|
+
export const protobufPackage = "account.v1";
|
|
9
|
+
export const protobufFileName = "account.proto";
|
|
10
|
+
export var Role;
|
|
11
|
+
(function (Role) {
|
|
12
|
+
Role[Role["USER"] = 0] = "USER";
|
|
13
|
+
Role[Role["ADMIN"] = 1] = "ADMIN";
|
|
14
|
+
Role[Role["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
15
|
+
})(Role || (Role = {}));
|
|
16
|
+
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
17
|
+
export function AccountServiceControllerMethods() {
|
|
18
|
+
return function (constructor) {
|
|
19
|
+
const grpcMethods = ["getAccount"];
|
|
20
|
+
for (const method of grpcMethods) {
|
|
21
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
22
|
+
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
23
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
24
|
+
}
|
|
25
|
+
const grpcStreamMethods = [];
|
|
26
|
+
for (const method of grpcStreamMethods) {
|
|
27
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
28
|
+
GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
29
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export const ACCOUNT_SERVICE_NAME = "AccountService";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "auth.v1";
|
|
3
|
+
export declare const protobufFileName = "auth.proto";
|
|
4
|
+
export interface SendOtpRequest {
|
|
5
|
+
identifier: string;
|
|
6
|
+
type: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SendOtpResponse {
|
|
9
|
+
ok: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface VerifyOtpRequest {
|
|
12
|
+
identifier: string;
|
|
13
|
+
type: string;
|
|
14
|
+
code: string;
|
|
15
|
+
}
|
|
16
|
+
export interface VerifyOtpResponse {
|
|
17
|
+
accessToken: string;
|
|
18
|
+
refreshToken: string;
|
|
19
|
+
}
|
|
20
|
+
export interface RefreshRequest {
|
|
21
|
+
refreshToken: string;
|
|
22
|
+
}
|
|
23
|
+
export interface RefreshResponse {
|
|
24
|
+
accessToken: string;
|
|
25
|
+
refreshToken: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
28
|
+
export interface AuthServiceClient {
|
|
29
|
+
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
30
|
+
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
31
|
+
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
32
|
+
}
|
|
33
|
+
export interface AuthServiceController {
|
|
34
|
+
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
35
|
+
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
36
|
+
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
37
|
+
}
|
|
38
|
+
export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
|
|
39
|
+
export declare const AUTH_SERVICE_NAME = "AuthService";
|
package/dist/gen/auth.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.18.1
|
|
4
|
+
// protoc v4.25.9
|
|
5
|
+
// source: auth.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
8
|
+
export const protobufPackage = "auth.v1";
|
|
9
|
+
export const protobufFileName = "auth.proto";
|
|
10
|
+
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
11
|
+
export function AuthServiceControllerMethods() {
|
|
12
|
+
return function (constructor) {
|
|
13
|
+
const grpcMethods = ["sendOtp", "verifyOtp", "refresh"];
|
|
14
|
+
for (const method of grpcMethods) {
|
|
15
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
16
|
+
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
17
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
18
|
+
}
|
|
19
|
+
const grpcStreamMethods = [];
|
|
20
|
+
for (const method of grpcStreamMethods) {
|
|
21
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
22
|
+
GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
23
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export const AUTH_SERVICE_NAME = "AuthService";
|
package/gen/account.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.18.1
|
|
4
|
+
// protoc v4.25.9
|
|
5
|
+
// source: account.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "account.v1";
|
|
12
|
+
|
|
13
|
+
export const protobufFileName = "account.proto";
|
|
14
|
+
|
|
15
|
+
export enum Role {
|
|
16
|
+
USER = 0,
|
|
17
|
+
ADMIN = 1,
|
|
18
|
+
UNRECOGNIZED = -1,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface GetAccountRequest {
|
|
22
|
+
id: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface GetAccountResponse {
|
|
26
|
+
id: string;
|
|
27
|
+
phone: string;
|
|
28
|
+
email: string;
|
|
29
|
+
isPhoneVerified: boolean;
|
|
30
|
+
isEmailVerified: boolean;
|
|
31
|
+
role: Role;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
35
|
+
|
|
36
|
+
export interface AccountServiceClient {
|
|
37
|
+
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface AccountServiceController {
|
|
41
|
+
getAccount(
|
|
42
|
+
request: GetAccountRequest,
|
|
43
|
+
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function AccountServiceControllerMethods() {
|
|
47
|
+
return function (constructor: Function) {
|
|
48
|
+
const grpcMethods: string[] = ["getAccount"];
|
|
49
|
+
for (const method of grpcMethods) {
|
|
50
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
51
|
+
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
52
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
53
|
+
}
|
|
54
|
+
const grpcStreamMethods: string[] = [];
|
|
55
|
+
for (const method of grpcStreamMethods) {
|
|
56
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
57
|
+
GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
58
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const ACCOUNT_SERVICE_NAME = "AccountService";
|
package/gen/auth.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.18.1
|
|
4
|
+
// protoc v4.25.9
|
|
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 const protobufFileName = "auth.proto";
|
|
14
|
+
|
|
15
|
+
export interface SendOtpRequest {
|
|
16
|
+
identifier: string;
|
|
17
|
+
type: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface SendOtpResponse {
|
|
21
|
+
ok: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface VerifyOtpRequest {
|
|
25
|
+
identifier: string;
|
|
26
|
+
type: string;
|
|
27
|
+
code: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface VerifyOtpResponse {
|
|
31
|
+
accessToken: string;
|
|
32
|
+
refreshToken: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface RefreshRequest {
|
|
36
|
+
refreshToken: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface RefreshResponse {
|
|
40
|
+
accessToken: string;
|
|
41
|
+
refreshToken: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
45
|
+
|
|
46
|
+
export interface AuthServiceClient {
|
|
47
|
+
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
48
|
+
|
|
49
|
+
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
50
|
+
|
|
51
|
+
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface AuthServiceController {
|
|
55
|
+
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
56
|
+
|
|
57
|
+
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
58
|
+
|
|
59
|
+
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function AuthServiceControllerMethods() {
|
|
63
|
+
return function (constructor: Function) {
|
|
64
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
|
|
65
|
+
for (const method of grpcMethods) {
|
|
66
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
67
|
+
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
68
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
69
|
+
}
|
|
70
|
+
const grpcStreamMethods: string[] = [];
|
|
71
|
+
for (const method of grpcStreamMethods) {
|
|
72
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
73
|
+
GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
74
|
+
Object.defineProperty(constructor.prototype, method, descriptor);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const AUTH_SERVICE_NAME = "AuthService";
|
package/package.json
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aleshacinema/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "Protobuf definitions and generated TypeSript types",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"default": "./dist/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./gen/*": "./dist/gen/*"
|
|
14
|
-
},
|
|
15
8
|
"scripts": {
|
|
16
|
-
"
|
|
17
|
-
"build": "
|
|
9
|
+
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit",
|
|
10
|
+
"build": "yarn run generate && tsc -p tsconfig.build.json"
|
|
18
11
|
},
|
|
19
12
|
"files": [
|
|
20
13
|
"dist",
|
|
21
|
-
"proto"
|
|
14
|
+
"proto",
|
|
15
|
+
"gen"
|
|
22
16
|
],
|
|
23
17
|
"publishConfig": {
|
|
24
18
|
"access": "public"
|
|
@@ -32,4 +26,4 @@
|
|
|
32
26
|
"@types/node": "^26.6.5",
|
|
33
27
|
"typescript": "^7.0.2"
|
|
34
28
|
}
|
|
35
|
-
}
|
|
29
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|