@dkcinema/contracts 1.0.18 → 1.0.20

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.
@@ -0,0 +1,28 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "account.v1";
3
+ export declare enum Role {
4
+ USER = 0,
5
+ ADMIN = 1,
6
+ UNRECOGNIZED = -1
7
+ }
8
+ export interface GetAccountRequest {
9
+ id: string;
10
+ }
11
+ export interface GetAccountResponse {
12
+ id: string;
13
+ email?: string | undefined;
14
+ phone?: string | undefined;
15
+ isPhoneVerified: boolean;
16
+ isEmailVerified: boolean;
17
+ role: Role;
18
+ }
19
+ export declare const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
20
+ export interface AccountServiceClient {
21
+ getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
22
+ }
23
+ export interface AccountServiceController {
24
+ getAccount(request: GetAccountRequest): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
25
+ }
26
+ export declare function AccountServiceControllerMethods(): (constructor: Function) => void;
27
+ export declare const ACCOUNT_SERVICE_NAME = "AccountService";
28
+ //# sourceMappingURL=account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../output/account.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,eAAO,MAAM,eAAe,eAAe,CAAC;AAE5C,oBAAY,IAAI;IACd,IAAI,IAAI;IACR,KAAK,IAAI;IACT,YAAY,KAAK;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,eAAO,MAAM,uBAAuB,eAAe,CAAC;AAEpD,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;CACxE;AAED,MAAM,WAAW,wBAAwB;IACvC,UAAU,CACR,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,kBAAkB,CAAC,GAAG,UAAU,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAAC;CACtF;AAED,wBAAgB,+BAA+B,KAC5B,aAAa,QAAQ,UAYvC;AAED,eAAO,MAAM,oBAAoB,mBAAmB,CAAC"}
@@ -0,0 +1,30 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc v3.21.12
5
+ // source: account.proto
6
+ /* eslint-disable */
7
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
8
+ export const protobufPackage = "account.v1";
9
+ export var Role;
10
+ (function (Role) {
11
+ Role[Role["USER"] = 0] = "USER";
12
+ Role[Role["ADMIN"] = 1] = "ADMIN";
13
+ Role[Role["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
14
+ })(Role || (Role = {}));
15
+ export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
16
+ export function AccountServiceControllerMethods() {
17
+ return function (constructor) {
18
+ const grpcMethods = ["getAccount"];
19
+ for (const method of grpcMethods) {
20
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
21
+ GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
22
+ }
23
+ const grpcStreamMethods = [];
24
+ for (const method of grpcStreamMethods) {
25
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
26
+ GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
27
+ }
28
+ };
29
+ }
30
+ export const ACCOUNT_SERVICE_NAME = "AccountService";
@@ -0,0 +1,67 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "auth.v1";
3
+ export interface RefreshRequest {
4
+ refreshToken: string;
5
+ }
6
+ export interface RefreshResponse {
7
+ accessToken: string;
8
+ refreshToken: string;
9
+ }
10
+ export interface GetUserRequest {
11
+ userId: string;
12
+ }
13
+ export interface GetUserResponse {
14
+ id: string;
15
+ email?: string | undefined;
16
+ phone?: string | undefined;
17
+ }
18
+ export interface VerifyEmailOtpRequest {
19
+ code: string;
20
+ email: string;
21
+ }
22
+ export interface VerifyPhoneOtpRequest {
23
+ code: string;
24
+ phone: string;
25
+ }
26
+ export interface VerifyOtpResponse {
27
+ accessToken: string;
28
+ refreshToken: string;
29
+ }
30
+ export interface SendEmailOtpRequest {
31
+ email: string;
32
+ }
33
+ export interface SendPhoneOtpRequest {
34
+ phone: string;
35
+ }
36
+ export interface SendOtpResponse {
37
+ ok: boolean;
38
+ }
39
+ export interface LoginByEmailRequest {
40
+ email: string;
41
+ }
42
+ export interface LoginByEmailResponse {
43
+ accessToken: string;
44
+ refreshToken: string;
45
+ }
46
+ export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
47
+ export interface AuthServiceClient {
48
+ sendEmailOtp(request: SendEmailOtpRequest): Observable<SendOtpResponse>;
49
+ sendPhoneOtp(request: SendPhoneOtpRequest): Observable<SendOtpResponse>;
50
+ verifyEmailOtp(request: VerifyEmailOtpRequest): Observable<VerifyOtpResponse>;
51
+ verifyPhoneOtp(request: VerifyPhoneOtpRequest): Observable<VerifyOtpResponse>;
52
+ loginByEmail(request: LoginByEmailRequest): Observable<LoginByEmailResponse>;
53
+ refresh(request: RefreshRequest): Observable<RefreshResponse>;
54
+ getUser(request: GetUserRequest): Observable<GetUserResponse>;
55
+ }
56
+ export interface AuthServiceController {
57
+ sendEmailOtp(request: SendEmailOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
58
+ sendPhoneOtp(request: SendPhoneOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
59
+ verifyEmailOtp(request: VerifyEmailOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
60
+ verifyPhoneOtp(request: VerifyPhoneOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
61
+ loginByEmail(request: LoginByEmailRequest): Promise<LoginByEmailResponse> | Observable<LoginByEmailResponse> | LoginByEmailResponse;
62
+ refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
63
+ getUser(request: GetUserRequest): Promise<GetUserResponse> | Observable<GetUserResponse> | GetUserResponse;
64
+ }
65
+ export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
66
+ export declare const AUTH_SERVICE_NAME = "AuthService";
67
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../output/auth.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,32 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc v3.21.12
5
+ // source: auth.proto
6
+ /* eslint-disable */
7
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
8
+ export const protobufPackage = "auth.v1";
9
+ export const AUTH_V1_PACKAGE_NAME = "auth.v1";
10
+ export function AuthServiceControllerMethods() {
11
+ return function (constructor) {
12
+ const grpcMethods = [
13
+ "sendEmailOtp",
14
+ "sendPhoneOtp",
15
+ "verifyEmailOtp",
16
+ "verifyPhoneOtp",
17
+ "loginByEmail",
18
+ "refresh",
19
+ "getUser",
20
+ ];
21
+ for (const method of grpcMethods) {
22
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
23
+ GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
24
+ }
25
+ const grpcStreamMethods = [];
26
+ for (const method of grpcStreamMethods) {
27
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
28
+ GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
29
+ }
30
+ };
31
+ }
32
+ export const AUTH_SERVICE_NAME = "AuthService";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constant/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.const.d.ts","sourceRoot":"","sources":["../../../src/constant/paths.const.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;CAGZ,CAAA"}
@@ -2,8 +2,8 @@ import { dirname, join } from 'path';
2
2
  import { fileURLToPath } from 'url';
3
3
  const __dirname = dirname(fileURLToPath(import.meta.url));
4
4
  const authPath = join(__dirname, '../../protos', 'auth.proto');
5
- const accountPath = join(__dirname, '../../protos', 'auth.proto');
5
+ const accountPath = join(__dirname, '../../protos', 'account.proto');
6
6
  export const protoPath = {
7
7
  AUTH: authPath,
8
- ACCOUNT: accountPath
8
+ ACCOUNT: accountPath,
9
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
package/package.json CHANGED
@@ -1,16 +1,22 @@
1
1
  {
2
2
  "name": "@dkcinema/contracts",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "scripts": {
8
- "build": "tsc -p tsconfig.build.json",
9
- "proto:generate": "mkdir -p ./output && protoc -I ./protos ./protos/*.proto --ts_proto_opt=nestJs=true --ts_proto_out=./output"
8
+ "clean": "rimraf dist",
9
+ "compile": "tsc -p tsconfig.build.json",
10
+ "proto:dirs": "mkdirp ./output",
11
+ "proto:generate": "protoc -I ./protos ./protos/*.proto --ts_proto_opt=nestJs=true --ts_proto_out=./output",
12
+ "build:proto": "npm-run-all proto:dirs proto:generate",
13
+ "build": "npm-run-all build:proto compile",
14
+ "build:full": "npm run build",
15
+ "format": "prettier --write \"src/**/*.{js,ts,jsx,tsx}\"",
16
+ "format:check": "prettier --check \"src/**/*.{js,ts,jsx,tsx}\"",
17
+ "prepublishOnly": "npm run build"
10
18
  },
11
19
  "files": [
12
- "protos",
13
- "output",
14
20
  "dist"
15
21
  ],
16
22
  "publishConfig": {
@@ -31,7 +37,12 @@
31
37
  "license": "ISC",
32
38
  "description": "Shared gRPC/protobuf contracts for DK Cinema microservices",
33
39
  "devDependencies": {
40
+ "@dkcinema/core": "^1.0.11",
34
41
  "@types/node": "^26.1.0",
42
+ "mkdirp": "^3.0.1",
43
+ "npm-run-all": "^4.1.5",
44
+ "prettier": "^3.8.3",
45
+ "rimraf": "^6.1.3",
35
46
  "typescript": "^6.0.3"
36
47
  }
37
48
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constant/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"paths.const.d.ts","sourceRoot":"","sources":["../../src/constant/paths.const.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;CAGZ,CAAA"}
package/output/account.ts DELETED
@@ -1,59 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.11.8
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
-
11
- export const protobufPackage = "account.v1";
12
-
13
- export enum Role {
14
- USER = 0,
15
- ADMIN = 1,
16
- UNRECOGNIZED = -1,
17
- }
18
-
19
- export interface GetAccountRequest {
20
- id: string;
21
- }
22
-
23
- export interface GetAccountResponse {
24
- id: string;
25
- email?: string | undefined;
26
- phone?: string | undefined;
27
- isPhoneVerified: boolean;
28
- isEmailVerified: boolean;
29
- role: Role;
30
- }
31
-
32
- export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
33
-
34
- export interface AccountServiceClient {
35
- getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
36
- }
37
-
38
- export interface AccountServiceController {
39
- getAccount(
40
- request: GetAccountRequest,
41
- ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
42
- }
43
-
44
- export function AccountServiceControllerMethods() {
45
- return function (constructor: Function) {
46
- const grpcMethods: string[] = ["getAccount"];
47
- for (const method of grpcMethods) {
48
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
49
- GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
50
- }
51
- const grpcStreamMethods: string[] = [];
52
- for (const method of grpcStreamMethods) {
53
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
54
- GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
55
- }
56
- };
57
- }
58
-
59
- export const ACCOUNT_SERVICE_NAME = "AccountService";
package/output/auth.ts DELETED
@@ -1,131 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.11.8
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 RefreshRequest {
14
- refreshToken: string;
15
- }
16
-
17
- export interface RefreshResponse {
18
- accessToken: string;
19
- refreshToken: string;
20
- }
21
-
22
- export interface GetUserRequest {
23
- userId: string;
24
- }
25
-
26
- export interface GetUserResponse {
27
- id: string;
28
- email?: string | undefined;
29
- phone?: string | undefined;
30
- }
31
-
32
- export interface VerifyEmailOtpRequest {
33
- code: string;
34
- email: string;
35
- }
36
-
37
- export interface VerifyPhoneOtpRequest {
38
- code: string;
39
- phone: string;
40
- }
41
-
42
- export interface VerifyOtpResponse {
43
- accessToken: string;
44
- refreshToken: string;
45
- }
46
-
47
- export interface SendEmailOtpRequest {
48
- email: string;
49
- }
50
-
51
- export interface SendPhoneOtpRequest {
52
- phone: string;
53
- }
54
-
55
- export interface SendOtpResponse {
56
- ok: boolean;
57
- }
58
-
59
- export interface LoginByEmailRequest {
60
- email: string;
61
- }
62
-
63
- export interface LoginByEmailResponse {
64
- accessToken: string;
65
- refreshToken: string;
66
- }
67
-
68
- export const AUTH_V1_PACKAGE_NAME = "auth.v1";
69
-
70
- export interface AuthServiceClient {
71
- sendEmailOtp(request: SendEmailOtpRequest): Observable<SendOtpResponse>;
72
-
73
- sendPhoneOtp(request: SendPhoneOtpRequest): Observable<SendOtpResponse>;
74
-
75
- verifyEmailOtp(request: VerifyEmailOtpRequest): Observable<VerifyOtpResponse>;
76
-
77
- verifyPhoneOtp(request: VerifyPhoneOtpRequest): Observable<VerifyOtpResponse>;
78
-
79
- loginByEmail(request: LoginByEmailRequest): Observable<LoginByEmailResponse>;
80
-
81
- refresh(request: RefreshRequest): Observable<RefreshResponse>;
82
-
83
- getUser(request: GetUserRequest): Observable<GetUserResponse>;
84
- }
85
-
86
- export interface AuthServiceController {
87
- sendEmailOtp(request: SendEmailOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
88
-
89
- sendPhoneOtp(request: SendPhoneOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
90
-
91
- verifyEmailOtp(
92
- request: VerifyEmailOtpRequest,
93
- ): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
94
-
95
- verifyPhoneOtp(
96
- request: VerifyPhoneOtpRequest,
97
- ): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
98
-
99
- loginByEmail(
100
- request: LoginByEmailRequest,
101
- ): Promise<LoginByEmailResponse> | Observable<LoginByEmailResponse> | LoginByEmailResponse;
102
-
103
- refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
104
-
105
- getUser(request: GetUserRequest): Promise<GetUserResponse> | Observable<GetUserResponse> | GetUserResponse;
106
- }
107
-
108
- export function AuthServiceControllerMethods() {
109
- return function (constructor: Function) {
110
- const grpcMethods: string[] = [
111
- "sendEmailOtp",
112
- "sendPhoneOtp",
113
- "verifyEmailOtp",
114
- "verifyPhoneOtp",
115
- "loginByEmail",
116
- "refresh",
117
- "getUser",
118
- ];
119
- for (const method of grpcMethods) {
120
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
121
- GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
122
- }
123
- const grpcStreamMethods: string[] = [];
124
- for (const method of grpcStreamMethods) {
125
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
126
- GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
127
- }
128
- };
129
- }
130
-
131
- export const AUTH_SERVICE_NAME = "AuthService";
@@ -1,28 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package account.v1;
4
-
5
- service AccountService {
6
- rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
7
- }
8
-
9
- enum Role {
10
- USER = 0;
11
- ADMIN = 1;
12
- }
13
-
14
- message GetAccountRequest {
15
- string id = 1;
16
- }
17
-
18
- message GetAccountResponse {
19
- string id = 1;
20
- optional string email = 2;
21
- optional string phone = 3;
22
- bool is_phone_verified = 4;
23
- bool is_email_verified = 5;
24
- Role role = 6;
25
- }
26
-
27
-
28
-
package/protos/auth.proto DELETED
@@ -1,73 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package auth.v1;
4
-
5
- service AuthService {
6
- rpc SendEmailOtp (SendEmailOtpRequest) returns (SendOtpResponse);
7
- rpc SendPhoneOtp (SendPhoneOtpRequest) returns (SendOtpResponse);
8
-
9
- rpc VerifyEmailOtp(VerifyEmailOtpRequest) returns (VerifyOtpResponse);
10
- rpc VerifyPhoneOtp(VerifyPhoneOtpRequest) returns (VerifyOtpResponse);
11
-
12
- rpc LoginByEmail (LoginByEmailRequest) returns (LoginByEmailResponse);
13
- rpc Refresh (RefreshRequest) returns (RefreshResponse);
14
-
15
- rpc GetUser (GetUserRequest) returns (GetUserResponse);
16
- }
17
-
18
- message RefreshRequest {
19
- string refresh_token = 1;
20
- }
21
-
22
- message RefreshResponse {
23
- string access_token = 1;
24
- string refresh_token = 2;
25
- }
26
-
27
- message GetUserRequest {
28
- string user_id = 1;
29
- }
30
-
31
- message GetUserResponse {
32
- string id = 1;
33
-
34
- oneof contact {
35
- string email = 2;
36
- string phone = 3;
37
- }
38
- }
39
- message VerifyEmailOtpRequest {
40
- string code = 1;
41
- string email = 2;
42
- }
43
-
44
- message VerifyPhoneOtpRequest {
45
- string code = 1;
46
- string phone = 2;
47
- }
48
-
49
- message VerifyOtpResponse {
50
- string access_token = 1;
51
- string refresh_token = 2;
52
- }
53
-
54
- message SendEmailOtpRequest {
55
- string email = 1;
56
- }
57
-
58
- message SendPhoneOtpRequest {
59
- string phone = 1;
60
- }
61
-
62
- message SendOtpResponse {
63
- bool ok = 1;
64
- }
65
-
66
- message LoginByEmailRequest {
67
- string email = 1;
68
- }
69
-
70
- message LoginByEmailResponse {
71
- string access_token = 1;
72
- string refresh_token = 2;
73
- }
File without changes
File without changes
File without changes
File without changes