@taskora-uni/contracts 1.0.0 → 1.1.1

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,7 @@
1
+ export declare const PROTO_CONTRACTS: {
2
+ readonly AUTH: {
3
+ readonly PACKAGE_NAME: "auth.v1";
4
+ readonly PATH: string;
5
+ readonly SERVICE_NAME: "AuthService";
6
+ };
7
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROTO_CONTRACTS = void 0;
4
+ const path_1 = require("path");
5
+ exports.PROTO_CONTRACTS = {
6
+ AUTH: {
7
+ PACKAGE_NAME: "auth.v1",
8
+ PATH: (0, path_1.join)(__dirname, '../../proto/auth.proto'),
9
+ SERVICE_NAME: "AuthService"
10
+ },
11
+ };
@@ -0,0 +1 @@
1
+ export * from "./contracts";
@@ -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("./contracts"), exports);
package/generated/auth.ts CHANGED
@@ -20,19 +20,32 @@ export interface LoginResponse {
20
20
  refreshToken: string;
21
21
  }
22
22
 
23
+ export interface RefreshRequest {
24
+ refreshToken: string;
25
+ }
26
+
27
+ export interface RefreshResponse {
28
+ accessToken: string;
29
+ refreshToken: string;
30
+ }
31
+
23
32
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
24
33
 
25
34
  export interface AuthServiceClient {
26
35
  login(request: LoginRequest): Observable<LoginResponse>;
36
+
37
+ refresh(request: RefreshRequest): Observable<RefreshResponse>;
27
38
  }
28
39
 
29
40
  export interface AuthServiceController {
30
41
  login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
42
+
43
+ refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
31
44
  }
32
45
 
33
46
  export function AuthServiceControllerMethods() {
34
47
  return function (constructor: Function) {
35
- const grpcMethods: string[] = ["login"];
48
+ const grpcMethods: string[] = ["login", "refresh"];
36
49
  for (const method of grpcMethods) {
37
50
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
38
51
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@taskora-uni/contracts",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "description": "Shared protobuf contracts and generated TypeScript bindings for Taskora Uni backend services.",
5
5
  "license": "MIT",
6
- "type": "module",
6
+ "type": "commonjs",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
7
9
  "files": [
8
10
  "proto",
9
- "generated"
11
+ "generated",
12
+ "dist"
10
13
  ],
11
14
  "publishConfig": {
12
15
  "access": "public"
@@ -16,7 +19,12 @@
16
19
  "rxjs": "^7.8.2",
17
20
  "ts-proto": "^2.11.6"
18
21
  },
22
+ "devDependencies": {
23
+ "@types/node": "^25.5.0",
24
+ "typescript": "^6.0.2"
25
+ },
19
26
  "scripts": {
27
+ "build": "tsc -p tsconfig.build.json",
20
28
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./generated --ts_proto_opt=nestJs=true,package=omit"
21
29
  }
22
30
  }
package/proto/auth.proto CHANGED
@@ -4,6 +4,7 @@ package auth.v1;
4
4
 
5
5
  service AuthService {
6
6
  rpc Login(LoginRequest) returns (LoginResponse);
7
+ rpc Refresh(RefreshRequest) returns (RefreshResponse);
7
8
  }
8
9
 
9
10
  message LoginRequest {
@@ -15,3 +16,12 @@ message LoginResponse {
15
16
  string access_token = 1;
16
17
  string refresh_token = 2;
17
18
  }
19
+
20
+ message RefreshRequest {
21
+ string refresh_token = 1;
22
+ }
23
+
24
+ message RefreshResponse {
25
+ string access_token = 1;
26
+ string refresh_token = 2;
27
+ }