@kottvideo/contracts 1.0.3 → 1.0.5

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 @@
1
+ export * from './proto';
package/dist/index.js ADDED
@@ -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,3 @@
1
+ export declare const PROTO_PATH: {
2
+ readonly AUTH: string;
3
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROTO_PATH = void 0;
4
+ const node_path_1 = require("node:path");
5
+ exports.PROTO_PATH = {
6
+ AUTH: (0, node_path_1.join)(__dirname, '../../proto/auth.proto'),
7
+ };
package/gen/auth.ts CHANGED
@@ -30,23 +30,46 @@ export interface VerifyOtpResponse {
30
30
  refreshToken: string;
31
31
  }
32
32
 
33
+ export interface RefreshTokenRequest {
34
+ refreshToken: string;
35
+ }
36
+
37
+ export interface RefreshTokenResponse {
38
+ accessToken: string;
39
+ refreshToken: string;
40
+ }
41
+
33
42
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
34
43
 
35
44
  export interface AuthServiceClient {
45
+ /** One-time passwords */
46
+
36
47
  sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
37
48
 
38
49
  verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
50
+
51
+ /** Authentication tokens */
52
+
53
+ refreshToken(request: RefreshTokenRequest): Observable<RefreshTokenResponse>;
39
54
  }
40
55
 
41
56
  export interface AuthServiceController {
57
+ /** One-time passwords */
58
+
42
59
  sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
43
60
 
44
61
  verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
62
+
63
+ /** Authentication tokens */
64
+
65
+ refreshToken(
66
+ request: RefreshTokenRequest,
67
+ ): Promise<RefreshTokenResponse> | Observable<RefreshTokenResponse> | RefreshTokenResponse;
45
68
  }
46
69
 
47
70
  export function AuthServiceControllerMethods() {
48
71
  return function (constructor: Function) {
49
- const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
72
+ const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refreshToken"];
50
73
  for (const method of grpcMethods) {
51
74
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
52
75
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kottvideo/contracts",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "gRPC contracts for KottVideo microservices",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "files": [
13
13
  "proto",
14
- "gen"
14
+ "gen",
15
+ "dist"
15
16
  ],
16
17
  "publishConfig": {
17
18
  "access": "public"
package/proto/auth.proto CHANGED
@@ -3,8 +3,12 @@ syntax = "proto3";
3
3
  package auth.v1;
4
4
 
5
5
  service AuthService {
6
+ // One-time passwords
6
7
  rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
7
8
  rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
9
+
10
+ // Authentication tokens
11
+ rpc RefreshToken (RefreshTokenRequest) returns (RefreshTokenResponse);
8
12
  }
9
13
 
10
14
  message SendOtpRequest {
@@ -25,4 +29,13 @@ message VerifyOtpRequest {
25
29
  message VerifyOtpResponse {
26
30
  string access_token = 1;
27
31
  string refresh_token = 2;
28
- }
32
+ }
33
+
34
+ message RefreshTokenRequest {
35
+ string refresh_token = 1;
36
+ }
37
+
38
+ message RefreshTokenResponse {
39
+ string access_token = 1;
40
+ string refresh_token = 2;
41
+ }