@in-human-resources/backend-proto 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # `@in-human-resources/backend-proto`
2
+
3
+ Published npm package: **Protobuf-ES** message types and **Connect-ES** service stubs for `api.v1`, `auth.v1`, and `common.v1`.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @in-human-resources/backend-proto
9
+ ```
10
+
11
+ Peer dependencies (install in your app):
12
+
13
+ ```bash
14
+ npm install @bufbuild/protobuf @connectrpc/connect
15
+ ```
16
+
17
+ For browsers you may also use `@connectrpc/connect-web`.
18
+
19
+ ## Usage
20
+
21
+ Import Connect service definitions and create a client (example: gateway `api.v1`):
22
+
23
+ ```typescript
24
+ import { createClient } from '@connectrpc/connect';
25
+ import { createGrpcTransport } from '@connectrpc/connect-node';
26
+ import { AuthService } from '@in-human-resources/backend-proto/gen/ts/api/v1/auth_connect.js';
27
+
28
+ const transport = createGrpcTransport({ baseUrl: 'http://localhost:8082', httpVersion: '2' });
29
+ export const authClient = createClient(AuthService, transport);
30
+ ```
31
+
32
+ Use the same pattern for `company_connect.js`, `candidate_connect.js`, or internal `auth/v1/service_connect.js` as needed.
33
+
34
+ ## Regenerate (maintainers)
35
+
36
+ From this directory:
37
+
38
+ ```bash
39
+ npm install
40
+ npx buf generate
41
+ ```
42
+
43
+ This refreshes **Go** output under `gen/` and **TypeScript** under `gen/ts/`. Commit both when APIs change.
44
+
45
+ ## Publish
46
+
47
+ 1. Bump `"version"` in `package.json`.
48
+ 2. `npm login` (npmjs.com account with permission to publish the `@in-human-resources` scope).
49
+ 3. **npm requires 2FA to publish** (or a [granular access token](https://docs.npmjs.com/about-access-tokens) with publish rights). Enable 2FA on [npm account settings](https://www.npmjs.com/settings/~/auth) (Authorization and publishing), or create a token with “Bypass two-factor authentication” if your org allows it.
50
+ 4. From `proto/`:
51
+
52
+ ```bash
53
+ npm publish
54
+ ```
55
+
56
+ `publishConfig.access` is set to `public` in `package.json` for this scoped package.
57
+
58
+ ## Layout
59
+
60
+ | Path | Contents |
61
+ |------------|-----------------------------------------------|
62
+ | `gen/` | Go protobuf + gRPC (`paths=source_relative`) |
63
+ | `gen/ts/` | `*_pb.ts` (messages) and `*_connect.ts` (Connect services) |
package/buf.gen.yaml ADDED
@@ -0,0 +1,17 @@
1
+ version: v2
2
+ plugins:
3
+ - remote: buf.build/protocolbuffers/go
4
+ out: gen
5
+ opt: paths=source_relative
6
+ - remote: buf.build/grpc/go
7
+ out: gen
8
+ opt: paths=source_relative
9
+ # TypeScript: Protobuf-ES messages, then Connect-ES service stubs (order matters).
10
+ - local: protoc-gen-es
11
+ out: gen/ts
12
+ opt:
13
+ - target=ts
14
+ - import_extension=.js
15
+ - local: protoc-gen-connect-es
16
+ out: gen/ts
17
+ opt: target=ts
package/buf.yaml ADDED
@@ -0,0 +1,10 @@
1
+ version: v2
2
+ modules:
3
+ - path: .
4
+ name: buf.build/InHuman-Resources/backend
5
+ lint:
6
+ use:
7
+ - STANDARD
8
+ breaking:
9
+ use:
10
+ - FILE
@@ -0,0 +1,195 @@
1
+ // @generated by protoc-gen-connect-es v1.7.0 with parameter "target=ts"
2
+ // @generated from file api/v1/auth.proto (package api.v1, syntax proto3)
3
+ /* eslint-disable */
4
+ // @ts-nocheck
5
+
6
+ import { ChangePasswordRequest, GetProfileRequest, GetProfileResponse, LinkOAuthAccountRequest, ListSessionsRequest, ListSessionsResponse, LoginRequest, LoginResponse, LogoutRequest, OAuthCallbackRequest, OAuthCallbackResponse, OAuthLoginRequest, OAuthLoginResponse, RefreshTokenRequest, RefreshTokenResponse, RegisterRequest, RegisterResponse, RequestPasswordResetRequest, ResendVerificationEmailRequest, ResetPasswordRequest, RevokeAllSessionsRequest, RevokeSessionRequest, UnlinkOAuthAccountRequest, UpdateProfileRequest, VerifyEmailRequest } from "./auth_pb.js";
7
+ import { MethodKind } from "@bufbuild/protobuf";
8
+ import { Empty } from "./common_pb.js";
9
+
10
+ /**
11
+ * AuthService is the client-facing authentication service.
12
+ * Mobile and web clients call these RPCs directly.
13
+ *
14
+ * @generated from service api.v1.AuthService
15
+ */
16
+ export const AuthService = {
17
+ typeName: "api.v1.AuthService",
18
+ methods: {
19
+ /**
20
+ * Core authentication
21
+ *
22
+ * @generated from rpc api.v1.AuthService.Register
23
+ */
24
+ register: {
25
+ name: "Register",
26
+ I: RegisterRequest,
27
+ O: RegisterResponse,
28
+ kind: MethodKind.Unary,
29
+ },
30
+ /**
31
+ * @generated from rpc api.v1.AuthService.Login
32
+ */
33
+ login: {
34
+ name: "Login",
35
+ I: LoginRequest,
36
+ O: LoginResponse,
37
+ kind: MethodKind.Unary,
38
+ },
39
+ /**
40
+ * @generated from rpc api.v1.AuthService.RefreshToken
41
+ */
42
+ refreshToken: {
43
+ name: "RefreshToken",
44
+ I: RefreshTokenRequest,
45
+ O: RefreshTokenResponse,
46
+ kind: MethodKind.Unary,
47
+ },
48
+ /**
49
+ * @generated from rpc api.v1.AuthService.Logout
50
+ */
51
+ logout: {
52
+ name: "Logout",
53
+ I: LogoutRequest,
54
+ O: Empty,
55
+ kind: MethodKind.Unary,
56
+ },
57
+ /**
58
+ * Email verification
59
+ *
60
+ * @generated from rpc api.v1.AuthService.VerifyEmail
61
+ */
62
+ verifyEmail: {
63
+ name: "VerifyEmail",
64
+ I: VerifyEmailRequest,
65
+ O: Empty,
66
+ kind: MethodKind.Unary,
67
+ },
68
+ /**
69
+ * @generated from rpc api.v1.AuthService.ResendVerificationEmail
70
+ */
71
+ resendVerificationEmail: {
72
+ name: "ResendVerificationEmail",
73
+ I: ResendVerificationEmailRequest,
74
+ O: Empty,
75
+ kind: MethodKind.Unary,
76
+ },
77
+ /**
78
+ * Password management
79
+ *
80
+ * @generated from rpc api.v1.AuthService.RequestPasswordReset
81
+ */
82
+ requestPasswordReset: {
83
+ name: "RequestPasswordReset",
84
+ I: RequestPasswordResetRequest,
85
+ O: Empty,
86
+ kind: MethodKind.Unary,
87
+ },
88
+ /**
89
+ * @generated from rpc api.v1.AuthService.ResetPassword
90
+ */
91
+ resetPassword: {
92
+ name: "ResetPassword",
93
+ I: ResetPasswordRequest,
94
+ O: Empty,
95
+ kind: MethodKind.Unary,
96
+ },
97
+ /**
98
+ * @generated from rpc api.v1.AuthService.ChangePassword
99
+ */
100
+ changePassword: {
101
+ name: "ChangePassword",
102
+ I: ChangePasswordRequest,
103
+ O: Empty,
104
+ kind: MethodKind.Unary,
105
+ },
106
+ /**
107
+ * Profile
108
+ *
109
+ * @generated from rpc api.v1.AuthService.GetProfile
110
+ */
111
+ getProfile: {
112
+ name: "GetProfile",
113
+ I: GetProfileRequest,
114
+ O: GetProfileResponse,
115
+ kind: MethodKind.Unary,
116
+ },
117
+ /**
118
+ * @generated from rpc api.v1.AuthService.UpdateProfile
119
+ */
120
+ updateProfile: {
121
+ name: "UpdateProfile",
122
+ I: UpdateProfileRequest,
123
+ O: Empty,
124
+ kind: MethodKind.Unary,
125
+ },
126
+ /**
127
+ * Sessions
128
+ *
129
+ * @generated from rpc api.v1.AuthService.ListSessions
130
+ */
131
+ listSessions: {
132
+ name: "ListSessions",
133
+ I: ListSessionsRequest,
134
+ O: ListSessionsResponse,
135
+ kind: MethodKind.Unary,
136
+ },
137
+ /**
138
+ * @generated from rpc api.v1.AuthService.RevokeSession
139
+ */
140
+ revokeSession: {
141
+ name: "RevokeSession",
142
+ I: RevokeSessionRequest,
143
+ O: Empty,
144
+ kind: MethodKind.Unary,
145
+ },
146
+ /**
147
+ * @generated from rpc api.v1.AuthService.RevokeAllSessions
148
+ */
149
+ revokeAllSessions: {
150
+ name: "RevokeAllSessions",
151
+ I: RevokeAllSessionsRequest,
152
+ O: Empty,
153
+ kind: MethodKind.Unary,
154
+ },
155
+ /**
156
+ * OAuth
157
+ *
158
+ * @generated from rpc api.v1.AuthService.OAuthLogin
159
+ */
160
+ oAuthLogin: {
161
+ name: "OAuthLogin",
162
+ I: OAuthLoginRequest,
163
+ O: OAuthLoginResponse,
164
+ kind: MethodKind.Unary,
165
+ },
166
+ /**
167
+ * @generated from rpc api.v1.AuthService.OAuthCallback
168
+ */
169
+ oAuthCallback: {
170
+ name: "OAuthCallback",
171
+ I: OAuthCallbackRequest,
172
+ O: OAuthCallbackResponse,
173
+ kind: MethodKind.Unary,
174
+ },
175
+ /**
176
+ * @generated from rpc api.v1.AuthService.LinkOAuthAccount
177
+ */
178
+ linkOAuthAccount: {
179
+ name: "LinkOAuthAccount",
180
+ I: LinkOAuthAccountRequest,
181
+ O: Empty,
182
+ kind: MethodKind.Unary,
183
+ },
184
+ /**
185
+ * @generated from rpc api.v1.AuthService.UnlinkOAuthAccount
186
+ */
187
+ unlinkOAuthAccount: {
188
+ name: "UnlinkOAuthAccount",
189
+ I: UnlinkOAuthAccountRequest,
190
+ O: Empty,
191
+ kind: MethodKind.Unary,
192
+ },
193
+ }
194
+ } as const;
195
+