@dewtix/contracts 1.0.3 → 1.0.4
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/src/index.d.ts +1 -0
- package/dist/src/index.js +17 -0
- package/dist/src/proto/index.d.ts +1 -0
- package/dist/src/proto/index.js +17 -0
- package/dist/src/proto/paths.d.ts +4 -0
- package/dist/src/proto/paths.js +8 -0
- package/gen/auth.ts +34 -33
- package/package.json +2 -2
- package/proto/auth.proto +27 -27
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './proto';
|
|
@@ -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("./proto"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './paths';
|
|
@@ -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("./paths"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PROTO_PATHS = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
exports.PROTO_PATHS = {
|
|
6
|
+
AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto'),
|
|
7
|
+
ACCOUNT: (0, path_1.join)(__dirname, '../../proto/account.proto'),
|
|
8
|
+
};
|
package/gen/auth.ts
CHANGED
|
@@ -1,62 +1,63 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
3
|
// protoc-gen-ts_proto v2.11.5
|
|
4
|
-
// protoc
|
|
4
|
+
// protoc v7.34.0
|
|
5
5
|
// source: auth.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
|
-
import { GrpcMethod, GrpcStreamMethod } from
|
|
9
|
-
import { Observable } from
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices'
|
|
9
|
+
import { Observable } from 'rxjs'
|
|
10
10
|
|
|
11
|
-
export const protobufPackage =
|
|
11
|
+
export const protobufPackage = 'auth.v1'
|
|
12
12
|
|
|
13
13
|
export interface SendOtpRequest {
|
|
14
|
-
identifier: string
|
|
15
|
-
type: string
|
|
14
|
+
identifier: string
|
|
15
|
+
type: string
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export interface SendOtpResponse {
|
|
19
|
-
ok: boolean
|
|
19
|
+
ok: boolean
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export
|
|
23
|
-
identifier: string;
|
|
24
|
-
type: string;
|
|
25
|
-
code: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface VerifyOtpResponse {
|
|
29
|
-
accessToken: string;
|
|
30
|
-
refreshToken: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
22
|
+
export const AUTH_V1_PACKAGE_NAME = 'auth.v1'
|
|
34
23
|
|
|
35
24
|
export interface AuthServiceClient {
|
|
36
|
-
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse
|
|
37
|
-
|
|
38
|
-
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
25
|
+
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>
|
|
39
26
|
}
|
|
40
27
|
|
|
41
28
|
export interface AuthServiceController {
|
|
42
|
-
sendOtp(
|
|
43
|
-
|
|
44
|
-
|
|
29
|
+
sendOtp(
|
|
30
|
+
request: SendOtpRequest,
|
|
31
|
+
): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse
|
|
45
32
|
}
|
|
46
33
|
|
|
47
34
|
export function AuthServiceControllerMethods() {
|
|
48
35
|
return function (constructor: Function) {
|
|
49
|
-
const grpcMethods: string[] = [
|
|
36
|
+
const grpcMethods: string[] = ['sendOtp']
|
|
50
37
|
for (const method of grpcMethods) {
|
|
51
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(
|
|
52
|
-
|
|
38
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(
|
|
39
|
+
constructor.prototype,
|
|
40
|
+
method,
|
|
41
|
+
)
|
|
42
|
+
GrpcMethod('AuthService', method)(
|
|
43
|
+
constructor.prototype[method],
|
|
44
|
+
method,
|
|
45
|
+
descriptor,
|
|
46
|
+
)
|
|
53
47
|
}
|
|
54
|
-
const grpcStreamMethods: string[] = []
|
|
48
|
+
const grpcStreamMethods: string[] = []
|
|
55
49
|
for (const method of grpcStreamMethods) {
|
|
56
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(
|
|
57
|
-
|
|
50
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(
|
|
51
|
+
constructor.prototype,
|
|
52
|
+
method,
|
|
53
|
+
)
|
|
54
|
+
GrpcStreamMethod('AuthService', method)(
|
|
55
|
+
constructor.prototype[method],
|
|
56
|
+
method,
|
|
57
|
+
descriptor,
|
|
58
|
+
)
|
|
58
59
|
}
|
|
59
|
-
}
|
|
60
|
+
}
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
export const AUTH_SERVICE_NAME =
|
|
63
|
+
export const AUTH_SERVICE_NAME = 'AuthService'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dewtix/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Protobuf defs and gen ts",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
|
-
"proto",
|
|
13
12
|
"gen",
|
|
13
|
+
"proto",
|
|
14
14
|
"dist"
|
|
15
15
|
],
|
|
16
16
|
"repository": {
|
package/proto/auth.proto
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package auth.v1;
|
|
4
|
-
|
|
5
|
-
service AuthService {
|
|
6
|
-
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
7
|
-
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
message SendOtpRequest {
|
|
11
|
-
string identifier = 1;
|
|
12
|
-
string type = 2;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
message SendOtpResponse {
|
|
16
|
-
bool ok = 1;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
message VerifyOtpRequest {
|
|
20
|
-
string identifier = 1;
|
|
21
|
-
string type = 2;
|
|
22
|
-
string code = 3;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
message VerifyOtpResponse {
|
|
26
|
-
string access_token = 1;
|
|
27
|
-
string refresh_token = 2;
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package auth.v1;
|
|
4
|
+
|
|
5
|
+
service AuthService {
|
|
6
|
+
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
7
|
+
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
message SendOtpRequest {
|
|
11
|
+
string identifier = 1;
|
|
12
|
+
string type = 2;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message SendOtpResponse {
|
|
16
|
+
bool ok = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message VerifyOtpRequest {
|
|
20
|
+
string identifier = 1;
|
|
21
|
+
string type = 2;
|
|
22
|
+
string code = 3;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message VerifyOtpResponse {
|
|
26
|
+
string access_token = 1;
|
|
27
|
+
string refresh_token = 2;
|
|
28
28
|
}
|