@fatehan/tsrp 1.5.3 → 1.5.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.
Files changed (76) hide show
  1. package/dist/fatehan/activities/workflow.d.ts +8 -0
  2. package/dist/fatehan/activities/workflow.d.ts.map +1 -1
  3. package/dist/fatehan/activities/workflow.js +66 -3
  4. package/dist/fatehan/apis/client.d.ts +1 -1
  5. package/dist/fatehan/apis/client.js +3 -3
  6. package/dist/fatehan/areas/area.js +2 -2
  7. package/dist/fatehan/devices/devices.js +2 -2
  8. package/dist/fatehan/devices/maintenance.js +2 -2
  9. package/dist/fatehan/financial/financial.js +2 -2
  10. package/dist/fatehan/google/protobuf/descriptor.d.ts +470 -39
  11. package/dist/fatehan/google/protobuf/descriptor.d.ts.map +1 -1
  12. package/dist/fatehan/google/protobuf/descriptor.js +1070 -57
  13. package/dist/fatehan/google/protobuf/duration.js +2 -2
  14. package/dist/fatehan/google/protobuf/field_mask.d.ts +16 -18
  15. package/dist/fatehan/google/protobuf/field_mask.d.ts.map +1 -1
  16. package/dist/fatehan/google/protobuf/field_mask.js +2 -2
  17. package/dist/fatehan/google/protobuf/timestamp.d.ts +10 -9
  18. package/dist/fatehan/google/protobuf/timestamp.d.ts.map +1 -1
  19. package/dist/fatehan/google/protobuf/timestamp.js +2 -2
  20. package/dist/fatehan/identities/authentication.d.ts +82 -6
  21. package/dist/fatehan/identities/authentication.d.ts.map +1 -1
  22. package/dist/fatehan/identities/authentication.js +575 -47
  23. package/dist/fatehan/identities/identities.d.ts +13 -1
  24. package/dist/fatehan/identities/identities.d.ts.map +1 -1
  25. package/dist/fatehan/identities/identities.js +15 -3
  26. package/dist/fatehan/models/fusion.js +2 -2
  27. package/dist/fatehan/models/models.js +2 -2
  28. package/dist/fatehan/notifies/notify.js +2 -2
  29. package/dist/fatehan/packets/{messages.d.ts → commands.d.ts} +58 -1
  30. package/dist/fatehan/packets/commands.d.ts.map +1 -0
  31. package/dist/fatehan/packets/{messages.js → commands.js} +588 -3
  32. package/dist/fatehan/packets/dataModel.d.ts +188 -127
  33. package/dist/fatehan/packets/dataModel.d.ts.map +1 -1
  34. package/dist/fatehan/packets/dataModel.js +1641 -1005
  35. package/dist/fatehan/packets/dataModule.js +2 -2
  36. package/dist/fatehan/packets/forge.d.ts +117 -0
  37. package/dist/fatehan/packets/forge.d.ts.map +1 -0
  38. package/dist/fatehan/packets/forge.js +1079 -0
  39. package/dist/fatehan/services/api.d.ts +812 -26
  40. package/dist/fatehan/services/api.d.ts.map +1 -1
  41. package/dist/fatehan/services/api.js +8438 -244
  42. package/dist/fatehan/services/repositories.js +2 -2
  43. package/dist/fatehan/stream/stream.d.ts +224 -0
  44. package/dist/fatehan/stream/stream.d.ts.map +1 -0
  45. package/dist/fatehan/stream/stream.js +1416 -0
  46. package/dist/fatehan/trips/trip.d.ts +159 -159
  47. package/dist/fatehan/trips/trip.d.ts.map +1 -1
  48. package/dist/fatehan/trips/trip.js +169 -169
  49. package/dist/fatehan/utils/buf/validate/validate.js +2 -2
  50. package/dist/services.d.ts +65 -0
  51. package/dist/services.d.ts.map +1 -0
  52. package/dist/services.js +205 -0
  53. package/package.json +12 -12
  54. package/dist/api.d.ts +0 -36
  55. package/dist/api.d.ts.map +0 -1
  56. package/dist/api.js +0 -146
  57. package/dist/fatehan/activities/camera.d.ts +0 -95
  58. package/dist/fatehan/activities/camera.d.ts.map +0 -1
  59. package/dist/fatehan/activities/camera.js +0 -811
  60. package/dist/fatehan/google/protobuf/any.d.ts +0 -146
  61. package/dist/fatehan/google/protobuf/any.d.ts.map +0 -1
  62. package/dist/fatehan/google/protobuf/any.js +0 -104
  63. package/dist/fatehan/google/status.d.ts +0 -53
  64. package/dist/fatehan/google/status.d.ts.map +0 -1
  65. package/dist/fatehan/google/status.js +0 -95
  66. package/dist/fatehan/packets/messages.d.ts.map +0 -1
  67. package/dist/fatehan/reports/report.d.ts +0 -830
  68. package/dist/fatehan/reports/report.d.ts.map +0 -1
  69. package/dist/fatehan/reports/report.js +0 -8380
  70. package/dist/index.d.ts +0 -2
  71. package/dist/index.d.ts.map +0 -1
  72. package/dist/index.js +0 -1
  73. package/dist/report.d.ts +0 -29
  74. package/dist/report.d.ts.map +0 -1
  75. package/dist/report.js +0 -139
  76. package/readme.md +0 -26
