@taskora-uni/contracts 4.0.2 → 6.0.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.
@@ -1,4 +1,3 @@
1
1
  export declare const AUTH_EVENT_PATTERNS: {
2
2
  readonly OTP_REQUESTED: "auth.registration.otp-requested";
3
- readonly PROFILE_CREATION_REQUESTED: "auth.registration.profile-creation-requested";
4
3
  };
@@ -3,5 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AUTH_EVENT_PATTERNS = void 0;
4
4
  exports.AUTH_EVENT_PATTERNS = {
5
5
  OTP_REQUESTED: "auth.registration.otp-requested",
6
- PROFILE_CREATION_REQUESTED: "auth.registration.profile-creation-requested",
7
6
  };
@@ -1,2 +1 @@
1
1
  export * from "./otp-requested.payload";
2
- export * from "./profile-creation-requested.payload";
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./otp-requested.payload"), exports);
18
- __exportStar(require("./profile-creation-requested.payload"), exports);
@@ -1,2 +1 @@
1
1
  export * from "./auth";
2
- export * from "./user";
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./auth"), exports);
18
- __exportStar(require("./user"), exports);
@@ -1,12 +1,6 @@
1
1
  import { Observable } from "rxjs";
2
+ import { Empty } from "./google/protobuf/empty";
2
3
  export declare const protobufPackage = "auth.v1";
