@ssoeasy-dev/proto 1.1.0-dev-feat-auth.5 → 1.1.0-dev-feat-auth.7
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 +1 -1
- package/gen/ts/auth/v1/verification.ts +8 -8
- 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 +3 -2
- 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 -1
- package/proto/auth/v1/auth.proto +3 -2
- package/proto/auth/v1/common.proto +0 -4
- package/proto/auth/v1/permission.proto +15 -0
- package/proto/auth/v1/verification.proto +3 -3
- 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,17 +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
|
-
|
|
14
|
+
VERIFICATION_TYPE_EMAIL_CODE = "VERIFICATION_TYPE_EMAIL_CODE",
|
|
15
15
|
VERIFICATION_TYPE_EMAIL_LINK = "VERIFICATION_TYPE_EMAIL_LINK",
|
|
16
16
|
UNRECOGNIZED = "UNRECOGNIZED",
|
|
17
17
|
}
|
|
@@ -22,8 +22,8 @@ export function verificationTypeFromJSON(object: any): VerificationType {
|
|
|
22
22
|
case "VERIFICATION_TYPE_UNSPECIFIED":
|
|
23
23
|
return VerificationType.VERIFICATION_TYPE_UNSPECIFIED;
|
|
24
24
|
case 1:
|
|
25
|
-
case "
|
|
26
|
-
return VerificationType.
|
|
25
|
+
case "VERIFICATION_TYPE_EMAIL_CODE":
|
|
26
|
+
return VerificationType.VERIFICATION_TYPE_EMAIL_CODE;
|
|
27
27
|
case 2:
|
|
28
28
|
case "VERIFICATION_TYPE_EMAIL_LINK":
|
|
29
29
|
return VerificationType.VERIFICATION_TYPE_EMAIL_LINK;
|
|
@@ -38,8 +38,8 @@ export function verificationTypeToJSON(object: VerificationType): string {
|
|
|
38
38
|
switch (object) {
|
|
39
39
|
case VerificationType.VERIFICATION_TYPE_UNSPECIFIED:
|
|
40
40
|
return "VERIFICATION_TYPE_UNSPECIFIED";
|
|
41
|
-
case VerificationType.
|
|
42
|
-
return "
|
|
41
|
+
case VerificationType.VERIFICATION_TYPE_EMAIL_CODE:
|
|
42
|
+
return "VERIFICATION_TYPE_EMAIL_CODE";
|
|
43
43
|
case VerificationType.VERIFICATION_TYPE_EMAIL_LINK:
|
|
44
44
|
return "VERIFICATION_TYPE_EMAIL_LINK";
|
|
45
45
|
case VerificationType.UNRECOGNIZED:
|
|
@@ -52,7 +52,7 @@ export function verificationTypeToNumber(object: VerificationType): number {
|
|
|
52
52
|
switch (object) {
|
|
53
53
|
case VerificationType.VERIFICATION_TYPE_UNSPECIFIED:
|
|
54
54
|
return 0;
|
|
55
|
-
case VerificationType.
|
|
55
|
+
case VerificationType.VERIFICATION_TYPE_EMAIL_CODE:
|
|
56
56
|
return 1;
|
|
57
57
|
case VerificationType.VERIFICATION_TYPE_EMAIL_LINK:
|
|
58
58
|
return 2;
|
|
@@ -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
|
}
|