Compare commits

...

10 Commits

Author SHA1 Message Date
Дмитрий
f5d18a63e5 first commit
All checks were successful
Publish / Publish Job (push) Successful in 1m14s
2026-03-26 15:45:17 +03:00
Дмитрий
0c494faa6b fix: fix path name proto file 2026-03-25 16:31:12 +03:00
Дмитрий
54bff3da7d fix: rename path 2026-03-25 16:30:29 +03:00
Дмитрий
7cbe61f226 fix: add dist to files 2026-03-25 16:22:15 +03:00
Дмитрий
287cd340de feat: add PROTO_PATHS 2026-03-25 16:06:35 +03:00
Дмитрий
d4196e16f9 fix: npm install deps frozen lockfile 2026-03-25 13:58:47 +03:00
Дмитрий
4a1eb650f4 fix: npm install deps frozen lockfile 2026-03-25 13:56:54 +03:00
Дмитрий
e55fd159cb fix: totp and telegram codes is optional 2026-03-25 12:17:56 +03:00
Дмитрий
1eb1d4b946 fix: remove reserve codes from request 2026-03-25 12:09:51 +03:00
Дмитрий
c956cd29f0 fix: rename twofaservice 2026-03-25 11:33:30 +03:00
9 changed files with 83 additions and 8 deletions

View File

@@ -17,13 +17,17 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: 20
registry-url: "https://registry.npmjs.org/" registry-url: "https://git.lendry.ru/api/packages/lendry-erp/npm/"
scope: "@lendry-erp"
- name: Install protoc - name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Install deps - name: Install deps
run: npm install run: npm ci
- name: Build
run: npm run build
- name: Generate TS Protobuf - name: Generate TS Protobuf
run: npm run generate run: npm run generate

39
package-lock.json generated
View File

@@ -1,16 +1,20 @@
{ {
"name": "@lendry-erp/contracts", "name": "@lendry-erp/contracts",
"version": "1.0.0", "version": "1.0.6",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lendry-erp/contracts", "name": "@lendry-erp/contracts",
"version": "1.0.0", "version": "1.0.6",
"dependencies": { "dependencies": {
"@nestjs/microservices": "^11.1.17", "@nestjs/microservices": "^11.1.17",
"rxjs": "^7.8.2", "rxjs": "^7.8.2",
"ts-proto": "^2.11.6" "ts-proto": "^2.11.6"
},
"devDependencies": {
"@types/node": "^25.5.0",
"typescript": "^6.0.2"
} }
}, },
"node_modules/@borewit/text-codec": { "node_modules/@borewit/text-codec": {
@@ -214,6 +218,16 @@
"license": "MIT", "license": "MIT",
"peer": true "peer": true
}, },
"node_modules/@types/node": {
"version": "25.5.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.5.0.tgz",
"integrity": "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~7.18.0"
}
},
"node_modules/case-anything": { "node_modules/case-anything": {
"version": "2.1.13", "version": "2.1.13",
"resolved": "https://registry.npmjs.org/case-anything/-/case-anything-2.1.13.tgz", "resolved": "https://registry.npmjs.org/case-anything/-/case-anything-2.1.13.tgz",
@@ -460,6 +474,20 @@
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
"license": "0BSD" "license": "0BSD"
}, },
"node_modules/typescript": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.2.tgz",
"integrity": "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"node_modules/uid": { "node_modules/uid": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz",
@@ -485,6 +513,13 @@
"funding": { "funding": {
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
},
"node_modules/undici-types": {
"version": "7.18.2",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz",
"integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==",
"dev": true,
"license": "MIT"
} }
} }
} }

View File

@@ -1,12 +1,16 @@
{ {
"name": "@lendry-erp/contracts", "name": "@lendry-erp/contracts",
"version": "1.0.2", "version": "1.0.0",
"description": "Protobuf definitions and generated TypeScript types", "description": "Protobuf definitions and generated TypeScript types",
"type": "commonjs", "type": "commonjs",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": { "scripts": {
"build": "tsc -p tsconfig.build.json",
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit" "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
}, },
"files": [ "files": [
"dist",
"proto", "proto",
"gen" "gen"
], ],
@@ -17,5 +21,9 @@
"@nestjs/microservices": "^11.1.17", "@nestjs/microservices": "^11.1.17",
"rxjs": "^7.8.2", "rxjs": "^7.8.2",
"ts-proto": "^2.11.6" "ts-proto": "^2.11.6"
},
"devDependencies": {
"@types/node": "^25.5.0",
"typescript": "^6.0.2"
} }
} }

View File

@@ -50,9 +50,8 @@ message RegisterResponse {
message Verify2FaRequest { message Verify2FaRequest {
string temp_token = 1; string temp_token = 1;
string totp_code = 2; optional string totp_code = 2;
string telegram_code = 3; optional string telegram_code = 3;
string reserve_code = 4;
} }
message Verify2FaResponse { message Verify2FaResponse {

1
src/index.ts Normal file
View File

@@ -0,0 +1 @@
export * from "./proto";

1
src/proto/index.ts Normal file
View File

@@ -0,0 +1 @@
export * from "./paths";

5
src/proto/paths.ts Normal file
View File

@@ -0,0 +1,5 @@
import { join } from "path";
export const PROTO_PATHS = {
AUTH: join(__dirname, "../../proto/identity.proto"),
} as const;

11
tsconfig.build.json Normal file
View File

@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"outDir": "./dist",
"rootDir": "./src",
"types": ["node"]
},
"include": ["src/**/*"],
"exclude": ["node_module", "dist", "test"]
}

11
tsconfig.json Normal file
View File

@@ -0,0 +1,11 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2024",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"strictNullChecks": false
}
}