@miradorlabs/web-grpc 4.22.0 → 4.23.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.
Files changed (34) hide show
  1. package/google/api/field_behavior.ts +1 -1
  2. package/google/protobuf/descriptor.ts +1 -1
  3. package/google/protobuf/duration.ts +1 -1
  4. package/google/protobuf/timestamp.ts +1 -1
  5. package/package.json +1 -1
  6. package/proto/gateway/common/v1/attribute_value.ts +1 -1
  7. package/proto/gateway/common/v1/status.ts +1 -1
  8. package/proto/gateway/common/v1/types.ts +1 -1
  9. package/proto/gateway/web/v1/account_gateway.ts +1418 -106
  10. package/proto/gateway/web/v1/account_gateway_grpc_pb.js +137 -0
  11. package/proto/gateway/web/v1/account_gateway_pb.js +2491 -38
  12. package/proto/gateway/web/v1/admin_gateway.ts +1 -1
  13. package/proto/gateway/web/v1/ai_gateway.ts +1 -1
  14. package/proto/gateway/web/v1/attribute_value.ts +1 -1
  15. package/proto/gateway/web/v1/beta_gateway.ts +1 -1
  16. package/proto/gateway/web/v1/chain_gateway.ts +1 -1
  17. package/proto/gateway/web/v1/claude_enterprise_gateway.ts +1 -1
  18. package/proto/gateway/web/v1/common.ts +1 -1
  19. package/proto/gateway/web/v1/derived_metric_gateway.ts +1 -1
  20. package/proto/gateway/web/v1/desktop_auth_gateway.ts +1 -1
  21. package/proto/gateway/web/v1/github_connector.ts +1 -1
  22. package/proto/gateway/web/v1/integration_gateway.ts +1 -1
  23. package/proto/gateway/web/v1/log_gateway.ts +1 -1
  24. package/proto/gateway/web/v1/market_gateway.ts +1 -1
  25. package/proto/gateway/web/v1/metric_gateway.ts +1 -1
  26. package/proto/gateway/web/v1/notification_gateway.ts +1 -1
  27. package/proto/gateway/web/v1/oauth_gateway.ts +1 -1
  28. package/proto/gateway/web/v1/plan_gateway.ts +1 -1
  29. package/proto/gateway/web/v1/policy_gateway.ts +1 -1
  30. package/proto/gateway/web/v1/reference_gateway.ts +1 -1
  31. package/proto/gateway/web/v1/rule_gateway.ts +1 -1
  32. package/proto/gateway/web/v1/slo_gateway.ts +1 -1
  33. package/proto/gateway/web/v1/trace_gateway.ts +1 -1
  34. package/proto/gateway/web/v1/trace_measure_gateway.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.18.4
3
+ // protoc-gen-ts_proto v2.19.0
4
4
  // protoc v3.21.12
5
5
  // source: proto/gateway/web/v1/account_gateway.proto
6
6
 
@@ -55,6 +55,49 @@ export function userRoleToJSON(object: UserRole): string {
55
55
  }
56
56
  }
57
57
 
