@ssoeasy-dev/proto 1.1.1-beta.1 → 1.1.1-beta.3
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.
Potentially problematic release.
This version of @ssoeasy-dev/proto might be problematic. Click here for more details.
- package/README.md +107 -164
- package/gen/ts/auth/v1/auth.ts +648 -233
- package/gen/ts/auth/v1/common.ts +120 -0
- package/gen/ts/{companies/v1/models/employee_company.ts → auth/v1/permission.ts} +63 -35
- package/gen/ts/auth/v1/user_policy.ts +454 -0
- package/gen/ts/auth/v1/verification.ts +389 -102
- package/gen/ts/common/v1/types.ts +25 -67
- package/gen/ts/companies/v1/owner.ts +41 -284
- package/gen/ts/companies/v1/service.ts +150 -0
- package/gen/ts/index.auth.ts +1 -1
- package/gen/ts/index.auth.v1.ts +4 -1
- package/gen/ts/index.common.ts +1 -1
- package/gen/ts/index.common.v1.ts +1 -1
- package/gen/ts/index.companies.ts +1 -1
- package/gen/ts/index.companies.v1.ts +2 -2
- package/gen/ts/index.ts +2 -5
- package/package.json +1 -9
- package/proto/auth/v1/auth.proto +47 -19
- package/proto/auth/v1/common.proto +8 -0
- package/proto/auth/v1/permission.proto +15 -0
- package/proto/auth/v1/user_policy.proto +30 -0
- package/proto/auth/v1/verification.proto +32 -9
- package/proto/common/v1/types.proto +2 -5
- package/proto/companies/v1/owner.proto +4 -19
- package/proto/companies/v1/service.proto +14 -0
- package/gen/ts/abac/v1/employee_attribute.ts +0 -501
- package/gen/ts/abac/v1/models/employee_attribute.ts +0 -190
- package/gen/ts/companies/v1/models/company.ts +0 -204
- package/gen/ts/companies/v1/models/employee.ts +0 -175
- package/gen/ts/companies/v1/models/subscription.ts +0 -166
- package/gen/ts/google/protobuf/timestamp.ts +0 -233
- package/gen/ts/index.abac.ts +0 -8
- package/gen/ts/index.abac.v1.models.ts +0 -8
- package/gen/ts/index.abac.v1.ts +0 -9
- package/gen/ts/index.companies.v1.models.ts +0 -11
- package/gen/ts/index.google.protobuf.ts +0 -8
- package/gen/ts/index.google.ts +0 -8
- package/gen/ts/index.services.ts +0 -8
- package/gen/ts/index.services.v1.ts +0 -8
- package/gen/ts/services/v1/services.ts +0 -293
- package/proto/abac/v1/employee_attribute.proto +0 -31
- package/proto/abac/v1/models/employee_attribute.proto +0 -11
- package/proto/companies/v1/models/company.proto +0 -12
- package/proto/companies/v1/models/employee.proto +0 -11
- package/proto/companies/v1/models/employee_company.proto +0 -9
- package/proto/companies/v1/models/subscription.proto +0 -10
- package/proto/services/v1/services.proto +0 -19
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.
|
|
3
|
+
// protoc-gen-ts_proto v2.11.4
|
|
4
4
|
// protoc unknown
|
|
5
5
|
// source: auth/v1/verification.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
9
|
import type { CallContext, CallOptions } from "nice-grpc-common";
|
|
10
|
+
import { StatusResponse } from "../../common/v1/types";
|
|
10
11
|
|
|
11
12
|
export enum VerificationType {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
VERIFICATION_TYPE_UNSPECIFIED = "VERIFICATION_TYPE_UNSPECIFIED",
|
|
14
|
+
VERIFICATION_TYPE_EMAIL_CODE = "VERIFICATION_TYPE_EMAIL_CODE",
|
|
15
|
+
VERIFICATION_TYPE_EMAIL_LINK = "VERIFICATION_TYPE_EMAIL_LINK",
|
|
14
16
|
UNRECOGNIZED = "UNRECOGNIZED",
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export function verificationTypeFromJSON(object: any): VerificationType {
|
|
18
20
|
switch (object) {
|
|
19
21
|
case 0:
|
|
20
|
-
case "
|
|
21
|
-
return VerificationType.
|
|
22
|
+
case "VERIFICATION_TYPE_UNSPECIFIED":
|
|
23
|
+
return VerificationType.VERIFICATION_TYPE_UNSPECIFIED;
|
|
22
24
|
case 1:
|
|
23
|
-
case "
|
|
24
|
-
return VerificationType.
|
|
25
|
+
case "VERIFICATION_TYPE_EMAIL_CODE":
|
|
26
|
+
return VerificationType.VERIFICATION_TYPE_EMAIL_CODE;
|
|
27
|
+
case 2:
|
|
28
|
+
case "VERIFICATION_TYPE_EMAIL_LINK":
|
|
29
|
+
return VerificationType.VERIFICATION_TYPE_EMAIL_LINK;
|
|
25
30
|
case -1:
|
|
26
31
|
case "UNRECOGNIZED":
|
|
27
32
|
default:
|
|
@@ -31,10 +36,12 @@ export function verificationTypeFromJSON(object: any): VerificationType {
|
|
|
31
36
|
|
|
32
37
|
export function verificationTypeToJSON(object: VerificationType): string {
|
|
33
38
|
switch (object) {
|
|
34
|
-
case VerificationType.
|
|
35
|
-
return "
|
|
36
|
-
case VerificationType.
|
|
37
|
-
return "
|
|
39
|
+
case VerificationType.VERIFICATION_TYPE_UNSPECIFIED:
|
|
40
|
+
return "VERIFICATION_TYPE_UNSPECIFIED";
|
|
41
|
+
case VerificationType.VERIFICATION_TYPE_EMAIL_CODE:
|
|
42
|
+
return "VERIFICATION_TYPE_EMAIL_CODE";
|
|
43
|
+
case VerificationType.VERIFICATION_TYPE_EMAIL_LINK:
|
|
44
|
+
return "VERIFICATION_TYPE_EMAIL_LINK";
|
|
38
45
|
case VerificationType.UNRECOGNIZED:
|
|
39
46
|
default:
|
|
40
47
|
return "UNRECOGNIZED";
|
|
@@ -43,61 +50,132 @@ export function verificationTypeToJSON(object: VerificationType): string {
|
|
|
43
50
|
|
|
44
51
|
export function verificationTypeToNumber(object: VerificationType): number {
|
|
45
52
|
switch (object) {
|
|
46
|
-
case VerificationType.
|
|
53
|
+
case VerificationType.VERIFICATION_TYPE_UNSPECIFIED:
|
|
47
54
|
return 0;
|
|
48
|
-
case VerificationType.
|
|
55
|
+
case VerificationType.VERIFICATION_TYPE_EMAIL_CODE:
|
|
49
56
|
return 1;
|
|
57
|
+
case VerificationType.VERIFICATION_TYPE_EMAIL_LINK:
|
|
58
|
+
return 2;
|
|
50
59
|
case VerificationType.UNRECOGNIZED:
|
|
51
60
|
default:
|
|
52
61
|
return -1;
|
|
53
62
|
}
|
|
54
63
|
}
|
|
55
64
|
|
|
65
|
+
export enum VerificationStatus {
|
|
66
|
+
VERIFICATION_STATUS_UNSPECIFIED = "VERIFICATION_STATUS_UNSPECIFIED",
|
|
67
|
+
VERIFICATION_STATUS_WAIT = "VERIFICATION_STATUS_WAIT",
|
|
68
|
+
VERIFICATION_STATUS_EXPIRES = "VERIFICATION_STATUS_EXPIRES",
|
|
69
|
+
VERIFICATION_STATUS_VERIFIED = "VERIFICATION_STATUS_VERIFIED",
|
|
70
|
+
UNRECOGNIZED = "UNRECOGNIZED",
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function verificationStatusFromJSON(object: any): VerificationStatus {
|
|
74
|
+
switch (object) {
|
|
75
|
+
case 0:
|
|
76
|
+
case "VERIFICATION_STATUS_UNSPECIFIED":
|
|
77
|
+
return VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED;
|
|
78
|
+
case 1:
|
|
79
|
+
case "VERIFICATION_STATUS_WAIT":
|
|
80
|
+
return VerificationStatus.VERIFICATION_STATUS_WAIT;
|
|
81
|
+
case 2:
|
|
82
|
+
case "VERIFICATION_STATUS_EXPIRES":
|
|
83
|
+
return VerificationStatus.VERIFICATION_STATUS_EXPIRES;
|
|
84
|
+
case 3:
|
|
85
|
+
case "VERIFICATION_STATUS_VERIFIED":
|
|
86
|
+
return VerificationStatus.VERIFICATION_STATUS_VERIFIED;
|
|
87
|
+
case -1:
|
|
88
|
+
case "UNRECOGNIZED":
|
|
89
|
+
default:
|
|
90
|
+
return VerificationStatus.UNRECOGNIZED;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function verificationStatusToJSON(object: VerificationStatus): string {
|
|
95
|
+
switch (object) {
|
|
96
|
+
case VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED:
|
|
97
|
+
return "VERIFICATION_STATUS_UNSPECIFIED";
|
|
98
|
+
case VerificationStatus.VERIFICATION_STATUS_WAIT:
|
|
99
|
+
return "VERIFICATION_STATUS_WAIT";
|
|
100
|
+
case VerificationStatus.VERIFICATION_STATUS_EXPIRES:
|
|
101
|
+
return "VERIFICATION_STATUS_EXPIRES";
|
|
102
|
+
case VerificationStatus.VERIFICATION_STATUS_VERIFIED:
|
|
103
|
+
return "VERIFICATION_STATUS_VERIFIED";
|
|
104
|
+
case VerificationStatus.UNRECOGNIZED:
|
|
105
|
+
default:
|
|
106
|
+
return "UNRECOGNIZED";
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function verificationStatusToNumber(object: VerificationStatus): number {
|
|
111
|
+
switch (object) {
|
|
112
|
+
case VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED:
|
|
113
|
+
return 0;
|
|
114
|
+
case VerificationStatus.VERIFICATION_STATUS_WAIT:
|
|
115
|
+
return 1;
|
|
116
|
+
case VerificationStatus.VERIFICATION_STATUS_EXPIRES:
|
|
117
|
+
return 2;
|
|
118
|
+
case VerificationStatus.VERIFICATION_STATUS_VERIFIED:
|
|
119
|
+
return 3;
|
|
120
|
+
case VerificationStatus.UNRECOGNIZED:
|
|
121
|
+
default:
|
|
122
|
+
return -1;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface Verification {
|
|
127
|
+
$type: "auth.v1.Verification";
|
|
128
|
+
id: string;
|
|
129
|
+
value: string;
|
|
130
|
+
expiresAt: number;
|
|
131
|
+
}
|
|
132
|
+
|
|
56
133
|
export interface VerificateRequest {
|
|
57
134
|
$type: "auth.v1.VerificateRequest";
|
|
58
135
|
id: string;
|
|
59
136
|
value: string;
|
|
60
|
-
type: string;
|
|
61
|
-
companyId: string;
|
|
62
|
-
serviceId: string;
|
|
63
137
|
}
|
|
64
138
|
|
|
65
|
-
export interface
|
|
66
|
-
$type: "auth.v1.
|
|
67
|
-
|
|
68
|
-
|
|
139
|
+
export interface RefreshRequest {
|
|
140
|
+
$type: "auth.v1.RefreshRequest";
|
|
141
|
+
userId: string;
|
|
142
|
+
type: VerificationType;
|
|
69
143
|
}
|
|
70
144
|
|
|
71
|
-
|
|
72
|
-
|
|
145
|
+
export interface CheckStatusRequest {
|
|
146
|
+
$type: "auth.v1.CheckStatusRequest";
|
|
147
|
+
id: string;
|
|
73
148
|
}
|
|
74
149
|
|
|
75
|
-
export
|
|
76
|
-
$type: "auth.v1.
|
|
150
|
+
export interface CheckStatusResponse {
|
|
151
|
+
$type: "auth.v1.CheckStatusResponse";
|
|
152
|
+
status: VerificationStatus;
|
|
153
|
+
}
|
|
77
154
|
|
|
78
|
-
|
|
155
|
+
function createBaseVerification(): Verification {
|
|
156
|
+
return { $type: "auth.v1.Verification", id: "", value: "", expiresAt: 0 };
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export const Verification: MessageFns<Verification, "auth.v1.Verification"> = {
|
|
160
|
+
$type: "auth.v1.Verification" as const,
|
|
161
|
+
|
|
162
|
+
encode(message: Verification, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
79
163
|
if (message.id !== "") {
|
|
80
164
|
writer.uint32(10).string(message.id);
|
|
81
165
|
}
|
|
82
166
|
if (message.value !== "") {
|
|
83
167
|
writer.uint32(18).string(message.value);
|
|
84
168
|
}
|
|
85
|
-
if (message.
|
|
86
|
-
writer.uint32(
|
|
87
|
-
}
|
|
88
|
-
if (message.companyId !== "") {
|
|
89
|
-
writer.uint32(34).string(message.companyId);
|
|
90
|
-
}
|
|
91
|
-
if (message.serviceId !== "") {
|
|
92
|
-
writer.uint32(42).string(message.serviceId);
|
|
169
|
+
if (message.expiresAt !== 0) {
|
|
170
|
+
writer.uint32(24).int64(message.expiresAt);
|
|
93
171
|
}
|
|
94
172
|
return writer;
|
|
95
173
|
},
|
|
96
174
|
|
|
97
|
-
decode(input: BinaryReader | Uint8Array, length?: number):
|
|
175
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Verification {
|
|
98
176
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
99
177
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
100
|
-
const message =
|
|
178
|
+
const message = createBaseVerification();
|
|
101
179
|
while (reader.pos < end) {
|
|
102
180
|
const tag = reader.uint32();
|
|
103
181
|
switch (tag >>> 3) {
|
|
@@ -118,27 +196,99 @@ export const VerificateRequest: MessageFns<VerificateRequest, "auth.v1.Verificat
|
|
|
118
196
|
continue;
|
|
119
197
|
}
|
|
120
198
|
case 3: {
|
|
121
|
-
if (tag !==
|
|
199
|
+
if (tag !== 24) {
|
|
122
200
|
break;
|
|
123
201
|
}
|
|
124
202
|
|
|
125
|
-
message.
|
|
203
|
+
message.expiresAt = longToNumber(reader.int64());
|
|
126
204
|
continue;
|
|
127
205
|
}
|
|
128
|
-
|
|
129
|
-
|
|
206
|
+
}
|
|
207
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
reader.skip(tag & 7);
|
|
211
|
+
}
|
|
212
|
+
return message;
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
fromJSON(object: any): Verification {
|
|
216
|
+
return {
|
|
217
|
+
$type: Verification.$type,
|
|
218
|
+
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
219
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
220
|
+
expiresAt: isSet(object.expiresAt)
|
|
221
|
+
? globalThis.Number(object.expiresAt)
|
|
222
|
+
: isSet(object.expires_at)
|
|
223
|
+
? globalThis.Number(object.expires_at)
|
|
224
|
+
: 0,
|
|
225
|
+
};
|
|
226
|
+
},
|
|
227
|
+
|
|
228
|
+
toJSON(message: Verification): unknown {
|
|
229
|
+
const obj: any = {};
|
|
230
|
+
if (message.id !== "") {
|
|
231
|
+
obj.id = message.id;
|
|
232
|
+
}
|
|
233
|
+
if (message.value !== "") {
|
|
234
|
+
obj.value = message.value;
|
|
235
|
+
}
|
|
236
|
+
if (message.expiresAt !== 0) {
|
|
237
|
+
obj.expiresAt = Math.round(message.expiresAt);
|
|
238
|
+
}
|
|
239
|
+
return obj;
|
|
240
|
+
},
|
|
241
|
+
|
|
242
|
+
create<I extends Exact<DeepPartial<Verification>, I>>(base?: I): Verification {
|
|
243
|
+
return Verification.fromPartial(base ?? ({} as any));
|
|
244
|
+
},
|
|
245
|
+
fromPartial<I extends Exact<DeepPartial<Verification>, I>>(object: I): Verification {
|
|
246
|
+
const message = createBaseVerification();
|
|
247
|
+
message.id = object.id ?? "";
|
|
248
|
+
message.value = object.value ?? "";
|
|
249
|
+
message.expiresAt = object.expiresAt ?? 0;
|
|
250
|
+
return message;
|
|
251
|
+
},
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
function createBaseVerificateRequest(): VerificateRequest {
|
|
255
|
+
return { $type: "auth.v1.VerificateRequest", id: "", value: "" };
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export const VerificateRequest: MessageFns<VerificateRequest, "auth.v1.VerificateRequest"> = {
|
|
259
|
+
$type: "auth.v1.VerificateRequest" as const,
|
|
260
|
+
|
|
261
|
+
encode(message: VerificateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
262
|
+
if (message.id !== "") {
|
|
263
|
+
writer.uint32(10).string(message.id);
|
|
264
|
+
}
|
|
265
|
+
if (message.value !== "") {
|
|
266
|
+
writer.uint32(18).string(message.value);
|
|
267
|
+
}
|
|
268
|
+
return writer;
|
|
269
|
+
},
|
|
270
|
+
|
|
271
|
+
decode(input: BinaryReader | Uint8Array, length?: number): VerificateRequest {
|
|
272
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
273
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
274
|
+
const message = createBaseVerificateRequest();
|
|
275
|
+
while (reader.pos < end) {
|
|
276
|
+
const tag = reader.uint32();
|
|
277
|
+
switch (tag >>> 3) {
|
|
278
|
+
case 1: {
|
|
279
|
+
if (tag !== 10) {
|
|
130
280
|
break;
|
|
131
281
|
}
|
|
132
282
|
|
|
133
|
-
message.
|
|
283
|
+
message.id = reader.string();
|
|
134
284
|
continue;
|
|
135
285
|
}
|
|
136
|
-
case
|
|
137
|
-
if (tag !==
|
|
286
|
+
case 2: {
|
|
287
|
+
if (tag !== 18) {
|
|
138
288
|
break;
|
|
139
289
|
}
|
|
140
290
|
|
|
141
|
-
message.
|
|
291
|
+
message.value = reader.string();
|
|
142
292
|
continue;
|
|
143
293
|
}
|
|
144
294
|
}
|
|
@@ -155,17 +305,6 @@ export const VerificateRequest: MessageFns<VerificateRequest, "auth.v1.Verificat
|
|
|
155
305
|
$type: VerificateRequest.$type,
|
|
156
306
|
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
157
307
|
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
308
|
};
|
|
170
309
|
},
|
|
171
310
|
|
|
@@ -177,15 +316,6 @@ export const VerificateRequest: MessageFns<VerificateRequest, "auth.v1.Verificat
|
|
|
177
316
|
if (message.value !== "") {
|
|
178
317
|
obj.value = message.value;
|
|
179
318
|
}
|
|
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
319
|
return obj;
|
|
190
320
|
},
|
|
191
321
|
|
|
@@ -196,34 +326,31 @@ export const VerificateRequest: MessageFns<VerificateRequest, "auth.v1.Verificat
|
|
|
196
326
|
const message = createBaseVerificateRequest();
|
|
197
327
|
message.id = object.id ?? "";
|
|
198
328
|
message.value = object.value ?? "";
|
|
199
|
-
message.type = object.type ?? "";
|
|
200
|
-
message.companyId = object.companyId ?? "";
|
|
201
|
-
message.serviceId = object.serviceId ?? "";
|
|
202
329
|
return message;
|
|
203
330
|
},
|
|
204
331
|
};
|
|
205
332
|
|
|
206
|
-
function
|
|
207
|
-
return { $type: "auth.v1.
|
|
333
|
+
function createBaseRefreshRequest(): RefreshRequest {
|
|
334
|
+
return { $type: "auth.v1.RefreshRequest", userId: "", type: VerificationType.VERIFICATION_TYPE_UNSPECIFIED };
|
|
208
335
|
}
|
|
209
336
|
|
|
210
|
-
export const
|
|
211
|
-
$type: "auth.v1.
|
|
337
|
+
export const RefreshRequest: MessageFns<RefreshRequest, "auth.v1.RefreshRequest"> = {
|
|
338
|
+
$type: "auth.v1.RefreshRequest" as const,
|
|
212
339
|
|
|
213
|
-
encode(message:
|
|
214
|
-
if (message.
|
|
215
|
-
writer.uint32(10).string(message.
|
|
340
|
+
encode(message: RefreshRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
341
|
+
if (message.userId !== "") {
|
|
342
|
+
writer.uint32(10).string(message.userId);
|
|
216
343
|
}
|
|
217
|
-
if (message.
|
|
218
|
-
writer.uint32(
|
|
344
|
+
if (message.type !== VerificationType.VERIFICATION_TYPE_UNSPECIFIED) {
|
|
345
|
+
writer.uint32(16).int32(verificationTypeToNumber(message.type));
|
|
219
346
|
}
|
|
220
347
|
return writer;
|
|
221
348
|
},
|
|
222
349
|
|
|
223
|
-
decode(input: BinaryReader | Uint8Array, length?: number):
|
|
350
|
+
decode(input: BinaryReader | Uint8Array, length?: number): RefreshRequest {
|
|
224
351
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
225
352
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
226
|
-
const message =
|
|
353
|
+
const message = createBaseRefreshRequest();
|
|
227
354
|
while (reader.pos < end) {
|
|
228
355
|
const tag = reader.uint32();
|
|
229
356
|
switch (tag >>> 3) {
|
|
@@ -232,15 +359,15 @@ export const VerificateResponse: MessageFns<VerificateResponse, "auth.v1.Verific
|
|
|
232
359
|
break;
|
|
233
360
|
}
|
|
234
361
|
|
|
235
|
-
message.
|
|
362
|
+
message.userId = reader.string();
|
|
236
363
|
continue;
|
|
237
364
|
}
|
|
238
365
|
case 2: {
|
|
239
|
-
if (tag !==
|
|
366
|
+
if (tag !== 16) {
|
|
240
367
|
break;
|
|
241
368
|
}
|
|
242
369
|
|
|
243
|
-
message.
|
|
370
|
+
message.type = verificationTypeFromJSON(reader.int32());
|
|
244
371
|
continue;
|
|
245
372
|
}
|
|
246
373
|
}
|
|
@@ -252,32 +379,161 @@ export const VerificateResponse: MessageFns<VerificateResponse, "auth.v1.Verific
|
|
|
252
379
|
return message;
|
|
253
380
|
},
|
|
254
381
|
|
|
255
|
-
fromJSON(object: any):
|
|
382
|
+
fromJSON(object: any): RefreshRequest {
|
|
256
383
|
return {
|
|
257
|
-
$type:
|
|
258
|
-
|
|
259
|
-
|
|
384
|
+
$type: RefreshRequest.$type,
|
|
385
|
+
userId: isSet(object.userId)
|
|
386
|
+
? globalThis.String(object.userId)
|
|
387
|
+
: isSet(object.user_id)
|
|
388
|
+
? globalThis.String(object.user_id)
|
|
389
|
+
: "",
|
|
390
|
+
type: isSet(object.type) ? verificationTypeFromJSON(object.type) : VerificationType.VERIFICATION_TYPE_UNSPECIFIED,
|
|
260
391
|
};
|
|
261
392
|
},
|
|
262
393
|
|
|
263
|
-
toJSON(message:
|
|
394
|
+
toJSON(message: RefreshRequest): unknown {
|
|
264
395
|
const obj: any = {};
|
|
265
|
-
if (message.
|
|
266
|
-
obj.
|
|
396
|
+
if (message.userId !== "") {
|
|
397
|
+
obj.userId = message.userId;
|
|
267
398
|
}
|
|
268
|
-
if (message.
|
|
269
|
-
obj.
|
|
399
|
+
if (message.type !== VerificationType.VERIFICATION_TYPE_UNSPECIFIED) {
|
|
400
|
+
obj.type = verificationTypeToJSON(message.type);
|
|
270
401
|
}
|
|
271
402
|
return obj;
|
|
272
403
|
},
|
|
273
404
|
|
|
274
|
-
create<I extends Exact<DeepPartial<
|
|
275
|
-
return
|
|
405
|
+
create<I extends Exact<DeepPartial<RefreshRequest>, I>>(base?: I): RefreshRequest {
|
|
406
|
+
return RefreshRequest.fromPartial(base ?? ({} as any));
|
|
276
407
|
},
|
|
277
|
-
fromPartial<I extends Exact<DeepPartial<
|
|
278
|
-
const message =
|
|
279
|
-
message.
|
|
280
|
-
message.
|
|
408
|
+
fromPartial<I extends Exact<DeepPartial<RefreshRequest>, I>>(object: I): RefreshRequest {
|
|
409
|
+
const message = createBaseRefreshRequest();
|
|
410
|
+
message.userId = object.userId ?? "";
|
|
411
|
+
message.type = object.type ?? VerificationType.VERIFICATION_TYPE_UNSPECIFIED;
|
|
412
|
+
return message;
|
|
413
|
+
},
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
function createBaseCheckStatusRequest(): CheckStatusRequest {
|
|
417
|
+
return { $type: "auth.v1.CheckStatusRequest", id: "" };
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export const CheckStatusRequest: MessageFns<CheckStatusRequest, "auth.v1.CheckStatusRequest"> = {
|
|
421
|
+
$type: "auth.v1.CheckStatusRequest" as const,
|
|
422
|
+
|
|
423
|
+
encode(message: CheckStatusRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
424
|
+
if (message.id !== "") {
|
|
425
|
+
writer.uint32(10).string(message.id);
|
|
426
|
+
}
|
|
427
|
+
return writer;
|
|
428
|
+
},
|
|
429
|
+
|
|
430
|
+
decode(input: BinaryReader | Uint8Array, length?: number): CheckStatusRequest {
|
|
431
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
432
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
433
|
+
const message = createBaseCheckStatusRequest();
|
|
434
|
+
while (reader.pos < end) {
|
|
435
|
+
const tag = reader.uint32();
|
|
436
|
+
switch (tag >>> 3) {
|
|
437
|
+
case 1: {
|
|
438
|
+
if (tag !== 10) {
|
|
439
|
+
break;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
message.id = reader.string();
|
|
443
|
+
continue;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
447
|
+
break;
|
|
448
|
+
}
|
|
449
|
+
reader.skip(tag & 7);
|
|
450
|
+
}
|
|
451
|
+
return message;
|
|
452
|
+
},
|
|
453
|
+
|
|
454
|
+
fromJSON(object: any): CheckStatusRequest {
|
|
455
|
+
return { $type: CheckStatusRequest.$type, id: isSet(object.id) ? globalThis.String(object.id) : "" };
|
|
456
|
+
},
|
|
457
|
+
|
|
458
|
+
toJSON(message: CheckStatusRequest): unknown {
|
|
459
|
+
const obj: any = {};
|
|
460
|
+
if (message.id !== "") {
|
|
461
|
+
obj.id = message.id;
|
|
462
|
+
}
|
|
463
|
+
return obj;
|
|
464
|
+
},
|
|
465
|
+
|
|
466
|
+
create<I extends Exact<DeepPartial<CheckStatusRequest>, I>>(base?: I): CheckStatusRequest {
|
|
467
|
+
return CheckStatusRequest.fromPartial(base ?? ({} as any));
|
|
468
|
+
},
|
|
469
|
+
fromPartial<I extends Exact<DeepPartial<CheckStatusRequest>, I>>(object: I): CheckStatusRequest {
|
|
470
|
+
const message = createBaseCheckStatusRequest();
|
|
471
|
+
message.id = object.id ?? "";
|
|
472
|
+
return message;
|
|
473
|
+
},
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
function createBaseCheckStatusResponse(): CheckStatusResponse {
|
|
477
|
+
return { $type: "auth.v1.CheckStatusResponse", status: VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED };
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
export const CheckStatusResponse: MessageFns<CheckStatusResponse, "auth.v1.CheckStatusResponse"> = {
|
|
481
|
+
$type: "auth.v1.CheckStatusResponse" as const,
|
|
482
|
+
|
|
483
|
+
encode(message: CheckStatusResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
484
|
+
if (message.status !== VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED) {
|
|
485
|
+
writer.uint32(8).int32(verificationStatusToNumber(message.status));
|
|
486
|
+
}
|
|
487
|
+
return writer;
|
|
488
|
+
},
|
|
489
|
+
|
|
490
|
+
decode(input: BinaryReader | Uint8Array, length?: number): CheckStatusResponse {
|
|
491
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
492
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
493
|
+
const message = createBaseCheckStatusResponse();
|
|
494
|
+
while (reader.pos < end) {
|
|
495
|
+
const tag = reader.uint32();
|
|
496
|
+
switch (tag >>> 3) {
|
|
497
|
+
case 1: {
|
|
498
|
+
if (tag !== 8) {
|
|
499
|
+
break;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
message.status = verificationStatusFromJSON(reader.int32());
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
507
|
+
break;
|
|
508
|
+
}
|
|
509
|
+
reader.skip(tag & 7);
|
|
510
|
+
}
|
|
511
|
+
return message;
|
|
512
|
+
},
|
|
513
|
+
|
|
514
|
+
fromJSON(object: any): CheckStatusResponse {
|
|
515
|
+
return {
|
|
516
|
+
$type: CheckStatusResponse.$type,
|
|
517
|
+
status: isSet(object.status)
|
|
518
|
+
? verificationStatusFromJSON(object.status)
|
|
519
|
+
: VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED,
|
|
520
|
+
};
|
|
521
|
+
},
|
|
522
|
+
|
|
523
|
+
toJSON(message: CheckStatusResponse): unknown {
|
|
524
|
+
const obj: any = {};
|
|
525
|
+
if (message.status !== VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED) {
|
|
526
|
+
obj.status = verificationStatusToJSON(message.status);
|
|
527
|
+
}
|
|
528
|
+
return obj;
|
|
529
|
+
},
|
|
530
|
+
|
|
531
|
+
create<I extends Exact<DeepPartial<CheckStatusResponse>, I>>(base?: I): CheckStatusResponse {
|
|
532
|
+
return CheckStatusResponse.fromPartial(base ?? ({} as any));
|
|
533
|
+
},
|
|
534
|
+
fromPartial<I extends Exact<DeepPartial<CheckStatusResponse>, I>>(object: I): CheckStatusResponse {
|
|
535
|
+
const message = createBaseCheckStatusResponse();
|
|
536
|
+
message.status = object.status ?? VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED;
|
|
281
537
|
return message;
|
|
282
538
|
},
|
|
283
539
|
};
|
|
@@ -291,7 +547,23 @@ export const VerificationServiceDefinition = {
|
|
|
291
547
|
name: "Verificate",
|
|
292
548
|
requestType: VerificateRequest,
|
|
293
549
|
requestStream: false,
|
|
294
|
-
responseType:
|
|
550
|
+
responseType: StatusResponse,
|
|
551
|
+
responseStream: false,
|
|
552
|
+
options: {},
|
|
553
|
+
},
|
|
554
|
+
refresh: {
|
|
555
|
+
name: "Refresh",
|
|
556
|
+
requestType: RefreshRequest,
|
|
557
|
+
requestStream: false,
|
|
558
|
+
responseType: Verification,
|
|
559
|
+
responseStream: false,
|
|
560
|
+
options: {},
|
|
561
|
+
},
|
|
562
|
+
checkStatus: {
|
|
563
|
+
name: "CheckStatus",
|
|
564
|
+
requestType: CheckStatusRequest,
|
|
565
|
+
requestStream: false,
|
|
566
|
+
responseType: CheckStatusResponse,
|
|
295
567
|
responseStream: false,
|
|
296
568
|
options: {},
|
|
297
569
|
},
|
|
@@ -299,17 +571,21 @@ export const VerificationServiceDefinition = {
|
|
|
299
571
|
} as const;
|
|
300
572
|
|
|
301
573
|
export interface VerificationServiceImplementation<CallContextExt = {}> {
|
|
302
|
-
verificate(
|
|
303
|
-
|
|
574
|
+
verificate(request: VerificateRequest, context: CallContext & CallContextExt): Promise<DeepPartial<StatusResponse>>;
|
|
575
|
+
refresh(request: RefreshRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Verification>>;
|
|
576
|
+
checkStatus(
|
|
577
|
+
request: CheckStatusRequest,
|
|
304
578
|
context: CallContext & CallContextExt,
|
|
305
|
-
): Promise<DeepPartial<
|
|
579
|
+
): Promise<DeepPartial<CheckStatusResponse>>;
|
|
306
580
|
}
|
|
307
581
|
|
|
308
582
|
export interface VerificationServiceClient<CallOptionsExt = {}> {
|
|
309
|
-
verificate(
|
|
310
|
-
|
|
583
|
+
verificate(request: DeepPartial<VerificateRequest>, options?: CallOptions & CallOptionsExt): Promise<StatusResponse>;
|
|
584
|
+
refresh(request: DeepPartial<RefreshRequest>, options?: CallOptions & CallOptionsExt): Promise<Verification>;
|
|
585
|
+
checkStatus(
|
|
586
|
+
request: DeepPartial<CheckStatusRequest>,
|
|
311
587
|
options?: CallOptions & CallOptionsExt,
|
|
312
|
-
): Promise<
|
|
588
|
+
): Promise<CheckStatusResponse>;
|
|
313
589
|
}
|
|
314
590
|
|
|
315
591
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
@@ -325,6 +601,17 @@ type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
|
325
601
|
type Exact<P, I extends P> = P extends Builtin ? P
|
|
326
602
|
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
|
|
327
603
|
|
|
604
|
+
function longToNumber(int64: { toString(): string }): number {
|
|
605
|
+
const num = globalThis.Number(int64.toString());
|
|
606
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
607
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
608
|
+
}
|
|
609
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
610
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
611
|
+
}
|
|
612
|
+
return num;
|
|
613
|
+
}
|
|
614
|
+
|
|
328
615
|
function isSet(value: any): boolean {
|
|
329
616
|
return value !== null && value !== undefined;
|
|
330
617
|
}
|