@ssoeasy-dev/proto 1.1.0-beta.2

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 (41) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +228 -0
  3. package/gen/ts/abac/v1/employee_attribute.ts +501 -0
  4. package/gen/ts/abac/v1/models/employee_attribute.ts +190 -0
  5. package/gen/ts/auth/v1/auth.ts +663 -0
  6. package/gen/ts/auth/v1/verification.ts +340 -0
  7. package/gen/ts/common/v1/types.ts +142 -0
  8. package/gen/ts/companies/v1/models/company.ts +204 -0
  9. package/gen/ts/companies/v1/models/employee.ts +175 -0
  10. package/gen/ts/companies/v1/models/employee_company.ts +145 -0
  11. package/gen/ts/companies/v1/models/subscription.ts +166 -0
  12. package/gen/ts/companies/v1/owner.ts +569 -0
  13. package/gen/ts/google/protobuf/timestamp.ts +233 -0
  14. package/gen/ts/index.abac.ts +8 -0
  15. package/gen/ts/index.abac.v1.models.ts +8 -0
  16. package/gen/ts/index.abac.v1.ts +9 -0
  17. package/gen/ts/index.auth.ts +8 -0
  18. package/gen/ts/index.auth.v1.ts +9 -0
  19. package/gen/ts/index.common.ts +8 -0
  20. package/gen/ts/index.common.v1.ts +8 -0
  21. package/gen/ts/index.companies.ts +8 -0
  22. package/gen/ts/index.companies.v1.models.ts +11 -0
  23. package/gen/ts/index.companies.v1.ts +9 -0
  24. package/gen/ts/index.google.protobuf.ts +8 -0
  25. package/gen/ts/index.google.ts +8 -0
  26. package/gen/ts/index.services.ts +8 -0
  27. package/gen/ts/index.services.v1.ts +8 -0
  28. package/gen/ts/index.ts +13 -0
  29. package/gen/ts/services/v1/services.ts +293 -0
  30. package/package.json +69 -0
  31. package/proto/abac/v1/employee_attribute.proto +31 -0
  32. package/proto/abac/v1/models/employee_attribute.proto +11 -0
  33. package/proto/auth/v1/auth.proto +39 -0
  34. package/proto/auth/v1/verification.proto +25 -0
  35. package/proto/common/v1/types.proto +10 -0
  36. package/proto/companies/v1/models/company.proto +12 -0
  37. package/proto/companies/v1/models/employee.proto +11 -0
  38. package/proto/companies/v1/models/employee_company.proto +9 -0
  39. package/proto/companies/v1/models/subscription.proto +10 -0
  40. package/proto/companies/v1/owner.proto +38 -0
  41. package/proto/services/v1/services.proto +19 -0
