@cloudquery/plugin-pb-javascript
Advanced tools
Comparing version 0.0.1 to 0.0.5
@@ -1,2 +0,3 @@ | ||
import grpc = require("@grpc/grpc-js"); | ||
export declare const getServer: () => grpc.Server; | ||
import pluginV3 = require("./protos/plugin/v3/plugin"); | ||
import discovery1 = require("./protos/discovery/v1/discovery"); | ||
export { pluginV3, discovery1 }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getServer = void 0; | ||
const plugin_pb_js_1 = require("@cloudquery/plugin-pb-js"); | ||
const plugin_pb_js_2 = require("@cloudquery/plugin-pb-js"); | ||
const grpc = require("@grpc/grpc-js"); | ||
class DiscoveryServer extends plugin_pb_js_1.discovery1.cloudquery.discovery.v1 | ||
.UnimplementedDiscoveryService { | ||
GetVersions(call, callback) { | ||
throw new Error("Method not implemented."); | ||
} | ||
} | ||
class PluginServer extends plugin_pb_js_2.pluginV3.cloudquery.plugin.v3 | ||
.UnimplementedPluginService { | ||
GetName(call, callback) { | ||
throw new Error("Method not implemented."); | ||
} | ||
GetVersion(call, callback) { | ||
throw new Error("Method not implemented."); | ||
} | ||
Init(call, callback) { | ||
throw new Error("Method not implemented."); | ||
} | ||
GetTables(call, callback) { | ||
throw new Error("Method not implemented."); | ||
} | ||
Sync(call) { | ||
throw new Error("Method not implemented."); | ||
} | ||
Read(call) { | ||
throw new Error("Method not implemented."); | ||
} | ||
Write(call, callback) { | ||
throw new Error("Method not implemented."); | ||
} | ||
Close(call, callback) { | ||
throw new Error("Method not implemented."); | ||
} | ||
} | ||
const getServer = () => { | ||
const server = new grpc.Server(); | ||
server.addService(plugin_pb_js_2.pluginV3.cloudquery.plugin.v3.UnimplementedPluginService.definition, new PluginServer()); | ||
server.addService(plugin_pb_js_1.discovery1.cloudquery.discovery.v1.UnimplementedDiscoveryService.definition, new DiscoveryServer()); | ||
return server; | ||
}; | ||
exports.getServer = getServer; | ||
const main = () => { | ||
const server = (0, exports.getServer)(); | ||
server.bindAsync(`0.0.0.0:9999`, grpc.ServerCredentials.createInsecure(), (err, port) => { | ||
server.start(); | ||
console.log("server running on port", port); | ||
}); | ||
}; | ||
main(); | ||
exports.discovery1 = exports.pluginV3 = void 0; | ||
const pluginV3 = require("./protos/plugin/v3/plugin"); | ||
exports.pluginV3 = pluginV3; | ||
const discovery1 = require("./protos/discovery/v1/discovery"); | ||
exports.discovery1 = discovery1; |
{ | ||
"name": "@cloudquery/plugin-pb-javascript", | ||
"version": "0.0.1", | ||
"version": "0.0.5", | ||
"files": [ | ||
"dist", | ||
"!dist/**/*.test.*", | ||
"!dist/tsconfig.tsbuildinfo" | ||
"dist" | ||
], | ||
"scripts": { | ||
"dev": "ts-node src/index.ts", | ||
"proto-clone": "git clone https://github.com/cloudquery/plugin-pb", | ||
"proto-prepare": "cd plugin-pb && git pull && cd .. && rm -rf ./protos && mkdir -p ./protos/plugin/v3 && mkdir -p ./protos/discovery/v1 && cp -r ./plugin-pb/plugin/v3/* ./protos/plugin/v3 && cp -r ./plugin-pb/discovery/v1/* ./protos/discovery/v1", | ||
"proto-gen": "grpc_tools_node_protoc --ts_out=grpc_ts:. ./protos/plugin/v3/*.proto ./protos/discovery/v1/*.proto", | ||
"proto-all": "npm run proto-prepare && npm run proto-gen", | ||
"build": "rm -rf dist && tsc", | ||
"test": "ava" | ||
"all": "npm run proto-all && npm run build" | ||
}, | ||
"description": "This is the high-level package to use for developing CloudQuery plugins in JavaScript", | ||
"description": "This is a low-level auto-generated gRPC client and server for CloudQuery plugins", | ||
"keywords": [ | ||
@@ -37,8 +38,7 @@ "nodejs", | ||
"devDependencies": { | ||
"@ava/typescript": "^4.1.0", | ||
"@cloudquery/plugin-pb-js": "^0.0.4", | ||
"@grpc/grpc-js": "^1.9.0", | ||
"@tsconfig/node16": "^16.1.0", | ||
"ava": "^5.3.1", | ||
"ts-node": "^10.9.1", | ||
"@types/google-protobuf": "^3.15.6", | ||
"grpc-tools": "^1.12.4", | ||
"protoc-gen-ts": "^0.8.6", | ||
"typescript": "^4.9.5" | ||
@@ -49,11 +49,6 @@ }, | ||
}, | ||
"main": "index.js", | ||
"ava": { | ||
"typescript": { | ||
"rewritePaths": { | ||
"src/": "dist/" | ||
}, | ||
"compile": "tsc" | ||
} | ||
"main": "dist/index.js", | ||
"dependencies": { | ||
"google-protobuf": "^3.21.2" | ||
} | ||
} |
@@ -1,11 +0,11 @@ | ||
# CloudQuery Plugin SDK for JavaScript | ||
# plugin-pb-javascript | ||
This is the high-level package to use for developing CloudQuery plugins in JavaScript. | ||
This is a low-level auto-generated gRPC client and server for CloudQuery plugin from [plugin-pb protos](https://github.com/cloudquery/plugin-pb). | ||
## Prerequisites | ||
## Development | ||
### Prerequisites | ||
Node.js 16 or higher. Install Node.js from [here](https://nodejs.org/en/download/). | ||
## Setup | ||
### Install dependencies | ||
@@ -17,18 +17,7 @@ | ||
### Run in Development mode | ||
### Generate gRPC client and server | ||
```bash | ||
npm run dev | ||
``` | ||
### Build | ||
```bash | ||
npm run proto-clone # Only needed once | ||
npm run build | ||
``` | ||
### Test | ||
```bash | ||
npm test | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
171655
6
11
3213
1
23
1
+ Addedgoogle-protobuf@^3.21.2
+ Addedgoogle-protobuf@3.21.4(transitive)