3
- export declare enum RegistrationStatus {
4
- UNSPECIFIED = 0,
5
- PENDING = 1,
6
- COMPLETED = 2,
7
- REQUIRES_RESTART = 3,
8
- UNRECOGNIZED = -1
9
- }
10
4
  export interface LoginRequest {
11
5
  email: string;
12
6
  password: string;
@@ -15,6 +9,9 @@ export interface LoginResponse {
15
9
  accessToken: string;
16
10
  refreshToken: string;
17
11
  }
12
+ export interface LogoutRequest {
13
+ refreshToken: string;
14
+ }
18
15
  export interface RefreshTokensRequest {
19
16
  refreshToken: string;
20
17
  }
@@ -22,46 +19,16 @@ export interface RefreshTokensResponse {
22
19
  accessToken: string;
23
20
  refreshToken: string;
24
21
  }
25
- export interface StartRegistrationRequest {
26
- email: string;
27
- password: string;
28
- token: string;
29
- }
30
- export interface StartRegistrationResponse {
31
- id: string;
32
- }
33
- export interface CompleteRegistrationRequest {
34
- id: string;
35
- code: string;
36
- token: string;
37
- firstName: string;
38
- lastName: string;
39
- }
40
- export interface CompleteRegistrationResponse {
41
- status: RegistrationStatus;
42
- }
43
- export interface GetRegistrationStatusRequest {
44
- id: string;
45
- }
46
- export interface GetRegistrationStatusResponse {
47
- status: RegistrationStatus;
48
- accessToken?: string | undefined;
49
- refreshToken?: string | undefined;
50
- }
51
22
  export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
52
23
  export interface AuthServiceClient {
53
24
  login(request: LoginRequest): Observable<LoginResponse>;
25
+ logout(request: LogoutRequest): Observable<Empty>;
54
26
  refreshTokens(request: RefreshTokensRequest): Observable<RefreshTokensResponse>;
55
- startRegistration(request: StartRegistrationRequest): Observable<StartRegistrationResponse>;
56
- completeRegistration(request: CompleteRegistrationRequest): Observable<CompleteRegistrationResponse>;
57
- getRegistrationStatus(request: GetRegistrationStatusRequest): Observable<GetRegistrationStatusResponse>;
58
27
  }
59
28
  export interface AuthServiceController {
60
29
  login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
30
+ logout(request: LogoutRequest): void | Promise<void>;
61
31
  refreshTokens(request: RefreshTokensRequest): Promise<RefreshTokensResponse> | Observable<RefreshTokensResponse> | RefreshTokensResponse;
62
- startRegistration(request: StartRegistrationRequest): Promise<StartRegistrationResponse> | Observable<StartRegistrationResponse> | StartRegistrationResponse;
63
- completeRegistration(request: CompleteRegistrationRequest): Promise<CompleteRegistrationResponse> | Observable<CompleteRegistrationResponse> | CompleteRegistrationResponse;
64
- getRegistrationStatus(request: GetRegistrationStatusRequest): Promise<GetRegistrationStatusResponse> | Observable<GetRegistrationStatusResponse> | GetRegistrationStatusResponse;
65
32
  }
66
33
  export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
67
34
  export declare const AUTH_SERVICE_NAME = "AuthService";
@@ -5,29 +5,15 @@
5
5
  // protoc v3.21.12
6
6
  // source: auth.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.AUTH_SERVICE_NAME = exports.AUTH_V1_PACKAGE_NAME = exports.RegistrationStatus = exports.protobufPackage = void 0;
8
+ exports.AUTH_SERVICE_NAME = exports.AUTH_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
9
  exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const microservices_1 = require("@nestjs/microservices");
12
12
  exports.protobufPackage = "auth.v1";
13
- var RegistrationStatus;
14
- (function (RegistrationStatus) {
15
- RegistrationStatus[RegistrationStatus["UNSPECIFIED"] = 0] = "UNSPECIFIED";
16
- RegistrationStatus[RegistrationStatus["PENDING"] = 1] = "PENDING";
17
- RegistrationStatus[RegistrationStatus["COMPLETED"] = 2] = "COMPLETED";
18
- RegistrationStatus[RegistrationStatus["REQUIRES_RESTART"] = 3] = "REQUIRES_RESTART";
19
- RegistrationStatus[RegistrationStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
20
- })(RegistrationStatus || (exports.RegistrationStatus = RegistrationStatus = {}));
21
13
  exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
22
14
  function AuthServiceControllerMethods() {
23
15
  return function (constructor) {
24
- const grpcMethods = [
25
- "login",
26
- "refreshTokens",
27
- "startRegistration",
28
- "completeRegistration",
29
- "getRegistrationStatus",
30
- ];
16
+ const grpcMethods = ["login", "logout", "refreshTokens"];
31
17
  for (const method of grpcMethods) {
32
18
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
33
19
  (0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taskora-uni/contracts",
3
- "version": "4.0.2",
3
+ "version": "6.0.0",
4
4
  "description": "Shared protobuf contracts and generated TypeScript bindings for Taskora Uni backend services.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
package/proto/auth.proto CHANGED
@@ -2,12 +2,12 @@ syntax = "proto3";
2
2
 
3
3
  package auth.v1;
4
4
 
5
+ import "google/protobuf/empty.proto";
6
+
5
7
  service AuthService {
6
8
  rpc Login(LoginRequest) returns (LoginResponse);
9
+ rpc Logout(LogoutRequest) returns (google.protobuf.Empty);
7
10
  rpc RefreshTokens(RefreshTokensRequest) returns (RefreshTokensResponse);
8
- rpc StartRegistration(StartRegistrationRequest) returns (StartRegistrationResponse);
9
- rpc CompleteRegistration(CompleteRegistrationRequest) returns (CompleteRegistrationResponse);
10
- rpc GetRegistrationStatus(GetRegistrationStatusRequest) returns (GetRegistrationStatusResponse);
11
11
  }
12
12
 
13
13
  message LoginRequest {
@@ -20,6 +20,10 @@ message LoginResponse {
20
20
  string refresh_token = 2;
21
21
  }
22
22
 
23
+ message LogoutRequest {
24
+ string refresh_token = 1;
25
+ }
26
+
23
27
  message RefreshTokensRequest {
24
28
  string refresh_token = 1;
25
29
  }
@@ -28,42 +32,3 @@ message RefreshTokensResponse {
28
32
  string access_token = 1;
29
33
  string refresh_token = 2;
30
34
  }
31
-
32
- message StartRegistrationRequest {
33
- string email = 1;
34
- string password = 2;
35
- string token = 3;
36
- }
37
-
38
- message StartRegistrationResponse {
39
- string id = 1;
40
- }
41
-
42
- enum RegistrationStatus {
43
- UNSPECIFIED = 0;
44
- PENDING = 1;
45
- COMPLETED = 2;
46
- REQUIRES_RESTART = 3;
47
- }
48
-
49
- message CompleteRegistrationRequest {
50
- string id = 1;
51
- string code = 2;
52
- string token = 3;
53
- string first_name = 4;
54
- string last_name = 5;
55
- }
56
-
57
- message CompleteRegistrationResponse {
58
- RegistrationStatus status = 1;
59
- }
60
-
61
- message GetRegistrationStatusRequest {
62
- string id = 1;
63
- }
64
-
65
- message GetRegistrationStatusResponse {
66
- RegistrationStatus status = 1;
67
- optional string access_token = 2;
68
- optional string refresh_token = 3;
69
- }
@@ -1,7 +0,0 @@
1
- export interface AuthProfileCreationRequestedPayload {
2
- eventId: string;
3
- userId: string;
4
- firstName: string;
5
- lastName: string;
6
- occurredAt: string;
7
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- export * from "./patterns";
2
- export * from "./payloads";
@@ -1,18 +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("./patterns"), exports);
18
- __exportStar(require("./payloads"), exports);
@@ -1,4 +0,0 @@
1
- export declare const USER_EVENT_PATTERNS: {
2
- readonly PROFILE_CREATED: "user.profile-created";
3
- readonly PROFILE_CREATION_FAILED: "user.profile-creation-failed";
4
- };
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.USER_EVENT_PATTERNS = void 0;
4
- exports.USER_EVENT_PATTERNS = {
5
- PROFILE_CREATED: "user.profile-created",
6
- PROFILE_CREATION_FAILED: "user.profile-creation-failed",
7
- };
@@ -1 +0,0 @@
1
- export * from "./event-patterns";
@@ -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("./event-patterns"), exports);
@@ -1,2 +0,0 @@
1
- export * from "./profile-created.payload";
2
- export * from "./profile-creation-failed.payload";
@@ -1,18 +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("./profile-created.payload"), exports);
18
- __exportStar(require("./profile-creation-failed.payload"), exports);
@@ -1,5 +0,0 @@
1
- export interface UserProfileCreatedPayload {
2
- eventId: string;
3
- userId: string;
4
- occurredAt: string;
5
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- export interface UserProfileCreationFailedPayload {
2
- eventId: string;
3
- userId: string;
4
- reason: string;
5
- occurredAt: string;
6
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });