@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,501 @@
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: abac/v1/employee_attribute.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+ import type { CallContext, CallOptions } from "nice-grpc-common";
10
+ import { EmployeeAttribute } from "./models/employee_attribute";
11
+
12
+ export interface CreateEmployeeAttributeRequest {
13
+ $type: "abac.v1.CreateEmployeeAttributeRequest";
14
+ employeeId: string;
15
+ companyId: string;
16
+ serviceId: string;
17
+ attributeName: string;
18
+ attributeValue: string;
19
+ }
20
+
21
+ export interface CreateEmployeeAttributeResponse {
22
+ $type: "abac.v1.CreateEmployeeAttributeResponse";
23
+ employeeAttribute?: EmployeeAttribute | undefined;
24
+ }
25
+
26
+ export interface CreateEmployeeAttributeCompinsateRequest {
27
+ $type: "abac.v1.CreateEmployeeAttributeCompinsateRequest";
28
+ employeeAttributeId: string;
29
+ }
30
+
31
+ export interface CreateEmployeeAttributeCompinsateResponse {
32
+ $type: "abac.v1.CreateEmployeeAttributeCompinsateResponse";
33
+ success: boolean;
34
+ message: string;
35
+ }
36
+
37
+ function createBaseCreateEmployeeAttributeRequest(): CreateEmployeeAttributeRequest {
38
+ return {
39
+ $type: "abac.v1.CreateEmployeeAttributeRequest",
40
+ employeeId: "",
41
+ companyId: "",
42
+ serviceId: "",
43
+ attributeName: "",
44
+ attributeValue: "",
45
+ };
46
+ }
47
+
48
+ export const CreateEmployeeAttributeRequest: MessageFns<
49
+ CreateEmployeeAttributeRequest,
50
+ "abac.v1.CreateEmployeeAttributeRequest"
51
+ > = {
52
+ $type: "abac.v1.CreateEmployeeAttributeRequest" as const,
53
+
54
+ encode(message: CreateEmployeeAttributeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
55
+ if (message.employeeId !== "") {
56
+ writer.uint32(10).string(message.employeeId);
57
+ }
58
+ if (message.companyId !== "") {
59
+ writer.uint32(18).string(message.companyId);
60
+ }
61
+ if (message.serviceId !== "") {
62
+ writer.uint32(26).string(message.serviceId);
63
+ }
64
+ if (message.attributeName !== "") {
65
+ writer.uint32(34).string(message.attributeName);
66
+ }
67
+ if (message.attributeValue !== "") {
68
+ writer.uint32(42).string(message.attributeValue);
69
+ }
70
+ return writer;
71
+ },
72
+
73
+ decode(input: BinaryReader | Uint8Array, length?: number): CreateEmployeeAttributeRequest {
74
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
75
+ const end = length === undefined ? reader.len : reader.pos + length;
76
+ const message = createBaseCreateEmployeeAttributeRequest();
77
+ while (reader.pos < end) {
78
+ const tag = reader.uint32();
79
+ switch (tag >>> 3) {
80
+ case 1: {
81
+ if (tag !== 10) {
82
+ break;
83
+ }
84
+
85
+ message.employeeId = reader.string();
86
+ continue;
87
+ }
88
+ case 2: {
89
+ if (tag !== 18) {
90
+ break;
91
+ }
92
+
93
+ message.companyId = reader.string();
94
+ continue;
95
+ }
96
+ case 3: {
97
+ if (tag !== 26) {
98
+ break;
99
+ }
100
+
101
+ message.serviceId = reader.string();
102
+ continue;
103
+ }
104
+ case 4: {
105
+ if (tag !== 34) {
106
+ break;
107
+ }
108
+
109
+ message.attributeName = reader.string();
110
+ continue;
111
+ }
112
+ case 5: {
113
+ if (tag !== 42) {
114
+ break;
115
+ }
116
+
117
+ message.attributeValue = reader.string();
118
+ continue;
119
+ }
120
+ }
121
+ if ((tag & 7) === 4 || tag === 0) {
122
+ break;
123
+ }
124
+ reader.skip(tag & 7);
125
+ }
126
+ return message;
127
+ },
128
+
129
+ fromJSON(object: any): CreateEmployeeAttributeRequest {
130
+ return {
131
+ $type: CreateEmployeeAttributeRequest.$type,
132
+ employeeId: isSet(object.employeeId)
133
+ ? globalThis.String(object.employeeId)
134
+ : isSet(object.employee_id)
135
+ ? globalThis.String(object.employee_id)
136
+ : "",
137
+ companyId: isSet(object.companyId)
138
+ ? globalThis.String(object.companyId)
139
+ : isSet(object.company_id)
140
+ ? globalThis.String(object.company_id)
141
+ : "",
142
+ serviceId: isSet(object.serviceId)
143
+ ? globalThis.String(object.serviceId)
144
+ : isSet(object.service_id)
145
+ ? globalThis.String(object.service_id)
146
+ : "",
147
+ attributeName: isSet(object.attributeName)
148
+ ? globalThis.String(object.attributeName)
149
+ : isSet(object.attribute_name)
150
+ ? globalThis.String(object.attribute_name)
151
+ : "",
152
+ attributeValue: isSet(object.attributeValue)
153
+ ? globalThis.String(object.attributeValue)
154
+ : isSet(object.attribute_value)
155
+ ? globalThis.String(object.attribute_value)
156
+ : "",
157
+ };
158
+ },
159
+
160
+ toJSON(message: CreateEmployeeAttributeRequest): unknown {
161
+ const obj: any = {};
162
+ if (message.employeeId !== "") {
163
+ obj.employeeId = message.employeeId;
164
+ }
165
+ if (message.companyId !== "") {
166
+ obj.companyId = message.companyId;
167
+ }
168
+ if (message.serviceId !== "") {
169
+ obj.serviceId = message.serviceId;
170
+ }
171
+ if (message.attributeName !== "") {
172
+ obj.attributeName = message.attributeName;
173
+ }
174
+ if (message.attributeValue !== "") {
175
+ obj.attributeValue = message.attributeValue;
176
+ }
177
+ return obj;
178
+ },
179
+
180
+ create<I extends Exact<DeepPartial<CreateEmployeeAttributeRequest>, I>>(base?: I): CreateEmployeeAttributeRequest {
181
+ return CreateEmployeeAttributeRequest.fromPartial(base ?? ({} as any));
182
+ },
183
+ fromPartial<I extends Exact<DeepPartial<CreateEmployeeAttributeRequest>, I>>(
184
+ object: I,
185
+ ): CreateEmployeeAttributeRequest {
186
+ const message = createBaseCreateEmployeeAttributeRequest();
187
+ message.employeeId = object.employeeId ?? "";
188
+ message.companyId = object.companyId ?? "";
189
+ message.serviceId = object.serviceId ?? "";
190
+ message.attributeName = object.attributeName ?? "";
191
+ message.attributeValue = object.attributeValue ?? "";
192
+ return message;
193
+ },
194
+ };
195
+
196
+ function createBaseCreateEmployeeAttributeResponse(): CreateEmployeeAttributeResponse {
197
+ return { $type: "abac.v1.CreateEmployeeAttributeResponse", employeeAttribute: undefined };
198
+ }
199
+
200
+ export const CreateEmployeeAttributeResponse: MessageFns<
201
+ CreateEmployeeAttributeResponse,
202
+ "abac.v1.CreateEmployeeAttributeResponse"
203
+ > = {
204
+ $type: "abac.v1.CreateEmployeeAttributeResponse" as const,
205
+
206
+ encode(message: CreateEmployeeAttributeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
207
+ if (message.employeeAttribute !== undefined) {
208
+ EmployeeAttribute.encode(message.employeeAttribute, writer.uint32(10).fork()).join();
209
+ }
210
+ return writer;
211
+ },
212
+
213
+ decode(input: BinaryReader | Uint8Array, length?: number): CreateEmployeeAttributeResponse {
214
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
215
+ const end = length === undefined ? reader.len : reader.pos + length;
216
+ const message = createBaseCreateEmployeeAttributeResponse();
217
+ while (reader.pos < end) {
218
+ const tag = reader.uint32();
219
+ switch (tag >>> 3) {
220
+ case 1: {
221
+ if (tag !== 10) {
222
+ break;
223
+ }
224
+
225
+ message.employeeAttribute = EmployeeAttribute.decode(reader, reader.uint32());
226
+ continue;
227
+ }
228
+ }
229
+ if ((tag & 7) === 4 || tag === 0) {
230
+ break;
231
+ }
232
+ reader.skip(tag & 7);
233
+ }
234
+ return message;
235
+ },
236
+
237
+ fromJSON(object: any): CreateEmployeeAttributeResponse {
238
+ return {
239
+ $type: CreateEmployeeAttributeResponse.$type,
240
+ employeeAttribute: isSet(object.employeeAttribute)
241
+ ? EmployeeAttribute.fromJSON(object.employeeAttribute)
242
+ : isSet(object.employee_attribute)
243
+ ? EmployeeAttribute.fromJSON(object.employee_attribute)
244
+ : undefined,
245
+ };
246
+ },
247
+
248
+ toJSON(message: CreateEmployeeAttributeResponse): unknown {
249
+ const obj: any = {};
250
+ if (message.employeeAttribute !== undefined) {
251
+ obj.employeeAttribute = EmployeeAttribute.toJSON(message.employeeAttribute);
252
+ }
253
+ return obj;
254
+ },
255
+
256
+ create<I extends Exact<DeepPartial<CreateEmployeeAttributeResponse>, I>>(base?: I): CreateEmployeeAttributeResponse {
257
+ return CreateEmployeeAttributeResponse.fromPartial(base ?? ({} as any));
258
+ },
259
+ fromPartial<I extends Exact<DeepPartial<CreateEmployeeAttributeResponse>, I>>(
260
+ object: I,
261
+ ): CreateEmployeeAttributeResponse {
262
+ const message = createBaseCreateEmployeeAttributeResponse();
263
+ message.employeeAttribute = (object.employeeAttribute !== undefined && object.employeeAttribute !== null)
264
+ ? EmployeeAttribute.fromPartial(object.employeeAttribute)
265
+ : undefined;
266
+ return message;
267
+ },
268
+ };
269
+
270
+ function createBaseCreateEmployeeAttributeCompinsateRequest(): CreateEmployeeAttributeCompinsateRequest {
271
+ return { $type: "abac.v1.CreateEmployeeAttributeCompinsateRequest", employeeAttributeId: "" };
272
+ }
273
+
274
+ export const CreateEmployeeAttributeCompinsateRequest: MessageFns<
275
+ CreateEmployeeAttributeCompinsateRequest,
276
+ "abac.v1.CreateEmployeeAttributeCompinsateRequest"
277
+ > = {
278
+ $type: "abac.v1.CreateEmployeeAttributeCompinsateRequest" as const,
279
+
280
+ encode(message: CreateEmployeeAttributeCompinsateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
281
+ if (message.employeeAttributeId !== "") {
282
+ writer.uint32(10).string(message.employeeAttributeId);
283
+ }
284
+ return writer;
285
+ },
286
+
287
+ decode(input: BinaryReader | Uint8Array, length?: number): CreateEmployeeAttributeCompinsateRequest {
288
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
289
+ const end = length === undefined ? reader.len : reader.pos + length;
290
+ const message = createBaseCreateEmployeeAttributeCompinsateRequest();
291
+ while (reader.pos < end) {
292
+ const tag = reader.uint32();
293
+ switch (tag >>> 3) {
294
+ case 1: {
295
+ if (tag !== 10) {
296
+ break;
297
+ }
298
+
299
+ message.employeeAttributeId = reader.string();
300
+ continue;
301
+ }
302
+ }
303
+ if ((tag & 7) === 4 || tag === 0) {
304
+ break;
305
+ }
306
+ reader.skip(tag & 7);
307
+ }
308
+ return message;
309
+ },
310
+
311
+ fromJSON(object: any): CreateEmployeeAttributeCompinsateRequest {
312
+ return {
313
+ $type: CreateEmployeeAttributeCompinsateRequest.$type,
314
+ employeeAttributeId: isSet(object.employeeAttributeId)
315
+ ? globalThis.String(object.employeeAttributeId)
316
+ : isSet(object.employee_attribute_id)
317
+ ? globalThis.String(object.employee_attribute_id)
318
+ : "",
319
+ };
320
+ },
321
+
322
+ toJSON(message: CreateEmployeeAttributeCompinsateRequest): unknown {
323
+ const obj: any = {};
324
+ if (message.employeeAttributeId !== "") {
325
+ obj.employeeAttributeId = message.employeeAttributeId;
326
+ }
327
+ return obj;
328
+ },
329
+
330
+ create<I extends Exact<DeepPartial<CreateEmployeeAttributeCompinsateRequest>, I>>(
331
+ base?: I,
332
+ ): CreateEmployeeAttributeCompinsateRequest {
333
+ return CreateEmployeeAttributeCompinsateRequest.fromPartial(base ?? ({} as any));
334
+ },
335
+ fromPartial<I extends Exact<DeepPartial<CreateEmployeeAttributeCompinsateRequest>, I>>(
336
+ object: I,
337
+ ): CreateEmployeeAttributeCompinsateRequest {
338
+ const message = createBaseCreateEmployeeAttributeCompinsateRequest();
339
+ message.employeeAttributeId = object.employeeAttributeId ?? "";
340
+ return message;
341
+ },
342
+ };
343
+
344
+ function createBaseCreateEmployeeAttributeCompinsateResponse(): CreateEmployeeAttributeCompinsateResponse {
345
+ return { $type: "abac.v1.CreateEmployeeAttributeCompinsateResponse", success: false, message: "" };
346
+ }
347
+
348
+ export const CreateEmployeeAttributeCompinsateResponse: MessageFns<
349
+ CreateEmployeeAttributeCompinsateResponse,
350
+ "abac.v1.CreateEmployeeAttributeCompinsateResponse"
351
+ > = {
352
+ $type: "abac.v1.CreateEmployeeAttributeCompinsateResponse" as const,
353
+
354
+ encode(message: CreateEmployeeAttributeCompinsateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
355
+ if (message.success !== false) {
356
+ writer.uint32(8).bool(message.success);
357
+ }
358
+ if (message.message !== "") {
359
+ writer.uint32(18).string(message.message);
360
+ }
361
+ return writer;
362
+ },
363
+
364
+ decode(input: BinaryReader | Uint8Array, length?: number): CreateEmployeeAttributeCompinsateResponse {
365
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
366
+ const end = length === undefined ? reader.len : reader.pos + length;
367
+ const message = createBaseCreateEmployeeAttributeCompinsateResponse();
368
+ while (reader.pos < end) {
369
+ const tag = reader.uint32();
370
+ switch (tag >>> 3) {
371
+ case 1: {
372
+ if (tag !== 8) {
373
+ break;
374
+ }
375
+
376
+ message.success = reader.bool();
377
+ continue;
378
+ }
379
+ case 2: {
380
+ if (tag !== 18) {
381
+ break;
382
+ }
383
+
384
+ message.message = reader.string();
385
+ continue;
386
+ }
387
+ }
388
+ if ((tag & 7) === 4 || tag === 0) {
389
+ break;
390
+ }
391
+ reader.skip(tag & 7);
392
+ }
393
+ return message;
394
+ },
395
+
396
+ fromJSON(object: any): CreateEmployeeAttributeCompinsateResponse {
397
+ return {
398
+ $type: CreateEmployeeAttributeCompinsateResponse.$type,
399
+ success: isSet(object.success) ? globalThis.Boolean(object.success) : false,
400
+ message: isSet(object.message) ? globalThis.String(object.message) : "",
401
+ };
402
+ },
403
+
404
+ toJSON(message: CreateEmployeeAttributeCompinsateResponse): unknown {
405
+ const obj: any = {};
406
+ if (message.success !== false) {
407
+ obj.success = message.success;
408
+ }
409
+ if (message.message !== "") {
410
+ obj.message = message.message;
411
+ }
412
+ return obj;
413
+ },
414
+
415
+ create<I extends Exact<DeepPartial<CreateEmployeeAttributeCompinsateResponse>, I>>(
416
+ base?: I,
417
+ ): CreateEmployeeAttributeCompinsateResponse {
418
+ return CreateEmployeeAttributeCompinsateResponse.fromPartial(base ?? ({} as any));
419
+ },
420
+ fromPartial<I extends Exact<DeepPartial<CreateEmployeeAttributeCompinsateResponse>, I>>(
421
+ object: I,
422
+ ): CreateEmployeeAttributeCompinsateResponse {
423
+ const message = createBaseCreateEmployeeAttributeCompinsateResponse();
424
+ message.success = object.success ?? false;
425
+ message.message = object.message ?? "";
426
+ return message;
427
+ },
428
+ };
429
+
430
+ export type EmployeeAttributeServiceDefinition = typeof EmployeeAttributeServiceDefinition;
431
+ export const EmployeeAttributeServiceDefinition = {
432
+ name: "EmployeeAttributeService",
433
+ fullName: "abac.v1.EmployeeAttributeService",
434
+ methods: {
435
+ createEmployeeAttribute: {
436
+ name: "CreateEmployeeAttribute",
437
+ requestType: CreateEmployeeAttributeRequest,
438
+ requestStream: false,
439
+ responseType: CreateEmployeeAttributeResponse,
440
+ responseStream: false,
441
+ options: {},
442
+ },
443
+ createEmployeeAttributeCompinsate: {
444
+ name: "CreateEmployeeAttributeCompinsate",
445
+ requestType: CreateEmployeeAttributeCompinsateRequest,
446
+ requestStream: false,
447
+ responseType: CreateEmployeeAttributeCompinsateResponse,
448
+ responseStream: false,
449
+ options: {},
450
+ },
451
+ },
452
+ } as const;
453
+
454
+ export interface EmployeeAttributeServiceImplementation<CallContextExt = {}> {
455
+ createEmployeeAttribute(
456
+ request: CreateEmployeeAttributeRequest,
457
+ context: CallContext & CallContextExt,
458
+ ): Promise<DeepPartial<CreateEmployeeAttributeResponse>>;
459
+ createEmployeeAttributeCompinsate(
460
+ request: CreateEmployeeAttributeCompinsateRequest,
461
+ context: CallContext & CallContextExt,
462
+ ): Promise<DeepPartial<CreateEmployeeAttributeCompinsateResponse>>;
463
+ }
464
+
465
+ export interface EmployeeAttributeServiceClient<CallOptionsExt = {}> {
466
+ createEmployeeAttribute(
467
+ request: DeepPartial<CreateEmployeeAttributeRequest>,
468
+ options?: CallOptions & CallOptionsExt,
469
+ ): Promise<CreateEmployeeAttributeResponse>;
470
+ createEmployeeAttributeCompinsate(
471
+ request: DeepPartial<CreateEmployeeAttributeCompinsateRequest>,
472
+ options?: CallOptions & CallOptionsExt,
473
+ ): Promise<CreateEmployeeAttributeCompinsateResponse>;
474
+ }
475
+
476
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
477
+
478
+ type DeepPartial<T> = T extends Builtin ? T
479
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
480
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
481
+ : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
482
+ : T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
483
+ : Partial<T>;
484
+
485
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
486
+ type Exact<P, I extends P> = P extends Builtin ? P
487
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
488
+
489
+ function isSet(value: any): boolean {
490
+ return value !== null && value !== undefined;
491
+ }
492
+
493
+ interface MessageFns<T, V extends string> {
494
+ readonly $type: V;
495
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
496
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
497
+ fromJSON(object: any): T;
498
+ toJSON(message: T): unknown;
499
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
500
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
501
+ }
@@ -0,0 +1,190 @@
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: abac/v1/models/employee_attribute.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+
10
+ export interface EmployeeAttribute {
11
+ $type: "abac.v1.models.EmployeeAttribute";
12
+ id: string;
13
+ employeeId: string;
14
+ companyId: string;
15
+ attributeId: string;
16
+ value: string;
17
+ }
18
+
19
+ function createBaseEmployeeAttribute(): EmployeeAttribute {
20
+ return {
21
+ $type: "abac.v1.models.EmployeeAttribute",
22
+ id: "",
23
+ employeeId: "",
24
+ companyId: "",
25
+ attributeId: "",
26
+ value: "",
27
+ };
28
+ }
29
+
30
+ export const EmployeeAttribute: MessageFns<EmployeeAttribute, "abac.v1.models.EmployeeAttribute"> = {
31
+ $type: "abac.v1.models.EmployeeAttribute" as const,
32
+
33
+ encode(message: EmployeeAttribute, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
34
+ if (message.id !== "") {
35
+ writer.uint32(10).string(message.id);
36
+ }
37
+ if (message.employeeId !== "") {
38
+ writer.uint32(18).string(message.employeeId);
39
+ }
40
+ if (message.companyId !== "") {
41
+ writer.uint32(26).string(message.companyId);
42
+ }
43
+ if (message.attributeId !== "") {
44
+ writer.uint32(34).string(message.attributeId);
45
+ }
46
+ if (message.value !== "") {
47
+ writer.uint32(42).string(message.value);
48
+ }
49
+ return writer;
50
+ },
51
+
52
+ decode(input: BinaryReader | Uint8Array, length?: number): EmployeeAttribute {
53
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
54
+ const end = length === undefined ? reader.len : reader.pos + length;
55
+ const message = createBaseEmployeeAttribute();
56
+ while (reader.pos < end) {
57
+ const tag = reader.uint32();
58
+ switch (tag >>> 3) {
59
+ case 1: {
60
+ if (tag !== 10) {
61
+ break;
62
+ }
63
+
64
+ message.id = reader.string();
65
+ continue;
66
+ }
67
+ case 2: {
68
+ if (tag !== 18) {
69
+ break;
70
+ }
71
+
72
+ message.employeeId = reader.string();
73
+ continue;
74
+ }
75
+ case 3: {
76
+ if (tag !== 26) {
77
+ break;
78
+ }
79
+
80
+ message.companyId = reader.string();
81
+ continue;
82
+ }
83
+ case 4: {
84
+ if (tag !== 34) {
85
+ break;
86
+ }
87
+
88
+ message.attributeId = reader.string();
89
+ continue;
90
+ }
91
+ case 5: {
92
+ if (tag !== 42) {
93
+ break;
94
+ }
95
+
96
+ message.value = reader.string();
97
+ continue;
98
+ }
99
+ }
100
+ if ((tag & 7) === 4 || tag === 0) {
101
+ break;
102
+ }
103
+ reader.skip(tag & 7);
104
+ }
105
+ return message;
106
+ },
107
+
108
+ fromJSON(object: any): EmployeeAttribute {
109
+ return {
110
+ $type: EmployeeAttribute.$type,
111
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
112
+ employeeId: isSet(object.employeeId)
113
+ ? globalThis.String(object.employeeId)
114
+ : isSet(object.employee_id)
115
+ ? globalThis.String(object.employee_id)
116
+ : "",
117
+ companyId: isSet(object.companyId)
118
+ ? globalThis.String(object.companyId)
119
+ : isSet(object.company_id)
120
+ ? globalThis.String(object.company_id)
121
+ : "",
122
+ attributeId: isSet(object.attributeId)
123
+ ? globalThis.String(object.attributeId)
124
+ : isSet(object.attribute_id)
125
+ ? globalThis.String(object.attribute_id)
126
+ : "",
127
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
128
+ };
129
+ },
130
+
131
+ toJSON(message: EmployeeAttribute): unknown {
132
+ const obj: any = {};
133
+ if (message.id !== "") {
134
+ obj.id = message.id;
135
+ }
136
+ if (message.employeeId !== "") {
137
+ obj.employeeId = message.employeeId;
138
+ }
139
+ if (message.companyId !== "") {
140
+ obj.companyId = message.companyId;
141
+ }
142
+ if (message.attributeId !== "") {
143
+ obj.attributeId = message.attributeId;
144
+ }
145
+ if (message.value !== "") {
146
+ obj.value = message.value;
147
+ }
148
+ return obj;
149
+ },
150
+
151
+ create<I extends Exact<DeepPartial<EmployeeAttribute>, I>>(base?: I): EmployeeAttribute {
152
+ return EmployeeAttribute.fromPartial(base ?? ({} as any));
153
+ },
154
+ fromPartial<I extends Exact<DeepPartial<EmployeeAttribute>, I>>(object: I): EmployeeAttribute {
155
+ const message = createBaseEmployeeAttribute();
156
+ message.id = object.id ?? "";
157
+ message.employeeId = object.employeeId ?? "";
158
+ message.companyId = object.companyId ?? "";
159
+ message.attributeId = object.attributeId ?? "";
160
+ message.value = object.value ?? "";
161
+ return message;
162
+ },
163
+ };
164
+
165
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
166
+
167
+ type DeepPartial<T> = T extends Builtin ? T
168
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
169
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
170
+ : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
171
+ : T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
172
+ : Partial<T>;
173
+
174
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
175
+ type Exact<P, I extends P> = P extends Builtin ? P
176
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
177
+
178
+ function isSet(value: any): boolean {
179
+ return value !== null && value !== undefined;
180
+ }
181
+
182
+ interface MessageFns<T, V extends string> {
183
+ readonly $type: V;
184
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
185
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
186
+ fromJSON(object: any): T;
187
+ toJSON(message: T): unknown;
188
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
189
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
190
+ }