@taskora-uni/contracts 2.1.0 → 3.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.
@@ -0,0 +1,2 @@
1
+ export * from "./patterns";
2
+ export * from "./payloads";
@@ -0,0 +1,18 @@
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);
@@ -0,0 +1,3 @@
1
+ export declare const AUTH_EVENT_PATTERNS: {
2
+ readonly OTP_REQUESTED: "auth.otp.requested";
3
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AUTH_EVENT_PATTERNS = void 0;
4
+ exports.AUTH_EVENT_PATTERNS = {
5
+ OTP_REQUESTED: "auth.otp.requested",
6
+ };
@@ -0,0 +1 @@
1
+ export * from './event-patterns';
@@ -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("./event-patterns"), exports);
@@ -0,0 +1 @@
1
+ export * from "./otp-requested.payload";
@@ -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("./otp-requested.payload"), exports);
@@ -0,0 +1,5 @@
1
+ export interface AuthOtpRequestedPayload {
2
+ email: string;
3
+ code: string;
4
+ codeTtlSeconds: number;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./auth";
@@ -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("./auth"), exports);
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
+ export * from "./events";
1
2
  export * from "./proto";
package/dist/index.js CHANGED
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./events"), exports);
17
18
  __exportStar(require("./proto"), exports);
package/generated/auth.ts CHANGED
@@ -39,7 +39,7 @@ export interface StartRegistrationResponse {
39
39
  id: string;
40
40
  }
41
41
 
42
- export interface ConfirmRegistrationOtpRequest {
42
+ export interface CompleteRegistrationRequest {
43
43
  id: string;
44
44
  code: string;
45
45
  token: string;
@@ -47,7 +47,7 @@ export interface ConfirmRegistrationOtpRequest {
47
47
  lastName: string;
48
48
  }
49
49
 
50
- export interface ConfirmRegistrationOtpResponse {
50
+ export interface CompleteRegistrationResponse {
51
51
  accessToken: string;
52
52
  refreshToken: string;
53
53
  }
@@ -61,7 +61,7 @@ export interface AuthServiceClient {
61
61
 
62
62
  startRegistration(request: StartRegistrationRequest): Observable<StartRegistrationResponse>;
63
63
 
64
- confirmRegistrationOtp(request: ConfirmRegistrationOtpRequest): Observable<ConfirmRegistrationOtpResponse>;
64
+ completeRegistration(request: CompleteRegistrationRequest): Observable<CompleteRegistrationResponse>;
65
65
  }
66
66
 
67
67
  export interface AuthServiceController {
@@ -75,17 +75,14 @@ export interface AuthServiceController {
75
75
  request: StartRegistrationRequest,
76
76
  ): Promise<StartRegistrationResponse> | Observable<StartRegistrationResponse> | StartRegistrationResponse;
77
77
 
78
- confirmRegistrationOtp(
79
- request: ConfirmRegistrationOtpRequest,
80
- ):
81
- | Promise<ConfirmRegistrationOtpResponse>
82
- | Observable<ConfirmRegistrationOtpResponse>
83
- | ConfirmRegistrationOtpResponse;
78
+ completeRegistration(
79
+ request: CompleteRegistrationRequest,
80
+ ): Promise<CompleteRegistrationResponse> | Observable<CompleteRegistrationResponse> | CompleteRegistrationResponse;
84
81
  }
85
82
 
86
83
  export function AuthServiceControllerMethods() {
87
84
  return function (constructor: Function) {
88
- const grpcMethods: string[] = ["login", "refreshTokens", "startRegistration", "confirmRegistrationOtp"];
85
+ const grpcMethods: string[] = ["login", "refreshTokens", "startRegistration", "completeRegistration"];
89
86
  for (const method of grpcMethods) {
90
87
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
91
88
  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": "2.1.0",
3
+ "version": "3.1.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
@@ -6,7 +6,7 @@ service AuthService {
6
6
  rpc Login(LoginRequest) returns (LoginResponse);
7
7
  rpc RefreshTokens(RefreshTokensRequest) returns (RefreshTokensResponse);
8
8
  rpc StartRegistration(StartRegistrationRequest) returns (StartRegistrationResponse);
9
- rpc ConfirmRegistrationOtp(ConfirmRegistrationOtpRequest) returns (ConfirmRegistrationOtpResponse);
9
+ rpc CompleteRegistration(CompleteRegistrationRequest) returns (CompleteRegistrationResponse);
10
10
  }
11
11
 
12
12
  message LoginRequest {
@@ -38,7 +38,7 @@ message StartRegistrationResponse {
38
38
  string id = 1;
39
39
  }
40
40
 
41
- message ConfirmRegistrationOtpRequest {
41
+ message CompleteRegistrationRequest {
42
42
  string id = 1;
43
43
  string code = 2;
44
44
  string token = 3;
@@ -46,7 +46,7 @@ message ConfirmRegistrationOtpRequest {
46
46
  string last_name = 5;
47
47
  }
48
48
 
49
- message ConfirmRegistrationOtpResponse {
49
+ message CompleteRegistrationResponse {
50
50
  string access_token = 1;
51
51
  string refresh_token = 2;
52
52
  }