@ssoeasy-dev/proto 1.1.0-beta.1

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.
@@ -0,0 +1,100 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.5
4
+ // protoc unknown
5
+ // source: common/v1/types.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+
10
+ export interface StatusResponse {
11
+ $type: "common.v1.StatusResponse";
12
+ success: boolean;
13
+ }
14
+
15
+ function createBaseStatusResponse(): StatusResponse {
16
+ return { $type: "common.v1.StatusResponse", success: false };
17
+ }
18
+
19
+ export const StatusResponse: MessageFns<StatusResponse, "common.v1.StatusResponse"> = {
20
+ $type: "common.v1.StatusResponse" as const,
21
+
22
+ encode(message: StatusResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
23
+ if (message.success !== false) {
24
+ writer.uint32(8).bool(message.success);
25
+ }
26
+ return writer;
27
+ },
28
+
29
+ decode(input: BinaryReader | Uint8Array, length?: number): StatusResponse {
30
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
31
+ const end = length === undefined ? reader.len : reader.pos + length;
32
+ const message = createBaseStatusResponse();
33
+ while (reader.pos < end) {
34
+ const tag = reader.uint32();
35
+ switch (tag >>> 3) {
36
+ case 1: {
37
+ if (tag !== 8) {
38
+ break;
39
+ }
40
+
41
+ message.success = reader.bool();
42
+ continue;
43
+ }
44
+ }
45
+ if ((tag & 7) === 4 || tag === 0) {
46
+ break;
47
+ }
48
+ reader.skip(tag & 7);
49
+ }
50
+ return message;
51
+ },
52
+
53
+ fromJSON(object: any): StatusResponse {
54
+ return { $type: StatusResponse.$type, success: isSet(object.success) ? globalThis.Boolean(object.success) : false };
55
+ },
56
+
57
+ toJSON(message: StatusResponse): unknown {
58
+ const obj: any = {};
59
+ if (message.success !== false) {
60
+ obj.success = message.success;
61
+ }
62
+ return obj;
63
+ },
64
+
65
+ create<I extends Exact<DeepPartial<StatusResponse>, I>>(base?: I): StatusResponse {
66
+ return StatusResponse.fromPartial(base ?? ({} as any));
67
+ },
68
+ fromPartial<I extends Exact<DeepPartial<StatusResponse>, I>>(object: I): StatusResponse {
69
+ const message = createBaseStatusResponse();
70
+ message.success = object.success ?? false;
71
+ return message;
72
+ },
73
+ };
74
+
75
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
76
+
77
+ type DeepPartial<T> = T extends Builtin ? T
78
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
79
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
80
+ : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
81
+ : T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
82
+ : Partial<T>;
83
+
84
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
85
+ type Exact<P, I extends P> = P extends Builtin ? P
86
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
87
+
88
+ function isSet(value: any): boolean {
89
+ return value !== null && value !== undefined;
90
+ }
91
+
92
+ interface MessageFns<T, V extends string> {
93
+ readonly $type: V;
94
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
95
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
96
+ fromJSON(object: any): T;
97
+ toJSON(message: T): unknown;
98
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
99
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
100
+ }
@@ -0,0 +1,418 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.5
4
+ // protoc unknown
5
+ // source: companies/v1/employee.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 interface GetByUserIdRequest {
12
+ $type: "companies.v1.GetByUserIdRequest";
13
+ userId: string;
14
+ serviceId?: string | undefined;
15
+ }
16
+
17
+ export interface EmployeeCompany {
18
+ $type: "companies.v1.EmployeeCompany";
19
+ id: string;
20
+ name: string;
21
+ serviceName?: string | undefined;
22
+ subscriptionId?: string | undefined;
23
+ subscriptionIsActive?: boolean | undefined;
24
+ }
25
+
26
+ export interface GetByUserIdResponse {
27
+ $type: "companies.v1.GetByUserIdResponse";
28
+ firstname: string;
29
+ lastname: string;
30
+ companies: EmployeeCompany[];
31
+ }
32
+
33
+ function createBaseGetByUserIdRequest(): GetByUserIdRequest {
34
+ return { $type: "companies.v1.GetByUserIdRequest", userId: "", serviceId: undefined };
35
+ }
36
+
37
+ export const GetByUserIdRequest: MessageFns<GetByUserIdRequest, "companies.v1.GetByUserIdRequest"> = {
38
+ $type: "companies.v1.GetByUserIdRequest" as const,
39
+
40
+ encode(message: GetByUserIdRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
41
+ if (message.userId !== "") {
42
+ writer.uint32(10).string(message.userId);
43
+ }
44
+ if (message.serviceId !== undefined) {
45
+ writer.uint32(18).string(message.serviceId);
46
+ }
47
+ return writer;
48
+ },
49
+
50
+ decode(input: BinaryReader | Uint8Array, length?: number): GetByUserIdRequest {
51
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
52
+ const end = length === undefined ? reader.len : reader.pos + length;
53
+ const message = createBaseGetByUserIdRequest();
54
+ while (reader.pos < end) {
55
+ const tag = reader.uint32();
56
+ switch (tag >>> 3) {
57
+ case 1: {
58
+ if (tag !== 10) {
59
+ break;
60
+ }
61
+
62
+ message.userId = reader.string();
63
+ continue;
64
+ }
65
+ case 2: {
66
+ if (tag !== 18) {
67
+ break;
68
+ }
69
+
70
+ message.serviceId = reader.string();
71
+ continue;
72
+ }
73
+ }
74
+ if ((tag & 7) === 4 || tag === 0) {
75
+ break;
76
+ }
77
+ reader.skip(tag & 7);
78
+ }
79
+ return message;
80
+ },
81
+
82
+ fromJSON(object: any): GetByUserIdRequest {
83
+ return {
84
+ $type: GetByUserIdRequest.$type,
85
+ userId: isSet(object.userId)
86
+ ? globalThis.String(object.userId)
87
+ : isSet(object.user_id)
88
+ ? globalThis.String(object.user_id)
89
+ : "",
90
+ serviceId: isSet(object.serviceId)
91
+ ? globalThis.String(object.serviceId)
92
+ : isSet(object.service_id)
93
+ ? globalThis.String(object.service_id)
94
+ : undefined,
95
+ };
96
+ },
97
+
98
+ toJSON(message: GetByUserIdRequest): unknown {
99
+ const obj: any = {};
100
+ if (message.userId !== "") {
101
+ obj.userId = message.userId;
102
+ }
103
+ if (message.serviceId !== undefined) {
104
+ obj.serviceId = message.serviceId;
105
+ }
106
+ return obj;
107
+ },
108
+
109
+ create<I extends Exact<DeepPartial<GetByUserIdRequest>, I>>(base?: I): GetByUserIdRequest {
110
+ return GetByUserIdRequest.fromPartial(base ?? ({} as any));
111
+ },
112
+ fromPartial<I extends Exact<DeepPartial<GetByUserIdRequest>, I>>(object: I): GetByUserIdRequest {
113
+ const message = createBaseGetByUserIdRequest();
114
+ message.userId = object.userId ?? "";
115
+ message.serviceId = object.serviceId ?? undefined;
116
+ return message;
117
+ },
118
+ };
119
+
120
+ function createBaseEmployeeCompany(): EmployeeCompany {
121
+ return {
122
+ $type: "companies.v1.EmployeeCompany",
123
+ id: "",
124
+ name: "",
125
+ serviceName: undefined,
126
+ subscriptionId: undefined,
127
+ subscriptionIsActive: undefined,
128
+ };
129
+ }
130
+
131
+ export const EmployeeCompany: MessageFns<EmployeeCompany, "companies.v1.EmployeeCompany"> = {
132
+ $type: "companies.v1.EmployeeCompany" as const,
133
+
134
+ encode(message: EmployeeCompany, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
135
+ if (message.id !== "") {
136
+ writer.uint32(10).string(message.id);
137
+ }
138
+ if (message.name !== "") {
139
+ writer.uint32(18).string(message.name);
140
+ }
141
+ if (message.serviceName !== undefined) {
142
+ writer.uint32(26).string(message.serviceName);
143
+ }
144
+ if (message.subscriptionId !== undefined) {
145
+ writer.uint32(34).string(message.subscriptionId);
146
+ }
147
+ if (message.subscriptionIsActive !== undefined) {
148
+ writer.uint32(40).bool(message.subscriptionIsActive);
149
+ }
150
+ return writer;
151
+ },
152
+
153
+ decode(input: BinaryReader | Uint8Array, length?: number): EmployeeCompany {
154
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
155
+ const end = length === undefined ? reader.len : reader.pos + length;
156
+ const message = createBaseEmployeeCompany();
157
+ while (reader.pos < end) {
158
+ const tag = reader.uint32();
159
+ switch (tag >>> 3) {
160
+ case 1: {
161
+ if (tag !== 10) {
162
+ break;
163
+ }
164
+
165
+ message.id = reader.string();
166
+ continue;
167
+ }
168
+ case 2: {
169
+ if (tag !== 18) {
170
+ break;
171
+ }
172
+
173
+ message.name = reader.string();
174
+ continue;
175
+ }
176
+ case 3: {
177
+ if (tag !== 26) {
178
+ break;
179
+ }
180
+
181
+ message.serviceName = reader.string();
182
+ continue;
183
+ }
184
+ case 4: {
185
+ if (tag !== 34) {
186
+ break;
187
+ }
188
+
189
+ message.subscriptionId = reader.string();
190
+ continue;
191
+ }
192
+ case 5: {
193
+ if (tag !== 40) {
194
+ break;
195
+ }
196
+
197
+ message.subscriptionIsActive = reader.bool();
198
+ continue;
199
+ }
200
+ }
201
+ if ((tag & 7) === 4 || tag === 0) {
202
+ break;
203
+ }
204
+ reader.skip(tag & 7);
205
+ }
206
+ return message;
207
+ },
208
+
209
+ fromJSON(object: any): EmployeeCompany {
210
+ return {
211
+ $type: EmployeeCompany.$type,
212
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
213
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
214
+ serviceName: isSet(object.serviceName)
215
+ ? globalThis.String(object.serviceName)
216
+ : isSet(object.service_name)
217
+ ? globalThis.String(object.service_name)
218
+ : undefined,
219
+ subscriptionId: isSet(object.subscriptionId)
220
+ ? globalThis.String(object.subscriptionId)
221
+ : isSet(object.subscription_id)
222
+ ? globalThis.String(object.subscription_id)
223
+ : undefined,
224
+ subscriptionIsActive: isSet(object.subscriptionIsActive)
225
+ ? globalThis.Boolean(object.subscriptionIsActive)
226
+ : isSet(object.subscription_is_active)
227
+ ? globalThis.Boolean(object.subscription_is_active)
228
+ : undefined,
229
+ };
230
+ },
231
+
232
+ toJSON(message: EmployeeCompany): unknown {
233
+ const obj: any = {};
234
+ if (message.id !== "") {
235
+ obj.id = message.id;
236
+ }
237
+ if (message.name !== "") {
238
+ obj.name = message.name;
239
+ }
240
+ if (message.serviceName !== undefined) {
241
+ obj.serviceName = message.serviceName;
242
+ }
243
+ if (message.subscriptionId !== undefined) {
244
+ obj.subscriptionId = message.subscriptionId;
245
+ }
246
+ if (message.subscriptionIsActive !== undefined) {
247
+ obj.subscriptionIsActive = message.subscriptionIsActive;
248
+ }
249
+ return obj;
250
+ },
251
+
252
+ create<I extends Exact<DeepPartial<EmployeeCompany>, I>>(base?: I): EmployeeCompany {
253
+ return EmployeeCompany.fromPartial(base ?? ({} as any));
254
+ },
255
+ fromPartial<I extends Exact<DeepPartial<EmployeeCompany>, I>>(object: I): EmployeeCompany {
256
+ const message = createBaseEmployeeCompany();
257
+ message.id = object.id ?? "";
258
+ message.name = object.name ?? "";
259
+ message.serviceName = object.serviceName ?? undefined;
260
+ message.subscriptionId = object.subscriptionId ?? undefined;
261
+ message.subscriptionIsActive = object.subscriptionIsActive ?? undefined;
262
+ return message;
263
+ },
264
+ };
265
+
266
+ function createBaseGetByUserIdResponse(): GetByUserIdResponse {
267
+ return { $type: "companies.v1.GetByUserIdResponse", firstname: "", lastname: "", companies: [] };
268
+ }
269
+
270
+ export const GetByUserIdResponse: MessageFns<GetByUserIdResponse, "companies.v1.GetByUserIdResponse"> = {
271
+ $type: "companies.v1.GetByUserIdResponse" as const,
272
+
273
+ encode(message: GetByUserIdResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
274
+ if (message.firstname !== "") {
275
+ writer.uint32(10).string(message.firstname);
276
+ }
277
+ if (message.lastname !== "") {
278
+ writer.uint32(18).string(message.lastname);
279
+ }
280
+ for (const v of message.companies) {
281
+ EmployeeCompany.encode(v!, writer.uint32(26).fork()).join();
282
+ }
283
+ return writer;
284
+ },
285
+
286
+ decode(input: BinaryReader | Uint8Array, length?: number): GetByUserIdResponse {
287
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
288
+ const end = length === undefined ? reader.len : reader.pos + length;
289
+ const message = createBaseGetByUserIdResponse();
290
+ while (reader.pos < end) {
291
+ const tag = reader.uint32();
292
+ switch (tag >>> 3) {
293
+ case 1: {
294
+ if (tag !== 10) {
295
+ break;
296
+ }
297
+
298
+ message.firstname = reader.string();
299
+ continue;
300
+ }
301
+ case 2: {
302
+ if (tag !== 18) {
303
+ break;
304
+ }
305
+
306
+ message.lastname = reader.string();
307
+ continue;
308
+ }
309
+ case 3: {
310
+ if (tag !== 26) {
311
+ break;
312
+ }
313
+
314
+ message.companies.push(EmployeeCompany.decode(reader, reader.uint32()));
315
+ continue;
316
+ }
317
+ }
318
+ if ((tag & 7) === 4 || tag === 0) {
319
+ break;
320
+ }
321
+ reader.skip(tag & 7);
322
+ }
323
+ return message;
324
+ },
325
+
326
+ fromJSON(object: any): GetByUserIdResponse {
327
+ return {
328
+ $type: GetByUserIdResponse.$type,
329
+ firstname: isSet(object.firstname) ? globalThis.String(object.firstname) : "",
330
+ lastname: isSet(object.lastname) ? globalThis.String(object.lastname) : "",
331
+ companies: globalThis.Array.isArray(object?.companies)
332
+ ? object.companies.map((e: any) => EmployeeCompany.fromJSON(e))
333
+ : [],
334
+ };
335
+ },
336
+
337
+ toJSON(message: GetByUserIdResponse): unknown {
338
+ const obj: any = {};
339
+ if (message.firstname !== "") {
340
+ obj.firstname = message.firstname;
341
+ }
342
+ if (message.lastname !== "") {
343
+ obj.lastname = message.lastname;
344
+ }
345
+ if (message.companies?.length) {
346
+ obj.companies = message.companies.map((e) => EmployeeCompany.toJSON(e));
347
+ }
348
+ return obj;
349
+ },
350
+
351
+ create<I extends Exact<DeepPartial<GetByUserIdResponse>, I>>(base?: I): GetByUserIdResponse {
352
+ return GetByUserIdResponse.fromPartial(base ?? ({} as any));
353
+ },
354
+ fromPartial<I extends Exact<DeepPartial<GetByUserIdResponse>, I>>(object: I): GetByUserIdResponse {
355
+ const message = createBaseGetByUserIdResponse();
356
+ message.firstname = object.firstname ?? "";
357
+ message.lastname = object.lastname ?? "";
358
+ message.companies = object.companies?.map((e) => EmployeeCompany.fromPartial(e)) || [];
359
+ return message;
360
+ },
361
+ };
362
+
363
+ export type EmployeeServiceDefinition = typeof EmployeeServiceDefinition;
364
+ export const EmployeeServiceDefinition = {
365
+ name: "EmployeeService",
366
+ fullName: "companies.v1.EmployeeService",
367
+ methods: {
368
+ getByUserId: {
369
+ name: "GetByUserId",
370
+ requestType: GetByUserIdRequest as typeof GetByUserIdRequest,
371
+ requestStream: false,
372
+ responseType: GetByUserIdResponse as typeof GetByUserIdResponse,
373
+ responseStream: false,
374
+ options: {},
375
+ },
376
+ },
377
+ } as const;
378
+
379
+ export interface EmployeeServiceImplementation<CallContextExt = {}> {
380
+ getByUserId(
381
+ request: GetByUserIdRequest,
382
+ context: CallContext & CallContextExt,
383
+ ): Promise<DeepPartial<GetByUserIdResponse>>;
384
+ }
385
+
386
+ export interface EmployeeServiceClient<CallOptionsExt = {}> {
387
+ getByUserId(
388
+ request: DeepPartial<GetByUserIdRequest>,
389
+ options?: CallOptions & CallOptionsExt,
390
+ ): Promise<GetByUserIdResponse>;
391
+ }
392
+
393
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
394
+
395
+ type DeepPartial<T> = T extends Builtin ? T
396
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
397
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
398
+ : T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
399
+ : T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
400
+ : Partial<T>;
401
+
402
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
403
+ type Exact<P, I extends P> = P extends Builtin ? P
404
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
405
+
406
+ function isSet(value: any): boolean {
407
+ return value !== null && value !== undefined;
408
+ }
409
+
410
+ interface MessageFns<T, V extends string> {
411
+ readonly $type: V;
412
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
413
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
414
+ fromJSON(object: any): T;
415
+ toJSON(message: T): unknown;
416
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
417
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
418
+ }