@funpay-pilot/contracts 0.1.79 → 0.2.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.
- package/dist/gen/auth.d.ts +59 -0
- package/dist/gen/auth.js +28 -0
- package/dist/gen/core.d.ts +73 -0
- package/dist/gen/core.js +42 -0
- package/dist/gen/users.d.ts +18 -0
- package/dist/gen/users.js +28 -0
- package/package.json +44 -34
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{index.js → src/index.js} +0 -0
- /package/dist/{messages → src/messages}/client/get-account.type.d.ts +0 -0
- /package/dist/{messages → src/messages}/client/get-account.type.js +0 -0
- /package/dist/{messages → src/messages}/client/get-runner.type.d.ts +0 -0
- /package/dist/{messages → src/messages}/client/get-runner.type.js +0 -0
- /package/dist/{messages → src/messages}/client/index.d.ts +0 -0
- /package/dist/{messages → src/messages}/client/index.js +0 -0
- /package/dist/{messages → src/messages}/client/send-message.type.d.ts +0 -0
- /package/dist/{messages → src/messages}/client/send-message.type.js +0 -0
- /package/dist/{messages → src/messages}/index.d.ts +0 -0
- /package/dist/{messages → src/messages}/index.js +0 -0
- /package/dist/{proto → src/proto}/index.d.ts +0 -0
- /package/dist/{proto → src/proto}/index.js +0 -0
- /package/dist/{proto → src/proto}/paths.d.ts +0 -0
- /package/dist/{proto → src/proto}/paths.js +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "auth.v1";
|
|
3
|
+
export interface RegisterRequest {
|
|
4
|
+
email: string;
|
|
5
|
+
password: string;
|
|
6
|
+
username: string;
|
|
7
|
+
}
|
|
8
|
+
export interface RegisterResponse {
|
|
9
|
+
accessToken: string;
|
|
10
|
+
refreshToken: string;
|
|
11
|
+
}
|
|
12
|
+
export interface LoginRequest {
|
|
13
|
+
email: string;
|
|
14
|
+
password: string;
|
|
15
|
+
}
|
|
16
|
+
export interface LoginResponse {
|
|
17
|
+
accessToken: string;
|
|
18
|
+
refreshToken: string;
|
|
19
|
+
}
|
|
20
|
+
export interface RefreshRequest {
|
|
21
|
+
refreshToken: string;
|
|
22
|
+
}
|
|
23
|
+
export interface RefreshResponse {
|
|
24
|
+
accessToken: string;
|
|
25
|
+
refreshToken: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ValidateRequest {
|
|
28
|
+
token: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ValidateResponse {
|
|
31
|
+
valid: boolean;
|
|
32
|
+
userId: string;
|
|
33
|
+
}
|
|
34
|
+
export interface GetUserRequest {
|
|
35
|
+
accessToken: string;
|
|
36
|
+
}
|
|
37
|
+
export interface GetUserResponse {
|
|
38
|
+
id: string;
|
|
39
|
+
email: string;
|
|
40
|
+
username: string;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
}
|
|
43
|
+
export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
44
|
+
export interface AuthServiceClient {
|
|
45
|
+
register(request: RegisterRequest): Observable<RegisterResponse>;
|
|
46
|
+
login(request: LoginRequest): Observable<LoginResponse>;
|
|
47
|
+
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
48
|
+
validate(request: ValidateRequest): Observable<ValidateResponse>;
|
|
49
|
+
getUser(request: GetUserRequest): Observable<GetUserResponse>;
|
|
50
|
+
}
|
|
51
|
+
export interface AuthServiceController {
|
|
52
|
+
register(request: RegisterRequest): Promise<RegisterResponse> | Observable<RegisterResponse> | RegisterResponse;
|
|
53
|
+
login(request: LoginRequest): Promise<LoginResponse> | Observable<LoginResponse> | LoginResponse;
|
|
54
|
+
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
55
|
+
validate(request: ValidateRequest): Promise<ValidateResponse> | Observable<ValidateResponse> | ValidateResponse;
|
|
56
|
+
getUser(request: GetUserRequest): Promise<GetUserResponse> | Observable<GetUserResponse> | GetUserResponse;
|
|
57
|
+
}
|
|
58
|
+
export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
|
|
59
|
+
export declare const AUTH_SERVICE_NAME = "AuthService";
|
package/dist/gen/auth.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.6
|
|
5
|
+
// protoc v7.36.2
|
|
6
|
+
// source: auth.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.AUTH_SERVICE_NAME = exports.AUTH_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "auth.v1";
|
|
13
|
+
exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
14
|
+
function AuthServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = ["register", "login", "refresh", "validate", "getUser"];
|
|
17
|
+
for (const method of grpcMethods) {
|
|
18
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
+
(0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
20
|
+
}
|
|
21
|
+
const grpcStreamMethods = [];
|
|
22
|
+
for (const method of grpcStreamMethods) {
|
|
23
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
24
|
+
(0, microservices_1.GrpcStreamMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.AUTH_SERVICE_NAME = "AuthService";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "core.v1";
|
|
3
|
+
export declare enum Status {
|
|
4
|
+
INACTIVE = 0,
|
|
5
|
+
ACTIVE = 1,
|
|
6
|
+
INITIALIZING = 2,
|
|
7
|
+
UNRECOGNIZED = -1
|
|
8
|
+
}
|
|
9
|
+
export interface CreateAccountRequest {
|
|
10
|
+
userId: string;
|
|
11
|
+
goldenKey: string;
|
|
12
|
+
}
|
|
13
|
+
export interface GetAccountsListRequest {
|
|
14
|
+
userId: string;
|
|
15
|
+
}
|
|
16
|
+
export interface GetAccountsListResponse {
|
|
17
|
+
accounts: Account[];
|
|
18
|
+
}
|
|
19
|
+
export interface GetAccountRequest {
|
|
20
|
+
userId: string;
|
|
21
|
+
id: string;
|
|
22
|
+
}
|
|
23
|
+
export interface SetAccountStatusRequest {
|
|
24
|
+
userId: string;
|
|
25
|
+
id: string;
|
|
26
|
+
status: Status;
|
|
27
|
+
}
|
|
28
|
+
export interface DeleteAccountRequest {
|
|
29
|
+
userId: string;
|
|
30
|
+
id: string;
|
|
31
|
+
}
|
|
32
|
+
export interface DeleteAccountResponse {
|
|
33
|
+
ok: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface Account {
|
|
36
|
+
id: string;
|
|
37
|
+
userId: string;
|
|
38
|
+
funpayId?: number | undefined;
|
|
39
|
+
username?: string | undefined;
|
|
40
|
+
avatarUrl?: string | undefined;
|
|
41
|
+
balance?: number | undefined;
|
|
42
|
+
status: Status;
|
|
43
|
+
error?: string | undefined;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
updatedAt: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ChangeAccountStatusRequest {
|
|
48
|
+
id: string;
|
|
49
|
+
userId: string;
|
|
50
|
+
status: Status;
|
|
51
|
+
}
|
|
52
|
+
export interface ChangeAccountStatusResponse {
|
|
53
|
+
ok: boolean;
|
|
54
|
+
}
|
|
55
|
+
export declare const CORE_V1_PACKAGE_NAME = "core.v1";
|
|
56
|
+
export interface CoreServiceClient {
|
|
57
|
+
createAccount(request: CreateAccountRequest): Observable<Account>;
|
|
58
|
+
getAccountsList(request: GetAccountsListRequest): Observable<GetAccountsListResponse>;
|
|
59
|
+
getAccount(request: GetAccountRequest): Observable<Account>;
|
|
60
|
+
setAccountStatus(request: SetAccountStatusRequest): Observable<Account>;
|
|
61
|
+
deleteAccount(request: DeleteAccountRequest): Observable<DeleteAccountResponse>;
|
|
62
|
+
changeAccountStatus(request: ChangeAccountStatusRequest): Observable<ChangeAccountStatusResponse>;
|
|
63
|
+
}
|
|
64
|
+
export interface CoreServiceController {
|
|
65
|
+
createAccount(request: CreateAccountRequest): Promise<Account> | Observable<Account> | Account;
|
|
66
|
+
getAccountsList(request: GetAccountsListRequest): Promise<GetAccountsListResponse> | Observable<GetAccountsListResponse> | GetAccountsListResponse;
|
|
67
|
+
getAccount(request: GetAccountRequest): Promise<Account> | Observable<Account> | Account;
|
|
68
|
+
setAccountStatus(request: SetAccountStatusRequest): Promise<Account> | Observable<Account> | Account;
|
|
69
|
+
deleteAccount(request: DeleteAccountRequest): Promise<DeleteAccountResponse> | Observable<DeleteAccountResponse> | DeleteAccountResponse;
|
|
70
|
+
changeAccountStatus(request: ChangeAccountStatusRequest): Promise<ChangeAccountStatusResponse> | Observable<ChangeAccountStatusResponse> | ChangeAccountStatusResponse;
|
|
71
|
+
}
|
|
72
|
+
export declare function CoreServiceControllerMethods(): (constructor: Function) => void;
|
|
73
|
+
export declare const CORE_SERVICE_NAME = "CoreService";
|
package/dist/gen/core.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.6
|
|
5
|
+
// protoc v7.36.2
|
|
6
|
+
// source: core.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.CORE_SERVICE_NAME = exports.CORE_V1_PACKAGE_NAME = exports.Status = exports.protobufPackage = void 0;
|
|
9
|
+
exports.CoreServiceControllerMethods = CoreServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "core.v1";
|
|
13
|
+
var Status;
|
|
14
|
+
(function (Status) {
|
|
15
|
+
Status[Status["INACTIVE"] = 0] = "INACTIVE";
|
|
16
|
+
Status[Status["ACTIVE"] = 1] = "ACTIVE";
|
|
17
|
+
Status[Status["INITIALIZING"] = 2] = "INITIALIZING";
|
|
18
|
+
Status[Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
19
|
+
})(Status || (exports.Status = Status = {}));
|
|
20
|
+
exports.CORE_V1_PACKAGE_NAME = "core.v1";
|
|
21
|
+
function CoreServiceControllerMethods() {
|
|
22
|
+
return function (constructor) {
|
|
23
|
+
const grpcMethods = [
|
|
24
|
+
"createAccount",
|
|
25
|
+
"getAccountsList",
|
|
26
|
+
"getAccount",
|
|
27
|
+
"setAccountStatus",
|
|
28
|
+
"deleteAccount",
|
|
29
|
+
"changeAccountStatus",
|
|
30
|
+
];
|
|
31
|
+
for (const method of grpcMethods) {
|
|
32
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
33
|
+
(0, microservices_1.GrpcMethod)("CoreService", method)(constructor.prototype[method], method, descriptor);
|
|
34
|
+
}
|
|
35
|
+
const grpcStreamMethods = [];
|
|
36
|
+
for (const method of grpcStreamMethods) {
|
|
37
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
38
|
+
(0, microservices_1.GrpcStreamMethod)("CoreService", method)(constructor.prototype[method], method, descriptor);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
exports.CORE_SERVICE_NAME = "CoreService";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "users.v1";
|
|
3
|
+
export interface CreateUserRequest {
|
|
4
|
+
id: string;
|
|
5
|
+
username: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CreateUserResponse {
|
|
8
|
+
ok: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
11
|
+
export interface UsersServiceClient {
|
|
12
|
+
createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
|
|
13
|
+
}
|
|
14
|
+
export interface UsersServiceController {
|
|
15
|
+
createUser(request: CreateUserRequest): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
|
|
16
|
+
}
|
|
17
|
+
export declare function UsersServiceControllerMethods(): (constructor: Function) => void;
|
|
18
|
+
export declare const USERS_SERVICE_NAME = "UsersService";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.6
|
|
5
|
+
// protoc v7.36.2
|
|
6
|
+
// source: users.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.USERS_SERVICE_NAME = exports.USERS_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.UsersServiceControllerMethods = UsersServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "users.v1";
|
|
13
|
+
exports.USERS_V1_PACKAGE_NAME = "users.v1";
|
|
14
|
+
function UsersServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = ["createUser"];
|
|
17
|
+
for (const method of grpcMethods) {
|
|
18
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
+
(0, microservices_1.GrpcMethod)("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
20
|
+
}
|
|
21
|
+
const grpcStreamMethods = [];
|
|
22
|
+
for (const method of grpcStreamMethods) {
|
|
23
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
24
|
+
(0, microservices_1.GrpcStreamMethod)("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.USERS_SERVICE_NAME = "UsersService";
|
package/package.json
CHANGED
|
@@ -1,36 +1,46 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
2
|
+
"name": "@funpay-pilot/contracts",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Protobuf definitions and generated TypeScript types",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc -p tsconfig.build.json",
|
|
9
|
+
"generate": "npx protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"proto",
|
|
14
|
+
"gen"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/src/index.d.ts",
|
|
19
|
+
"default": "./dist/src/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./gen/*": {
|
|
22
|
+
"types": "./dist/gen/*.d.ts",
|
|
23
|
+
"default": "./dist/gen/*.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@nestjs/microservices": "^11.1.17",
|
|
31
|
+
"rxjs": "^7.8.2",
|
|
32
|
+
"ts-proto": "^2.11.6"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@eslint/eslintrc": "^3.3.5",
|
|
36
|
+
"@eslint/js": "^10.0.1",
|
|
37
|
+
"@types/node": "^25.5.0",
|
|
38
|
+
"eslint": "^10.2.1",
|
|
39
|
+
"eslint-config-prettier": "^10.1.8",
|
|
40
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
41
|
+
"globals": "^17.5.0",
|
|
42
|
+
"prettier": "^3.8.3",
|
|
43
|
+
"typescript": "^6.0.2",
|
|
44
|
+
"typescript-eslint": "^8.59.0"
|
|
45
|
+
}
|
|
36
46
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|