@in-human-resources/backend-proto
v0.1.27
Published
Protobuf-ES and Connect-ES generated clients for api.v1, auth.v1, hiring.v1, workflow.v1, assessment.v1, and common.v1
Readme
@in-human-resources/backend-proto
Published npm package: Protobuf-ES message types and Connect-ES service stubs for api.v1, auth.v1, and common.v1.
Install
npm install @in-human-resources/backend-proto@^0.1.9The package ships compiled ESM under gen/ts/dist/ (run npm run build in this folder before publish or when using file: link).
Monorepo / local dev:
"@in-human-resources/backend-proto": "file:../Backend/proto"Then from Backend/proto: npm install && npm run build, and reinstall in your app.
Next.js (optional): compiled .js exports usually work without transpilePackages. If you hit resolution issues, add:
transpilePackages: ["@in-human-resources/backend-proto"],Imports (unchanged):
import { AuthService } from "@in-human-resources/backend-proto/gen/ts/api/v1/auth_connect";Peer dependencies (install in your app):
npm install @bufbuild/protobuf @connectrpc/connectFor browsers you may also use @connectrpc/connect-web.
Usage
Import Connect service definitions and create a client (example: gateway api.v1):
import { createClient } from '@connectrpc/connect';
import { createGrpcTransport } from '@connectrpc/connect-node';
import { AuthService } from '@in-human-resources/backend-proto/gen/ts/api/v1/auth_connect';
const transport = createGrpcTransport({ baseUrl: 'http://localhost:8082', httpVersion: '2' });
export const authClient = createClient(AuthService, transport);Use the same pattern for company_connect, candidate_connect, or internal auth/v1/service_connect (extensionless so Next/Turbopack can resolve the published .ts files).
Note: Code is generated with
import_extension=noneso local imports insidegen/tsomit.js. The package only publishes TypeScript undergen/ts(not precompiled.js); a.jssuffix in import specifiers is incorrect for that layout.
Source .proto files (contract reference)
The package ships the original Protobuf schemas next to generated code so you can read RPCs and messages without leaving node_modules:
| Location in the package | Contents |
|-------------------------|----------|
| api/v1/*.proto | Public gateway API (AuthService, CompanyService, CandidateService, HiringService, shared types) |
| auth/v1/service.proto | Internal auth service (auth.v1.AuthService) |
| hiring/v1/service.proto | Private hiring service (hiring.v1.HiringService) |
| common/v1/common.proto | Shared common.v1 messages |
Example path after install:
node_modules/@in-human-resources/backend-proto/api/v1/auth.proto
buf.yaml / buf.gen.yaml are included for Buf-based tooling if you point at this folder as a module.
Regenerate (maintainers)
From the repository root:
(cd proto && npm ci) # first time or after dependency changes
make proto-genThis refreshes Go output under gen/ and TypeScript under gen/ts/. Commit both when APIs change.
Version history
0.1.27
- Regenerated Go and TypeScript clients (
buf generate).
0.1.26
- Additive:
AssessmentAssignmentSummary—company_name,job_title,languages,application_stage(api.v1 + assessment.v1). - Additive:
Job—candidate_has_applied,profile_match_percent(api.v1; gateway-populated). - Additive:
GetJobResponse—candidate_has_applied,profile_match_percent(api.v1; gateway-populated for candidates). - Additive:
Application—next_action_label,next_action_due_at(api.v1; gateway-populated).
0.1.12
- Additive:
CreateJobRequest.team_metadata_json(field 5) onapi.v1andhiring.v1for role team context on create (department, location, employment type, etc. as JSON).
0.1.11
- Prior published baseline (pipeline types, hiring surface).
Publish
Bump
"version"inpackage.json.npm login(npmjs.com account with permission to publish the@in-human-resourcesscope).npm requires 2FA to publish (or a granular access token with publish rights). Enable 2FA on npm account settings (Authorization and publishing), or create a token with “Bypass two-factor authentication” if your org allows it.
From
proto/:npm publishpublishConfig.accessis set topublicinpackage.jsonfor this scoped package.
What ships on npm
| Path | Contents |
|------|----------|
| gen/ts/ | Generated TypeScript (*_pb.ts, *_connect.ts) |
| api/, auth/, hiring/, common/ | Source .proto files (API contract) |
| buf.yaml, buf.gen.yaml | Buf module + codegen config |
Go stubs under gen/*.go are not published (they stay in the git repo for the backend workspace only).
