@ssoeasy-dev/proto 1.1.0-dev-feat-auth.1 → 1.1.0-dev-feat-auth.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.
|
@@ -54,6 +54,59 @@ export function verificationTypeToNumber(object: VerificationType): number {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
export enum VerificationStatus {
|
|
58
|
+
wait = "wait",
|
|
59
|
+
expires = "expires",
|
|
60
|
+
verified = "verified",
|
|
61
|
+
UNRECOGNIZED = "UNRECOGNIZED",
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function verificationStatusFromJSON(object: any): VerificationStatus {
|
|
65
|
+
switch (object) {
|
|
66
|
+
case 0:
|
|
67
|
+
case "wait":
|
|
68
|
+
return VerificationStatus.wait;
|
|
69
|
+
case 1:
|
|
70
|
+
case "expires":
|
|
71
|
+
return VerificationStatus.expires;
|
|
72
|
+
case 2:
|
|
73
|
+
case "verified":
|
|
74
|
+
return VerificationStatus.verified;
|
|
75
|
+
case -1:
|
|
76
|
+
case "UNRECOGNIZED":
|
|
77
|
+
default:
|
|
78
|
+
return VerificationStatus.UNRECOGNIZED;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function verificationStatusToJSON(object: VerificationStatus): string {
|
|
83
|
+
switch (object) {
|
|
84
|
+
case VerificationStatus.wait:
|
|
85
|
+
return "wait";
|
|
86
|
+
case VerificationStatus.expires:
|
|
87
|
+
return "expires";
|
|
88
|
+
case VerificationStatus.verified:
|
|
89
|
+
return "verified";
|
|
90
|
+
case VerificationStatus.UNRECOGNIZED:
|
|
91
|
+
default:
|
|
92
|
+
return "UNRECOGNIZED";
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function verificationStatusToNumber(object: VerificationStatus): number {
|
|
97
|
+
switch (object) {
|
|
98
|
+
case VerificationStatus.wait:
|
|
99
|
+
return 0;
|
|
100
|
+
case VerificationStatus.expires:
|
|
101
|
+
return 1;
|
|
102
|
+
case VerificationStatus.verified:
|
|
103
|
+
return 2;
|
|
104
|
+
case VerificationStatus.UNRECOGNIZED:
|
|
105
|
+
default:
|
|
106
|
+
return -1;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
57
110
|
export interface Verification {
|
|
58
111
|
$type: "auth.v1.Verification";
|
|
59
112
|
id: string;
|
|
@@ -65,7 +118,6 @@ export interface VerificateRequest {
|
|
|
65
118
|
$type: "auth.v1.VerificateRequest";
|
|
66
119
|
id: string;
|
|
67
120
|
value: string;
|
|
68
|
-
code: string;
|
|
69
121
|
}
|
|
70
122
|
|
|
71
123
|
export interface RefreshRequest {
|
|
@@ -74,6 +126,16 @@ export interface RefreshRequest {
|
|
|
74
126
|
type: VerificationType;
|
|
75
127
|
}
|
|
76
128
|
|
|
129
|
+
export interface CheckStatusRequest {
|
|
130
|
+
$type: "auth.v1.CheckStatusRequest";
|
|
131
|
+
id: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface CheckStatusResponse {
|
|
135
|
+
$type: "auth.v1.CheckStatusResponse";
|
|
136
|
+
status: VerificationStatus;
|
|
137
|
+
}
|
|
138
|
+
|
|
77
139
|
function createBaseVerification(): Verification {
|
|
78
140
|
return { $type: "auth.v1.Verification", id: "", value: "", expiresAt: 0 };
|
|
79
141
|
}
|
|
@@ -174,7 +236,7 @@ export const Verification: MessageFns<Verification, "auth.v1.Verification"> = {
|
|
|
174
236
|
};
|
|
175
237
|
|
|
176
238
|
function createBaseVerificateRequest(): VerificateRequest {
|
|
177
|
-
return { $type: "auth.v1.VerificateRequest", id: "", value: ""
|
|
239
|
+
return { $type: "auth.v1.VerificateRequest", id: "", value: "" };
|
|
178
240
|
}
|
|
179
241
|
|
|
180
242
|
export const VerificateRequest: MessageFns<VerificateRequest, "auth.v1.VerificateRequest"> = {
|
|
@@ -187,9 +249,6 @@ export const VerificateRequest: MessageFns<VerificateRequest, "auth.v1.Verificat
|
|
|
187
249
|
if (message.value !== "") {
|
|
188
250
|
writer.uint32(18).string(message.value);
|
|
189
251
|
}
|
|
190
|
-
if (message.code !== "") {
|
|
191
|
-
writer.uint32(26).string(message.code);
|
|
192
|
-
}
|
|
193
252
|
return writer;
|
|
194
253
|
},
|
|
195
254
|
|
|
@@ -216,14 +275,6 @@ export const VerificateRequest: MessageFns<VerificateRequest, "auth.v1.Verificat
|
|
|
216
275
|
message.value = reader.string();
|
|
217
276
|
continue;
|
|
218
277
|
}
|
|
219
|
-
case 3: {
|
|
220
|
-
if (tag !== 26) {
|
|
221
|
-
break;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
message.code = reader.string();
|
|
225
|
-
continue;
|
|
226
|
-
}
|
|
227
278
|
}
|
|
228
279
|
if ((tag & 7) === 4 || tag === 0) {
|
|
229
280
|
break;
|
|
@@ -238,7 +289,6 @@ export const VerificateRequest: MessageFns<VerificateRequest, "auth.v1.Verificat
|
|
|
238
289
|
$type: VerificateRequest.$type,
|
|
239
290
|
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
240
291
|
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
241
|
-
code: isSet(object.code) ? globalThis.String(object.code) : "",
|
|
242
292
|
};
|
|
243
293
|
},
|
|
244
294
|
|
|
@@ -250,9 +300,6 @@ export const VerificateRequest: MessageFns<VerificateRequest, "auth.v1.Verificat
|
|
|
250
300
|
if (message.value !== "") {
|
|
251
301
|
obj.value = message.value;
|
|
252
302
|
}
|
|
253
|
-
if (message.code !== "") {
|
|
254
|
-
obj.code = message.code;
|
|
255
|
-
}
|
|
256
303
|
return obj;
|
|
257
304
|
},
|
|
258
305
|
|
|
@@ -263,7 +310,6 @@ export const VerificateRequest: MessageFns<VerificateRequest, "auth.v1.Verificat
|
|
|
263
310
|
const message = createBaseVerificateRequest();
|
|
264
311
|
message.id = object.id ?? "";
|
|
265
312
|
message.value = object.value ?? "";
|
|
266
|
-
message.code = object.code ?? "";
|
|
267
313
|
return message;
|
|
268
314
|
},
|
|
269
315
|
};
|
|
@@ -351,6 +397,129 @@ export const RefreshRequest: MessageFns<RefreshRequest, "auth.v1.RefreshRequest"
|
|
|
351
397
|
},
|
|
352
398
|
};
|
|
353
399
|
|
|
400
|
+
function createBaseCheckStatusRequest(): CheckStatusRequest {
|
|
401
|
+
return { $type: "auth.v1.CheckStatusRequest", id: "" };
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export const CheckStatusRequest: MessageFns<CheckStatusRequest, "auth.v1.CheckStatusRequest"> = {
|
|
405
|
+
$type: "auth.v1.CheckStatusRequest" as const,
|
|
406
|
+
|
|
407
|
+
encode(message: CheckStatusRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
408
|
+
if (message.id !== "") {
|
|
409
|
+
writer.uint32(10).string(message.id);
|
|
410
|
+
}
|
|
411
|
+
return writer;
|
|
412
|
+
},
|
|
413
|
+
|
|
414
|
+
decode(input: BinaryReader | Uint8Array, length?: number): CheckStatusRequest {
|
|
415
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
416
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
417
|
+
const message = createBaseCheckStatusRequest();
|
|
418
|
+
while (reader.pos < end) {
|
|
419
|
+
const tag = reader.uint32();
|
|
420
|
+
switch (tag >>> 3) {
|
|
421
|
+
case 1: {
|
|
422
|
+
if (tag !== 10) {
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
message.id = reader.string();
|
|
427
|
+
continue;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
431
|
+
break;
|
|
432
|
+
}
|
|
433
|
+
reader.skip(tag & 7);
|
|
434
|
+
}
|
|
435
|
+
return message;
|
|
436
|
+
},
|
|
437
|
+
|
|
438
|
+
fromJSON(object: any): CheckStatusRequest {
|
|
439
|
+
return { $type: CheckStatusRequest.$type, id: isSet(object.id) ? globalThis.String(object.id) : "" };
|
|
440
|
+
},
|
|
441
|
+
|
|
442
|
+
toJSON(message: CheckStatusRequest): unknown {
|
|
443
|
+
const obj: any = {};
|
|
444
|
+
if (message.id !== "") {
|
|
445
|
+
obj.id = message.id;
|
|
446
|
+
}
|
|
447
|
+
return obj;
|
|
448
|
+
},
|
|
449
|
+
|
|
450
|
+
create<I extends Exact<DeepPartial<CheckStatusRequest>, I>>(base?: I): CheckStatusRequest {
|
|
451
|
+
return CheckStatusRequest.fromPartial(base ?? ({} as any));
|
|
452
|
+
},
|
|
453
|
+
fromPartial<I extends Exact<DeepPartial<CheckStatusRequest>, I>>(object: I): CheckStatusRequest {
|
|
454
|
+
const message = createBaseCheckStatusRequest();
|
|
455
|
+
message.id = object.id ?? "";
|
|
456
|
+
return message;
|
|
457
|
+
},
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
function createBaseCheckStatusResponse(): CheckStatusResponse {
|
|
461
|
+
return { $type: "auth.v1.CheckStatusResponse", status: VerificationStatus.wait };
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
export const CheckStatusResponse: MessageFns<CheckStatusResponse, "auth.v1.CheckStatusResponse"> = {
|
|
465
|
+
$type: "auth.v1.CheckStatusResponse" as const,
|
|
466
|
+
|
|
467
|
+
encode(message: CheckStatusResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
468
|
+
if (message.status !== VerificationStatus.wait) {
|
|
469
|
+
writer.uint32(8).int32(verificationStatusToNumber(message.status));
|
|
470
|
+
}
|
|
471
|
+
return writer;
|
|
472
|
+
},
|
|
473
|
+
|
|
474
|
+
decode(input: BinaryReader | Uint8Array, length?: number): CheckStatusResponse {
|
|
475
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
476
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
477
|
+
const message = createBaseCheckStatusResponse();
|
|
478
|
+
while (reader.pos < end) {
|
|
479
|
+
const tag = reader.uint32();
|
|
480
|
+
switch (tag >>> 3) {
|
|
481
|
+
case 1: {
|
|
482
|
+
if (tag !== 8) {
|
|
483
|
+
break;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
message.status = verificationStatusFromJSON(reader.int32());
|
|
487
|
+
continue;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
491
|
+
break;
|
|
492
|
+
}
|
|
493
|
+
reader.skip(tag & 7);
|
|
494
|
+
}
|
|
495
|
+
return message;
|
|
496
|
+
},
|
|
497
|
+
|
|
498
|
+
fromJSON(object: any): CheckStatusResponse {
|
|
499
|
+
return {
|
|
500
|
+
$type: CheckStatusResponse.$type,
|
|
501
|
+
status: isSet(object.status) ? verificationStatusFromJSON(object.status) : VerificationStatus.wait,
|
|
502
|
+
};
|
|
503
|
+
},
|
|
504
|
+
|
|
505
|
+
toJSON(message: CheckStatusResponse): unknown {
|
|
506
|
+
const obj: any = {};
|
|
507
|
+
if (message.status !== VerificationStatus.wait) {
|
|
508
|
+
obj.status = verificationStatusToJSON(message.status);
|
|
509
|
+
}
|
|
510
|
+
return obj;
|
|
511
|
+
},
|
|
512
|
+
|
|
513
|
+
create<I extends Exact<DeepPartial<CheckStatusResponse>, I>>(base?: I): CheckStatusResponse {
|
|
514
|
+
return CheckStatusResponse.fromPartial(base ?? ({} as any));
|
|
515
|
+
},
|
|
516
|
+
fromPartial<I extends Exact<DeepPartial<CheckStatusResponse>, I>>(object: I): CheckStatusResponse {
|
|
517
|
+
const message = createBaseCheckStatusResponse();
|
|
518
|
+
message.status = object.status ?? VerificationStatus.wait;
|
|
519
|
+
return message;
|
|
520
|
+
},
|
|
521
|
+
};
|
|
522
|
+
|
|
354
523
|
export type VerificationServiceDefinition = typeof VerificationServiceDefinition;
|
|
355
524
|
export const VerificationServiceDefinition = {
|
|
356
525
|
name: "VerificationService",
|
|
@@ -372,17 +541,33 @@ export const VerificationServiceDefinition = {
|
|
|
372
541
|
responseStream: false,
|
|
373
542
|
options: {},
|
|
374
543
|
},
|
|
544
|
+
checkStatus: {
|
|
545
|
+
name: "CheckStatus",
|
|
546
|
+
requestType: CheckStatusRequest,
|
|
547
|
+
requestStream: false,
|
|
548
|
+
responseType: CheckStatusResponse,
|
|
549
|
+
responseStream: false,
|
|
550
|
+
options: {},
|
|
551
|
+
},
|
|
375
552
|
},
|
|
376
553
|
} as const;
|
|
377
554
|
|
|
378
555
|
export interface VerificationServiceImplementation<CallContextExt = {}> {
|
|
379
556
|
verificate(request: VerificateRequest, context: CallContext & CallContextExt): Promise<DeepPartial<StatusResponse>>;
|
|
380
557
|
refresh(request: RefreshRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Verification>>;
|
|
558
|
+
checkStatus(
|
|
559
|
+
request: CheckStatusRequest,
|
|
560
|
+
context: CallContext & CallContextExt,
|
|
561
|
+
): Promise<DeepPartial<CheckStatusResponse>>;
|
|
381
562
|
}
|
|
382
563
|
|
|
383
564
|
export interface VerificationServiceClient<CallOptionsExt = {}> {
|
|
384
565
|
verificate(request: DeepPartial<VerificateRequest>, options?: CallOptions & CallOptionsExt): Promise<StatusResponse>;
|
|
385
566
|
refresh(request: DeepPartial<RefreshRequest>, options?: CallOptions & CallOptionsExt): Promise<Verification>;
|
|
567
|
+
checkStatus(
|
|
568
|
+
request: DeepPartial<CheckStatusRequest>,
|
|
569
|
+
options?: CallOptions & CallOptionsExt,
|
|
570
|
+
): Promise<CheckStatusResponse>;
|
|
386
571
|
}
|
|
387
572
|
|
|
388
573
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import "auth/v1/common.proto";
|
|
|
7
7
|
service VerificationService {
|
|
8
8
|
rpc Verificate(VerificateRequest) returns (auth.v1.StatusResponse);
|
|
9
9
|
rpc Refresh(RefreshRequest) returns (Verification);
|
|
10
|
+
rpc CheckStatus(CheckStatusRequest) returns (CheckStatusResponse);
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
enum VerificationType {
|
|
@@ -23,10 +24,23 @@ message Verification {
|
|
|
23
24
|
message VerificateRequest {
|
|
24
25
|
string id = 1;
|
|
25
26
|
string value = 2;
|
|
26
|
-
string code = 3;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
message RefreshRequest {
|
|
30
30
|
string user_id = 1;
|
|
31
31
|
VerificationType type = 2;
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
enum VerificationStatus {
|
|
35
|
+
wait = 0;
|
|
36
|
+
expires = 1;
|
|
37
|
+
verified = 2;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message CheckStatusRequest {
|
|
41
|
+
string id = 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message CheckStatusResponse {
|
|
45
|
+
VerificationStatus status = 1;
|
|
46
|
+
}
|