@@ -1,13 +1,29 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.10.1
4
- // protoc v3.21.12
3
+ // protoc-gen-ts_proto v2.11.6
4
+ // protoc v7.34.1
5
5
  // source: identities/authentication.proto
6
6
  /* eslint-disable */
7
7
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
8
  import Long from "long";
9
+ import { Duration } from "../google/protobuf/duration";
9
10
  import { Timestamp } from "../google/protobuf/timestamp";
10
11
  export const protobufPackage = "com.fatehan.identities";
12
+ /** authentication method */
13
+ export var AuthenticationMethod;
14
+ (function (AuthenticationMethod) {
15
+ AuthenticationMethod[AuthenticationMethod["UNSPECIFIED_AUTHENTICATION"] = 0] = "UNSPECIFIED_AUTHENTICATION";
16
+ AuthenticationMethod[AuthenticationMethod["OTP"] = 1] = "OTP";
17
+ AuthenticationMethod[AuthenticationMethod["LOGIN_PASSWORD"] = 2] = "LOGIN_PASSWORD";
18
+ AuthenticationMethod[AuthenticationMethod["GOOGLE"] = 3] = "GOOGLE";
19
+ AuthenticationMethod[AuthenticationMethod["TELEGRAM"] = 4] = "TELEGRAM";
20
+ AuthenticationMethod[AuthenticationMethod["AUTHENTICATOR"] = 5] = "AUTHENTICATOR";
21
+ AuthenticationMethod[AuthenticationMethod["QR"] = 6] = "QR";
22
+ AuthenticationMethod[AuthenticationMethod["WHATS_APP"] = 7] = "WHATS_APP";
23
+ AuthenticationMethod[AuthenticationMethod["BALE"] = 8] = "BALE";
24
+ AuthenticationMethod[AuthenticationMethod["VERIFY_PASSWORD"] = 9] = "VERIFY_PASSWORD";
25
+ AuthenticationMethod[AuthenticationMethod["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
26
+ })(AuthenticationMethod || (AuthenticationMethod = {}));
11
27
  function createBaseVerifyRequest() {
12
28
  return { token: "" };
13
29
  }
@@ -142,7 +158,7 @@ function createBaseIdentity() {
142
158
  emailHash: undefined,
143
159
  telegramUsername: undefined,
144
160
  telegramId: undefined,
145
- twoStepVerification: false,
161
+ sessionLimitReached: false,
146
162
  };
147
163
  }
148
164
  export const Identity = {
@@ -186,8 +202,8 @@ export const Identity = {
186
202
  if (message.telegramId !== undefined) {
187
203
  writer.uint32(104).sint64(message.telegramId.toString());
188
204
  }
189
- if (message.twoStepVerification !== false) {
190
- writer.uint32(112).bool(message.twoStepVerification);
205
+ if (message.sessionLimitReached !== false) {
206
+ writer.uint32(112).bool(message.sessionLimitReached);
191
207
  }
192
208
  return writer;
193
209
  },
@@ -293,7 +309,7 @@ export const Identity = {
293
309
  if (tag !== 112) {
294
310
  break;
295
311
  }
296
- message.twoStepVerification = reader.bool();
312
+ message.sessionLimitReached = reader.bool();
297
313
  continue;
298
314
  }
299
315
  }
@@ -324,7 +340,7 @@ export const Identity = {
324
340
  message.telegramId = (object.telegramId !== undefined && object.telegramId !== null)
325
341
  ? Long.fromValue(object.telegramId)
326
342
  : undefined;
327
- message.twoStepVerification = object.twoStepVerification ?? false;
343
+ message.sessionLimitReached = object.sessionLimitReached ?? false;
328
344
  return message;
329
345
  },
330
346
  };
@@ -334,11 +350,9 @@ function createBaseAccessToken() {
334
350
  identityId: Long.UZERO,
335
351
  domain: "",
336
352
  token: Long.UZERO,
337
- phoneHash: new Uint8Array(0),
338
353
  ipAddress: "",
339
354
  userAgent: "",
340
355
  deviceType: "",
341
- twoStepVerification: false,
342
356
  expiresAt: undefined,
343
357
  createdAt: undefined,
344
358
  logoutAt: undefined,
@@ -358,9 +372,6 @@ export const AccessToken = {
358
372
  if (!message.token.equals(Long.UZERO)) {
359
373
  writer.uint32(32).uint64(message.token.toString());
360
374
  }
361
- if (message.phoneHash.length !== 0) {
362
- writer.uint32(42).bytes(message.phoneHash);
363
- }
364
375
  if (message.ipAddress !== "") {
365
376
  writer.uint32(50).string(message.ipAddress);
366
377
  }
@@ -370,9 +381,6 @@ export const AccessToken = {
370
381
  if (message.deviceType !== "") {
371
382
  writer.uint32(66).string(message.deviceType);
372
383
  }
373
- if (message.twoStepVerification !== false) {
374
- writer.uint32(96).bool(message.twoStepVerification);
375
- }
376
384
  if (message.expiresAt !== undefined) {
377
385
  Timestamp.encode(toTimestamp(message.expiresAt), writer.uint32(74).fork()).join();
378
386
  }
@@ -419,13 +427,6 @@ export const AccessToken = {
419
427
  message.token = Long.fromString(reader.uint64().toString(), true);
420
428
  continue;
421
429
  }
422
- case 5: {
423
- if (tag !== 42) {
424
- break;
425
- }
426
- message.phoneHash = reader.bytes();
427
- continue;
428
- }
429
430
  case 6: {
430
431
  if (tag !== 50) {
431
432
  break;
@@ -447,13 +448,6 @@ export const AccessToken = {
447
448
  message.deviceType = reader.string();
448
449
  continue;
449
450
  }
450
- case 12: {
451
- if (tag !== 96) {
452
- break;
453
- }
454
- message.twoStepVerification = reader.bool();
455
- continue;
456
- }
457
451
  case 9: {
458
452
  if (tag !== 74) {
459
453
  break;
@@ -494,11 +488,9 @@ export const AccessToken = {
494
488
  : Long.UZERO;
495
489
  message.domain = object.domain ?? "";
496
490
  message.token = (object.token !== undefined && object.token !== null) ? Long.fromValue(object.token) : Long.UZERO;
497
- message.phoneHash = object.phoneHash ?? new Uint8Array(0);
498
491
  message.ipAddress = object.ipAddress ?? "";
499
492
  message.userAgent = object.userAgent ?? "";
500
493
  message.deviceType = object.deviceType ?? "";
501
- message.twoStepVerification = object.twoStepVerification ?? false;
502
494
  message.expiresAt = object.expiresAt ?? undefined;
503
495
  message.createdAt = object.createdAt ?? undefined;
504
496
  message.logoutAt = object.logoutAt ?? undefined;
@@ -628,7 +620,7 @@ function createBaseCredential() {
628
620
  created: Long.ZERO,
629
621
  token: Long.UZERO,
630
622
  domain: "",
631
- passwordVerified: false,
623
+ sessionLimitReached: false,
632
624
  };
633
625
  }
634
626
  export const Credential = {
@@ -651,8 +643,8 @@ export const Credential = {
651
643
  if (message.domain !== "") {
652
644
  writer.uint32(42).string(message.domain);
653
645
  }
654
- if (message.passwordVerified !== false) {
655
- writer.uint32(56).bool(message.passwordVerified);
646
+ if (message.sessionLimitReached !== false) {
647
+ writer.uint32(56).bool(message.sessionLimitReached);
656
648
  }
657
649
  return writer;
658
650
  },
@@ -709,7 +701,7 @@ export const Credential = {
709
701
  if (tag !== 56) {
710
702
  break;
711
703
  }
712
- message.passwordVerified = reader.bool();
704
+ message.sessionLimitReached = reader.bool();
713
705
  continue;
714
706
  }
715
707
  }
@@ -737,12 +729,19 @@ export const Credential = {
737
729
  : Long.ZERO;
738
730
  message.token = (object.token !== undefined && object.token !== null) ? Long.fromValue(object.token) : Long.UZERO;
739
731
  message.domain = object.domain ?? "";
740
- message.passwordVerified = object.passwordVerified ?? false;
732
+ message.sessionLimitReached = object.sessionLimitReached ?? false;
741
733
  return message;
742
734
  },
743
735
  };
744
736
  function createBasePassword() {
745
- return { id: Long.UZERO, identityId: Long.UZERO, password: "", expiresAt: undefined, createdAt: undefined };
737
+ return {
738
+ id: Long.UZERO,
739
+ identityId: Long.UZERO,
740
+ password: new Uint8Array(0),
741
+ passwordUsage: "",
742
+ createdAt: undefined,
743
+ expiresAt: undefined,
744
+ };
746
745
  }
747
746
  export const Password = {
748
747
  encode(message, writer = new BinaryWriter()) {
@@ -752,14 +751,17 @@ export const Password = {
752
751
  if (!message.identityId.equals(Long.UZERO)) {
753
752
  writer.uint32(16).uint64(message.identityId.toString());
754
753
  }
755
- if (message.password !== "") {
756
- writer.uint32(26).string(message.password);
754
+ if (message.password.length !== 0) {
755
+ writer.uint32(26).bytes(message.password);
757
756
  }
758
- if (message.expiresAt !== undefined) {
759
- Timestamp.encode(toTimestamp(message.expiresAt), writer.uint32(50).fork()).join();
757
+ if (message.passwordUsage !== "") {
758
+ writer.uint32(34).string(message.passwordUsage);
760
759
  }
761
760
  if (message.createdAt !== undefined) {
762
- Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(58).fork()).join();
761
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(50).fork()).join();
762
+ }
763
+ if (message.expiresAt !== undefined) {
764
+ Timestamp.encode(toTimestamp(message.expiresAt), writer.uint32(58).fork()).join();
763
765
  }
764
766
  return writer;
765
767
  },
@@ -788,21 +790,28 @@ export const Password = {
788
790
  if (tag !== 26) {
789
791
  break;
790
792
  }
791
- message.password = reader.string();
793
+ message.password = reader.bytes();
794
+ continue;
795
+ }
796
+ case 4: {
797
+ if (tag !== 34) {
798
+ break;
799
+ }
800
+ message.passwordUsage = reader.string();
792
801
  continue;
793
802
  }
794
803
  case 6: {
795
804
  if (tag !== 50) {
796
805
  break;
797
806
  }
798
- message.expiresAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
807
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
799
808
  continue;
800
809
  }
801
810
  case 7: {
802
811
  if (tag !== 58) {
803
812
  break;
804
813
  }
805
- message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
814
+ message.expiresAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
806
815
  continue;
807
816
  }
808
817
  }
@@ -822,9 +831,10 @@ export const Password = {
822
831
  message.identityId = (object.identityId !== undefined && object.identityId !== null)
823
832
  ? Long.fromValue(object.identityId)
824
833
  : Long.UZERO;
825
- message.password = object.password ?? "";
826
- message.expiresAt = object.expiresAt ?? undefined;
834
+ message.password = object.password ?? new Uint8Array(0);
835
+ message.passwordUsage = object.passwordUsage ?? "";
827
836
  message.createdAt = object.createdAt ?? undefined;
837
+ message.expiresAt = object.expiresAt ?? undefined;
828
838
  return message;
829
839
  },
830
840
  };
@@ -979,6 +989,524 @@ export const TemporaryAccessToken = {
979
989
  return message;
980
990
  },
981
991
  };
992
+ function createBaseAuthenticationStrategy() {
993
+ return {
994
+ authentication: [],
995
+ verification: 0,
996
+ verificationTimeout: undefined,
997
+ sessionTimeout: undefined,
998
+ activeSessionLimit: 0,
999
+ passwordMinimumLength: 0,
1000
+ passwordMinCharacterClass: 0,
1001
+ passwordTimeout: undefined,
1002
+ };
1003
+ }
1004
+ export const AuthenticationStrategy = {
1005
+ encode(message, writer = new BinaryWriter()) {
1006
+ writer.uint32(10).fork();
1007
+ for (const v of message.authentication) {
1008
+ writer.int32(v);
1009
+ }
1010
+ writer.join();
1011
+ if (message.verification !== 0) {
1012
+ writer.uint32(16).int32(message.verification);
1013
+ }
1014
+ if (message.verificationTimeout !== undefined) {
1015
+ Duration.encode(message.verificationTimeout, writer.uint32(26).fork()).join();
1016
+ }
1017
+ if (message.sessionTimeout !== undefined) {
1018
+ Duration.encode(message.sessionTimeout, writer.uint32(34).fork()).join();
1019
+ }
1020
+ if (message.activeSessionLimit !== 0) {
1021
+ writer.uint32(40).uint32(message.activeSessionLimit);
1022
+ }
1023
+ if (message.passwordMinimumLength !== 0) {
1024
+ writer.uint32(48).uint32(message.passwordMinimumLength);
1025
+ }
1026
+ if (message.passwordMinCharacterClass !== 0) {
1027
+ writer.uint32(56).uint32(message.passwordMinCharacterClass);
1028
+ }
1029
+ if (message.passwordTimeout !== undefined) {
1030
+ Duration.encode(message.passwordTimeout, writer.uint32(66).fork()).join();
1031
+ }
1032
+ return writer;
1033
+ },
1034
+ decode(input, length) {
1035
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1036
+ const end = length === undefined ? reader.len : reader.pos + length;
1037
+ const message = createBaseAuthenticationStrategy();
1038
+ while (reader.pos < end) {
1039
+ const tag = reader.uint32();
1040
+ switch (tag >>> 3) {
1041
+ case 1: {
1042
+ if (tag === 8) {
1043
+ message.authentication.push(reader.int32());
1044
+ continue;
1045
+ }
1046
+ if (tag === 10) {
1047
+ const end2 = reader.uint32() + reader.pos;
1048
+ while (reader.pos < end2) {
1049
+ message.authentication.push(reader.int32());
1050
+ }
1051
+ continue;
1052
+ }
1053
+ break;
1054
+ }
1055
+ case 2: {
1056
+ if (tag !== 16) {
1057
+ break;
1058
+ }
1059
+ message.verification = reader.int32();
1060
+ continue;
1061
+ }
1062
+ case 3: {
1063
+ if (tag !== 26) {
1064
+ break;
1065
+ }
1066
+ message.verificationTimeout = Duration.decode(reader, reader.uint32());
1067
+ continue;
1068
+ }
1069
+ case 4: {
1070
+ if (tag !== 34) {
1071
+ break;
1072
+ }
1073
+ message.sessionTimeout = Duration.decode(reader, reader.uint32());
1074
+ continue;
1075
+ }
1076
+ case 5: {
1077
+ if (tag !== 40) {
1078
+ break;
1079
+ }
1080
+ message.activeSessionLimit = reader.uint32();
1081
+ continue;
1082
+ }
1083
+ case 6: {
1084
+ if (tag !== 48) {
1085
+ break;
1086
+ }
1087
+ message.passwordMinimumLength = reader.uint32();
1088
+ continue;
1089
+ }
1090
+ case 7: {
1091
+ if (tag !== 56) {
1092
+ break;
1093
+ }
1094
+ message.passwordMinCharacterClass = reader.uint32();
1095
+ continue;
1096
+ }
1097
+ case 8: {
1098
+ if (tag !== 66) {
1099
+ break;
1100
+ }
1101
+ message.passwordTimeout = Duration.decode(reader, reader.uint32());
1102
+ continue;
1103
+ }
1104
+ }
1105
+ if ((tag & 7) === 4 || tag === 0) {
1106
+ break;
1107
+ }
1108
+ reader.skip(tag & 7);
1109
+ }
1110
+ return message;
1111
+ },
1112
+ create(base) {
1113
+ return AuthenticationStrategy.fromPartial(base ?? {});
1114
+ },
1115
+ fromPartial(object) {
1116
+ const message = createBaseAuthenticationStrategy();
1117
+ message.authentication = object.authentication?.map((e) => e) || [];
1118
+ message.verification = object.verification ?? 0;
1119
+ message.verificationTimeout = (object.verificationTimeout !== undefined && object.verificationTimeout !== null)
1120
+ ? Duration.fromPartial(object.verificationTimeout)
1121
+ : undefined;
1122
+ message.sessionTimeout = (object.sessionTimeout !== undefined && object.sessionTimeout !== null)
1123
+ ? Duration.fromPartial(object.sessionTimeout)
1124
+ : undefined;
1125
+ message.activeSessionLimit = object.activeSessionLimit ?? 0;
1126
+ message.passwordMinimumLength = object.passwordMinimumLength ?? 0;
1127
+ message.passwordMinCharacterClass = object.passwordMinCharacterClass ?? 0;
1128
+ message.passwordTimeout = (object.passwordTimeout !== undefined && object.passwordTimeout !== null)
1129
+ ? Duration.fromPartial(object.passwordTimeout)
1130
+ : undefined;
1131
+ return message;
1132
+ },
1133
+ };
1134
+ function createBaseAuthState() {
1135
+ return {
1136
+ strategy: undefined,
1137
+ authentication: 0,
1138
+ authenticated: undefined,
1139
+ verification: 0,
1140
+ verified: undefined,
1141
+ csrfToken: "",
1142
+ identity: undefined,
1143
+ google: undefined,
1144
+ };
1145
+ }
1146
+ export const AuthState = {
1147
+ encode(message, writer = new BinaryWriter()) {
1148
+ if (message.strategy !== undefined) {
1149
+ AuthenticationStrategy.encode(message.strategy, writer.uint32(10).fork()).join();
1150
+ }
1151
+ if (message.authentication !== 0) {
1152
+ writer.uint32(16).int32(message.authentication);
1153
+ }
1154
+ if (message.authenticated !== undefined) {
1155
+ Timestamp.encode(toTimestamp(message.authenticated), writer.uint32(26).fork()).join();
1156
+ }
1157
+ if (message.verification !== 0) {
1158
+ writer.uint32(32).int32(message.verification);
1159
+ }
1160
+ if (message.verified !== undefined) {
1161
+ Timestamp.encode(toTimestamp(message.verified), writer.uint32(42).fork()).join();
1162
+ }
1163
+ if (message.csrfToken !== "") {
1164
+ writer.uint32(50).string(message.csrfToken);
1165
+ }
1166
+ if (message.identity !== undefined) {
1167
+ Identity.encode(message.identity, writer.uint32(58).fork()).join();
1168
+ }
1169
+ if (message.google !== undefined) {
1170
+ Identity.encode(message.google, writer.uint32(66).fork()).join();
1171
+ }
1172
+ return writer;
1173
+ },
1174
+ decode(input, length) {
1175
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1176
+ const end = length === undefined ? reader.len : reader.pos + length;
1177
+ const message = createBaseAuthState();
1178
+ while (reader.pos < end) {
1179
+ const tag = reader.uint32();
1180
+ switch (tag >>> 3) {
1181
+ case 1: {
1182
+ if (tag !== 10) {
1183
+ break;
1184
+ }
1185
+ message.strategy = AuthenticationStrategy.decode(reader, reader.uint32());
1186
+ continue;
1187
+ }
1188
+ case 2: {
1189
+ if (tag !== 16) {
1190
+ break;
1191
+ }
1192
+ message.authentication = reader.int32();
1193
+ continue;
1194
+ }
1195
+ case 3: {
1196
+ if (tag !== 26) {
1197
+ break;
1198
+ }
1199
+ message.authenticated = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1200
+ continue;
1201
+ }
1202
+ case 4: {
1203
+ if (tag !== 32) {
1204
+ break;
1205
+ }
1206
+ message.verification = reader.int32();
1207
+ continue;
1208
+ }
1209
+ case 5: {
1210
+ if (tag !== 42) {
1211
+ break;
1212
+ }
1213
+ message.verified = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1214
+ continue;
1215
+ }
1216
+ case 6: {
1217
+ if (tag !== 50) {
1218
+ break;
1219
+ }
1220
+ message.csrfToken = reader.string();
1221
+ continue;
1222
+ }
1223
+ case 7: {
1224
+ if (tag !== 58) {
1225
+ break;
1226
+ }
1227
+ message.identity = Identity.decode(reader, reader.uint32());
1228
+ continue;
1229
+ }
1230
+ case 8: {
1231
+ if (tag !== 66) {
1232
+ break;
1233
+ }
1234
+ message.google = Identity.decode(reader, reader.uint32());
1235
+ continue;
1236
+ }
1237
+ }
1238
+ if ((tag & 7) === 4 || tag === 0) {
1239
+ break;
1240
+ }
1241
+ reader.skip(tag & 7);
1242
+ }
1243
+ return message;
1244
+ },
1245
+ create(base) {
1246
+ return AuthState.fromPartial(base ?? {});
1247
+ },
1248
+ fromPartial(object) {
1249
+ const message = createBaseAuthState();
1250
+ message.strategy = (object.strategy !== undefined && object.strategy !== null)
1251
+ ? AuthenticationStrategy.fromPartial(object.strategy)
1252
+ : undefined;
1253
+ message.authentication = object.authentication ?? 0;
1254
+ message.authenticated = object.authenticated ?? undefined;
1255
+ message.verification = object.verification ?? 0;
1256
+ message.verified = object.verified ?? undefined;
1257
+ message.csrfToken = object.csrfToken ?? "";
1258
+ message.identity = (object.identity !== undefined && object.identity !== null)
1259
+ ? Identity.fromPartial(object.identity)
1260
+ : undefined;
1261
+ message.google = (object.google !== undefined && object.google !== null)
1262
+ ? Identity.fromPartial(object.google)
1263
+ : undefined;
1264
+ return message;
1265
+ },
1266
+ };
1267
+ function createBaseActivityLog() {
1268
+ return {
1269
+ id: Long.UZERO,
1270
+ createdBy: undefined,
1271
+ organizationId: undefined,
1272
+ logName: undefined,
1273
+ event: undefined,
1274
+ batchUuid: undefined,
1275
+ description: undefined,
1276
+ objectType: undefined,
1277
+ objectId: undefined,
1278
+ causerType: undefined,
1279
+ causerId: undefined,
1280
+ dataHash: undefined,
1281
+ ip: undefined,
1282
+ userAgent: undefined,
1283
+ properties: undefined,
1284
+ createdAt: undefined,
1285
+ updatedAt: undefined,
1286
+ };
1287
+ }
1288
+ export const ActivityLog = {
1289
+ encode(message, writer = new BinaryWriter()) {
1290
+ if (!message.id.equals(Long.UZERO)) {
1291
+ writer.uint32(8).uint64(message.id.toString());
1292
+ }
1293
+ if (message.createdBy !== undefined) {
1294
+ writer.uint32(16).uint64(message.createdBy.toString());
1295
+ }
1296
+ if (message.organizationId !== undefined) {
1297
+ writer.uint32(24).uint64(message.organizationId.toString());
1298
+ }
1299
+ if (message.logName !== undefined) {
1300
+ writer.uint32(34).string(message.logName);
1301
+ }
1302
+ if (message.event !== undefined) {
1303
+ writer.uint32(42).string(message.event);
1304
+ }
1305
+ if (message.batchUuid !== undefined) {
1306
+ writer.uint32(50).string(message.batchUuid);
1307
+ }
1308
+ if (message.description !== undefined) {
1309
+ writer.uint32(58).string(message.description);
1310
+ }
1311
+ if (message.objectType !== undefined) {
1312
+ writer.uint32(66).string(message.objectType);
1313
+ }
1314
+ if (message.objectId !== undefined) {
1315
+ writer.uint32(72).uint64(message.objectId.toString());
1316
+ }
1317
+ if (message.causerType !== undefined) {
1318
+ writer.uint32(82).string(message.causerType);
1319
+ }
1320
+ if (message.causerId !== undefined) {
1321
+ writer.uint32(88).uint64(message.causerId.toString());
1322
+ }
1323
+ if (message.dataHash !== undefined) {
1324
+ writer.uint32(98).string(message.dataHash);
1325
+ }
1326
+ if (message.ip !== undefined) {
1327
+ writer.uint32(106).string(message.ip);
1328
+ }
1329
+ if (message.userAgent !== undefined) {
1330
+ writer.uint32(114).string(message.userAgent);
1331
+ }
1332
+ if (message.properties !== undefined) {
1333
+ writer.uint32(122).string(message.properties);
1334
+ }
1335
+ if (message.createdAt !== undefined) {
1336
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(130).fork()).join();
1337
+ }
1338
+ if (message.updatedAt !== undefined) {
1339
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(138).fork()).join();
1340
+ }
1341
+ return writer;
1342
+ },
1343
+ decode(input, length) {
1344
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1345
+ const end = length === undefined ? reader.len : reader.pos + length;
1346
+ const message = createBaseActivityLog();
1347
+ while (reader.pos < end) {
1348
+ const tag = reader.uint32();
1349
+ switch (tag >>> 3) {
1350
+ case 1: {
1351
+ if (tag !== 8) {
1352
+ break;
1353
+ }
1354
+ message.id = Long.fromString(reader.uint64().toString(), true);
1355
+ continue;
1356
+ }
1357
+ case 2: {
1358
+ if (tag !== 16) {
1359
+ break;
1360
+ }
1361
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
1362
+ continue;
1363
+ }
1364
+ case 3: {
1365
+ if (tag !== 24) {
1366
+ break;
1367
+ }
1368
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
1369
+ continue;
1370
+ }
1371
+ case 4: {
1372
+ if (tag !== 34) {
1373
+ break;
1374
+ }
1375
+ message.logName = reader.string();
1376
+ continue;
1377
+ }
1378
+ case 5: {
1379
+ if (tag !== 42) {
1380
+ break;
1381
+ }
1382
+ message.event = reader.string();
1383
+ continue;
1384
+ }
1385
+ case 6: {
1386
+ if (tag !== 50) {
1387
+ break;
1388
+ }
1389
+ message.batchUuid = reader.string();
1390
+ continue;
1391
+ }
1392
+ case 7: {
1393
+ if (tag !== 58) {
1394
+ break;
1395
+ }
1396
+ message.description = reader.string();
1397
+ continue;
1398
+ }
1399
+ case 8: {
1400
+ if (tag !== 66) {
1401
+ break;
1402
+ }
1403
+ message.objectType = reader.string();
1404
+ continue;
1405
+ }
1406
+ case 9: {
1407
+ if (tag !== 72) {
1408
+ break;
1409
+ }
1410
+ message.objectId = Long.fromString(reader.uint64().toString(), true);
1411
+ continue;
1412
+ }
1413
+ case 10: {
1414
+ if (tag !== 82) {
1415
+ break;
1416
+ }
1417
+ message.causerType = reader.string();
1418
+ continue;
1419
+ }
1420
+ case 11: {
1421
+ if (tag !== 88) {
1422
+ break;
1423
+ }
1424
+ message.causerId = Long.fromString(reader.uint64().toString(), true);
1425
+ continue;
1426
+ }
1427
+ case 12: {
1428
+ if (tag !== 98) {
1429
+ break;
1430
+ }
1431
+ message.dataHash = reader.string();
1432
+ continue;
1433
+ }
1434
+ case 13: {
1435
+ if (tag !== 106) {
1436
+ break;
1437
+ }
1438
+ message.ip = reader.string();
1439
+ continue;
1440
+ }
1441
+ case 14: {
1442
+ if (tag !== 114) {
1443
+ break;
1444
+ }
1445
+ message.userAgent = reader.string();
1446
+ continue;
1447
+ }
1448
+ case 15: {
1449
+ if (tag !== 122) {
1450
+ break;
1451
+ }
1452
+ message.properties = reader.string();
1453
+ continue;
1454
+ }
1455
+ case 16: {
1456
+ if (tag !== 130) {
1457
+ break;
1458
+ }
1459
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1460
+ continue;
1461
+ }
1462
+ case 17: {
1463
+ if (tag !== 138) {
1464
+ break;
1465
+ }
1466
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1467
+ continue;
1468
+ }
1469
+ }
1470
+ if ((tag & 7) === 4 || tag === 0) {
1471
+ break;
1472
+ }
1473
+ reader.skip(tag & 7);
1474
+ }
1475
+ return message;
1476
+ },
1477
+ create(base) {
1478
+ return ActivityLog.fromPartial(base ?? {});
1479
+ },
1480
+ fromPartial(object) {
1481
+ const message = createBaseActivityLog();
1482
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
1483
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
1484
+ ? Long.fromValue(object.createdBy)
1485
+ : undefined;
1486
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
1487
+ ? Long.fromValue(object.organizationId)
1488
+ : undefined;
1489
+ message.logName = object.logName ?? undefined;
1490
+ message.event = object.event ?? undefined;
1491
+ message.batchUuid = object.batchUuid ?? undefined;
1492
+ message.description = object.description ?? undefined;
1493
+ message.objectType = object.objectType ?? undefined;
1494
+ message.objectId = (object.objectId !== undefined && object.objectId !== null)
1495
+ ? Long.fromValue(object.objectId)
1496
+ : undefined;
1497
+ message.causerType = object.causerType ?? undefined;
1498
+ message.causerId = (object.causerId !== undefined && object.causerId !== null)
1499
+ ? Long.fromValue(object.causerId)
1500
+ : undefined;
1501
+ message.dataHash = object.dataHash ?? undefined;
1502
+ message.ip = object.ip ?? undefined;
1503
+ message.userAgent = object.userAgent ?? undefined;
1504
+ message.properties = object.properties ?? undefined;
1505
+ message.createdAt = object.createdAt ?? undefined;
1506
+ message.updatedAt = object.updatedAt ?? undefined;
1507
+ return message;
1508
+ },
1509
+ };
982
1510
  function toTimestamp(date) {
983
1511
  const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
984
1512
  const nanos = (date.getTime() % 1_000) * 1_000_000;