Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Wetiontop 2021-12-26 18:09:31 +08:00
commit 6517259363
14 changed files with 87 additions and 74 deletions

View File

@ -4,11 +4,12 @@
"main": "index.js", "main": "index.js",
"private": true, "private": true,
"scripts": { "scripts": {
"proto": "tsrpc proto --config tsrpc.config.ts", "proto": "tsrpc proto",
"sync": "tsrpc sync --config tsrpc.config.ts", "sync": "tsrpc sync",
"api": "tsrpc api --config tsrpc.config.ts", "api": "tsrpc api",
"dev": "tsrpc dev --config tsrpc.config.ts", "doc": "tsrpc doc",
"build": "tsrpc build --config tsrpc.config.ts" "dev": "tsrpc dev",
"build": "tsrpc build"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^15.14.9", "@types/node": "^15.14.9",
@ -20,4 +21,4 @@
"dependencies": { "dependencies": {
"tsrpc": "^3.0.9" "tsrpc": "^3.0.9"
} }
} }

View File

@ -4,11 +4,12 @@
"main": "index.js", "main": "index.js",
"private": true, "private": true,
"scripts": { "scripts": {
"proto": "tsrpc proto --config tsrpc.config.ts", "proto": "tsrpc proto",
"sync": "tsrpc sync --config tsrpc.config.ts", "sync": "tsrpc sync",
"api": "tsrpc api --config tsrpc.config.ts", "api": "tsrpc api",
"dev": "tsrpc dev --config tsrpc.config.ts", "doc": "tsrpc doc",
"build": "tsrpc build --config tsrpc.config.ts" "dev": "tsrpc dev",
"build": "tsrpc build"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^15.14.9", "@types/node": "^15.14.9",
@ -20,4 +21,4 @@
"dependencies": { "dependencies": {
"tsrpc": "^3.0.9" "tsrpc": "^3.0.9"
} }
} }

View File

@ -4,11 +4,12 @@
"main": "index.js", "main": "index.js",
"private": true, "private": true,
"scripts": { "scripts": {
"proto": "tsrpc proto --config tsrpc.config.ts", "proto": "tsrpc proto",
"sync": "tsrpc sync --config tsrpc.config.ts", "sync": "tsrpc sync",
"api": "tsrpc api --config tsrpc.config.ts", "api": "tsrpc api",
"dev": "tsrpc dev --config tsrpc.config.ts", "doc": "tsrpc doc",
"build": "tsrpc build --config tsrpc.config.ts" "dev": "tsrpc dev",
"build": "tsrpc build"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^15.14.9", "@types/node": "^15.14.9",
@ -20,4 +21,4 @@
"dependencies": { "dependencies": {
"tsrpc": "^3.1.2" "tsrpc": "^3.1.2"
} }
} }

View File

@ -4,11 +4,12 @@
"main": "index.js", "main": "index.js",
"private": true, "private": true,
"scripts": { "scripts": {
"proto": "tsrpc proto --config tsrpc.config.ts", "proto": "tsrpc proto",
"sync": "tsrpc sync --config tsrpc.config.ts", "sync": "tsrpc sync",
"api": "tsrpc api --config tsrpc.config.ts", "api": "tsrpc api",
"dev": "tsrpc dev --config tsrpc.config.ts", "doc": "tsrpc doc",
"build": "tsrpc build --config tsrpc.config.ts" "dev": "tsrpc dev",
"build": "tsrpc build"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^15.14.9", "@types/node": "^15.14.9",
@ -20,4 +21,4 @@
"dependencies": { "dependencies": {
"tsrpc": "^3.1.2" "tsrpc": "^3.1.2"
} }
} }

View File

