@ssoeasy-dev/proto 1.1.0-dev-feat-auth.4 → 1.1.0-dev-feat-auth.6
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.
- package/gen/ts/auth/v1/auth.ts +3 -2
- package/gen/ts/auth/v1/common.ts +1 -66
- package/gen/ts/{companies/v1/models/employee_company.ts → auth/v1/permission.ts} +63 -35
- package/gen/ts/auth/v1/user_policy.ts +14 -6
- package/gen/ts/auth/v1/verification.ts +40 -24
- 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 +2 -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 +1 -4
- package/package.json +1 -1
- package/proto/auth/v1/auth.proto +3 -2
- package/proto/auth/v1/common.proto +0 -4
- package/proto/auth/v1/permission.proto +16 -0
- package/proto/auth/v1/user_policy.proto +4 -3
- package/proto/auth/v1/verification.proto +9 -6
- 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
package/gen/ts/auth/v1/auth.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
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/auth.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
|
|
10
|
+
import { StatusResponse } from "../../common/v1/types";
|
|
11
|
+
import { Tokens } from "./common";
|
|
11
12
|
import { UserPolicyRequest, UserPolicyResponse } from "./user_policy";
|
|
12
13
|
import {
|
|
13
14
|
Verification,
|
package/gen/ts/auth/v1/common.ts
CHANGED
|
@@ -1,83 +1,18 @@
|
|
|
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/common.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
9
|
|
|
10
|
-
export interface StatusResponse {
|
|
11
|
-
$type: "auth.v1.StatusResponse";
|
|
12
|
-
success: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
10
|
export interface Tokens {
|
|
16
11
|
$type: "auth.v1.Tokens";
|
|
17
12
|
access: string;
|
|
18
13
|
refresh: string;
|
|
19
14
|
}
|
|
20
15
|
|
|
21
|
-
function createBaseStatusResponse(): StatusResponse {
|
|
22
|
-
return { $type: "auth.v1.StatusResponse", success: false };
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const StatusResponse: MessageFns<StatusResponse, "auth.v1.StatusResponse"> = {
|
|
26
|
-
$type: "auth.v1.StatusResponse" as const,
|
|
27
|
-
|
|
28
|
-
encode(message: StatusResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
29
|
-
if (message.success !== false) {
|
|
30
|
-
writer.uint32(8).bool(message.success);
|
|
31
|
-
}
|
|
32
|
-
return writer;
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
decode(input: BinaryReader | Uint8Array, length?: number): StatusResponse {
|
|
36
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
37
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
38
|
-
const message = createBaseStatusResponse();
|
|
39
|
-
while (reader.pos < end) {
|
|
40
|
-
const tag = reader.uint32();
|
|
41
|
-
switch (tag >>> 3) {
|
|
42
|
-
case 1: {
|
|
43
|
-
if (tag !== 8) {
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
message.success = reader.bool();
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
reader.skip(tag & 7);
|
|
55
|
-
}
|
|
56
|
-
return message;
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
fromJSON(object: any): StatusResponse {
|
|
60
|
-
return { $type: StatusResponse.$type, success: isSet(object.success) ? globalThis.Boolean(object.success) : false };
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
toJSON(message: StatusResponse): unknown {
|
|
64
|
-
const obj: any = {};
|
|
65
|
-
if (message.success !== false) {
|
|
66
|
-
obj.success = message.success;
|
|
67
|
-
}
|
|
68
|
-
return obj;
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
create<I extends Exact<DeepPartial<StatusResponse>, I>>(base?: I): StatusResponse {
|
|
72
|
-
return StatusResponse.fromPartial(base ?? ({} as any));
|
|
73
|
-
},
|
|
74
|
-
fromPartial<I extends Exact<DeepPartial<StatusResponse>, I>>(object: I): StatusResponse {
|
|
75
|
-
const message = createBaseStatusResponse();
|
|
76
|
-
message.success = object.success ?? false;
|
|
77
|
-
return message;
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
|
|
81
16
|
function createBaseTokens(): Tokens {
|
|
82
17
|
return { $type: "auth.v1.Tokens", access: "", refresh: "" };
|
|
83
18
|
}
|
|
@@ -1,43 +1,45 @@
|
|
|
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
|
-
// source:
|
|
5
|
+
// source: auth/v1/permission.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import type { CallContext, CallOptions } from "nice-grpc-common";
|
|
10
|
+
import { StatusResponse } from "../../common/v1/types";
|
|
9
11
|
|
|
10
|
-
export interface
|
|
11
|
-
$type: "
|
|
12
|
+
export interface CheckPermissionRequest {
|
|
13
|
+
$type: "auth.v1.CheckPermissionRequest";
|
|
12
14
|
id: string;
|
|
13
|
-
|
|
14
|
-
companyId
|
|
15
|
+
token: string;
|
|
16
|
+
companyId?: string | undefined;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
function
|
|
18
|
-
return { $type: "
|
|
19
|
+
function createBaseCheckPermissionRequest(): CheckPermissionRequest {
|
|
20
|
+
return { $type: "auth.v1.CheckPermissionRequest", id: "", token: "", companyId: undefined };
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
export const
|
|
22
|
-
$type: "
|
|
23
|
+
export const CheckPermissionRequest: MessageFns<CheckPermissionRequest, "auth.v1.CheckPermissionRequest"> = {
|
|
24
|
+
$type: "auth.v1.CheckPermissionRequest" as const,
|
|
23
25
|
|
|
24
|
-
encode(message:
|
|
26
|
+
encode(message: CheckPermissionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
25
27
|
if (message.id !== "") {
|
|
26
28
|
writer.uint32(10).string(message.id);
|
|
27
29
|
}
|
|
28
|
-
if (message.
|
|
29
|
-
writer.uint32(18).string(message.
|
|
30
|
+
if (message.token !== "") {
|
|
31
|
+
writer.uint32(18).string(message.token);
|
|
30
32
|
}
|
|
31
|
-
if (message.companyId !==
|
|
33
|
+
if (message.companyId !== undefined) {
|
|
32
34
|
writer.uint32(26).string(message.companyId);
|
|
33
35
|
}
|
|
34
36
|
return writer;
|
|
35
37
|
},
|
|
36
38
|
|
|
37
|
-
decode(input: BinaryReader | Uint8Array, length?: number):
|
|
39
|
+
decode(input: BinaryReader | Uint8Array, length?: number): CheckPermissionRequest {
|
|
38
40
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
39
41
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
40
|
-
const message =
|
|
42
|
+
const message = createBaseCheckPermissionRequest();
|
|
41
43
|
while (reader.pos < end) {
|
|
42
44
|
const tag = reader.uint32();
|
|
43
45
|
switch (tag >>> 3) {
|
|
@@ -54,7 +56,7 @@ export const EmployeeCompany: MessageFns<EmployeeCompany, "companies.v1.models.E
|
|
|
54
56
|
break;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
message.
|
|
59
|
+
message.token = reader.string();
|
|
58
60
|
continue;
|
|
59
61
|
}
|
|
60
62
|
case 3: {
|
|
@@ -74,49 +76,75 @@ export const EmployeeCompany: MessageFns<EmployeeCompany, "companies.v1.models.E
|
|
|
74
76
|
return message;
|
|
75
77
|
},
|
|
76
78
|
|
|
77
|
-
fromJSON(object: any):
|
|
79
|
+
fromJSON(object: any): CheckPermissionRequest {
|
|
78
80
|
return {
|
|
79
|
-
$type:
|
|
81
|
+
$type: CheckPermissionRequest.$type,
|
|
80
82
|
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
81
|
-
|
|
82
|
-
? globalThis.String(object.employeeId)
|
|
83
|
-
: isSet(object.employee_id)
|
|
84
|
-
? globalThis.String(object.employee_id)
|
|
85
|
-
: "",
|
|
83
|
+
token: isSet(object.token) ? globalThis.String(object.token) : "",
|
|
86
84
|
companyId: isSet(object.companyId)
|
|
87
85
|
? globalThis.String(object.companyId)
|
|
88
86
|
: isSet(object.company_id)
|
|
89
87
|
? globalThis.String(object.company_id)
|
|
90
|
-
:
|
|
88
|
+
: undefined,
|
|
91
89
|
};
|
|
92
90
|
},
|
|
93
91
|
|
|
94
|
-
toJSON(message:
|
|
92
|
+
toJSON(message: CheckPermissionRequest): unknown {
|
|
95
93
|
const obj: any = {};
|
|
96
94
|
if (message.id !== "") {
|
|
97
95
|
obj.id = message.id;
|
|
98
96
|
}
|
|
99
|
-
if (message.
|
|
100
|
-
obj.
|
|
97
|
+
if (message.token !== "") {
|
|
98
|
+
obj.token = message.token;
|
|
101
99
|
}
|
|
102
|
-
if (message.companyId !==
|
|
100
|
+
if (message.companyId !== undefined) {
|
|
103
101
|
obj.companyId = message.companyId;
|
|
104
102
|
}
|
|
105
103
|
return obj;
|
|
106
104
|
},
|
|
107
105
|
|
|
108
|
-
create<I extends Exact<DeepPartial<
|
|
109
|
-
return
|
|
106
|
+
create<I extends Exact<DeepPartial<CheckPermissionRequest>, I>>(base?: I): CheckPermissionRequest {
|
|
107
|
+
return CheckPermissionRequest.fromPartial(base ?? ({} as any));
|
|
110
108
|
},
|
|
111
|
-
fromPartial<I extends Exact<DeepPartial<
|
|
112
|
-
const message =
|
|
109
|
+
fromPartial<I extends Exact<DeepPartial<CheckPermissionRequest>, I>>(object: I): CheckPermissionRequest {
|
|
110
|
+
const message = createBaseCheckPermissionRequest();
|
|
113
111
|
message.id = object.id ?? "";
|
|
114
|
-
message.
|
|
115
|
-
message.companyId = object.companyId ??
|
|
112
|
+
message.token = object.token ?? "";
|
|
113
|
+
message.companyId = object.companyId ?? undefined;
|
|
116
114
|
return message;
|
|
117
115
|
},
|
|
118
116
|
};
|
|
119
117
|
|
|
118
|
+
export type PermissionServiceDefinition = typeof PermissionServiceDefinition;
|
|
119
|
+
export const PermissionServiceDefinition = {
|
|
120
|
+
name: "PermissionService",
|
|
121
|
+
fullName: "auth.v1.PermissionService",
|
|
122
|
+
methods: {
|
|
123
|
+
checkPermission: {
|
|
124
|
+
name: "CheckPermission",
|
|
125
|
+
requestType: CheckPermissionRequest,
|
|
126
|
+
requestStream: false,
|
|
127
|
+
responseType: StatusResponse,
|
|
128
|
+
responseStream: false,
|
|
129
|
+
options: {},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
} as const;
|
|
133
|
+
|
|
134
|
+
export interface PermissionServiceImplementation<CallContextExt = {}> {
|
|
135
|
+
checkPermission(
|
|
136
|
+
request: CheckPermissionRequest,
|
|
137
|
+
context: CallContext & CallContextExt,
|
|
138
|
+
): Promise<DeepPartial<StatusResponse>>;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface PermissionServiceClient<CallOptionsExt = {}> {
|
|
142
|
+
checkPermission(
|
|
143
|
+
request: DeepPartial<CheckPermissionRequest>,
|
|
144
|
+
options?: CallOptions & CallOptionsExt,
|
|
145
|
+
): Promise<StatusResponse>;
|
|
146
|
+
}
|
|
147
|
+
|
|
120
148
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
121
149
|
|
|
122
150
|
type DeepPartial<T> = T extends Builtin ? T
|
|
@@ -1,6 +1,6 @@
|
|
|
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/user_policy.proto
|
|
6
6
|
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
9
|
|
|
10
10
|
export enum AttributeType {
|
|
11
|
+
ATTRIBUTE_TYPE_UNSPECIFIED = "ATTRIBUTE_TYPE_UNSPECIFIED",
|
|
11
12
|
ATTRIBUTE_TYPE_BOOLEAN = "ATTRIBUTE_TYPE_BOOLEAN",
|
|
12
13
|
ATTRIBUTE_TYPE_STRING = "ATTRIBUTE_TYPE_STRING",
|
|
13
14
|
ATTRIBUTE_TYPE_NUMBER = "ATTRIBUTE_TYPE_NUMBER",
|
|
@@ -17,12 +18,15 @@ export enum AttributeType {
|
|
|
17
18
|
export function attributeTypeFromJSON(object: any): AttributeType {
|
|
18
19
|
switch (object) {
|
|
19
20
|
case 0:
|
|
21
|
+
case "ATTRIBUTE_TYPE_UNSPECIFIED":
|
|
22
|
+
return AttributeType.ATTRIBUTE_TYPE_UNSPECIFIED;
|
|
23
|
+
case 1:
|
|
20
24
|
case "ATTRIBUTE_TYPE_BOOLEAN":
|
|
21
25
|
return AttributeType.ATTRIBUTE_TYPE_BOOLEAN;
|
|
22
|
-
case
|
|
26
|
+
case 2:
|
|
23
27
|
case "ATTRIBUTE_TYPE_STRING":
|
|
24
28
|
return AttributeType.ATTRIBUTE_TYPE_STRING;
|
|
25
|
-
case
|
|
29
|
+
case 3:
|
|
26
30
|
case "ATTRIBUTE_TYPE_NUMBER":
|
|
27
31
|
return AttributeType.ATTRIBUTE_TYPE_NUMBER;
|
|
28
32
|
case -1:
|
|
@@ -34,6 +38,8 @@ export function attributeTypeFromJSON(object: any): AttributeType {
|
|
|
34
38
|
|
|
35
39
|
export function attributeTypeToJSON(object: AttributeType): string {
|
|
36
40
|
switch (object) {
|
|
41
|
+
case AttributeType.ATTRIBUTE_TYPE_UNSPECIFIED:
|
|
42
|
+
return "ATTRIBUTE_TYPE_UNSPECIFIED";
|
|
37
43
|
case AttributeType.ATTRIBUTE_TYPE_BOOLEAN:
|
|
38
44
|
return "ATTRIBUTE_TYPE_BOOLEAN";
|
|
39
45
|
case AttributeType.ATTRIBUTE_TYPE_STRING:
|
|
@@ -48,12 +54,14 @@ export function attributeTypeToJSON(object: AttributeType): string {
|
|
|
48
54
|
|
|
49
55
|
export function attributeTypeToNumber(object: AttributeType): number {
|
|
50
56
|
switch (object) {
|
|
51
|
-
case AttributeType.
|
|
57
|
+
case AttributeType.ATTRIBUTE_TYPE_UNSPECIFIED:
|
|
52
58
|
return 0;
|
|
53
|
-
case AttributeType.
|
|
59
|
+
case AttributeType.ATTRIBUTE_TYPE_BOOLEAN:
|
|
54
60
|
return 1;
|
|
55
|
-
case AttributeType.
|
|
61
|
+
case AttributeType.ATTRIBUTE_TYPE_STRING:
|
|
56
62
|
return 2;
|
|
63
|
+
case AttributeType.ATTRIBUTE_TYPE_NUMBER:
|
|
64
|
+
return 3;
|
|
57
65
|
case AttributeType.UNRECOGNIZED:
|
|
58
66
|
default:
|
|
59
67
|
return -1;
|
|
@@ -1,16 +1,17 @@
|
|
|
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 "
|
|
10
|
+
import { StatusResponse } from "../../common/v1/types";
|
|
11
11
|
|
|
12
12
|
export enum VerificationType {
|
|
13
|
-
|
|
13
|
+
VERIFICATION_TYPE_UNSPECIFIED = "VERIFICATION_TYPE_UNSPECIFIED",
|
|
14
|
+
VERIFICATION_TYPE_EMAIL_CODE = "VERIFICATION_TYPE_EMAIL_CODE",
|
|
14
15
|
VERIFICATION_TYPE_EMAIL_LINK = "VERIFICATION_TYPE_EMAIL_LINK",
|
|
15
16
|
UNRECOGNIZED = "UNRECOGNIZED",
|
|
16
17
|
}
|
|
@@ -18,9 +19,12 @@ export enum VerificationType {
|
|
|
18
19
|
export function verificationTypeFromJSON(object: any): VerificationType {
|
|
19
20
|
switch (object) {
|
|
20
21
|
case 0:
|
|
21
|
-
case "
|
|
22
|
-
return VerificationType.
|
|
22
|
+
case "VERIFICATION_TYPE_UNSPECIFIED":
|
|
23
|
+
return VerificationType.VERIFICATION_TYPE_UNSPECIFIED;
|
|
23
24
|
case 1:
|
|
25
|
+
case "VERIFICATION_TYPE_EMAIL_CODE":
|
|
26
|
+
return VerificationType.VERIFICATION_TYPE_EMAIL_CODE;
|
|
27
|
+
case 2:
|
|
24
28
|
case "VERIFICATION_TYPE_EMAIL_LINK":
|
|
25
29
|
return VerificationType.VERIFICATION_TYPE_EMAIL_LINK;
|
|
26
30
|
case -1:
|
|
@@ -32,8 +36,10 @@ export function verificationTypeFromJSON(object: any): VerificationType {
|
|
|
32
36
|
|
|
33
37
|
export function verificationTypeToJSON(object: VerificationType): string {
|
|
34
38
|
switch (object) {
|
|
35
|
-
case VerificationType.
|
|
36
|
-
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";
|
|
37
43
|
case VerificationType.VERIFICATION_TYPE_EMAIL_LINK:
|
|
38
44
|
return "VERIFICATION_TYPE_EMAIL_LINK";
|
|
39
45
|
case VerificationType.UNRECOGNIZED:
|
|
@@ -44,10 +50,12 @@ export function verificationTypeToJSON(object: VerificationType): string {
|
|
|
44
50
|
|
|
45
51
|
export function verificationTypeToNumber(object: VerificationType): number {
|
|
46
52
|
switch (object) {
|
|
47
|
-
case VerificationType.
|
|
53
|
+
case VerificationType.VERIFICATION_TYPE_UNSPECIFIED:
|
|
48
54
|
return 0;
|
|
49
|
-
case VerificationType.
|
|
55
|
+
case VerificationType.VERIFICATION_TYPE_EMAIL_CODE:
|
|
50
56
|
return 1;
|
|
57
|
+
case VerificationType.VERIFICATION_TYPE_EMAIL_LINK:
|
|
58
|
+
return 2;
|
|
51
59
|
case VerificationType.UNRECOGNIZED:
|
|
52
60
|
default:
|
|
53
61
|
return -1;
|
|
@@ -55,6 +63,7 @@ export function verificationTypeToNumber(object: VerificationType): number {
|
|
|
55
63
|
}
|
|
56
64
|
|
|
57
65
|
export enum VerificationStatus {
|
|
66
|
+
VERIFICATION_STATUS_UNSPECIFIED = "VERIFICATION_STATUS_UNSPECIFIED",
|
|
58
67
|
VERIFICATION_STATUS_WAIT = "VERIFICATION_STATUS_WAIT",
|
|
59
68
|
VERIFICATION_STATUS_EXPIRES = "VERIFICATION_STATUS_EXPIRES",
|
|
60
69
|
VERIFICATION_STATUS_VERIFIED = "VERIFICATION_STATUS_VERIFIED",
|
|
@@ -64,12 +73,15 @@ export enum VerificationStatus {
|
|
|
64
73
|
export function verificationStatusFromJSON(object: any): VerificationStatus {
|
|
65
74
|
switch (object) {
|
|
66
75
|
case 0:
|
|
76
|
+
case "VERIFICATION_STATUS_UNSPECIFIED":
|
|
77
|
+
return VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED;
|
|
78
|
+
case 1:
|
|
67
79
|
case "VERIFICATION_STATUS_WAIT":
|
|
68
80
|
return VerificationStatus.VERIFICATION_STATUS_WAIT;
|
|
69
|
-
case
|
|
81
|
+
case 2:
|
|
70
82
|
case "VERIFICATION_STATUS_EXPIRES":
|
|
71
83
|
return VerificationStatus.VERIFICATION_STATUS_EXPIRES;
|
|
72
|
-
case
|
|
84
|
+
case 3:
|
|
73
85
|
case "VERIFICATION_STATUS_VERIFIED":
|
|
74
86
|
return VerificationStatus.VERIFICATION_STATUS_VERIFIED;
|
|
75
87
|
case -1:
|
|
@@ -81,6 +93,8 @@ export function verificationStatusFromJSON(object: any): VerificationStatus {
|
|
|
81
93
|
|
|
82
94
|
export function verificationStatusToJSON(object: VerificationStatus): string {
|
|
83
95
|
switch (object) {
|
|
96
|
+
case VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED:
|
|
97
|
+
return "VERIFICATION_STATUS_UNSPECIFIED";
|
|
84
98
|
case VerificationStatus.VERIFICATION_STATUS_WAIT:
|
|
85
99
|
return "VERIFICATION_STATUS_WAIT";
|
|
86
100
|
case VerificationStatus.VERIFICATION_STATUS_EXPIRES:
|
|
@@ -95,12 +109,14 @@ export function verificationStatusToJSON(object: VerificationStatus): string {
|
|
|
95
109
|
|
|
96
110
|
export function verificationStatusToNumber(object: VerificationStatus): number {
|
|
97
111
|
switch (object) {
|
|
98
|
-
case VerificationStatus.
|
|
112
|
+
case VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED:
|
|
99
113
|
return 0;
|
|
100
|
-
case VerificationStatus.
|
|
114
|
+
case VerificationStatus.VERIFICATION_STATUS_WAIT:
|
|
101
115
|
return 1;
|
|
102
|
-
case VerificationStatus.
|
|
116
|
+
case VerificationStatus.VERIFICATION_STATUS_EXPIRES:
|
|
103
117
|
return 2;
|
|
118
|
+
case VerificationStatus.VERIFICATION_STATUS_VERIFIED:
|
|
119
|
+
return 3;
|
|
104
120
|
case VerificationStatus.UNRECOGNIZED:
|
|
105
121
|
default:
|
|
106
122
|
return -1;
|
|
@@ -315,7 +331,7 @@ export const VerificateRequest: MessageFns<VerificateRequest, "auth.v1.Verificat
|
|
|
315
331
|
};
|
|
316
332
|
|
|
317
333
|
function createBaseRefreshRequest(): RefreshRequest {
|
|
318
|
-
return { $type: "auth.v1.RefreshRequest", userId: "", type: VerificationType.
|
|
334
|
+
return { $type: "auth.v1.RefreshRequest", userId: "", type: VerificationType.VERIFICATION_TYPE_UNSPECIFIED };
|
|
319
335
|
}
|
|
320
336
|
|
|
321
337
|
export const RefreshRequest: MessageFns<RefreshRequest, "auth.v1.RefreshRequest"> = {
|
|
@@ -325,7 +341,7 @@ export const RefreshRequest: MessageFns<RefreshRequest, "auth.v1.RefreshRequest"
|
|
|
325
341
|
if (message.userId !== "") {
|
|
326
342
|
writer.uint32(10).string(message.userId);
|
|
327
343
|
}
|
|
328
|
-
if (message.type !== VerificationType.
|
|
344
|
+
if (message.type !== VerificationType.VERIFICATION_TYPE_UNSPECIFIED) {
|
|
329
345
|
writer.uint32(16).int32(verificationTypeToNumber(message.type));
|
|
330
346
|
}
|
|
331
347
|
return writer;
|
|
@@ -371,7 +387,7 @@ export const RefreshRequest: MessageFns<RefreshRequest, "auth.v1.RefreshRequest"
|
|
|
371
387
|
: isSet(object.user_id)
|
|
372
388
|
? globalThis.String(object.user_id)
|
|
373
389
|
: "",
|
|
374
|
-
type: isSet(object.type) ? verificationTypeFromJSON(object.type) : VerificationType.
|
|
390
|
+
type: isSet(object.type) ? verificationTypeFromJSON(object.type) : VerificationType.VERIFICATION_TYPE_UNSPECIFIED,
|
|
375
391
|
};
|
|
376
392
|
},
|
|
377
393
|
|
|
@@ -380,7 +396,7 @@ export const RefreshRequest: MessageFns<RefreshRequest, "auth.v1.RefreshRequest"
|
|
|
380
396
|
if (message.userId !== "") {
|
|
381
397
|
obj.userId = message.userId;
|
|
382
398
|
}
|
|
383
|
-
if (message.type !== VerificationType.
|
|
399
|
+
if (message.type !== VerificationType.VERIFICATION_TYPE_UNSPECIFIED) {
|
|
384
400
|
obj.type = verificationTypeToJSON(message.type);
|
|
385
401
|
}
|
|
386
402
|
return obj;
|
|
@@ -392,7 +408,7 @@ export const RefreshRequest: MessageFns<RefreshRequest, "auth.v1.RefreshRequest"
|
|
|
392
408
|
fromPartial<I extends Exact<DeepPartial<RefreshRequest>, I>>(object: I): RefreshRequest {
|
|
393
409
|
const message = createBaseRefreshRequest();
|
|
394
410
|
message.userId = object.userId ?? "";
|
|
395
|
-
message.type = object.type ?? VerificationType.
|
|
411
|
+
message.type = object.type ?? VerificationType.VERIFICATION_TYPE_UNSPECIFIED;
|
|
396
412
|
return message;
|
|
397
413
|
},
|
|
398
414
|
};
|
|
@@ -458,14 +474,14 @@ export const CheckStatusRequest: MessageFns<CheckStatusRequest, "auth.v1.CheckSt
|
|
|
458
474
|
};
|
|
459
475
|
|
|
460
476
|
function createBaseCheckStatusResponse(): CheckStatusResponse {
|
|
461
|
-
return { $type: "auth.v1.CheckStatusResponse", status: VerificationStatus.
|
|
477
|
+
return { $type: "auth.v1.CheckStatusResponse", status: VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED };
|
|
462
478
|
}
|
|
463
479
|
|
|
464
480
|
export const CheckStatusResponse: MessageFns<CheckStatusResponse, "auth.v1.CheckStatusResponse"> = {
|
|
465
481
|
$type: "auth.v1.CheckStatusResponse" as const,
|
|
466
482
|
|
|
467
483
|
encode(message: CheckStatusResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
468
|
-
if (message.status !== VerificationStatus.
|
|
484
|
+
if (message.status !== VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED) {
|
|
469
485
|
writer.uint32(8).int32(verificationStatusToNumber(message.status));
|
|
470
486
|
}
|
|
471
487
|
return writer;
|
|
@@ -500,13 +516,13 @@ export const CheckStatusResponse: MessageFns<CheckStatusResponse, "auth.v1.Check
|
|
|
500
516
|
$type: CheckStatusResponse.$type,
|
|
501
517
|
status: isSet(object.status)
|
|
502
518
|
? verificationStatusFromJSON(object.status)
|
|
503
|
-
: VerificationStatus.
|
|
519
|
+
: VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED,
|
|
504
520
|
};
|
|
505
521
|
},
|
|
506
522
|
|
|
507
523
|
toJSON(message: CheckStatusResponse): unknown {
|
|
508
524
|
const obj: any = {};
|
|
509
|
-
if (message.status !== VerificationStatus.
|
|
525
|
+
if (message.status !== VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED) {
|
|
510
526
|
obj.status = verificationStatusToJSON(message.status);
|
|
511
527
|
}
|
|
512
528
|
return obj;
|
|
@@ -517,7 +533,7 @@ export const CheckStatusResponse: MessageFns<CheckStatusResponse, "auth.v1.Check
|
|
|
517
533
|
},
|
|
518
534
|
fromPartial<I extends Exact<DeepPartial<CheckStatusResponse>, I>>(object: I): CheckStatusResponse {
|
|
519
535
|
const message = createBaseCheckStatusResponse();
|
|
520
|
-
message.status = object.status ?? VerificationStatus.
|
|
536
|
+
message.status = object.status ?? VerificationStatus.VERIFICATION_STATUS_UNSPECIFIED;
|
|
521
537
|
return message;
|
|
522
538
|
},
|
|
523
539
|
};
|
|
@@ -1,57 +1,44 @@
|
|
|
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: common/v1/types.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
-
import { Timestamp } from "../../google/protobuf/timestamp";
|
|
10
9
|
|
|
11
|
-
export interface
|
|
12
|
-
$type: "common.v1.
|
|
13
|
-
|
|
14
|
-
updatedAt?: string | undefined;
|
|
10
|
+
export interface StatusResponse {
|
|
11
|
+
$type: "common.v1.StatusResponse";
|
|
12
|
+
success: boolean;
|
|
15
13
|
}
|
|
16
14
|
|
|
17
|
-
function
|
|
18
|
-
return { $type: "common.v1.
|
|
15
|
+
function createBaseStatusResponse(): StatusResponse {
|
|
16
|
+
return { $type: "common.v1.StatusResponse", success: false };
|
|
19
17
|
}
|
|
20
18
|
|
|
21
|
-
export const
|
|
22
|
-
$type: "common.v1.
|
|
19
|
+
export const StatusResponse: MessageFns<StatusResponse, "common.v1.StatusResponse"> = {
|
|
20
|
+
$type: "common.v1.StatusResponse" as const,
|
|
23
21
|
|
|
24
|
-
encode(message:
|
|
25
|
-
if (message.
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
if (message.updatedAt !== undefined) {
|
|
29
|
-
Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(18).fork()).join();
|
|
22
|
+
encode(message: StatusResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
23
|
+
if (message.success !== false) {
|
|
24
|
+
writer.uint32(8).bool(message.success);
|
|
30
25
|
}
|
|
31
26
|
return writer;
|
|
32
27
|
},
|
|
33
28
|
|
|
34
|
-
decode(input: BinaryReader | Uint8Array, length?: number):
|
|
29
|
+
decode(input: BinaryReader | Uint8Array, length?: number): StatusResponse {
|
|
35
30
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
36
31
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
37
|
-
const message =
|
|
32
|
+
const message = createBaseStatusResponse();
|
|
38
33
|
while (reader.pos < end) {
|
|
39
34
|
const tag = reader.uint32();
|
|
40
35
|
switch (tag >>> 3) {
|
|
41
36
|
case 1: {
|
|
42
|
-
if (tag !==
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
case 2: {
|
|
50
|
-
if (tag !== 18) {
|
|
37
|
+
if (tag !== 8) {
|
|
51
38
|
break;
|
|
52
39
|
}
|
|
53
40
|
|
|
54
|
-
message.
|
|
41
|
+
message.success = reader.bool();
|
|
55
42
|
continue;
|
|
56
43
|
}
|
|
57
44
|
}
|
|
@@ -63,40 +50,24 @@ export const AuditMetadata: MessageFns<AuditMetadata, "common.v1.AuditMetadata">
|
|
|
63
50
|
return message;
|
|
64
51
|
},
|
|
65
52
|
|
|
66
|
-
fromJSON(object: any):
|
|
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
|
-
};
|
|
53
|
+
fromJSON(object: any): StatusResponse {
|
|
54
|
+
return { $type: StatusResponse.$type, success: isSet(object.success) ? globalThis.Boolean(object.success) : false };
|
|
80
55
|
},
|
|
81
56
|
|
|
82
|
-
toJSON(message:
|
|
57
|
+
toJSON(message: StatusResponse): unknown {
|
|
83
58
|
const obj: any = {};
|
|
84
|
-
if (message.
|
|
85
|
-
obj.
|
|
86
|
-
}
|
|
87
|
-
if (message.updatedAt !== undefined) {
|
|
88
|
-
obj.updatedAt = message.updatedAt;
|
|
59
|
+
if (message.success !== false) {
|
|
60
|
+
obj.success = message.success;
|
|
89
61
|
}
|
|
90
62
|
return obj;
|
|
91
63
|
},
|
|
92
64
|
|
|
93
|
-
create<I extends Exact<DeepPartial<
|
|
94
|
-
return
|
|
65
|
+
create<I extends Exact<DeepPartial<StatusResponse>, I>>(base?: I): StatusResponse {
|
|
66
|
+
return StatusResponse.fromPartial(base ?? ({} as any));
|
|
95
67
|
},
|
|
96
|
-
fromPartial<I extends Exact<DeepPartial<
|
|
97
|
-
const message =
|
|
98
|
-
message.
|
|
99
|
-
message.updatedAt = object.updatedAt ?? undefined;
|
|
68
|
+
fromPartial<I extends Exact<DeepPartial<StatusResponse>, I>>(object: I): StatusResponse {
|
|
69
|
+
const message = createBaseStatusResponse();
|
|
70
|
+
message.success = object.success ?? false;
|
|
100
71
|
return message;
|
|
101
72
|
},
|
|
102
73
|
};
|
|
@@ -114,19 +85,6 @@ type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
|
114
85
|
type Exact<P, I extends P> = P extends Builtin ? P
|
|
115
86
|
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
|
|
116
87
|
|
|
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
88
|
function isSet(value: any): boolean {
|
|
131
89
|
return value !== null && value !== undefined;
|
|
132
90
|
}
|