58
+ /**
59
+ * ProjectRole is a member's role in one project (a Terma team). A lead and a member are both in the team; a team may
60
+ * have several leads.
61
+ */
62
+ export enum ProjectRole {
63
+ PROJECT_ROLE_UNSPECIFIED = 0,
64
+ PROJECT_ROLE_LEAD = 1,
65
+ PROJECT_ROLE_MEMBER = 2,
66
+ UNRECOGNIZED = -1,
67
+ }
68
+
69
+ export function projectRoleFromJSON(object: any): ProjectRole {
70
+ switch (object) {
71
+ case 0:
72
+ case "PROJECT_ROLE_UNSPECIFIED":
73
+ return ProjectRole.PROJECT_ROLE_UNSPECIFIED;
74
+ case 1:
75
+ case "PROJECT_ROLE_LEAD":
76
+ return ProjectRole.PROJECT_ROLE_LEAD;
77
+ case 2:
78
+ case "PROJECT_ROLE_MEMBER":
79
+ return ProjectRole.PROJECT_ROLE_MEMBER;
80
+ case -1:
81
+ case "UNRECOGNIZED":
82
+ default:
83
+ return ProjectRole.UNRECOGNIZED;
84
+ }
85
+ }
86
+
87
+ export function projectRoleToJSON(object: ProjectRole): string {
88
+ switch (object) {
89
+ case ProjectRole.PROJECT_ROLE_UNSPECIFIED:
90
+ return "PROJECT_ROLE_UNSPECIFIED";
91
+ case ProjectRole.PROJECT_ROLE_LEAD:
92
+ return "PROJECT_ROLE_LEAD";
93
+ case ProjectRole.PROJECT_ROLE_MEMBER:
94
+ return "PROJECT_ROLE_MEMBER";
95
+ case ProjectRole.UNRECOGNIZED:
96
+ default:
97
+ return "UNRECOGNIZED";
98
+ }
99
+ }
100
+
58
101
  export enum UserStatus {
59
102
  USER_STATUS_UNSPECIFIED = 0,
60
103
  USER_STATUS_INVITED = 1,
@@ -831,6 +874,80 @@ export interface RemoveUserResponse {
831
874
  status: ResponseStatus | undefined;
832
875
  }
833
876
 
877
+ export interface AssignProjectRoleRequest {
878
+ organizationId: string;
879
+ projectId: string;
880
+ userId: string;
881
+ role: ProjectRole;
882
+ }
883
+
884
+ export interface AssignProjectRoleResponse {
885
+ status: ResponseStatus | undefined;
886
+ projectUser: ProjectUser | undefined;
887
+ }
888
+
889
+ export interface UpdateProjectRoleRequest {
890
+ organizationId: string;
891
+ projectId: string;
892
+ userId: string;
893
+ role: ProjectRole;
894
+ }
895
+
896
+ export interface UpdateProjectRoleResponse {
897
+ status: ResponseStatus | undefined;
898
+ projectUser: ProjectUser | undefined;
899
+ }
900
+
901
+ export interface RemoveProjectRoleRequest {
902
+ organizationId: string;
903
+ projectId: string;
904
+ userId: string;
905
+ }
906
+
907
+ export interface RemoveProjectRoleResponse {
908
+ status: ResponseStatus | undefined;
909
+ }
910
+
911
+ export interface ListProjectRolesRequest {
912
+ organizationId: string;
913
+ projectId: string;
914
+ filter:
915
+ | ProjectUserFilter
916
+ | undefined;
917
+ /** 0 is the default (100); above 100 is capped at 100; negative is a validation error. */
918
+ pageSize: number;
919
+ /** Opaque: a prior response's next_page_token; empty starts at the first member. */
920
+ pageToken: string;
921
+ }
922
+
923
+ export interface ListProjectRolesResponse {
924
+ status: ResponseStatus | undefined;
925
+ projectUsers: ProjectUser[];
926
+ /** Empty at the end. */
927
+ nextPageToken: string;
928
+ }
929
+
930
+ /**
931
+ * ProjectUserFilter narrows a project's members: fields AND, a repeated field matches any of its values, and an empty
932
+ * field does not filter.
933
+ */
934
+ export interface ProjectUserFilter {
935
+ /** PROJECT_ROLE_UNSPECIFIED is a validation error. */
936
+ roles: ProjectRole[];
937
+ /** A malformed id is a validation error. */
938
+ userIds: string[];
939
+ }
940
+
941
+ /** ProjectUser is a member of the organization in one of its projects (a Terma team), with their role there. */
942
+ export interface ProjectUser {
943
+ userId: string;
944
+ organizationId: string;
945
+ projectId: string;
946
+ role: ProjectRole;
947
+ createdAt: Date | undefined;
948
+ updatedAt: Date | undefined;
949
+ }
950
+
834
951
  export interface ListInvitationsRequest {
835
952
  /** Organization UUID */
836
953
  organizationId: string;
@@ -6694,19 +6811,28 @@ export const RemoveUserResponse: MessageFns<RemoveUserResponse> = {
6694
6811
  },
6695
6812
  };
6696
6813
 
6697
- function createBaseListInvitationsRequest(): ListInvitationsRequest {
6698
- return { organizationId: "" };
6814
+ function createBaseAssignProjectRoleRequest(): AssignProjectRoleRequest {
6815
+ return { organizationId: "", projectId: "", userId: "", role: 0 };
6699
6816
  }
6700
6817
 
6701
- export const ListInvitationsRequest: MessageFns<ListInvitationsRequest> = {
6702
- encode(message: ListInvitationsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
6818
+ export const AssignProjectRoleRequest: MessageFns<AssignProjectRoleRequest> = {
6819
+ encode(message: AssignProjectRoleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
6703
6820
  if (message.organizationId !== "") {
6704
6821
  writer.uint32(10).string(message.organizationId);
6705
6822
  }
6823
+ if (message.projectId !== "") {
6824
+ writer.uint32(18).string(message.projectId);
6825
+ }
6826
+ if (message.userId !== "") {
6827
+ writer.uint32(26).string(message.userId);
6828
+ }
6829
+ if (message.role !== 0) {
6830
+ writer.uint32(32).int32(message.role);
6831
+ }
6706
6832
  return writer;
6707
6833
  },
6708
6834
 
6709
- decode(input: BinaryReader | Uint8Array, length?: number): ListInvitationsRequest {
6835
+ decode(input: BinaryReader | Uint8Array, length?: number): AssignProjectRoleRequest {
6710
6836
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
6711
6837
  const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
6712
6838
  if (previousRecursionDepth >= 100) {
@@ -6715,7 +6841,7 @@ export const ListInvitationsRequest: MessageFns<ListInvitationsRequest> = {
6715
6841
  (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
6716
6842
  try {
6717
6843
  const end = length === undefined ? reader.len : reader.pos + length;
6718
- const message = createBaseListInvitationsRequest();
6844
+ const message = createBaseAssignProjectRoleRequest();
6719
6845
  while (reader.pos < end) {
6720
6846
  const tag = reader.uint32();
6721
6847
  switch (tag >>> 3) {
@@ -6727,6 +6853,30 @@ export const ListInvitationsRequest: MessageFns<ListInvitationsRequest> = {
6727
6853
  message.organizationId = reader.string();
6728
6854
  continue;
6729
6855
  }
6856
+ case 2: {
6857
+ if (tag !== 18) {
6858
+ break;
6859
+ }
6860
+
6861
+ message.projectId = reader.string();
6862
+ continue;
6863
+ }
6864
+ case 3: {
6865
+ if (tag !== 26) {
6866
+ break;
6867
+ }
6868
+
6869
+ message.userId = reader.string();
6870
+ continue;
6871
+ }
6872
+ case 4: {
6873
+ if (tag !== 32) {
6874
+ break;
6875
+ }
6876
+
6877
+ message.role = reader.int32() as any;
6878
+ continue;
6879
+ }
6730
6880
  }
6731
6881
  if ((tag & 7) === 4 || tag === 0) {
6732
6882
  break;
@@ -6739,50 +6889,73 @@ export const ListInvitationsRequest: MessageFns<ListInvitationsRequest> = {
6739
6889
  }
6740
6890
  },
6741
6891
 
6742
- fromJSON(object: any): ListInvitationsRequest {
6892
+ fromJSON(object: any): AssignProjectRoleRequest {
6743
6893
  return {
6744
6894
  organizationId: isSet(object.organizationId)
6745
6895
  ? globalThis.String(object.organizationId)
6746
6896
  : isSet(object.organization_id)
6747
6897
  ? globalThis.String(object.organization_id)
6748
6898
  : "",
6899
+ projectId: isSet(object.projectId)
6900
+ ? globalThis.String(object.projectId)
6901
+ : isSet(object.project_id)
6902
+ ? globalThis.String(object.project_id)
6903
+ : "",
6904
+ userId: isSet(object.userId)
6905
+ ? globalThis.String(object.userId)
6906
+ : isSet(object.user_id)
6907
+ ? globalThis.String(object.user_id)
6908
+ : "",
6909
+ role: isSet(object.role) ? projectRoleFromJSON(object.role) : 0,
6749
6910
  };
6750
6911
  },
6751
6912
 
6752
- toJSON(message: ListInvitationsRequest): unknown {
6913
+ toJSON(message: AssignProjectRoleRequest): unknown {
6753
6914
  const obj: any = {};
6754
6915
  if (message.organizationId !== "") {
6755
6916
  obj.organizationId = message.organizationId;
6756
6917
  }
6918
+ if (message.projectId !== "") {
6919
+ obj.projectId = message.projectId;
6920
+ }
6921
+ if (message.userId !== "") {
6922
+ obj.userId = message.userId;
6923
+ }
6924
+ if (message.role !== 0) {
6925
+ obj.role = projectRoleToJSON(message.role);
6926
+ }
6757
6927
  return obj;
6758
6928
  },
6759
6929
 
6760
- create<I extends Exact<DeepPartial<ListInvitationsRequest>, I>>(base?: I): ListInvitationsRequest {
6761
- return ListInvitationsRequest.fromPartial(base ?? ({} as any));
6930
+ create<I extends Exact<DeepPartial<AssignProjectRoleRequest>, I>>(base?: I): AssignProjectRoleRequest {
6931
+ return AssignProjectRoleRequest.fromPartial(base ?? ({} as any));
6762
6932
  },
6763
- fromPartial<I extends Exact<DeepPartial<ListInvitationsRequest>, I>>(object: I): ListInvitationsRequest {
6764
- const message = createBaseListInvitationsRequest();
6933
+ fromPartial<I extends Exact<DeepPartial<AssignProjectRoleRequest>, I>>(object: I): AssignProjectRoleRequest {
6934
+ const message = createBaseAssignProjectRoleRequest();
6765
6935
  message.organizationId = object.organizationId ?? "";
6936
+ message.projectId = object.projectId ?? "";
6937
+ message.userId = object.userId ?? "";
6938
+ message.role = object.role ?? 0;
6766
6939
  return message;
6767
6940
  },
6768
6941
  };
6769
6942
 
6770
- function createBaseListInvitationsResponse(): ListInvitationsResponse {
6771
- return { status: undefined, invitations: [] };
6943
+ function createBaseAssignProjectRoleResponse(): AssignProjectRoleResponse {
6944
+ return { status: undefined, projectUser: undefined };
6772
6945
  }
6773
6946
 
6774
- export const ListInvitationsResponse: MessageFns<ListInvitationsResponse> = {
6775
- encode(message: ListInvitationsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
6947
+ export const AssignProjectRoleResponse: MessageFns<AssignProjectRoleResponse> = {
6948
+ encode(message: AssignProjectRoleResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
6776
6949
  if (message.status !== undefined) {
6777
6950
  ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
6778
6951
  }
6779
- for (const v of message.invitations) {
6780
- Invitation.encode(v!, writer.uint32(18).fork()).join();
6952
+ if (message.projectUser !== undefined) {
6953
+ ProjectUser.encode(message.projectUser, writer.uint32(18).fork()).join();
6781
6954
  }
6782
6955
  return writer;
6783
6956
  },
6784
6957
 
6785
- decode(input: BinaryReader | Uint8Array, length?: number): ListInvitationsResponse {
6958
+ decode(input: BinaryReader | Uint8Array, length?: number): AssignProjectRoleResponse {
6786
6959
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
6787
6960
  const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
6788
6961
  if (previousRecursionDepth >= 100) {
@@ -6791,7 +6964,7 @@ export const ListInvitationsResponse: MessageFns<ListInvitationsResponse> = {
6791
6964
  (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
6792
6965
  try {
6793
6966
  const end = length === undefined ? reader.len : reader.pos + length;
6794
- const message = createBaseListInvitationsResponse();
6967
+ const message = createBaseAssignProjectRoleResponse();
6795
6968
  while (reader.pos < end) {
6796
6969
  const tag = reader.uint32();
6797
6970
  switch (tag >>> 3) {
@@ -6808,7 +6981,7 @@ export const ListInvitationsResponse: MessageFns<ListInvitationsResponse> = {
6808
6981
  break;
6809
6982
  }
6810
6983
 
6811
- message.invitations.push(Invitation.decode(reader, reader.uint32()));
6984
+ message.projectUser = ProjectUser.decode(reader, reader.uint32());
6812
6985
  continue;
6813
6986
  }
6814
6987
  }
@@ -6823,67 +6996,65 @@ export const ListInvitationsResponse: MessageFns<ListInvitationsResponse> = {
6823
6996
  }
6824
6997
  },
6825
6998
 
6826
- fromJSON(object: any): ListInvitationsResponse {
6999
+ fromJSON(object: any): AssignProjectRoleResponse {
6827
7000
  return {
6828
7001
  status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
6829
- invitations: globalThis.Array.isArray(object?.invitations)
6830
- ? object.invitations.map((e: any) => Invitation.fromJSON(e))
6831
- : [],
7002
+ projectUser: isSet(object.projectUser)
7003
+ ? ProjectUser.fromJSON(object.projectUser)
7004
+ : isSet(object.project_user)
7005
+ ? ProjectUser.fromJSON(object.project_user)
7006
+ : undefined,
6832
7007
  };
6833
7008
  },
6834
7009
 
6835
- toJSON(message: ListInvitationsResponse): unknown {
7010
+ toJSON(message: AssignProjectRoleResponse): unknown {
6836
7011
  const obj: any = {};
6837
7012
  if (message.status !== undefined) {
6838
7013
  obj.status = ResponseStatus.toJSON(message.status);
6839
7014
  }
6840
- if (message.invitations?.length) {
6841
- obj.invitations = message.invitations.map((e) => Invitation.toJSON(e));
7015
+ if (message.projectUser !== undefined) {
7016
+ obj.projectUser = ProjectUser.toJSON(message.projectUser);
6842
7017
  }
6843
7018
  return obj;
6844
7019
  },
6845
7020
 
6846
- create<I extends Exact<DeepPartial<ListInvitationsResponse>, I>>(base?: I): ListInvitationsResponse {
6847
- return ListInvitationsResponse.fromPartial(base ?? ({} as any));
7021
+ create<I extends Exact<DeepPartial<AssignProjectRoleResponse>, I>>(base?: I): AssignProjectRoleResponse {
7022
+ return AssignProjectRoleResponse.fromPartial(base ?? ({} as any));
6848
7023
  },
6849
- fromPartial<I extends Exact<DeepPartial<ListInvitationsResponse>, I>>(object: I): ListInvitationsResponse {
6850
- const message = createBaseListInvitationsResponse();
7024
+ fromPartial<I extends Exact<DeepPartial<AssignProjectRoleResponse>, I>>(object: I): AssignProjectRoleResponse {
7025
+ const message = createBaseAssignProjectRoleResponse();
6851
7026
  message.status = (object.status !== undefined && object.status !== null)
6852
7027
  ? ResponseStatus.fromPartial(object.status)
6853
7028
  : undefined;
6854
- message.invitations = object.invitations?.map((e) => Invitation.fromPartial(e)) || [];
7029
+ message.projectUser = (object.projectUser !== undefined && object.projectUser !== null)
7030
+ ? ProjectUser.fromPartial(object.projectUser)
7031
+ : undefined;
6855
7032
  return message;
6856
7033
  },
6857
7034
  };
6858
7035
 
6859
- function createBaseInvitation(): Invitation {
6860
- return { id: "", email: "", status: 0, invitedBy: "", createdAt: undefined, updatedAt: undefined };
7036
+ function createBaseUpdateProjectRoleRequest(): UpdateProjectRoleRequest {
7037
+ return { organizationId: "", projectId: "", userId: "", role: 0 };
6861
7038
  }
6862
7039
 
6863
- export const Invitation: MessageFns<Invitation> = {
6864
- encode(message: Invitation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
6865
- if (message.id !== "") {
6866
- writer.uint32(10).string(message.id);
6867
- }
6868
- if (message.email !== "") {
6869
- writer.uint32(18).string(message.email);
6870
- }
6871
- if (message.status !== 0) {
6872
- writer.uint32(24).int32(message.status);
7040
+ export const UpdateProjectRoleRequest: MessageFns<UpdateProjectRoleRequest> = {
7041
+ encode(message: UpdateProjectRoleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
7042
+ if (message.organizationId !== "") {
7043
+ writer.uint32(10).string(message.organizationId);
6873
7044
  }
6874
- if (message.invitedBy !== "") {
6875
- writer.uint32(34).string(message.invitedBy);
7045
+ if (message.projectId !== "") {
7046
+ writer.uint32(18).string(message.projectId);
6876
7047
  }
6877
- if (message.createdAt !== undefined) {
6878
- Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(42).fork()).join();
7048
+ if (message.userId !== "") {
7049
+ writer.uint32(26).string(message.userId);
6879
7050
  }
6880
- if (message.updatedAt !== undefined) {
6881
- Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(50).fork()).join();
7051
+ if (message.role !== 0) {
7052
+ writer.uint32(32).int32(message.role);
6882
7053
  }
6883
7054
  return writer;
6884
7055
  },
6885
7056
 
6886
- decode(input: BinaryReader | Uint8Array, length?: number): Invitation {
7057
+ decode(input: BinaryReader | Uint8Array, length?: number): UpdateProjectRoleRequest {
6887
7058
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
6888
7059
  const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
6889
7060
  if (previousRecursionDepth >= 100) {
@@ -6892,7 +7063,7 @@ export const Invitation: MessageFns<Invitation> = {
6892
7063
  (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
6893
7064
  try {
6894
7065
  const end = length === undefined ? reader.len : reader.pos + length;
6895
- const message = createBaseInvitation();
7066
+ const message = createBaseUpdateProjectRoleRequest();
6896
7067
  while (reader.pos < end) {
6897
7068
  const tag = reader.uint32();
6898
7069
  switch (tag >>> 3) {
@@ -6901,7 +7072,7 @@ export const Invitation: MessageFns<Invitation> = {
6901
7072
  break;
6902
7073
  }
6903
7074
 
6904
- message.id = reader.string();
7075
+ message.organizationId = reader.string();
6905
7076
  continue;
6906
7077
  }
6907
7078
  case 2: {
@@ -6909,39 +7080,23 @@ export const Invitation: MessageFns<Invitation> = {
6909
7080
  break;
6910
7081
  }
6911
7082
 
6912
- message.email = reader.string();
7083
+ message.projectId = reader.string();
6913
7084
  continue;
6914
7085
  }
6915
7086
  case 3: {
6916
- if (tag !== 24) {
7087
+ if (tag !== 26) {
6917
7088
  break;
6918
7089
  }
6919
7090
 
6920
- message.status = reader.int32() as any;
7091
+ message.userId = reader.string();
6921
7092
  continue;
6922
7093
  }
6923
7094
  case 4: {
6924
- if (tag !== 34) {
6925
- break;
6926
- }
6927
-
6928
- message.invitedBy = reader.string();
6929
- continue;
6930
- }
6931
- case 5: {
6932
- if (tag !== 42) {
6933
- break;
6934
- }
6935
-
6936
- message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
6937
- continue;
6938
- }
6939
- case 6: {
6940
- if (tag !== 50) {
7095
+ if (tag !== 32) {
6941
7096
  break;
6942
7097
  }
6943
7098
 
6944
- message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
7099
+ message.role = reader.int32() as any;
6945
7100
  continue;
6946
7101
  }
6947
7102
  }
@@ -6956,45 +7111,1163 @@ export const Invitation: MessageFns<Invitation> = {
6956
7111
  }
6957
7112
  },
6958
7113
 
6959
- fromJSON(object: any): Invitation {
7114
+ fromJSON(object: any): UpdateProjectRoleRequest {
6960
7115
  return {
6961
- id: isSet(object.id) ? globalThis.String(object.id) : "",
6962
- email: isSet(object.email) ? globalThis.String(object.email) : "",
6963
- status: isSet(object.status) ? invitationStatusFromJSON(object.status) : 0,
6964
- invitedBy: isSet(object.invitedBy)
6965
- ? globalThis.String(object.invitedBy)
6966
- : isSet(object.invited_by)
6967
- ? globalThis.String(object.invited_by)
7116
+ organizationId: isSet(object.organizationId)
7117
+ ? globalThis.String(object.organizationId)
7118
+ : isSet(object.organization_id)
7119
+ ? globalThis.String(object.organization_id)
6968
7120
  : "",
6969
- createdAt: isSet(object.createdAt)
6970
- ? fromJsonTimestamp(object.createdAt)
6971
- : isSet(object.created_at)
6972
- ? fromJsonTimestamp(object.created_at)
6973
- : undefined,
6974
- updatedAt: isSet(object.updatedAt)
6975
- ? fromJsonTimestamp(object.updatedAt)
6976
- : isSet(object.updated_at)
6977
- ? fromJsonTimestamp(object.updated_at)
6978
- : undefined,
7121
+ projectId: isSet(object.projectId)
7122
+ ? globalThis.String(object.projectId)
7123
+ : isSet(object.project_id)
7124
+ ? globalThis.String(object.project_id)
7125
+ : "",
7126
+ userId: isSet(object.userId)
7127
+ ? globalThis.String(object.userId)
7128
+ : isSet(object.user_id)
7129
+ ? globalThis.String(object.user_id)
7130
+ : "",
7131
+ role: isSet(object.role) ? projectRoleFromJSON(object.role) : 0,
6979
7132
  };
6980
7133
  },
6981
7134
 
6982
- toJSON(message: Invitation): unknown {
7135
+ toJSON(message: UpdateProjectRoleRequest): unknown {
6983
7136
  const obj: any = {};
6984
- if (message.id !== "") {
6985
- obj.id = message.id;
6986
- }
6987
- if (message.email !== "") {
6988
- obj.email = message.email;
7137
+ if (message.organizationId !== "") {
7138
+ obj.organizationId = message.organizationId;
6989
7139
  }
6990
- if (message.status !== 0) {
6991
- obj.status = invitationStatusToJSON(message.status);
7140
+ if (message.projectId !== "") {
7141
+ obj.projectId = message.projectId;
6992
7142
  }
6993
- if (message.invitedBy !== "") {
6994
- obj.invitedBy = message.invitedBy;
7143
+ if (message.userId !== "") {
7144
+ obj.userId = message.userId;
6995
7145
  }
6996
- if (message.createdAt !== undefined) {
6997
- obj.createdAt = message.createdAt.toISOString();
7146
+ if (message.role !== 0) {
7147
+ obj.role = projectRoleToJSON(message.role);
7148
+ }
7149
+ return obj;
7150
+ },
7151
+
7152
+ create<I extends Exact<DeepPartial<UpdateProjectRoleRequest>, I>>(base?: I): UpdateProjectRoleRequest {
7153
+ return UpdateProjectRoleRequest.fromPartial(base ?? ({} as any));
7154
+ },
7155
+ fromPartial<I extends Exact<DeepPartial<UpdateProjectRoleRequest>, I>>(object: I): UpdateProjectRoleRequest {
7156
+ const message = createBaseUpdateProjectRoleRequest();
7157
+ message.organizationId = object.organizationId ?? "";
7158
+ message.projectId = object.projectId ?? "";
7159
+ message.userId = object.userId ?? "";
7160
+ message.role = object.role ?? 0;
7161
+ return message;
7162
+ },
7163
+ };
7164
+
7165
+ function createBaseUpdateProjectRoleResponse(): UpdateProjectRoleResponse {
7166
+ return { status: undefined, projectUser: undefined };
7167
+ }
7168
+
7169
+ export const UpdateProjectRoleResponse: MessageFns<UpdateProjectRoleResponse> = {
7170
+ encode(message: UpdateProjectRoleResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
7171
+ if (message.status !== undefined) {
7172
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
7173
+ }
7174
+ if (message.projectUser !== undefined) {
7175
+ ProjectUser.encode(message.projectUser, writer.uint32(18).fork()).join();
7176
+ }
7177
+ return writer;
7178
+ },
7179
+
7180
+ decode(input: BinaryReader | Uint8Array, length?: number): UpdateProjectRoleResponse {
7181
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
7182
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
7183
+ if (previousRecursionDepth >= 100) {
7184
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
7185
+ }
7186
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
7187
+ try {
7188
+ const end = length === undefined ? reader.len : reader.pos + length;
7189
+ const message = createBaseUpdateProjectRoleResponse();
7190
+ while (reader.pos < end) {
7191
+ const tag = reader.uint32();
7192
+ switch (tag >>> 3) {
7193
+ case 1: {
7194
+ if (tag !== 10) {
7195
+ break;
7196
+ }
7197
+
7198
+ message.status = ResponseStatus.decode(reader, reader.uint32());
7199
+ continue;
7200
+ }
7201
+ case 2: {
7202
+ if (tag !== 18) {
7203
+ break;
7204
+ }
7205
+
7206
+ message.projectUser = ProjectUser.decode(reader, reader.uint32());
7207
+ continue;
7208
+ }
7209
+ }
7210
+ if ((tag & 7) === 4 || tag === 0) {
7211
+ break;
7212
+ }
7213
+ reader.skip(tag & 7);
7214
+ }
7215
+ return message;
7216
+ } finally {
7217
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
7218
+ }
7219
+ },
7220
+
7221
+ fromJSON(object: any): UpdateProjectRoleResponse {
7222
+ return {
7223
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
7224
+ projectUser: isSet(object.projectUser)
7225
+ ? ProjectUser.fromJSON(object.projectUser)
7226
+ : isSet(object.project_user)
7227
+ ? ProjectUser.fromJSON(object.project_user)
7228
+ : undefined,
7229
+ };
7230
+ },
7231
+
7232
+ toJSON(message: UpdateProjectRoleResponse): unknown {
7233
+ const obj: any = {};
7234
+ if (message.status !== undefined) {
7235
+ obj.status = ResponseStatus.toJSON(message.status);
7236
+ }
7237
+ if (message.projectUser !== undefined) {
7238
+ obj.projectUser = ProjectUser.toJSON(message.projectUser);
7239
+ }
7240
+ return obj;
7241
+ },
7242
+
7243
+ create<I extends Exact<DeepPartial<UpdateProjectRoleResponse>, I>>(base?: I): UpdateProjectRoleResponse {
7244
+ return UpdateProjectRoleResponse.fromPartial(base ?? ({} as any));
7245
+ },
7246
+ fromPartial<I extends Exact<DeepPartial<UpdateProjectRoleResponse>, I>>(object: I): UpdateProjectRoleResponse {
7247
+ const message = createBaseUpdateProjectRoleResponse();
7248
+ message.status = (object.status !== undefined && object.status !== null)
7249
+ ? ResponseStatus.fromPartial(object.status)
7250
+ : undefined;
7251
+ message.projectUser = (object.projectUser !== undefined && object.projectUser !== null)
7252
+ ? ProjectUser.fromPartial(object.projectUser)
7253
+ : undefined;
7254
+ return message;
7255
+ },
7256
+ };
7257
+
7258
+ function createBaseRemoveProjectRoleRequest(): RemoveProjectRoleRequest {
7259
+ return { organizationId: "", projectId: "", userId: "" };
7260
+ }
7261
+
7262
+ export const RemoveProjectRoleRequest: MessageFns<RemoveProjectRoleRequest> = {
7263
+ encode(message: RemoveProjectRoleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
7264
+ if (message.organizationId !== "") {
7265
+ writer.uint32(10).string(message.organizationId);
7266
+ }
7267
+ if (message.projectId !== "") {
7268
+ writer.uint32(18).string(message.projectId);
7269
+ }
7270
+ if (message.userId !== "") {
7271
+ writer.uint32(26).string(message.userId);
7272
+ }
7273
+ return writer;
7274
+ },
7275
+
7276
+ decode(input: BinaryReader | Uint8Array, length?: number): RemoveProjectRoleRequest {
7277
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
7278
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
7279
+ if (previousRecursionDepth >= 100) {
7280
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
7281
+ }
7282
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
7283
+ try {
7284
+ const end = length === undefined ? reader.len : reader.pos + length;
7285
+ const message = createBaseRemoveProjectRoleRequest();
7286
+ while (reader.pos < end) {
7287
+ const tag = reader.uint32();
7288
+ switch (tag >>> 3) {
7289
+ case 1: {
7290
+ if (tag !== 10) {
7291
+ break;
7292
+ }
7293
+
7294
+ message.organizationId = reader.string();
7295
+ continue;
7296
+ }
7297
+ case 2: {
7298
+ if (tag !== 18) {
7299
+ break;
7300
+ }
7301
+
7302
+ message.projectId = reader.string();
7303
+ continue;
7304
+ }
7305
+ case 3: {
7306
+ if (tag !== 26) {
7307
+ break;
7308
+ }
7309
+
7310
+ message.userId = reader.string();
7311
+ continue;
7312
+ }
7313
+ }
7314
+ if ((tag & 7) === 4 || tag === 0) {
7315
+ break;
7316
+ }
7317
+ reader.skip(tag & 7);
7318
+ }
7319
+ return message;
7320
+ } finally {
7321
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
7322
+ }
7323
+ },
7324
+
7325
+ fromJSON(object: any): RemoveProjectRoleRequest {
7326
+ return {
7327
+ organizationId: isSet(object.organizationId)
7328
+ ? globalThis.String(object.organizationId)
7329
+ : isSet(object.organization_id)
7330
+ ? globalThis.String(object.organization_id)
7331
+ : "",
7332
+ projectId: isSet(object.projectId)
7333
+ ? globalThis.String(object.projectId)
7334
+ : isSet(object.project_id)
7335
+ ? globalThis.String(object.project_id)
7336
+ : "",
7337
+ userId: isSet(object.userId)
7338
+ ? globalThis.String(object.userId)
7339
+ : isSet(object.user_id)
7340
+ ? globalThis.String(object.user_id)
7341
+ : "",
7342
+ };
7343
+ },
7344
+
7345
+ toJSON(message: RemoveProjectRoleRequest): unknown {
7346
+ const obj: any = {};
7347
+ if (message.organizationId !== "") {
7348
+ obj.organizationId = message.organizationId;
7349
+ }
7350
+ if (message.projectId !== "") {
7351
+ obj.projectId = message.projectId;
7352
+ }
7353
+ if (message.userId !== "") {
7354
+ obj.userId = message.userId;
7355
+ }
7356
+ return obj;
7357
+ },
7358
+
7359
+ create<I extends Exact<DeepPartial<RemoveProjectRoleRequest>, I>>(base?: I): RemoveProjectRoleRequest {
7360
+ return RemoveProjectRoleRequest.fromPartial(base ?? ({} as any));
7361
+ },
7362
+ fromPartial<I extends Exact<DeepPartial<RemoveProjectRoleRequest>, I>>(object: I): RemoveProjectRoleRequest {
7363
+ const message = createBaseRemoveProjectRoleRequest();
7364
+ message.organizationId = object.organizationId ?? "";
7365
+ message.projectId = object.projectId ?? "";
7366
+ message.userId = object.userId ?? "";
7367
+ return message;
7368
+ },
7369
+ };
7370
+
7371
+ function createBaseRemoveProjectRoleResponse(): RemoveProjectRoleResponse {
7372
+ return { status: undefined };
7373
+ }
7374
+
7375
+ export const RemoveProjectRoleResponse: MessageFns<RemoveProjectRoleResponse> = {
7376
+ encode(message: RemoveProjectRoleResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
7377
+ if (message.status !== undefined) {
7378
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
7379
+ }
7380
+ return writer;
7381
+ },
7382
+
7383
+ decode(input: BinaryReader | Uint8Array, length?: number): RemoveProjectRoleResponse {
7384
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
7385
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
7386
+ if (previousRecursionDepth >= 100) {
7387
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
7388
+ }
7389
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
7390
+ try {
7391
+ const end = length === undefined ? reader.len : reader.pos + length;
7392
+ const message = createBaseRemoveProjectRoleResponse();
7393
+ while (reader.pos < end) {
7394
+ const tag = reader.uint32();
7395
+ switch (tag >>> 3) {
7396
+ case 1: {
7397
+ if (tag !== 10) {
7398
+ break;
7399
+ }
7400
+
7401
+ message.status = ResponseStatus.decode(reader, reader.uint32());
7402
+ continue;
7403
+ }
7404
+ }
7405
+ if ((tag & 7) === 4 || tag === 0) {
7406
+ break;
7407
+ }
7408
+ reader.skip(tag & 7);
7409
+ }
7410
+ return message;
7411
+ } finally {
7412
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
7413
+ }
7414
+ },
7415
+
7416
+ fromJSON(object: any): RemoveProjectRoleResponse {
7417
+ return { status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined };
7418
+ },
7419
+
7420
+ toJSON(message: RemoveProjectRoleResponse): unknown {
7421
+ const obj: any = {};
7422
+ if (message.status !== undefined) {
7423
+ obj.status = ResponseStatus.toJSON(message.status);
7424
+ }
7425
+ return obj;
7426
+ },
7427
+
7428
+ create<I extends Exact<DeepPartial<RemoveProjectRoleResponse>, I>>(base?: I): RemoveProjectRoleResponse {
7429
+ return RemoveProjectRoleResponse.fromPartial(base ?? ({} as any));
7430
+ },
7431
+ fromPartial<I extends Exact<DeepPartial<RemoveProjectRoleResponse>, I>>(object: I): RemoveProjectRoleResponse {
7432
+ const message = createBaseRemoveProjectRoleResponse();
7433
+ message.status = (object.status !== undefined && object.status !== null)
7434
+ ? ResponseStatus.fromPartial(object.status)
7435
+ : undefined;
7436
+ return message;
7437
+ },
7438
+ };
7439
+
7440
+ function createBaseListProjectRolesRequest(): ListProjectRolesRequest {
7441
+ return { organizationId: "", projectId: "", filter: undefined, pageSize: 0, pageToken: "" };
7442
+ }
7443
+
7444
+ export const ListProjectRolesRequest: MessageFns<ListProjectRolesRequest> = {
7445
+ encode(message: ListProjectRolesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
7446
+ if (message.organizationId !== "") {
7447
+ writer.uint32(10).string(message.organizationId);
7448
+ }
7449
+ if (message.projectId !== "") {
7450
+ writer.uint32(18).string(message.projectId);
7451
+ }
7452
+ if (message.filter !== undefined) {
7453
+ ProjectUserFilter.encode(message.filter, writer.uint32(26).fork()).join();
7454
+ }
7455
+ if (message.pageSize !== 0) {
7456
+ writer.uint32(32).int32(message.pageSize);
7457
+ }
7458
+ if (message.pageToken !== "") {
7459
+ writer.uint32(42).string(message.pageToken);
7460
+ }
7461
+ return writer;
7462
+ },
7463
+
7464
+ decode(input: BinaryReader | Uint8Array, length?: number): ListProjectRolesRequest {
7465
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
7466
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
7467
+ if (previousRecursionDepth >= 100) {
7468
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
7469
+ }
7470
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
7471
+ try {
7472
+ const end = length === undefined ? reader.len : reader.pos + length;
7473
+ const message = createBaseListProjectRolesRequest();
7474
+ while (reader.pos < end) {
7475
+ const tag = reader.uint32();
7476
+ switch (tag >>> 3) {
7477
+ case 1: {
7478
+ if (tag !== 10) {
7479
+ break;
7480
+ }
7481
+
7482
+ message.organizationId = reader.string();
7483
+ continue;
7484
+ }
7485
+ case 2: {
7486
+ if (tag !== 18) {
7487
+ break;
7488
+ }
7489
+
7490
+ message.projectId = reader.string();
7491
+ continue;
7492
+ }
7493
+ case 3: {
7494
+ if (tag !== 26) {
7495
+ break;
7496
+ }
7497
+
7498
+ message.filter = ProjectUserFilter.decode(reader, reader.uint32());
7499
+ continue;
7500
+ }
7501
+ case 4: {
7502
+ if (tag !== 32) {
7503
+ break;
7504
+ }
7505
+
7506
+ message.pageSize = reader.int32();
7507
+ continue;
7508
+ }
7509
+ case 5: {
7510
+ if (tag !== 42) {
7511
+ break;
7512
+ }
7513
+
7514
+ message.pageToken = reader.string();
7515
+ continue;
7516
+ }
7517
+ }
7518
+ if ((tag & 7) === 4 || tag === 0) {
7519
+ break;
7520
+ }
7521
+ reader.skip(tag & 7);
7522
+ }
7523
+ return message;
7524
+ } finally {
7525
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
7526
+ }
7527
+ },
7528
+
7529
+ fromJSON(object: any): ListProjectRolesRequest {
7530
+ return {
7531
+ organizationId: isSet(object.organizationId)
7532
+ ? globalThis.String(object.organizationId)
7533
+ : isSet(object.organization_id)
7534
+ ? globalThis.String(object.organization_id)
7535
+ : "",
7536
+ projectId: isSet(object.projectId)
7537
+ ? globalThis.String(object.projectId)
7538
+ : isSet(object.project_id)
7539
+ ? globalThis.String(object.project_id)
7540
+ : "",
7541
+ filter: isSet(object.filter) ? ProjectUserFilter.fromJSON(object.filter) : undefined,
7542
+ pageSize: isSet(object.pageSize)
7543
+ ? globalThis.Number(object.pageSize)
7544
+ : isSet(object.page_size)
7545
+ ? globalThis.Number(object.page_size)
7546
+ : 0,
7547
+ pageToken: isSet(object.pageToken)
7548
+ ? globalThis.String(object.pageToken)
7549
+ : isSet(object.page_token)
7550
+ ? globalThis.String(object.page_token)
7551
+ : "",
7552
+ };
7553
+ },
7554
+
7555
+ toJSON(message: ListProjectRolesRequest): unknown {
7556
+ const obj: any = {};
7557
+ if (message.organizationId !== "") {
7558
+ obj.organizationId = message.organizationId;
7559
+ }
7560
+ if (message.projectId !== "") {
7561
+ obj.projectId = message.projectId;
7562
+ }
7563
+ if (message.filter !== undefined) {
7564
+ obj.filter = ProjectUserFilter.toJSON(message.filter);
7565
+ }
7566
+ if (message.pageSize !== 0) {
7567
+ obj.pageSize = Math.round(message.pageSize);
7568
+ }
7569
+ if (message.pageToken !== "") {
7570
+ obj.pageToken = message.pageToken;
7571
+ }
7572
+ return obj;
7573
+ },
7574
+
7575
+ create<I extends Exact<DeepPartial<ListProjectRolesRequest>, I>>(base?: I): ListProjectRolesRequest {
7576
+ return ListProjectRolesRequest.fromPartial(base ?? ({} as any));
7577
+ },
7578
+ fromPartial<I extends Exact<DeepPartial<ListProjectRolesRequest>, I>>(object: I): ListProjectRolesRequest {
7579
+ const message = createBaseListProjectRolesRequest();
7580
+ message.organizationId = object.organizationId ?? "";
7581
+ message.projectId = object.projectId ?? "";
7582
+ message.filter = (object.filter !== undefined && object.filter !== null)
7583
+ ? ProjectUserFilter.fromPartial(object.filter)
7584
+ : undefined;
7585
+ message.pageSize = object.pageSize ?? 0;
7586
+ message.pageToken = object.pageToken ?? "";
7587
+ return message;
7588
+ },
7589
+ };
7590
+
7591
+ function createBaseListProjectRolesResponse(): ListProjectRolesResponse {
7592
+ return { status: undefined, projectUsers: [], nextPageToken: "" };
7593
+ }
7594
+
7595
+ export const ListProjectRolesResponse: MessageFns<ListProjectRolesResponse> = {
7596
+ encode(message: ListProjectRolesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
7597
+ if (message.status !== undefined) {
7598
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
7599
+ }
7600
+ for (const v of message.projectUsers) {
7601
+ ProjectUser.encode(v!, writer.uint32(18).fork()).join();
7602
+ }
7603
+ if (message.nextPageToken !== "") {
7604
+ writer.uint32(26).string(message.nextPageToken);
7605
+ }
7606
+ return writer;
7607
+ },
7608
+
7609
+ decode(input: BinaryReader | Uint8Array, length?: number): ListProjectRolesResponse {
7610
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
7611
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
7612
+ if (previousRecursionDepth >= 100) {
7613
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
7614
+ }
7615
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
7616
+ try {
7617
+ const end = length === undefined ? reader.len : reader.pos + length;
7618
+ const message = createBaseListProjectRolesResponse();
7619
+ while (reader.pos < end) {
7620
+ const tag = reader.uint32();
7621
+ switch (tag >>> 3) {
7622
+ case 1: {
7623
+ if (tag !== 10) {
7624
+ break;
7625
+ }
7626
+
7627
+ message.status = ResponseStatus.decode(reader, reader.uint32());
7628
+ continue;
7629
+ }
7630
+ case 2: {
7631
+ if (tag !== 18) {
7632
+ break;
7633
+ }
7634
+
7635
+ message.projectUsers.push(ProjectUser.decode(reader, reader.uint32()));
7636
+ continue;
7637
+ }
7638
+ case 3: {
7639
+ if (tag !== 26) {
7640
+ break;
7641
+ }
7642
+
7643
+ message.nextPageToken = reader.string();
7644
+ continue;
7645
+ }
7646
+ }
7647
+ if ((tag & 7) === 4 || tag === 0) {
7648
+ break;
7649
+ }
7650
+ reader.skip(tag & 7);
7651
+ }
7652
+ return message;
7653
+ } finally {
7654
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
7655
+ }
7656
+ },
7657
+
7658
+ fromJSON(object: any): ListProjectRolesResponse {
7659
+ return {
7660
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
7661
+ projectUsers: globalThis.Array.isArray(object?.projectUsers)
7662
+ ? object.projectUsers.map((e: any) => ProjectUser.fromJSON(e))
7663
+ : globalThis.Array.isArray(object?.project_users)
7664
+ ? object.project_users.map((e: any) => ProjectUser.fromJSON(e))
7665
+ : [],
7666
+ nextPageToken: isSet(object.nextPageToken)
7667
+ ? globalThis.String(object.nextPageToken)
7668
+ : isSet(object.next_page_token)
7669
+ ? globalThis.String(object.next_page_token)
7670
+ : "",
7671
+ };
7672
+ },
7673
+
7674
+ toJSON(message: ListProjectRolesResponse): unknown {
7675
+ const obj: any = {};
7676
+ if (message.status !== undefined) {
7677
+ obj.status = ResponseStatus.toJSON(message.status);
7678
+ }
7679
+ if (message.projectUsers?.length) {
7680
+ obj.projectUsers = message.projectUsers.map((e) => ProjectUser.toJSON(e));
7681
+ }
7682
+ if (message.nextPageToken !== "") {
7683
+ obj.nextPageToken = message.nextPageToken;
7684
+ }
7685
+ return obj;
7686
+ },
7687
+
7688
+ create<I extends Exact<DeepPartial<ListProjectRolesResponse>, I>>(base?: I): ListProjectRolesResponse {
7689
+ return ListProjectRolesResponse.fromPartial(base ?? ({} as any));
7690
+ },
7691
+ fromPartial<I extends Exact<DeepPartial<ListProjectRolesResponse>, I>>(object: I): ListProjectRolesResponse {
7692
+ const message = createBaseListProjectRolesResponse();
7693
+ message.status = (object.status !== undefined && object.status !== null)
7694
+ ? ResponseStatus.fromPartial(object.status)
7695
+ : undefined;
7696
+ message.projectUsers = object.projectUsers?.map((e) => ProjectUser.fromPartial(e)) || [];
7697
+ message.nextPageToken = object.nextPageToken ?? "";
7698
+ return message;
7699
+ },
7700
+ };
7701
+
7702
+ function createBaseProjectUserFilter(): ProjectUserFilter {
7703
+ return { roles: [], userIds: [] };
7704
+ }
7705
+
7706
+ export const ProjectUserFilter: MessageFns<ProjectUserFilter> = {
7707
+ encode(message: ProjectUserFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
7708
+ for (const v of message.roles) {
7709
+ writer.uint32(8).int32(v!);
7710
+ }
7711
+ for (const v of message.userIds) {
7712
+ writer.uint32(18).string(v!);
7713
+ }
7714
+ return writer;
7715
+ },
7716
+
7717
+ decode(input: BinaryReader | Uint8Array, length?: number): ProjectUserFilter {
7718
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
7719
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
7720
+ if (previousRecursionDepth >= 100) {
7721
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
7722
+ }
7723
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
7724
+ try {
7725
+ const end = length === undefined ? reader.len : reader.pos + length;
7726
+ const message = createBaseProjectUserFilter();
7727
+ while (reader.pos < end) {
7728
+ const tag = reader.uint32();
7729
+ switch (tag >>> 3) {
7730
+ case 1: {
7731
+ if (tag === 8) {
7732
+ message.roles.push(reader.int32() as any);
7733
+
7734
+ continue;
7735
+ }
7736
+
7737
+ if (tag === 10) {
7738
+ const end2 = reader.uint32() + reader.pos;
7739
+ while (reader.pos < end2) {
7740
+ message.roles.push(reader.int32() as any);
7741
+ }
7742
+
7743
+ continue;
7744
+ }
7745
+
7746
+ break;
7747
+ }
7748
+ case 2: {
7749
+ if (tag !== 18) {
7750
+ break;
7751
+ }
7752
+
7753
+ message.userIds.push(reader.string());
7754
+ continue;
7755
+ }
7756
+ }
7757
+ if ((tag & 7) === 4 || tag === 0) {
7758
+ break;
7759
+ }
7760
+ reader.skip(tag & 7);
7761
+ }
7762
+ return message;
7763
+ } finally {
7764
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
7765
+ }
7766
+ },
7767
+
7768
+ fromJSON(object: any): ProjectUserFilter {
7769
+ return {
7770
+ roles: globalThis.Array.isArray(object?.roles) ? object.roles.map((e: any) => projectRoleFromJSON(e)) : [],
7771
+ userIds: globalThis.Array.isArray(object?.userIds)
7772
+ ? object.userIds.map((e: any) => globalThis.String(e))
7773
+ : globalThis.Array.isArray(object?.user_ids)
7774
+ ? object.user_ids.map((e: any) => globalThis.String(e))
7775
+ : [],
7776
+ };
7777
+ },
7778
+
7779
+ toJSON(message: ProjectUserFilter): unknown {
7780
+ const obj: any = {};
7781
+ if (message.roles?.length) {
7782
+ obj.roles = message.roles.map((e) => projectRoleToJSON(e));
7783
+ }
7784
+ if (message.userIds?.length) {
7785
+ obj.userIds = message.userIds;
7786
+ }
7787
+ return obj;
7788
+ },
7789
+
7790
+ create<I extends Exact<DeepPartial<ProjectUserFilter>, I>>(base?: I): ProjectUserFilter {
7791
+ return ProjectUserFilter.fromPartial(base ?? ({} as any));
7792
+ },
7793
+ fromPartial<I extends Exact<DeepPartial<ProjectUserFilter>, I>>(object: I): ProjectUserFilter {
7794
+ const message = createBaseProjectUserFilter();
7795
+ message.roles = object.roles?.map((e) => e) || [];
7796
+ message.userIds = object.userIds?.map((e) => e) || [];
7797
+ return message;
7798
+ },
7799
+ };
7800
+
7801
+ function createBaseProjectUser(): ProjectUser {
7802
+ return { userId: "", organizationId: "", projectId: "", role: 0, createdAt: undefined, updatedAt: undefined };
7803
+ }
7804
+
7805
+ export const ProjectUser: MessageFns<ProjectUser> = {
7806
+ encode(message: ProjectUser, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
7807
+ if (message.userId !== "") {
7808
+ writer.uint32(10).string(message.userId);
7809
+ }
7810
+ if (message.organizationId !== "") {
7811
+ writer.uint32(18).string(message.organizationId);
7812
+ }
7813
+ if (message.projectId !== "") {
7814
+ writer.uint32(26).string(message.projectId);
7815
+ }
7816
+ if (message.role !== 0) {
7817
+ writer.uint32(32).int32(message.role);
7818
+ }
7819
+ if (message.createdAt !== undefined) {
7820
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(42).fork()).join();
7821
+ }
7822
+ if (message.updatedAt !== undefined) {
7823
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(50).fork()).join();
7824
+ }
7825
+ return writer;
7826
+ },
7827
+
7828
+ decode(input: BinaryReader | Uint8Array, length?: number): ProjectUser {
7829
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
7830
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
7831
+ if (previousRecursionDepth >= 100) {
7832
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
7833
+ }
7834
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
7835
+ try {
7836
+ const end = length === undefined ? reader.len : reader.pos + length;
7837
+ const message = createBaseProjectUser();
7838
+ while (reader.pos < end) {
7839
+ const tag = reader.uint32();
7840
+ switch (tag >>> 3) {
7841
+ case 1: {
7842
+ if (tag !== 10) {
7843
+ break;
7844
+ }
7845
+
7846
+ message.userId = reader.string();
7847
+ continue;
7848
+ }
7849
+ case 2: {
7850
+ if (tag !== 18) {
7851
+ break;
7852
+ }
7853
+
7854
+ message.organizationId = reader.string();
7855
+ continue;
7856
+ }
7857
+ case 3: {
7858
+ if (tag !== 26) {
7859
+ break;
7860
+ }
7861
+
7862
+ message.projectId = reader.string();
7863
+ continue;
7864
+ }
7865
+ case 4: {
7866
+ if (tag !== 32) {
7867
+ break;
7868
+ }
7869
+
7870
+ message.role = reader.int32() as any;
7871
+ continue;
7872
+ }
7873
+ case 5: {
7874
+ if (tag !== 42) {
7875
+ break;
7876
+ }
7877
+
7878
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
7879
+ continue;
7880
+ }
7881
+ case 6: {
7882
+ if (tag !== 50) {
7883
+ break;
7884
+ }
7885
+
7886
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
7887
+ continue;
7888
+ }
7889
+ }
7890
+ if ((tag & 7) === 4 || tag === 0) {
7891
+ break;
7892
+ }
7893
+ reader.skip(tag & 7);
7894
+ }
7895
+ return message;
7896
+ } finally {
7897
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
7898
+ }
7899
+ },
7900
+
7901
+ fromJSON(object: any): ProjectUser {
7902
+ return {
7903
+ userId: isSet(object.userId)
7904
+ ? globalThis.String(object.userId)
7905
+ : isSet(object.user_id)
7906
+ ? globalThis.String(object.user_id)
7907
+ : "",
7908
+ organizationId: isSet(object.organizationId)
7909
+ ? globalThis.String(object.organizationId)
7910
+ : isSet(object.organization_id)
7911
+ ? globalThis.String(object.organization_id)
7912
+ : "",
7913
+ projectId: isSet(object.projectId)
7914
+ ? globalThis.String(object.projectId)
7915
+ : isSet(object.project_id)
7916
+ ? globalThis.String(object.project_id)
7917
+ : "",
7918
+ role: isSet(object.role) ? projectRoleFromJSON(object.role) : 0,
7919
+ createdAt: isSet(object.createdAt)
7920
+ ? fromJsonTimestamp(object.createdAt)
7921
+ : isSet(object.created_at)
7922
+ ? fromJsonTimestamp(object.created_at)
7923
+ : undefined,
7924
+ updatedAt: isSet(object.updatedAt)
7925
+ ? fromJsonTimestamp(object.updatedAt)
7926
+ : isSet(object.updated_at)
7927
+ ? fromJsonTimestamp(object.updated_at)
7928
+ : undefined,
7929
+ };
7930
+ },
7931
+
7932
+ toJSON(message: ProjectUser): unknown {
7933
+ const obj: any = {};
7934
+ if (message.userId !== "") {
7935
+ obj.userId = message.userId;
7936
+ }
7937
+ if (message.organizationId !== "") {
7938
+ obj.organizationId = message.organizationId;
7939
+ }
7940
+ if (message.projectId !== "") {
7941
+ obj.projectId = message.projectId;
7942
+ }
7943
+ if (message.role !== 0) {
7944
+ obj.role = projectRoleToJSON(message.role);
7945
+ }
7946
+ if (message.createdAt !== undefined) {
7947
+ obj.createdAt = message.createdAt.toISOString();
7948
+ }
7949
+ if (message.updatedAt !== undefined) {
7950
+ obj.updatedAt = message.updatedAt.toISOString();
7951
+ }
7952
+ return obj;
7953
+ },
7954
+
7955
+ create<I extends Exact<DeepPartial<ProjectUser>, I>>(base?: I): ProjectUser {
7956
+ return ProjectUser.fromPartial(base ?? ({} as any));
7957
+ },
7958
+ fromPartial<I extends Exact<DeepPartial<ProjectUser>, I>>(object: I): ProjectUser {
7959
+ const message = createBaseProjectUser();
7960
+ message.userId = object.userId ?? "";
7961
+ message.organizationId = object.organizationId ?? "";
7962
+ message.projectId = object.projectId ?? "";
7963
+ message.role = object.role ?? 0;
7964
+ message.createdAt = object.createdAt ?? undefined;
7965
+ message.updatedAt = object.updatedAt ?? undefined;
7966
+ return message;
7967
+ },
7968
+ };
7969
+
7970
+ function createBaseListInvitationsRequest(): ListInvitationsRequest {
7971
+ return { organizationId: "" };
7972
+ }
7973
+
7974
+ export const ListInvitationsRequest: MessageFns<ListInvitationsRequest> = {
7975
+ encode(message: ListInvitationsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
7976
+ if (message.organizationId !== "") {
7977
+ writer.uint32(10).string(message.organizationId);
7978
+ }
7979
+ return writer;
7980
+ },
7981
+
7982
+ decode(input: BinaryReader | Uint8Array, length?: number): ListInvitationsRequest {
7983
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
7984
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
7985
+ if (previousRecursionDepth >= 100) {
7986
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
7987
+ }
7988
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
7989
+ try {
7990
+ const end = length === undefined ? reader.len : reader.pos + length;
7991
+ const message = createBaseListInvitationsRequest();
7992
+ while (reader.pos < end) {
7993
+ const tag = reader.uint32();
7994
+ switch (tag >>> 3) {
7995
+ case 1: {
7996
+ if (tag !== 10) {
7997
+ break;
7998
+ }
7999
+
8000
+ message.organizationId = reader.string();
8001
+ continue;
8002
+ }
8003
+ }
8004
+ if ((tag & 7) === 4 || tag === 0) {
8005
+ break;
8006
+ }
8007
+ reader.skip(tag & 7);
8008
+ }
8009
+ return message;
8010
+ } finally {
8011
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
8012
+ }
8013
+ },
8014
+
8015
+ fromJSON(object: any): ListInvitationsRequest {
8016
+ return {
8017
+ organizationId: isSet(object.organizationId)
8018
+ ? globalThis.String(object.organizationId)
8019
+ : isSet(object.organization_id)
8020
+ ? globalThis.String(object.organization_id)
8021
+ : "",
8022
+ };
8023
+ },
8024
+
8025
+ toJSON(message: ListInvitationsRequest): unknown {
8026
+ const obj: any = {};
8027
+ if (message.organizationId !== "") {
8028
+ obj.organizationId = message.organizationId;
8029
+ }
8030
+ return obj;
8031
+ },
8032
+
8033
+ create<I extends Exact<DeepPartial<ListInvitationsRequest>, I>>(base?: I): ListInvitationsRequest {
8034
+ return ListInvitationsRequest.fromPartial(base ?? ({} as any));
8035
+ },
8036
+ fromPartial<I extends Exact<DeepPartial<ListInvitationsRequest>, I>>(object: I): ListInvitationsRequest {
8037
+ const message = createBaseListInvitationsRequest();
8038
+ message.organizationId = object.organizationId ?? "";
8039
+ return message;
8040
+ },
8041
+ };
8042
+
8043
+ function createBaseListInvitationsResponse(): ListInvitationsResponse {
8044
+ return { status: undefined, invitations: [] };
8045
+ }
8046
+
8047
+ export const ListInvitationsResponse: MessageFns<ListInvitationsResponse> = {
8048
+ encode(message: ListInvitationsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
8049
+ if (message.status !== undefined) {
8050
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
8051
+ }
8052
+ for (const v of message.invitations) {
8053
+ Invitation.encode(v!, writer.uint32(18).fork()).join();
8054
+ }
8055
+ return writer;
8056
+ },
8057
+
8058
+ decode(input: BinaryReader | Uint8Array, length?: number): ListInvitationsResponse {
8059
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
8060
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
8061
+ if (previousRecursionDepth >= 100) {
8062
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
8063
+ }
8064
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
8065
+ try {
8066
+ const end = length === undefined ? reader.len : reader.pos + length;
8067
+ const message = createBaseListInvitationsResponse();
8068
+ while (reader.pos < end) {
8069
+ const tag = reader.uint32();
8070
+ switch (tag >>> 3) {
8071
+ case 1: {
8072
+ if (tag !== 10) {
8073
+ break;
8074
+ }
8075
+
8076
+ message.status = ResponseStatus.decode(reader, reader.uint32());
8077
+ continue;
8078
+ }
8079
+ case 2: {
8080
+ if (tag !== 18) {
8081
+ break;
8082
+ }
8083
+
8084
+ message.invitations.push(Invitation.decode(reader, reader.uint32()));
8085
+ continue;
8086
+ }
8087
+ }
8088
+ if ((tag & 7) === 4 || tag === 0) {
8089
+ break;
8090
+ }
8091
+ reader.skip(tag & 7);
8092
+ }
8093
+ return message;
8094
+ } finally {
8095
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
8096
+ }
8097
+ },
8098
+
8099
+ fromJSON(object: any): ListInvitationsResponse {
8100
+ return {
8101
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
8102
+ invitations: globalThis.Array.isArray(object?.invitations)
8103
+ ? object.invitations.map((e: any) => Invitation.fromJSON(e))
8104
+ : [],
8105
+ };
8106
+ },
8107
+
8108
+ toJSON(message: ListInvitationsResponse): unknown {
8109
+ const obj: any = {};
8110
+ if (message.status !== undefined) {
8111
+ obj.status = ResponseStatus.toJSON(message.status);
8112
+ }
8113
+ if (message.invitations?.length) {
8114
+ obj.invitations = message.invitations.map((e) => Invitation.toJSON(e));
8115
+ }
8116
+ return obj;
8117
+ },
8118
+
8119
+ create<I extends Exact<DeepPartial<ListInvitationsResponse>, I>>(base?: I): ListInvitationsResponse {
8120
+ return ListInvitationsResponse.fromPartial(base ?? ({} as any));
8121
+ },
8122
+ fromPartial<I extends Exact<DeepPartial<ListInvitationsResponse>, I>>(object: I): ListInvitationsResponse {
8123
+ const message = createBaseListInvitationsResponse();
8124
+ message.status = (object.status !== undefined && object.status !== null)
8125
+ ? ResponseStatus.fromPartial(object.status)
8126
+ : undefined;
8127
+ message.invitations = object.invitations?.map((e) => Invitation.fromPartial(e)) || [];
8128
+ return message;
8129
+ },
8130
+ };
8131
+
8132
+ function createBaseInvitation(): Invitation {
8133
+ return { id: "", email: "", status: 0, invitedBy: "", createdAt: undefined, updatedAt: undefined };
8134
+ }
8135
+
8136
+ export const Invitation: MessageFns<Invitation> = {
8137
+ encode(message: Invitation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
8138
+ if (message.id !== "") {
8139
+ writer.uint32(10).string(message.id);
8140
+ }
8141
+ if (message.email !== "") {
8142
+ writer.uint32(18).string(message.email);
8143
+ }
8144
+ if (message.status !== 0) {
8145
+ writer.uint32(24).int32(message.status);
8146
+ }
8147
+ if (message.invitedBy !== "") {
8148
+ writer.uint32(34).string(message.invitedBy);
8149
+ }
8150
+ if (message.createdAt !== undefined) {
8151
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(42).fork()).join();
8152
+ }
8153
+ if (message.updatedAt !== undefined) {
8154
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(50).fork()).join();
8155
+ }
8156
+ return writer;
8157
+ },
8158
+
8159
+ decode(input: BinaryReader | Uint8Array, length?: number): Invitation {
8160
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
8161
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
8162
+ if (previousRecursionDepth >= 100) {
8163
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
8164
+ }
8165
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
8166
+ try {
8167
+ const end = length === undefined ? reader.len : reader.pos + length;
8168
+ const message = createBaseInvitation();
8169
+ while (reader.pos < end) {
8170
+ const tag = reader.uint32();
8171
+ switch (tag >>> 3) {
8172
+ case 1: {
8173
+ if (tag !== 10) {
8174
+ break;
8175
+ }
8176
+
8177
+ message.id = reader.string();
8178
+ continue;
8179
+ }
8180
+ case 2: {
8181
+ if (tag !== 18) {
8182
+ break;
8183
+ }
8184
+
8185
+ message.email = reader.string();
8186
+ continue;
8187
+ }
8188
+ case 3: {
8189
+ if (tag !== 24) {
8190
+ break;
8191
+ }
8192
+
8193
+ message.status = reader.int32() as any;
8194
+ continue;
8195
+ }
8196
+ case 4: {
8197
+ if (tag !== 34) {
8198
+ break;
8199
+ }
8200
+
8201
+ message.invitedBy = reader.string();
8202
+ continue;
8203
+ }
8204
+ case 5: {
8205
+ if (tag !== 42) {
8206
+ break;
8207
+ }
8208
+
8209
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
8210
+ continue;
8211
+ }
8212
+ case 6: {
8213
+ if (tag !== 50) {
8214
+ break;
8215
+ }
8216
+
8217
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
8218
+ continue;
8219
+ }
8220
+ }
8221
+ if ((tag & 7) === 4 || tag === 0) {
8222
+ break;
8223
+ }
8224
+ reader.skip(tag & 7);
8225
+ }
8226
+ return message;
8227
+ } finally {
8228
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
8229
+ }
8230
+ },
8231
+
8232
+ fromJSON(object: any): Invitation {
8233
+ return {
8234
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
8235
+ email: isSet(object.email) ? globalThis.String(object.email) : "",
8236
+ status: isSet(object.status) ? invitationStatusFromJSON(object.status) : 0,
8237
+ invitedBy: isSet(object.invitedBy)
8238
+ ? globalThis.String(object.invitedBy)
8239
+ : isSet(object.invited_by)
8240
+ ? globalThis.String(object.invited_by)
8241
+ : "",
8242
+ createdAt: isSet(object.createdAt)
8243
+ ? fromJsonTimestamp(object.createdAt)
8244
+ : isSet(object.created_at)
8245
+ ? fromJsonTimestamp(object.created_at)
8246
+ : undefined,
8247
+ updatedAt: isSet(object.updatedAt)
8248
+ ? fromJsonTimestamp(object.updatedAt)
8249
+ : isSet(object.updated_at)
8250
+ ? fromJsonTimestamp(object.updated_at)
8251
+ : undefined,
8252
+ };
8253
+ },
8254
+
8255
+ toJSON(message: Invitation): unknown {
8256
+ const obj: any = {};
8257
+ if (message.id !== "") {
8258
+ obj.id = message.id;
8259
+ }
8260
+ if (message.email !== "") {
8261
+ obj.email = message.email;
8262
+ }
8263
+ if (message.status !== 0) {
8264
+ obj.status = invitationStatusToJSON(message.status);
8265
+ }
8266
+ if (message.invitedBy !== "") {
8267
+ obj.invitedBy = message.invitedBy;
8268
+ }
8269
+ if (message.createdAt !== undefined) {
8270
+ obj.createdAt = message.createdAt.toISOString();
6998
8271
  }
6999
8272
  if (message.updatedAt !== undefined) {
7000
8273
  obj.updatedAt = message.updatedAt.toISOString();
@@ -10371,6 +11644,17 @@ export interface AccountGatewayService {
10371
11644
  ListUsers(request: ListUsersRequest, metadata?: Metadata): Promise<ListUsersResponse>;
10372
11645
  UpdateUser(request: UpdateUserRequest, metadata?: Metadata): Promise<UpdateUserResponse>;
10373
11646
  RemoveUser(request: RemoveUserRequest, metadata?: Metadata): Promise<RemoveUserResponse>;
11647
+ /**
11648
+ * Team roles: who is in which project (a Terma team) and their role there. Organization admins only, in every
11649
+ * product. A project that is not an active project of the organization, the shared demo project included, is not
11650
+ * found; assigning a user who is not an activated member of the organization fails its precondition; assigning a
11651
+ * user who already has a role in the project already exists; updating or removing a role the user does not have is
11652
+ * not found. ListProjectRoles pages by user_id.
11653
+ */
11654
+ AssignProjectRole(request: AssignProjectRoleRequest, metadata?: Metadata): Promise<AssignProjectRoleResponse>;
11655
+ UpdateProjectRole(request: UpdateProjectRoleRequest, metadata?: Metadata): Promise<UpdateProjectRoleResponse>;
11656
+ RemoveProjectRole(request: RemoveProjectRoleRequest, metadata?: Metadata): Promise<RemoveProjectRoleResponse>;
11657
+ ListProjectRoles(request: ListProjectRolesRequest, metadata?: Metadata): Promise<ListProjectRolesResponse>;
10374
11658
  /** Invitation management operations */
10375
11659
  InviteUser(request: InviteUserRequest, metadata?: Metadata): Promise<InviteUserResponse>;
10376
11660
  ListInvitations(request: ListInvitationsRequest, metadata?: Metadata): Promise<ListInvitationsResponse>;
@@ -10432,6 +11716,10 @@ export class AccountGatewayServiceClientImpl implements AccountGatewayService {
10432
11716
  this.ListUsers = this.ListUsers.bind(this);
10433
11717
  this.UpdateUser = this.UpdateUser.bind(this);
10434
11718
  this.RemoveUser = this.RemoveUser.bind(this);
11719
+ this.AssignProjectRole = this.AssignProjectRole.bind(this);
11720
+ this.UpdateProjectRole = this.UpdateProjectRole.bind(this);
11721
+ this.RemoveProjectRole = this.RemoveProjectRole.bind(this);
11722
+ this.ListProjectRoles = this.ListProjectRoles.bind(this);
10435
11723
  this.InviteUser = this.InviteUser.bind(this);
10436
11724
  this.ListInvitations = this.ListInvitations.bind(this);
10437
11725
  this.RevokeInvitation = this.RevokeInvitation.bind(this);
@@ -10584,6 +11872,30 @@ export class AccountGatewayServiceClientImpl implements AccountGatewayService {
10584
11872
  return promise.then((data) => RemoveUserResponse.decode(new BinaryReader(data)));
10585
11873
  }
10586
11874
 
11875
+ AssignProjectRole(request: AssignProjectRoleRequest, metadata?: Metadata): Promise<AssignProjectRoleResponse> {
11876
+ const data = AssignProjectRoleRequest.encode(request).finish();
11877
+ const promise = this.rpc.request(this.service, "AssignProjectRole", data, metadata);
11878
+ return promise.then((data) => AssignProjectRoleResponse.decode(new BinaryReader(data)));
11879
+ }
11880
+
11881
+ UpdateProjectRole(request: UpdateProjectRoleRequest, metadata?: Metadata): Promise<UpdateProjectRoleResponse> {
11882
+ const data = UpdateProjectRoleRequest.encode(request).finish();
11883
+ const promise = this.rpc.request(this.service, "UpdateProjectRole", data, metadata);
11884
+ return promise.then((data) => UpdateProjectRoleResponse.decode(new BinaryReader(data)));
11885
+ }
11886
+
11887
+ RemoveProjectRole(request: RemoveProjectRoleRequest, metadata?: Metadata): Promise<RemoveProjectRoleResponse> {
11888
+ const data = RemoveProjectRoleRequest.encode(request).finish();
11889
+ const promise = this.rpc.request(this.service, "RemoveProjectRole", data, metadata);
11890
+ return promise.then((data) => RemoveProjectRoleResponse.decode(new BinaryReader(data)));
11891
+ }
11892
+
11893
+ ListProjectRoles(request: ListProjectRolesRequest, metadata?: Metadata): Promise<ListProjectRolesResponse> {
11894
+ const data = ListProjectRolesRequest.encode(request).finish();
11895
+ const promise = this.rpc.request(this.service, "ListProjectRoles", data, metadata);
11896
+ return promise.then((data) => ListProjectRolesResponse.decode(new BinaryReader(data)));
11897
+ }
11898
+
10587
11899
  InviteUser(request: InviteUserRequest, metadata?: Metadata): Promise<InviteUserResponse> {
10588
11900
  const data = InviteUserRequest.encode(request).finish();
10589
11901
  const promise = this.rpc.request(this.service, "InviteUser", data, metadata);