@ -4,12 +4,13 @@
"main": "index.js", "main": "index.js",
"private": true, "private": true,
"scripts": { "scripts": {
"proto": "tsrpc proto --config tsrpc.config.ts", "proto": "tsrpc proto",
"sync": "tsrpc sync --config tsrpc.config.ts", "sync": "tsrpc sync",
"api": "tsrpc api --config tsrpc.config.ts", "api": "tsrpc api",
"dev": "tsrpc dev --config tsrpc.config.ts", "doc": "tsrpc doc",
"dev": "tsrpc dev",
"test": "mocha test/**/*.test.ts", "test": "mocha test/**/*.test.ts",
"build": "tsrpc build --config tsrpc.config.ts" "build": "tsrpc build"
}, },
"devDependencies": { "devDependencies": {
"@types/mocha": "^8.2.3", "@types/mocha": "^8.2.3",
@ -23,4 +24,4 @@
"dependencies": { "dependencies": {
"tsrpc": "^3.0.9" "tsrpc": "^3.0.9"
} }
} }

View File

@ -4,11 +4,12 @@
"main": "index.js", "main": "index.js",
"private": true, "private": true,
"scripts": { "scripts": {
"proto": "tsrpc proto --config tsrpc.config.ts", "proto": "tsrpc proto",
"sync": "tsrpc sync --config tsrpc.config.ts", "sync": "tsrpc sync",
"api": "tsrpc api --config tsrpc.config.ts", "api": "tsrpc api",
"dev": "tsrpc dev --config tsrpc.config.ts", "doc": "tsrpc doc",
"build": "tsrpc build --config tsrpc.config.ts" "dev": "tsrpc dev",
"build": "tsrpc build"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^15.14.9", "@types/node": "^15.14.9",
@ -20,4 +21,4 @@
"dependencies": { "dependencies": {
"tsrpc": "^3.0.9" "tsrpc": "^3.0.9"
} }
} }

View File

@ -4,11 +4,12 @@
"main": "index.js", "main": "index.js",
"private": true, "private": true,
"scripts": { "scripts": {
"proto": "tsrpc proto --config tsrpc.config.ts", "proto": "tsrpc proto",
"sync": "tsrpc sync --config tsrpc.config.ts", "sync": "tsrpc sync",
"api": "tsrpc api --config tsrpc.config.ts", "api": "tsrpc api",
"dev": "tsrpc dev --config tsrpc.config.ts", "doc": "tsrpc doc",
"build": "tsrpc build --config tsrpc.config.ts" "dev": "tsrpc dev",
"build": "tsrpc build"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^15.14.9", "@types/node": "^15.14.9",
@ -20,4 +21,4 @@
"dependencies": { "dependencies": {
"tsrpc": "^3.0.9" "tsrpc": "^3.0.9"
} }
} }

View File

@ -5,7 +5,7 @@ import { serviceProto } from "./shared/protocols/serviceProto";
// Create the Server // Create the Server
const server = new HttpServer(serviceProto, { const server = new HttpServer(serviceProto, {
port: 3000, port: 3000,
cors: '*' json: true
}); });
// Entry function // Entry function

View File

