52 lines
1.6 KiB
Markdown
52 lines
1.6 KiB
Markdown
# Yoresee Doc Node SDK
|
|
|
|
Generated Node.js protobuf bindings for the Yoresee Doc API.
|
|
|
|
The package ships two module formats:
|
|
|
|
- **ESM/Connect** (`esm/`) for browser and `@connectrpc/connect-web` consumers.
|
|
- **CommonJS/gRPC** (`cjs/`) for Node.js `@grpc/grpc-js` consumers.
|
|
|
|
## Install
|
|
|
|
Consume the published Gitea tag as a Git dependency:
|
|
|
|
```json
|
|
"@yoresee-doc/sdk-node": "git+ssh://git@git.yoresee.cc/YoreseeDoc/yoresee_doc_sdk_node.git#v0.1.0"
|
|
```
|
|
|
|
## Usage
|
|
|
|
ESM consumers import from the `esm` subpath:
|
|
|
|
```js
|
|
import { DocumentService } from '@yoresee-doc/sdk-node/esm/yoresee_doc/v1/yoresee_doc_connect.js'
|
|
import { CreateDocumentRequest } from '@yoresee-doc/sdk-node/esm/yoresee_doc/v1/yoresee_doc_pb.js'
|
|
```
|
|
|
|
CommonJS consumers require from the `cjs` subpath:
|
|
|
|
```js
|
|
const { DocumentServiceClient } = require('@yoresee-doc/sdk-node/cjs/yoresee_doc/v1/yoresee_doc_grpc_pb.js')
|
|
const { CreateDocumentRequest } = require('@yoresee-doc/sdk-node/cjs/yoresee_doc/v1/yoresee_doc_pb.js')
|
|
```
|
|
|
|
## Source And Provenance
|
|
|
|
- Source proto: `../yoresee_doc/proto/yoresee_doc/v1/yoresee_doc.proto`
|
|
- Source proto commit: `272c5f79a5c5e21282861f8a557ba30520769681`
|
|
- Gitea tag: `v0.1.0`
|
|
- ESM generation command: `buf generate ../yoresee_doc/proto --template buf.gen.yaml`
|
|
- CJS generation command: `grpc_tools_node_protoc` with `protoc-gen-js` and `protoc-gen-grpc`
|
|
|
|
Generator versions used for this artifact:
|
|
|
|
- `buf 1.72.0`
|
|
- `protoc-gen-es v1.10.1`
|
|
- `protoc-gen-connect-es v1.7.0`
|
|
- `grpc-tools 1.13.1`
|
|
- `protoc-gen-js 3.21.4-4`
|
|
|
|
The generated artifacts are committed to this repository so consumers can
|
|
install the SDK without running protobuf code generation.
|