@babacarthiamdev/contracts 1.0.18 → 1.0.19

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/gen/users.ts CHANGED
@@ -27,6 +27,15 @@ export interface CreateUserResponse {
27
27
  ok: boolean;
28
28
  }
29
29
 
30
+ export interface PatchUserRequest {
31
+ userId: string;
32
+ name?: string | undefined;
33
+ }
34
+
35
+ export interface PatchUserResponse {
36
+ ok: boolean;
37
+ }
38
+
30
39
  export interface User {
31
40
  id: string;
32
41
  name?: string | undefined;
@@ -185,6 +194,91 @@ export const CreateUserResponse: MessageFns<CreateUserResponse> = {
185
194
  },
186
195
  };
187
196
 
197
+ function createBasePatchUserRequest(): PatchUserRequest {
198
+ return { userId: "" };
199
+ }
200
+
201
+ export const PatchUserRequest: MessageFns<PatchUserRequest> = {
202
+ encode(message: PatchUserRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
203
+ if (message.userId !== "") {
204
+ writer.uint32(10).string(message.userId);
205
+ }
206
+ if (message.name !== undefined) {
207
+ writer.uint32(18).string(message.name);
208
+ }
209
+ return writer;
210
+ },
211
+
212
+ decode(input: BinaryReader | Uint8Array, length?: number): PatchUserRequest {
213
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
214
+ const end = length === undefined ? reader.len : reader.pos + length;
215
+ const message = createBasePatchUserRequest();
216
+ while (reader.pos < end) {
217
+ const tag = reader.uint32();
218
+ switch (tag >>> 3) {
219
+ case 1: {
220
+ if (tag !== 10) {
221
+ break;
222
+ }
223
+
224
+ message.userId = reader.string();
225
+ continue;
226
+ }
227
+ case 2: {
228
+ if (tag !== 18) {
229
+ break;
230
+ }
231
+
232
+ message.name = reader.string();
233
+ continue;
234
+ }
235
+ }
236
+ if ((tag & 7) === 4 || tag === 0) {
237
+ break;
238
+ }
239
+ reader.skip(tag & 7);
240
+ }
241
+ return message;
242
+ },
243
+ };
244
+
245
+ function createBasePatchUserResponse(): PatchUserResponse {
246
+ return { ok: false };
247
+ }
248
+
249
+ export const PatchUserResponse: MessageFns<PatchUserResponse> = {
250
+ encode(message: PatchUserResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
251
+ if (message.ok !== false) {
252
+ writer.uint32(8).bool(message.ok);
253
+ }
254
+ return writer;
255
+ },
256
+
257
+ decode(input: BinaryReader | Uint8Array, length?: number): PatchUserResponse {
258
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
259
+ const end = length === undefined ? reader.len : reader.pos + length;
260
+ const message = createBasePatchUserResponse();
261
+ while (reader.pos < end) {
262
+ const tag = reader.uint32();
263
+ switch (tag >>> 3) {
264
+ case 1: {
265
+ if (tag !== 8) {
266
+ break;
267
+ }
268
+
269
+ message.ok = reader.bool();
270
+ continue;
271
+ }
272
+ }
273
+ if ((tag & 7) === 4 || tag === 0) {
274
+ break;
275
+ }
276
+ reader.skip(tag & 7);
277
+ }
278
+ return message;
279
+ },
280
+ };
281
+
188
282
  function createBaseUser(): User {
189
283
  return { id: "" };
190
284
  }
@@ -270,6 +364,8 @@ export interface UsersServiceClient {
270
364
  getMe(request: GetMeRequest): Observable<GetMeResponse>;
271
365
 
272
366
  createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
367
+
368
+ patchUser(request: PatchUserRequest): Observable<PatchUserResponse>;
273
369
  }
274
370
 
275
371
  export interface UsersServiceController {
@@ -278,11 +374,13 @@ export interface UsersServiceController {
278
374
  createUser(
279
375
  request: CreateUserRequest,
280
376
  ): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
377
+
378
+ patchUser(request: PatchUserRequest): Promise<PatchUserResponse> | Observable<PatchUserResponse> | PatchUserResponse;
281
379
  }
282
380
 
283
381
  export function UsersServiceControllerMethods() {
284
382
  return function (constructor: Function) {
285
- const grpcMethods: string[] = ["getMe", "createUser"];
383
+ const grpcMethods: string[] = ["getMe", "createUser", "patchUser"];
286
384
  for (const method of grpcMethods) {
287
385
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
288
386
  GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babacarthiamdev/contracts",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "type": "./dist/index.d.ts",
package/proto/users.proto CHANGED
@@ -4,7 +4,9 @@ package users.v1;
4
4
 
5
5
  service UsersService {
6
6
  rpc GetMe (GetMeRequest) returns (GetMeResponse);
7
+
7
8
  rpc CreateUser (CreateUserRequest) returns (CreateUserResponse);
9
+ rpc PatchUser (PatchUserRequest) returns (PatchUserResponse);
8
10
  }
9
11
 
10
12
  message GetMeRequest {
@@ -23,6 +25,16 @@ message CreateUserResponse {
23
25
  bool ok = 1;
24
26
  }
25
27
 
28
+ message PatchUserRequest {
29
+ string user_id = 1;
30
+
31
+ optional string name = 2;
32
+ }
33
+
34
+ message PatchUserResponse {
35
+ bool ok = 1;
36
+ }
37
+
26
38
  message User {
27
39
  string id = 1;
28
40
  optional string name = 2;