@ero-world/contracts 1.0.3 → 1.1.0

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/auth.d.ts ADDED
@@ -0,0 +1,45 @@
1
+ import { Observable } from "rxjs";
2
+ import { Empty } from "./google/protobuf/empty";
3
+ export declare const protobufPackage = "auth.v1";
4
+ export declare enum Role {
5
+ MASTER = 0,
6
+ SALON = 1,
7
+ UNRECOGNIZED = -1
8
+ }
9
+ export interface RegisterRequest {
10
+ email: string;
11
+ password: string;
12
+ passwordConfirm: string;
13
+ role: Role;
14
+ }
15
+ export interface RegisterResponse {
16
+ ok: boolean;
17
+ message: string;
18
+ }
19
+ export interface LoginRequest {
20
+ email: string;
21
+ password: string;
22
+ }
23
+ export interface TokensResponse {
24
+ accessToken: string;
25
+ refreshToken: string;
26
+ }
27
+ export interface VerifyRequest {
28
+ token: string;
29
+ }
30
+ export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
31
+ export interface AuthServiceClient {
32
+ register(request: RegisterRequest): Observable<RegisterResponse>;
33
+ login(request: LoginRequest): Observable<TokensResponse>;
34
+ verify(request: Empty): Observable<TokensResponse>;
35
+ refresh(request: Empty): Observable<TokensResponse>;
36
+ }
37
+ export interface AuthServiceController {
38
+ register(request: RegisterRequest): Promise<RegisterResponse> | Observable<RegisterResponse> | RegisterResponse;
39
+ login(request: LoginRequest): Promise<TokensResponse> | Observable<TokensResponse> | TokensResponse;
40
+ verify(request: Empty): Promise<TokensResponse> | Observable<TokensResponse> | TokensResponse;
41
+ refresh(request: Empty): Promise<TokensResponse> | Observable<TokensResponse> | TokensResponse;
42
+ }
43
+ export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
44
+ export declare const AUTH_SERVICE_NAME = "AuthService";
45
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAQA,OAA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YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC;IAEpG,MAAM,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC;IAE9F,OAAO,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,UAAU,CAAC,cAAc,CAAC,GAAG,cAAc,CAAC;CAChG;AAED,wBAAgB,4BAA4B,KACzB,aAAa,QAAQ,UAYvC;AAED,eAAO,MAAM,iBAAiB,gBAAgB,CAAC"}
package/dist/auth.js ADDED
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.2
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.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["MASTER"] = 0] = "MASTER";
16
+ Role[Role["SALON"] = 1] = "SALON";
17
+ Role[Role["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
18
+ })(Role || (exports.Role = Role = {}));
19
+ exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
20
+ function AuthServiceControllerMethods() {
21
+ return function (constructor) {
22
+ const grpcMethods = ["register", "login", "verify", "refresh"];
23
+ for (const method of grpcMethods) {
24
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
25
+ (0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
26
+ }
27
+ const grpcStreamMethods = [];
28
+ for (const method of grpcStreamMethods) {
29
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
30
+ (0, microservices_1.GrpcStreamMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
31
+ }
32
+ };
33
+ }
34
+ exports.AUTH_SERVICE_NAME = "AuthService";
@@ -1,13 +1,4 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.11.2
4
- // protoc v3.21.12
5
- // source: google/protobuf/empty.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 generic empty message that you can re-use to avoid defining duplicated
13
4
  * empty messages in your APIs. A typical example is to use it as the request
@@ -19,5 +10,5 @@ export const protobufPackage = "google.protobuf";
19
10
  */
20
11
  export interface Empty {
21
12
  }
22
-
23
- export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
13
+ export declare const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
14
+ //# sourceMappingURL=empty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty.d.ts","sourceRoot":"","sources":["../../../src/google/protobuf/empty.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD;;;;;;;;GAQG;AACH,MAAM,WAAW,KAAK;CACrB;AAED,eAAO,MAAM,4BAA4B,oBAAoB,CAAC"}
@@ -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.11.2
5
+ // protoc v3.21.12
6
+ // source: google/protobuf/empty.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/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "@ero-world/contracts",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "license": "ISC",
6
- "type": "module",
6
+ "main": "dist/auth.js",
7
+ "types": "gen/auth.d.ts",
8
+ "type": "commonjs",
7
9
  "scripts": {
8
- "release": "node scripts/release.js",
9
- "generate": "protoc -I ./proto --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./gen ./proto/*.proto --ts_proto_opt=nestJs=true,package=omit"
10
+ "release": "node scripts/release.mjs",
11
+ "generate": "protoc -I ./proto --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./src ./proto/*.proto --ts_proto_opt=nestJs=true,package=omit"
10
12
  },
11
13
  "publishConfig": {
12
14
  "access": "public"
@@ -16,7 +18,8 @@
16
18
  "email": "scerep529@gmail.com"
17
19
  },
18
20
  "devDependencies": {
19
- "ts-proto": "^2.11.2"
21
+ "ts-proto": "^2.11.2",
22
+ "typescript": "^5.9.3"
20
23
  },
21
24
  "dependencies": {
22
25
  "@nestjs/microservices": "^11.1.13",
package/proto/auth.proto CHANGED
@@ -4,8 +4,8 @@ package auth.v1;
4
4
  import "google/protobuf/empty.proto";
5
5
 
6
6
  enum Role {
7
- master = 0;
8
- salon = 1;
7
+ MASTER = 0;
8
+ SALON = 1;
9
9
  }
10
10
 
11
11
  service AuthService {
package/tsconfig.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "declaration": true,
4
+ "declarationMap": true,
5
+ "outDir": "dist",
6
+ "rootDir": "src",
7
+ "module": "CommonJS",
8
+ "target": "ES2022",
9
+ "esModuleInterop": true,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "strict": true,
12
+ "skipLibCheck": true
13
+ },
14
+ "include": ["src"]
15
+ }
package/gen/auth.ts DELETED
@@ -1,83 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.11.2
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
- import { Empty } from "./google/protobuf/empty";
11
-
12
- export const protobufPackage = "auth.v1";
13
-
14
- export enum Role {
15
- master = 0,
16
- salon = 1,
17
- UNRECOGNIZED = -1,
18
- }
19
-
20
- export interface RegisterRequest {
21
- email: string;
22
- password: string;
23
- passwordConfirm: string;
24
- role: Role;
25
- }
26
-
27
- export interface RegisterResponse {
28
- ok: boolean;
29
- message: string;
30
- }
31
-
32
- export interface LoginRequest {
33
- email: string;
34
- password: string;
35
- }
36
-
37
- export interface TokensResponse {
38
- accessToken: string;
39
- refreshToken: string;
40
- }
41
-
42
- export interface VerifyRequest {
43
- token: string;
44
- }
45
-
46
- export const AUTH_V1_PACKAGE_NAME = "auth.v1";
47
-
48
- export interface AuthServiceClient {
49
- register(request: RegisterRequest): Observable<RegisterResponse>;
50
-
51
- login(request: LoginRequest): Observable<TokensResponse>;
52
-
53
- verify(request: Empty): Observable<TokensResponse>;
54
-
55
- refresh(request: Empty): Observable<TokensResponse>;
56
- }
57
-
58
- export interface AuthServiceController {
59
- register(request: RegisterRequest): Promise<RegisterResponse> | Observable<RegisterResponse> | RegisterResponse;
60
-
61
- login(request: LoginRequest): Promise<TokensResponse> | Observable<TokensResponse> | TokensResponse;
62
-
63
- verify(request: Empty): Promise<TokensResponse> | Observable<TokensResponse> | TokensResponse;
64
-
65
- refresh(request: Empty): Promise<TokensResponse> | Observable<TokensResponse> | TokensResponse;
66
- }
67
-
68
- export function AuthServiceControllerMethods() {
69
- return function (constructor: Function) {
70
- const grpcMethods: string[] = ["register", "login", "verify", "refresh"];
71
- for (const method of grpcMethods) {
72
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
73
- GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
74
- }
75
- const grpcStreamMethods: string[] = [];
76
- for (const method of grpcStreamMethods) {
77
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
78
- GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
79
- }
80
- };
81
- }
82
-
83
- export const AUTH_SERVICE_NAME = "AuthService";