@i4you/proto-files 1.0.3 → 1.0.4

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/buf.gen.yaml CHANGED
@@ -3,7 +3,7 @@ clean: true
3
3
  plugins:
4
4
  - local: ./node_modules/.bin/protoc-gen-ts_proto
5
5
  out: generated
6
- opt: env=node,useOptionals=messages,outputServices=grpc-js
6
+ opt: env=node,useOptionals=messages,enums=literal,useEnumNames=true,outputServices=grpc-js
7
7
  strategy: all
8
8
  types:
9
9
  - "user.v2"
@@ -21,6 +21,39 @@ import {
21
21
 
22
22
  export const protobufPackage = "user.v2";
23
23
 
24
+ export enum UserStatus {
25
+ active = 0,
26
+ suspended = 1,
27
+ UNRECOGNIZED = -1,
28
+ }
29
+
30
+ export function userStatusFromJSON(object: any): UserStatus {
31
+ switch (object) {
32
+ case 0:
33
+ case "active":
34
+ return UserStatus.active;
35
+ case 1:
36
+ case "suspended":
37
+ return UserStatus.suspended;
38
+ case -1:
39
+ case "UNRECOGNIZED":
40
+ default:
41
+ return UserStatus.UNRECOGNIZED;
42
+ }
43
+ }
44
+
45
+ export function userStatusToJSON(object: UserStatus): string {
46
+ switch (object) {
47
+ case UserStatus.active:
48
+ return "active";
49
+ case UserStatus.suspended:
50
+ return "suspended";
51
+ case UserStatus.UNRECOGNIZED:
52
+ default:
53
+ return "UNRECOGNIZED";
54
+ }
55
+ }
56
+
24
57
  export interface GetUserByIdRequest {
25
58
  id: string;
26
59
  }
@@ -50,7 +83,7 @@ export interface User {
50
83
  preferences?: User_Preferences | undefined;
51
84
  location?: User_Location | undefined;
52
85
  onboardingCompleted: boolean;
53
- status: string;
86
+ status: UserStatus;
54
87
  createdAt: string;
55
88
  updatedAt: string;
56
89
  }
@@ -317,7 +350,7 @@ function createBaseUser(): User {
317
350
  preferences: undefined,
318
351
  location: undefined,
319
352
  onboardingCompleted: false,
320
- status: "",
353
+ status: 0,
321
354
  createdAt: "",
322
355
  updatedAt: "",
323
356
  };
@@ -361,8 +394,8 @@ export const User: MessageFns<User> = {
361
394
  if (message.onboardingCompleted !== false) {
362
395
  writer.uint32(96).bool(message.onboardingCompleted);
363
396
  }
364
- if (message.status !== "") {
365
- writer.uint32(106).string(message.status);
397
+ if (message.status !== 0) {
398
+ writer.uint32(104).int32(message.status);
366
399
  }
367
400
  if (message.createdAt !== "") {
368
401
  writer.uint32(114).string(message.createdAt);
@@ -477,11 +510,11 @@ export const User: MessageFns<User> = {
477
510
  continue;
478
511
  }
479
512
  case 13: {
480
- if (tag !== 106) {
513
+ if (tag !== 104) {
481
514
  break;
482
515
  }
483
516
 
484
- message.status = reader.string();
517
+ message.status = reader.int32() as any;
485
518
  continue;
486
519
  }
487
520
  case 14: {
@@ -525,7 +558,7 @@ export const User: MessageFns<User> = {
525
558
  preferences: isSet(object.preferences) ? User_Preferences.fromJSON(object.preferences) : undefined,
526
559
  location: isSet(object.location) ? User_Location.fromJSON(object.location) : undefined,
527
560
  onboardingCompleted: isSet(object.onboardingCompleted) ? globalThis.Boolean(object.onboardingCompleted) : false,
528
- status: isSet(object.status) ? globalThis.String(object.status) : "",
561
+ status: isSet(object.status) ? userStatusFromJSON(object.status) : 0,
529
562
  createdAt: isSet(object.createdAt) ? globalThis.String(object.createdAt) : "",
530
563
  updatedAt: isSet(object.updatedAt) ? globalThis.String(object.updatedAt) : "",
531
564
  };
@@ -569,8 +602,8 @@ export const User: MessageFns<User> = {
569
602
  if (message.onboardingCompleted !== false) {
570
603
  obj.onboardingCompleted = message.onboardingCompleted;
571
604
  }
572
- if (message.status !== "") {
573
- obj.status = message.status;
605
+ if (message.status !== 0) {
606
+ obj.status = userStatusToJSON(message.status);
574
607
  }
575
608
  if (message.createdAt !== "") {
576
609
  obj.createdAt = message.createdAt;
@@ -602,7 +635,7 @@ export const User: MessageFns<User> = {
602
635
  ? User_Location.fromPartial(object.location)
603
636
  : undefined;
604
637
  message.onboardingCompleted = object.onboardingCompleted ?? false;
605
- message.status = object.status ?? "";
638
+ message.status = object.status ?? 0;
606
639
  message.createdAt = object.createdAt ?? "";
607
640
  message.updatedAt = object.updatedAt ?? "";
608
641
  return message;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i4you/proto-files",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "",
5
5
  "type": "commonjs",
6
6
  "exports": {
@@ -52,7 +52,12 @@ message User {
52
52
  Location location = 11;
53
53
 
54
54
  bool onboarding_completed = 12;
55
- string status = 13;
55
+ UserStatus status = 13;
56
56
  string created_at = 14;
57
57
  string updated_at = 15;
58
- }
58
+ }
59
+
60
+ enum UserStatus {
61
+ active = 0;
62
+ suspended = 1;
63
+ }