@@ -0,0 +1,340 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.2
4
+ // protoc unknown
5
+ // source: auth/v1/verification.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+ import type { CallContext, CallOptions } from "nice-grpc-common";
10
+
11
+ export enum VerificationType {
12
+ email_code = "email_code",
13
+ email_link = "email_link",
14
+ UNRECOGNIZED = "UNRECOGNIZED",
15
+ }
16
+
17
+ export function verificationTypeFromJSON(object: any): VerificationType {
18
+ switch (object) {
19
+ case 0:
20
+ case "email_code":
21
+ return VerificationType.email_code;
22
+ case 1:
23
+ case "email_link":
24
+ return VerificationType.email_link;
25
+ case -1:
26
+ case "UNRECOGNIZED":
27
+ default:
28
+ return VerificationType.UNRECOGNIZED;
29
+ }
30
+ }
31
+
32
+ export function verificationTypeToJSON(object: VerificationType): string {
33
+ switch (object) {
34
+ case VerificationType.email_code:
35
+ return "email_code";
36
+ case VerificationType.email_link:
37
+ return "email_link";
38
+ case VerificationType.UNRECOGNIZED:
39
+ default:
40
+ return "UNRECOGNIZED";
41
+ }
42
+ }
43
+
44
+ export function verificationTypeToNumber(object: VerificationType): number {
45
+ switch (object) {
46
+ case VerificationType.email_code:
47
+ return 0;
48
+ case VerificationType.email_link:
49
+ return 1;
50
+ case VerificationType.UNRECOGNIZED:
51
+ default:
52
+ return -1;
53
+ }
54
+ }
55
+
56
+ export interface VerificateRequest {
57
+ $type: "auth.v1.VerificateRequest";
58
+ id: string;
59
+ value: string;
60
+ type: string;
61
+ companyId: string;
62
+ serviceId: string;
63
+ }
64
+
65
+ export interface VerificateResponse {
66
+ $type: "auth.v1.VerificateResponse";
67
+ access: string;
68
+ refresh: string;
69
+ }
70
+
71
+ function createBaseVerificateRequest(): VerificateRequest {
72
+ return { $type: "auth.v1.VerificateRequest", id: "", value: "", type: "", companyId: "", serviceId: "" };
73
+ }
74
+
75
+ export const VerificateRequest: MessageFns<VerificateRequest, "auth.v1.VerificateRequest"> = {
76
+ $type: "auth.v1.VerificateRequest" as const,
77
+
78
+ encode(message: VerificateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
79
+ if (message.id !== "") {
80
+ writer.uint32(10).string(message.id);
81
+ }
82
+ if (message.value !== "") {
83
+ writer.uint32(18).string(message.value);
84
+ }
85
+ if (message.type !== "") {
86
+ writer.uint32(26).string(message.type);
87
+ }
88
+ if (message.companyId !== "") {
89
+ writer.uint32(34).string(message.companyId);
90
+ }
91
+ if (message.serviceId !== "") {
92
+ writer.uint32(42).string(message.serviceId);
93
+ }
94
+ return writer;
95
+ },
96
+
97
+ decode(input: BinaryReader | Uint8Array, length?: number): VerificateRequest {
98
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
99
+ const end = length === undefined ? reader.len : reader.pos + length;
100
+ const message = createBaseVerificateRequest();
101
+ while (reader.pos < end) {
102
+ const tag = reader.uint32();
103
+ switch (tag >>> 3) {
104
+ case 1: {
105
+ if (tag !== 10) {
106
+ break;
107
+ }
108
+
109
+ message.id = reader.string();
110
+ continue;
111
+ }
112
+ case 2: {
113
+ if (tag !== 18) {
114
+ break;
115
+ }
116
+
117
+ message.value = reader.string();
118
+ continue;
119
+ }
120
+ case 3: {
121
+ if (tag !== 26) {
122
+ break;
123
+ }
124
+
125
+ message.type = reader.string();
126
+ continue;
127
+ }
128
+ case 4: {
129
+ if (tag !== 34) {
130
+ break;
131
+ }
132
+
133
+ message.companyId = reader.string();
134
+ continue;
135
+ }
136
+ case 5: {
137
+ if (tag !== 42) {
138
+ break;
139
+ }
140
+
141
+ message.serviceId = reader.string();
142
+ continue;
143
+ }
144
+ }
145
+ if ((tag & 7) === 4 || tag === 0) {
146
+ break;
147
+ }
148
+ reader.skip(tag & 7);
149
+ }
150
+ return message;
151
+ },
152
+
153
+ fromJSON(object: any): VerificateRequest {
154
+ return {
155
+ $type: VerificateRequest.$type,
156
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
157
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
158
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
159
+ companyId: isSet(object.companyId)
160
+ ? globalThis.String(object.companyId)
161
+ : isSet(object.company_id)
162
+ ? globalThis.String(object.company_id)
163
+ : "",
164
+ serviceId: isSet(object.serviceId)
165
+ ? globalThis.String(object.serviceId)
166
+ : isSet(object.service_id)
167
+ ? globalThis.String(object.service_id)
168
+ : "",
169
+ };
170
+ },
171
+
172
+ toJSON(message: VerificateRequest): unknown {
173
+ const obj: any = {};
174
+ if (message.id !== "") {
175
+ obj.id = message.id;
176
+ }
177
+ if (message.value !== "") {
178
+ obj.value = message.value;
179
+ }
180
+ if (message.type !== "") {
181
+ obj.type = message.type;
182
+ }
183
+ if (message.companyId !== "") {
184
+ obj.companyId = message.companyId;
185
+ }
186
+ if (message.serviceId !== "") {
187
+ obj.serviceId = message.serviceId;
188
+ }
189
+ return obj;
190
+ },
191
+
192
+ create<I extends Exact<DeepPartial<VerificateRequest>, I>>(base?: I): VerificateRequest {
193
+ return VerificateRequest.fromPartial(base ?? ({} as any));
194
+ },
195
+ fromPartial<I extends Exact<DeepPartial<VerificateRequest>, I>>(object: I): VerificateRequest {
196
+ const message = createBaseVerificateRequest();
197
+ message.id = object.id ?? "";
198
+ message.value = object.value ?? "";
199
+ message.type = object.type ?? "";
200
+ message.companyId = object.companyId ?? "";
201
+ message.serviceId = object.serviceId ?? "";
202
+ return message;
203
+ },
204
+ };
205
+
206
+ function createBaseVerificateResponse(): VerificateResponse {
207
+ return { $type: "auth.v1.VerificateResponse", access: "", refresh: "" };
208
+ }
209
+
210
+ export const VerificateResponse: MessageFns<VerificateResponse, "auth.v1.VerificateResponse"> = {
211
+ $type: "auth.v1.VerificateResponse" as const,
212
+
213
+ encode(message: VerificateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
214
+ if (message.access !== "") {
215
+ writer.uint32(10).string(message.access);
216
+ }
217
+ if (message.refresh !== "") {
218
+ writer.uint32(18).string(message.refresh);
219
+ }
220
+ return writer;
221
+ },
222
+
223
+ decode(input: BinaryReader | Uint8Array, length?: number): VerificateResponse {
224
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
225
+ const end = length === undefined ? reader.len : reader.pos + length;
226
+ const message = createBaseVerificateResponse();
227
+ while (reader.pos < end) {
228
+ const tag = reader.uint32();
229
+ switch (tag >>> 3) {
230
+ case 1: {
231
+ if (tag !== 10) {
232
+ break;
233
+ }
234
+
235
+ message.access = reader.string();
236
+ continue;
237
+ }
238
+ case 2: {
239
+ if (tag !== 18) {
240
+ break;
241
+ }
242
+
243
+ message.refresh = reader.string();
244
+ continue;
245
+ }
246
+ }
247
+ if ((tag & 7) === 4 || tag === 0) {
248
+ break;
249
+ }
250
+ reader.skip(tag & 7);
251
+ }
252
+ return message;
253
+ },
254
+
255
+ fromJSON(object: any): VerificateResponse {
256
+ return {
257
+ $type: VerificateResponse.$type,
258
+ access: isSet(object.access) ? globalThis.String(object.access) : "",
259
+ refresh: isSet(object.refresh) ? globalThis.String(object.refresh) : "",
260
+ };
261
+ },
262
+
263
+ toJSON(message: VerificateResponse): unknown {
264
+ const obj: any = {};
265
+ if (message.access !== "") {
266
+ obj.access = message.access;
267
+ }
268
+ if (message.refresh !== "") {
269
+ obj.refresh = message.refresh;
270
+ }
271
+ return obj;
272
+ },
273
+
274
+ create<I extends Exact<DeepPartial<VerificateResponse>, I>>(base?: I): VerificateResponse {
275
+ return VerificateResponse.fromPartial(base ?? ({} as any));
276
+ },
277
+ fromPartial<I extends Exact<DeepPartial<VerificateResponse>, I>>(object: I): VerificateResponse {
278
+ const message = createBaseVerificateResponse();
279
+ message.access = object.access ?? "";
280
+ message.refresh = object.refresh ?? "";
281
+ return message;
282
+ },
283
+ };
284
+
285
+ export type VerificationServiceDefinition = typeof VerificationServiceDefinition;
286
+ export const VerificationServiceDefinition = {
287
+ name: "VerificationService",
288
+ fullName: "auth.v1.VerificationService",
289
+ methods: {
290
+ verificate: {
291
+ name: "Verificate",
292
+ requestType: VerificateRequest,
293
+ requestStream: false,
294
+ responseType: VerificateResponse,
295
+ responseStream: false,
296
+ options: {},
297
+ },
298
+ },
299
+ } as const;
300
+
301
+ export interface VerificationServiceImplementation<CallContextExt = {}> {
302
+ verificate(
303
+ request: VerificateRequest,
304
+ context: CallContext & CallContextExt,
305
+ ): Promise<DeepPartial<VerificateResponse>>;
306
+ }
307
+
308
+ export interface VerificationServiceClient<CallOptionsExt = {}> {
309
+ verificate(
310
+ request: DeepPartial<VerificateRequest>,
311
+ options?: CallOptions & CallOptionsExt,
312
+ ): Promise<VerificateResponse>;
313
+ }
314
+
315
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
316
+
317
+ type DeepPartial<T> = T extends Builtin ? T
318
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
319
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
320
+ : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
321
+ : T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
322
+ : Partial<T>;
323
+
324
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
325
+ type Exact<P, I extends P> = P extends Builtin ? P
326
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
327
+
328
+ function isSet(value: any): boolean {
329
+ return value !== null && value !== undefined;
330
+ }
331
+
332
+ interface MessageFns<T, V extends string> {
333
+ readonly $type: V;
334
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
335
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
336
+ fromJSON(object: any): T;
337
+ toJSON(message: T): unknown;
338
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
339
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
340
+ }
@@ -0,0 +1,142 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.2
4
+ // protoc unknown
5
+ // source: common/v1/types.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+ import { Timestamp } from "../../google/protobuf/timestamp";
10
+
11
+ export interface AuditMetadata {
12
+ $type: "common.v1.AuditMetadata";
13
+ createdAt?: string | undefined;
14
+ updatedAt?: string | undefined;
15
+ }
16
+
17
+ function createBaseAuditMetadata(): AuditMetadata {
18
+ return { $type: "common.v1.AuditMetadata", createdAt: undefined, updatedAt: undefined };
19
+ }
20
+
21
+ export const AuditMetadata: MessageFns<AuditMetadata, "common.v1.AuditMetadata"> = {
22
+ $type: "common.v1.AuditMetadata" as const,
23
+
24
+ encode(message: AuditMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
25
+ if (message.createdAt !== undefined) {
26
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(10).fork()).join();
27
+ }
28
+ if (message.updatedAt !== undefined) {
29
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(18).fork()).join();
30
+ }
31
+ return writer;
32
+ },
33
+
34
+ decode(input: BinaryReader | Uint8Array, length?: number): AuditMetadata {
35
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
36
+ const end = length === undefined ? reader.len : reader.pos + length;
37
+ const message = createBaseAuditMetadata();
38
+ while (reader.pos < end) {
39
+ const tag = reader.uint32();
40
+ switch (tag >>> 3) {
41
+ case 1: {
42
+ if (tag !== 10) {
43
+ break;
44
+ }
45
+
46
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
47
+ continue;
48
+ }
49
+ case 2: {
50
+ if (tag !== 18) {
51
+ break;
52
+ }
53
+
54
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
55
+ continue;
56
+ }
57
+ }
58
+ if ((tag & 7) === 4 || tag === 0) {
59
+ break;
60
+ }
61
+ reader.skip(tag & 7);
62
+ }
63
+ return message;
64
+ },
65
+
66
+ fromJSON(object: any): AuditMetadata {
67
+ return {
68
+ $type: AuditMetadata.$type,
69
+ createdAt: isSet(object.createdAt)
70
+ ? globalThis.String(object.createdAt)
71
+ : isSet(object.created_at)
72
+ ? globalThis.String(object.created_at)
73
+ : undefined,
74
+ updatedAt: isSet(object.updatedAt)
75
+ ? globalThis.String(object.updatedAt)
76
+ : isSet(object.updated_at)
77
+ ? globalThis.String(object.updated_at)
78
+ : undefined,
79
+ };
80
+ },
81
+
82
+ toJSON(message: AuditMetadata): unknown {
83
+ const obj: any = {};
84
+ if (message.createdAt !== undefined) {
85
+ obj.createdAt = message.createdAt;
86
+ }
87
+ if (message.updatedAt !== undefined) {
88
+ obj.updatedAt = message.updatedAt;
89
+ }
90
+ return obj;
91
+ },
92
+
93
+ create<I extends Exact<DeepPartial<AuditMetadata>, I>>(base?: I): AuditMetadata {
94
+ return AuditMetadata.fromPartial(base ?? ({} as any));
95
+ },
96
+ fromPartial<I extends Exact<DeepPartial<AuditMetadata>, I>>(object: I): AuditMetadata {
97
+ const message = createBaseAuditMetadata();
98
+ message.createdAt = object.createdAt ?? undefined;
99
+ message.updatedAt = object.updatedAt ?? undefined;
100
+ return message;
101
+ },
102
+ };
103
+
104
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
105
+
106
+ type DeepPartial<T> = T extends Builtin ? T
107
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
108
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
109
+ : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
110
+ : T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
111
+ : Partial<T>;
112
+
113
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
114
+ type Exact<P, I extends P> = P extends Builtin ? P
115
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
116
+
117
+ function toTimestamp(dateStr: string): Timestamp {
118
+ const date = new globalThis.Date(dateStr);
119
+ const seconds = Math.trunc(date.getTime() / 1_000);
120
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
121
+ return { $type: "google.protobuf.Timestamp", seconds, nanos };
122
+ }
123
+
124
+ function fromTimestamp(t: Timestamp): string {
125
+ let millis = (t.seconds || 0) * 1_000;
126
+ millis += (t.nanos || 0) / 1_000_000;
127
+ return new globalThis.Date(millis).toISOString();
128
+ }
129
+
130
+ function isSet(value: any): boolean {
131
+ return value !== null && value !== undefined;
132
+ }
133
+
134
+ interface MessageFns<T, V extends string> {
135
+ readonly $type: V;
136
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
137
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
138
+ fromJSON(object: any): T;
139
+ toJSON(message: T): unknown;
140
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
141
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
142
+ }
@@ -0,0 +1,204 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.2
4
+ // protoc unknown
5
+ // source: companies/v1/models/company.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+
10
+ export interface Company {
11
+ $type: "companies.v1.models.Company";
12
+ id: string;
13
+ email: string;
14
+ name: string;
15
+ description?: string | undefined;
16
+ ownerId: string;
17
+ isActive: boolean;
18
+ }
19
+
20
+ function createBaseCompany(): Company {
21
+ return {
22
+ $type: "companies.v1.models.Company",
23
+ id: "",
24
+ email: "",
25
+ name: "",
26
+ description: undefined,
27
+ ownerId: "",
28
+ isActive: false,
29
+ };
30
+ }
31
+
32
+ export const Company: MessageFns<Company, "companies.v1.models.Company"> = {
33
+ $type: "companies.v1.models.Company" as const,
34
+
35
+ encode(message: Company, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
36
+ if (message.id !== "") {
37
+ writer.uint32(10).string(message.id);
38
+ }
39
+ if (message.email !== "") {
40
+ writer.uint32(18).string(message.email);
41
+ }
42
+ if (message.name !== "") {
43
+ writer.uint32(26).string(message.name);
44
+ }
45
+ if (message.description !== undefined) {
46
+ writer.uint32(34).string(message.description);
47
+ }
48
+ if (message.ownerId !== "") {
49
+ writer.uint32(42).string(message.ownerId);
50
+ }
51
+ if (message.isActive !== false) {
52
+ writer.uint32(48).bool(message.isActive);
53
+ }
54
+ return writer;
55
+ },
56
+
57
+ decode(input: BinaryReader | Uint8Array, length?: number): Company {
58
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
59
+ const end = length === undefined ? reader.len : reader.pos + length;
60
+ const message = createBaseCompany();
61
+ while (reader.pos < end) {
62
+ const tag = reader.uint32();
63
+ switch (tag >>> 3) {
64
+ case 1: {
65
+ if (tag !== 10) {
66
+ break;
67
+ }
68
+
69
+ message.id = reader.string();
70
+ continue;
71
+ }
72
+ case 2: {
73
+ if (tag !== 18) {
74
+ break;
75
+ }
76
+
77
+ message.email = reader.string();
78
+ continue;
79
+ }
80
+ case 3: {
81
+ if (tag !== 26) {
82
+ break;
83
+ }
84
+
85
+ message.name = reader.string();
86
+ continue;
87
+ }
88
+ case 4: {
89
+ if (tag !== 34) {
90
+ break;
91
+ }
92
+
93
+ message.description = reader.string();
94
+ continue;
95
+ }
96
+ case 5: {
97
+ if (tag !== 42) {
98
+ break;
99
+ }
100
+
101
+ message.ownerId = reader.string();
102
+ continue;
103
+ }
104
+ case 6: {
105
+ if (tag !== 48) {
106
+ break;
107
+ }
108
+
109
+ message.isActive = reader.bool();
110
+ continue;
111
+ }
112
+ }
113
+ if ((tag & 7) === 4 || tag === 0) {
114
+ break;
115
+ }
116
+ reader.skip(tag & 7);
117
+ }
118
+ return message;
119
+ },
120
+
121
+ fromJSON(object: any): Company {
122
+ return {
123
+ $type: Company.$type,
124
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
125
+ email: isSet(object.email) ? globalThis.String(object.email) : "",
126
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
127
+ description: isSet(object.description) ? globalThis.String(object.description) : undefined,
128
+ ownerId: isSet(object.ownerId)
129
+ ? globalThis.String(object.ownerId)
130
+ : isSet(object.owner_id)
131
+ ? globalThis.String(object.owner_id)
132
+ : "",
133
+ isActive: isSet(object.isActive)
134
+ ? globalThis.Boolean(object.isActive)
135
+ : isSet(object.is_active)
136
+ ? globalThis.Boolean(object.is_active)
137
+ : false,
138
+ };
139
+ },
140
+
141
+ toJSON(message: Company): unknown {
142
+ const obj: any = {};
143
+ if (message.id !== "") {
144
+ obj.id = message.id;
145
+ }
146
+ if (message.email !== "") {
147
+ obj.email = message.email;
148
+ }
149
+ if (message.name !== "") {
150
+ obj.name = message.name;
151
+ }
152
+ if (message.description !== undefined) {
153
+ obj.description = message.description;
154
+ }
155
+ if (message.ownerId !== "") {
156
+ obj.ownerId = message.ownerId;
157
+ }
158
+ if (message.isActive !== false) {
159
+ obj.isActive = message.isActive;
160
+ }
161
+ return obj;
162
+ },
163
+
164
+ create<I extends Exact<DeepPartial<Company>, I>>(base?: I): Company {
165
+ return Company.fromPartial(base ?? ({} as any));
166
+ },
167
+ fromPartial<I extends Exact<DeepPartial<Company>, I>>(object: I): Company {
168
+ const message = createBaseCompany();
169
+ message.id = object.id ?? "";
170
+ message.email = object.email ?? "";
171
+ message.name = object.name ?? "";
172
+ message.description = object.description ?? undefined;
173
+ message.ownerId = object.ownerId ?? "";
174
+ message.isActive = object.isActive ?? false;
175
+ return message;
176
+ },
177
+ };
178
+
179
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
180
+
181
+ type DeepPartial<T> = T extends Builtin ? T
182
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
183
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
184
+ : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
185
+ : T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
186
+ : Partial<T>;
187
+
188
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
189
+ type Exact<P, I extends P> = P extends Builtin ? P
190
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
191
+
192
+ function isSet(value: any): boolean {
193
+ return value !== null && value !== undefined;
194
+ }
195
+
196
+ interface MessageFns<T, V extends string> {
197
+ readonly $type: V;
198
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
199
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
200
+ fromJSON(object: any): T;
201
+ toJSON(message: T): unknown;
202
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
203
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
204
+ }