@taskora-uni/contracts 3.1.0 → 4.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.
- package/dist/events/auth/patterns/event-patterns.d.ts +2 -1
- package/dist/events/auth/patterns/event-patterns.js +2 -1
- package/dist/events/auth/payloads/index.d.ts +1 -0
- package/dist/events/auth/payloads/index.js +1 -0
- package/dist/events/auth/payloads/profile-creation-requested.payload.d.ts +7 -0
- package/dist/events/auth/payloads/profile-creation-requested.payload.js +2 -0
- package/dist/events/index.d.ts +1 -0
- package/dist/events/index.js +1 -0
- package/dist/events/user/index.d.ts +2 -0
- package/dist/events/user/index.js +18 -0
- package/dist/events/user/patterns/event-patterns.d.ts +4 -0
- package/dist/events/user/patterns/event-patterns.js +7 -0
- package/dist/events/user/patterns/index.d.ts +1 -0
- package/dist/events/user/patterns/index.js +17 -0
- package/dist/events/user/payloads/index.d.ts +2 -0
- package/dist/events/user/payloads/index.js +18 -0
- package/dist/events/user/payloads/profile-created.payload.d.ts +5 -0
- package/dist/events/user/payloads/profile-created.payload.js +2 -0
- package/dist/events/user/payloads/profile-creation-failed.payload.d.ts +6 -0
- package/dist/events/user/payloads/profile-creation-failed.payload.js +2 -0
- package/generated/auth.ts +32 -3
- package/package.json +1 -1
- package/proto/auth.proto +19 -2
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AUTH_EVENT_PATTERNS = void 0;
|
|
4
4
|
exports.AUTH_EVENT_PATTERNS = {
|
|
5
|
-
OTP_REQUESTED: "auth.otp
|
|
5
|
+
OTP_REQUESTED: "auth.registration.otp-requested",
|
|
6
|
+
PROFILE_CREATION_REQUESTED: "auth.registration.profile-creation-requested",
|
|
6
7
|
};
|
|
@@ -15,3 +15,4 @@ 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);
|
package/dist/events/index.d.ts
CHANGED
package/dist/events/index.js
CHANGED
|
@@ -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 @@
|
|
|
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,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("./profile-created.payload"), exports);
|
|
18
|
+
__exportStar(require("./profile-creation-failed.payload"), exports);
|
package/generated/auth.ts
CHANGED
|
@@ -10,6 +10,14 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "auth.v1";
|
|
12
12
|
|
|
13
|
+
export enum RegistrationStatus {
|
|
14
|
+
UNSPECIFIED = 0,
|
|
15
|
+
PENDING = 1,
|
|
16
|
+
COMPLETED = 2,
|
|
17
|
+
REQUIRES_RESTART = 3,
|
|
18
|
+
UNRECOGNIZED = -1,
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
export interface LoginRequest {
|
|
14
22
|
email: string;
|
|
15
23
|
password: string;
|
|
@@ -48,8 +56,17 @@ export interface CompleteRegistrationRequest {
|
|
|
48
56
|
}
|
|
49
57
|
|
|
50
58
|
export interface CompleteRegistrationResponse {
|
|
51
|
-
|
|
52
|
-
|
|
59
|
+
status: RegistrationStatus;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface GetRegistrationStatusRequest {
|
|
63
|
+
id: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface GetRegistrationStatusResponse {
|
|
67
|
+
status: RegistrationStatus;
|
|
68
|
+
accessToken?: string | undefined;
|
|
69
|
+
refreshToken?: string | undefined;
|
|
53
70
|
}
|
|
54
71
|
|
|
55
72
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
@@ -62,6 +79,8 @@ export interface AuthServiceClient {
|
|
|
62
79
|
startRegistration(request: StartRegistrationRequest): Observable<StartRegistrationResponse>;
|
|
63
80
|
|
|
64
81
|
completeRegistration(request: CompleteRegistrationRequest): Observable<CompleteRegistrationResponse>;
|
|
82
|
+
|
|
83
|
+
getRegistrationStatus(request: GetRegistrationStatusRequest): Observable<GetRegistrationStatusResponse>;
|
|
65
84
|
}
|
|
66
85
|
|
|
67
86
|
export interface AuthServiceController {
|
|
@@ -78,11 +97,21 @@ export interface AuthServiceController {
|
|
|
78
97
|
completeRegistration(
|
|
79
98
|
request: CompleteRegistrationRequest,
|
|
80
99
|
): Promise<CompleteRegistrationResponse> | Observable<CompleteRegistrationResponse> | CompleteRegistrationResponse;
|
|
100
|
+
|
|
101
|
+
getRegistrationStatus(
|
|
102
|
+
request: GetRegistrationStatusRequest,
|
|
103
|
+
): Promise<GetRegistrationStatusResponse> | Observable<GetRegistrationStatusResponse> | GetRegistrationStatusResponse;
|
|
81
104
|
}
|
|
82
105
|
|
|
83
106
|
export function AuthServiceControllerMethods() {
|
|
84
107
|
return function (constructor: Function) {
|
|
85
|
-
const grpcMethods: string[] = [
|
|
108
|
+
const grpcMethods: string[] = [
|
|
109
|
+
"login",
|
|
110
|
+
"refreshTokens",
|
|
111
|
+
"startRegistration",
|
|
112
|
+
"completeRegistration",
|
|
113
|
+
"getRegistrationStatus",
|
|
114
|
+
];
|
|
86
115
|
for (const method of grpcMethods) {
|
|
87
116
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
88
117
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -7,6 +7,7 @@ service AuthService {
|
|
|
7
7
|
rpc RefreshTokens(RefreshTokensRequest) returns (RefreshTokensResponse);
|
|
8
8
|
rpc StartRegistration(StartRegistrationRequest) returns (StartRegistrationResponse);
|
|
9
9
|
rpc CompleteRegistration(CompleteRegistrationRequest) returns (CompleteRegistrationResponse);
|
|
10
|
+
rpc GetRegistrationStatus(GetRegistrationStatusRequest) returns (GetRegistrationStatusResponse);
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
message LoginRequest {
|
|
@@ -38,6 +39,13 @@ message StartRegistrationResponse {
|
|
|
38
39
|
string id = 1;
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
enum RegistrationStatus {
|
|
43
|
+
UNSPECIFIED = 0;
|
|
44
|
+
PENDING = 1;
|
|
45
|
+
COMPLETED = 2;
|
|
46
|
+
REQUIRES_RESTART = 3;
|
|
47
|
+
}
|
|
48
|
+
|
|
41
49
|
message CompleteRegistrationRequest {
|
|
42
50
|
string id = 1;
|
|
43
51
|
string code = 2;
|
|
@@ -47,6 +55,15 @@ message CompleteRegistrationRequest {
|
|
|
47
55
|
}
|
|
48
56
|
|
|
49
57
|
message CompleteRegistrationResponse {
|
|
50
|
-
|
|
51
|
-
|
|
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;
|
|
52
69
|
}
|