@gastroly.io/contracts 1.0.7 → 1.0.8
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/constants/index.d.ts +18 -0
- package/dist/constants/index.js +20 -0
- package/dist/generated/account.d.ts +25 -0
- package/dist/generated/account.js +27 -0
- package/dist/generated/auth.d.ts +39 -0
- package/dist/generated/auth.js +27 -0
- package/{generated/google/protobuf/timestamp.ts → dist/generated/google/protobuf/timestamp.d.ts} +15 -25
- package/dist/generated/google/protobuf/timestamp.js +11 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.js +35 -1
- package/package.json +16 -12
- package/dist/proto/index.d.ts +0 -1
- package/dist/proto/index.js +0 -17
- package/dist/proto/paths.d.ts +0 -4
- package/dist/proto/paths.js +0 -8
- package/generated/account.ts +0 -55
- package/generated/auth.ts +0 -75
- /package/{proto → dist/proto}/account.proto +0 -0
- /package/{proto → dist/proto}/auth.proto +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const GRPC_PACKAGES: {
|
|
2
|
+
readonly AUTH: {
|
|
3
|
+
readonly NAME: "AUTH_PACKAGE";
|
|
4
|
+
readonly PACKAGE: "auth.v1";
|
|
5
|
+
readonly SERVICE: "AuthService";
|
|
6
|
+
};
|
|
7
|
+
readonly ACCOUNT: {
|
|
8
|
+
readonly NAME: "ACCOUNT_PACKAGE";
|
|
9
|
+
readonly PACKAGE: "account.v1";
|
|
10
|
+
readonly SERVICE: "AccountService";
|
|
11
|
+
};
|
|
12
|
+
readonly PAYMENT: {
|
|
13
|
+
readonly NAME: "PAYMENT_PACKAGE";
|
|
14
|
+
readonly PACKAGE: "payment.v1";
|
|
15
|
+
readonly SERVICE: "PaymentService";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type GrpcPackageName = keyof typeof GRPC_PACKAGES;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GRPC_PACKAGES = void 0;
|
|
4
|
+
exports.GRPC_PACKAGES = {
|
|
5
|
+
AUTH: {
|
|
6
|
+
NAME: "AUTH_PACKAGE",
|
|
7
|
+
PACKAGE: "auth.v1",
|
|
8
|
+
SERVICE: "AuthService",
|
|
9
|
+
},
|
|
10
|
+
ACCOUNT: {
|
|
11
|
+
NAME: "ACCOUNT_PACKAGE",
|
|
12
|
+
PACKAGE: "account.v1",
|
|
13
|
+
SERVICE: "AccountService",
|
|
14
|
+
},
|
|
15
|
+
PAYMENT: {
|
|
16
|
+
NAME: "PAYMENT_PACKAGE",
|
|
17
|
+
PACKAGE: "payment.v1",
|
|
18
|
+
SERVICE: "PaymentService",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Metadata } from "@grpc/grpc-js";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
4
|
+
export declare const protobufPackage = "account.v1";
|
|
5
|
+
export interface GetAccountRequest {
|
|
6
|
+
id: string;
|
|
7
|
+
}
|
|
8
|
+
export interface GetAccountResponse {
|
|
9
|
+
id: string;
|
|
10
|
+
phone: string;
|
|
11
|
+
email: string;
|
|
12
|
+
isPhoneVerified: boolean;
|
|
13
|
+
isEmailVerified: boolean;
|
|
14
|
+
createdAt: Timestamp | undefined;
|
|
15
|
+
updatedAt: Timestamp | undefined;
|
|
16
|
+
}
|
|
17
|
+
export declare const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
18
|
+
export interface AccountServiceClient {
|
|
19
|
+
getAccount(request: GetAccountRequest, metadata?: Metadata): Observable<GetAccountResponse>;
|
|
20
|
+
}
|
|
21
|
+
export interface AccountServiceController {
|
|
22
|
+
getAccount(request: GetAccountRequest, metadata?: Metadata): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
23
|
+
}
|
|
24
|
+
export declare function AccountServiceControllerMethods(): (constructor: Function) => void;
|
|
25
|
+
export declare const ACCOUNT_SERVICE_NAME = "AccountService";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.10.1
|
|
5
|
+
// protoc v3.21.12
|
|
6
|
+
// source: account.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ACCOUNT_SERVICE_NAME = exports.ACCOUNT_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.AccountServiceControllerMethods = AccountServiceControllerMethods;
|
|
10
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
11
|
+
exports.protobufPackage = "account.v1";
|
|
12
|
+
exports.ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
13
|
+
function AccountServiceControllerMethods() {
|
|
14
|
+
return function (constructor) {
|
|
15
|
+
const grpcMethods = ["getAccount"];
|
|
16
|
+
for (const method of grpcMethods) {
|
|
17
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
18
|
+
(0, microservices_1.GrpcMethod)("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
19
|
+
}
|
|
20
|
+
const grpcStreamMethods = [];
|
|
21
|
+
for (const method of grpcStreamMethods) {
|
|
22
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
23
|
+
(0, microservices_1.GrpcStreamMethod)("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
exports.ACCOUNT_SERVICE_NAME = "AccountService";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Metadata } from "@grpc/grpc-js";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
export declare const protobufPackage = "auth.v1";
|
|
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, metadata?: Metadata): Observable<SendOtpResponse>;
|
|
30
|
+
verifyOtp(request: VerifyOtpRequest, metadata?: Metadata): Observable<VerifyOtpResponse>;
|
|
31
|
+
refresh(request: RefreshRequest, metadata?: Metadata): Observable<RefreshResponse>;
|
|
32
|
+
}
|
|
33
|
+
export interface AuthServiceController {
|
|
34
|
+
sendOtp(request: SendOtpRequest, metadata?: Metadata): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
35
|
+
verifyOtp(request: VerifyOtpRequest, metadata?: Metadata): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
36
|
+
refresh(request: RefreshRequest, metadata?: Metadata): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
37
|
+
}
|
|
38
|
+
export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
|
|
39
|
+
export declare const AUTH_SERVICE_NAME = "AuthService";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.10.1
|
|
5
|
+
// protoc v3.21.12
|
|
6
|
+
// source: auth.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.AUTH_SERVICE_NAME = exports.AUTH_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
|
|
10
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
11
|
+
exports.protobufPackage = "auth.v1";
|
|
12
|
+
exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
13
|
+
function AuthServiceControllerMethods() {
|
|
14
|
+
return function (constructor) {
|
|
15
|
+
const grpcMethods = ["sendOtp", "verifyOtp", "refresh"];
|
|
16
|
+
for (const method of grpcMethods) {
|
|
17
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
18
|
+
(0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
19
|
+
}
|
|
20
|
+
const grpcStreamMethods = [];
|
|
21
|
+
for (const method of grpcStreamMethods) {
|
|
22
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
23
|
+
(0, microservices_1.GrpcStreamMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
exports.AUTH_SERVICE_NAME = "AuthService";
|
package/{generated/google/protobuf/timestamp.ts → dist/generated/google/protobuf/timestamp.d.ts}
RENAMED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.10.1
|
|
4
|
-
// protoc v3.21.12
|
|
5
|
-
// source: google/protobuf/timestamp.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
|
|
9
|
-
export const protobufPackage = "google.protobuf";
|
|
10
|
-
|
|
1
|
+
export declare const protobufPackage = "google.protobuf";
|
|
11
2
|
/**
|
|
12
3
|
* A Timestamp represents a point in time independent of any time zone or local
|
|
13
4
|
* calendar, encoded as a count of seconds and fractions of seconds at
|
|
@@ -100,19 +91,18 @@ export const protobufPackage = "google.protobuf";
|
|
|
100
91
|
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
101
92
|
*/
|
|
102
93
|
export interface Timestamp {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Represents seconds of UTC time since Unix epoch
|
|
96
|
+
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
|
97
|
+
* 9999-12-31T23:59:59Z inclusive.
|
|
98
|
+
*/
|
|
99
|
+
seconds: number;
|
|
100
|
+
/**
|
|
101
|
+
* Non-negative fractions of a second at nanosecond resolution. Negative
|
|
102
|
+
* second values with fractions must still have non-negative nanos values
|
|
103
|
+
* that count forward in time. Must be from 0 to 999,999,999
|
|
104
|
+
* inclusive.
|
|
105
|
+
*/
|
|
106
|
+
nanos: number;
|
|
116
107
|
}
|
|
117
|
-
|
|
118
|
-
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
108
|
+
export declare const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.10.1
|
|
5
|
+
// protoc v3.21.12
|
|
6
|
+
// source: google/protobuf/timestamp.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.GOOGLE_PROTOBUF_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
exports.protobufPackage = "google.protobuf";
|
|
11
|
+
exports.GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./constants";
|
|
2
|
+
export * as Account from "./generated/account";
|
|
3
|
+
export * as Auth from "./generated/auth";
|
|
4
|
+
export { AuthServiceClient, AuthServiceControllerMethods, } from "./generated/auth";
|
|
5
|
+
export { AccountServiceClient, AccountServiceControllerMethods, } from "./generated/account";
|
|
6
|
+
export declare const PROTO_PATHS: {
|
|
7
|
+
readonly AUTH: string;
|
|
8
|
+
readonly ACCOUNT: string;
|
|
9
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -10,8 +10,42 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
13
18
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
19
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
20
|
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
16
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
39
|
+
exports.PROTO_PATHS = exports.AccountServiceControllerMethods = exports.AuthServiceControllerMethods = exports.Auth = exports.Account = void 0;
|
|
40
|
+
__exportStar(require("./constants"), exports);
|
|
41
|
+
exports.Account = __importStar(require("./generated/account"));
|
|
42
|
+
exports.Auth = __importStar(require("./generated/auth"));
|
|
43
|
+
const path_1 = require("path");
|
|
44
|
+
var auth_1 = require("./generated/auth");
|
|
45
|
+
Object.defineProperty(exports, "AuthServiceControllerMethods", { enumerable: true, get: function () { return auth_1.AuthServiceControllerMethods; } });
|
|
46
|
+
var account_1 = require("./generated/account");
|
|
47
|
+
Object.defineProperty(exports, "AccountServiceControllerMethods", { enumerable: true, get: function () { return account_1.AccountServiceControllerMethods; } });
|
|
48
|
+
exports.PROTO_PATHS = {
|
|
49
|
+
AUTH: (0, path_1.join)(__dirname, "proto/auth.proto"),
|
|
50
|
+
ACCOUNT: (0, path_1.join)(__dirname, "proto/account.proto"),
|
|
51
|
+
};
|
package/package.json
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gastroly.io/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Protobuf definition and generated TypeScript types",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
8
|
+
"generate": "mkdir -p src/generated && protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./src/generated --ts_proto_opt=nestJs=true,addGrpcMetadata=true,addNextTick=true,esModuleInterop=true,package=omit -I ./src/proto ./src/proto/*.proto",
|
|
9
|
+
"prebuild": "npm run generate",
|
|
10
|
+
"build": "tsc -p tsconfig.build.json && cp -r src/proto dist/",
|
|
11
|
+
"clean": "rm -rf dist src/generated"
|
|
10
12
|
},
|
|
11
13
|
"files": [
|
|
12
|
-
"dist"
|
|
13
|
-
"proto",
|
|
14
|
-
"generated"
|
|
14
|
+
"dist"
|
|
15
15
|
],
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@
|
|
21
|
-
"@nestjs/microservices": "^11.1.11",
|
|
22
|
-
"rxjs": "^7.8.2",
|
|
20
|
+
"@grpc/grpc-js": "^1.12.2",
|
|
23
21
|
"ts-proto": "^2.10.1"
|
|
24
22
|
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@nestjs/microservices": "^10.0.0 || ^11.0.0",
|
|
25
|
+
"rxjs": "^7.0.0"
|
|
26
|
+
},
|
|
25
27
|
"devDependencies": {
|
|
26
|
-
"@
|
|
27
|
-
"
|
|
28
|
+
"@nestjs/microservices": "^11.0.5",
|
|
29
|
+
"@types/node": "^22.0.0",
|
|
30
|
+
"rxjs": "^7.8.1",
|
|
31
|
+
"typescript": "^5.7.3"
|
|
28
32
|
}
|
|
29
|
-
}
|
|
33
|
+
}
|
package/dist/proto/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./paths";
|
package/dist/proto/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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);
|
package/dist/proto/paths.d.ts
DELETED
package/dist/proto/paths.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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/generated/account.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.10.1
|
|
4
|
-
// protoc v3.21.12
|
|
5
|
-
// source: account.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
-
import { Observable } from "rxjs";
|
|
10
|
-
import { Timestamp } from "./google/protobuf/timestamp";
|
|
11
|
-
|
|
12
|
-
export const protobufPackage = "account.v1";
|
|
13
|
-
|
|
14
|
-
export interface GetAccountRequest {
|
|
15
|
-
id: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface GetAccountResponse {
|
|
19
|
-
id: string;
|
|
20
|
-
phone: string;
|
|
21
|
-
email: string;
|
|
22
|
-
isPhoneVerified: boolean;
|
|
23
|
-
isEmailVerified: boolean;
|
|
24
|
-
createdAt: Timestamp | undefined;
|
|
25
|
-
updatedAt: Timestamp | undefined;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
29
|
-
|
|
30
|
-
export interface AccountServiceClient {
|
|
31
|
-
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface AccountServiceController {
|
|
35
|
-
getAccount(
|
|
36
|
-
request: GetAccountRequest,
|
|
37
|
-
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function AccountServiceControllerMethods() {
|
|
41
|
-
return function (constructor: Function) {
|
|
42
|
-
const grpcMethods: string[] = ["getAccount"];
|
|
43
|
-
for (const method of grpcMethods) {
|
|
44
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
45
|
-
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
46
|
-
}
|
|
47
|
-
const grpcStreamMethods: string[] = [];
|
|
48
|
-
for (const method of grpcStreamMethods) {
|
|
49
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
50
|
-
GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export const ACCOUNT_SERVICE_NAME = "AccountService";
|
package/generated/auth.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.10.1
|
|
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 interface SendOtpRequest {
|
|
14
|
-
identifier: string;
|
|
15
|
-
type: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface SendOtpResponse {
|
|
19
|
-
ok: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface VerifyOtpRequest {
|
|
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 interface RefreshRequest {
|
|
34
|
-
refreshToken: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface RefreshResponse {
|
|
38
|
-
accessToken: string;
|
|
39
|
-
refreshToken: string;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
43
|
-
|
|
44
|
-
export interface AuthServiceClient {
|
|
45
|
-
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
46
|
-
|
|
47
|
-
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
48
|
-
|
|
49
|
-
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface AuthServiceController {
|
|
53
|
-
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
54
|
-
|
|
55
|
-
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
56
|
-
|
|
57
|
-
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export function AuthServiceControllerMethods() {
|
|
61
|
-
return function (constructor: Function) {
|
|
62
|
-
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
|
|
63
|
-
for (const method of grpcMethods) {
|
|
64
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
65
|
-
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
66
|
-
}
|
|
67
|
-
const grpcStreamMethods: string[] = [];
|
|
68
|
-
for (const method of grpcStreamMethods) {
|
|
69
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
70
|
-
GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export const AUTH_SERVICE_NAME = "AuthService";
|
|
File without changes
|
|
File without changes
|