@ -4,7 +4,8 @@ import { serviceProto } from './shared/protocols/serviceProto';
// Create the Client // Create the Client
let client = new HttpClient(serviceProto, { let client = new HttpClient(serviceProto, {
server: 'http://127.0.0.1:3000', server: 'http://127.0.0.1:3000',
logger: console json: true,
// logger: console
}); });
async function test() { async function test() {

View File

@ -4,11 +4,12 @@
"main": "index.js", "main": "index.js",
"private": true, "private": true,
"scripts": { "scripts": {
"proto": "tsrpc proto --config tsrpc.config.ts", "proto": "tsrpc proto",
"sync": "tsrpc sync --config tsrpc.config.ts", "sync": "tsrpc sync",
"api": "tsrpc api --config tsrpc.config.ts", "api": "tsrpc api",
"dev": "tsrpc dev --config tsrpc.config.ts", "doc": "tsrpc doc",
"build": "tsrpc build --config tsrpc.config.ts" "dev": "tsrpc dev",
"build": "tsrpc build"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^15.14.9", "@types/node": "^15.14.9",
@ -20,4 +21,4 @@
"dependencies": { "dependencies": {
"tsrpc": "^3.0.9" "tsrpc": "^3.0.9"
} }
} }

View File

@ -4,11 +4,12 @@
"main": "index.js", "main": "index.js",
"private": true, "private": true,
"scripts": { "scripts": {
"proto": "tsrpc proto --config tsrpc.config.ts", "proto": "tsrpc proto",
"sync": "tsrpc sync --config tsrpc.config.ts", "sync": "tsrpc sync",
"api": "tsrpc api --config tsrpc.config.ts", "api": "tsrpc api",
"dev": "tsrpc dev --config tsrpc.config.ts", "doc": "tsrpc doc",
"build": "tsrpc build --config tsrpc.config.ts" "dev": "tsrpc dev",
"build": "tsrpc build"
}, },
"devDependencies": { "devDependencies": {
"@types/mocha": "^8.2.3", "@types/mocha": "^8.2.3",
@ -24,4 +25,4 @@
"mongodb": "^3.7.2", "mongodb": "^3.7.2",
"tsrpc": "^3.0.9" "tsrpc": "^3.0.9"
} }
} }

View File

@ -4,11 +4,12 @@
"main": "index.js", "main": "index.js",
"private": true, "private": true,
"scripts": { "scripts": {
"proto": "tsrpc proto --config tsrpc.config.ts", "proto": "tsrpc proto",
"sync": "tsrpc sync --config tsrpc.config.ts", "sync": "tsrpc sync",
"api": "tsrpc api --config tsrpc.config.ts", "api": "tsrpc api",
"dev": "tsrpc dev --config tsrpc.config.ts", "doc": "tsrpc doc",
"build": "tsrpc build --config tsrpc.config.ts" "dev": "tsrpc dev",
"build": "tsrpc build"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^15.14.9", "@types/node": "^15.14.9",
@ -22,4 +23,4 @@
"tsrpc": "^3.0.9", "tsrpc": "^3.0.9",
"uuid": "^8.3.2" "uuid": "^8.3.2"
} }
} }

View File

@ -4,11 +4,12 @@
"main": "index.js", "main": "index.js",
"private": true, "private": true,
"scripts": { "scripts": {
"proto": "tsrpc proto --config tsrpc.config.ts", "proto": "tsrpc proto",
"sync": "tsrpc sync --config tsrpc.config.ts", "sync": "tsrpc sync",
"api": "tsrpc api --config tsrpc.config.ts", "api": "tsrpc api",
"dev": "tsrpc dev --config tsrpc.config.ts", "doc": "tsrpc doc",
"build": "tsrpc build --config tsrpc.config.ts" "dev": "tsrpc dev",
"build": "tsrpc build"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^15.14.9", "@types/node": "^15.14.9",
@ -20,4 +21,4 @@
"dependencies": { "dependencies": {
"tsrpc": "^3.0.9" "tsrpc": "^3.0.9"
} }
} }

View File

@ -4,11 +4,12 @@
"main": "index.js", "main": "index.js",
"private": true, "private": true,
"scripts": { "scripts": {
"proto": "tsrpc proto --config tsrpc.config.ts", "proto": "tsrpc proto",
"sync": "tsrpc sync --config tsrpc.config.ts", "sync": "tsrpc sync",
"api": "tsrpc api --config tsrpc.config.ts", "api": "tsrpc api",
"dev": "tsrpc dev --config tsrpc.config.ts", "doc": "tsrpc doc",
"build": "tsrpc build --config tsrpc.config.ts" "dev": "tsrpc dev",
"build": "tsrpc build"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^15.14.9", "@types/node": "^15.14.9",
@ -22,4 +23,4 @@
"tsrpc": "^3.0.9", "tsrpc": "^3.0.9",
"uuid": "^8.3.2" "uuid": "^8.3.2"
} }
} }