@ssoeasy-dev/proto 1.1.0-dev-develop.5304bf2 → 1.1.0-dev-feat-auth.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @ssoeasy-dev/proto might be problematic. Click here for more details.
- package/gen/ts/auth/v1/auth.ts +646 -232
- package/gen/ts/auth/v1/common.ts +185 -0
- package/gen/ts/auth/v1/user_policy.ts +446 -0
- package/gen/ts/auth/v1/verification.ts +174 -90
- package/gen/ts/index.auth.v1.ts +2 -0
- package/package.json +1 -1
- package/proto/auth/v1/auth.proto +46 -19
- package/proto/auth/v1/common.proto +12 -0
- package/proto/auth/v1/user_policy.proto +29 -0
- package/proto/auth/v1/verification.proto +14 -7
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: auth/v1/common.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
|
|
10
|
+
export interface StatusResponse {
|
|
11
|
+
$type: "auth.v1.StatusResponse";
|
|
12
|
+
success: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface Tokens {
|
|
16
|
+
$type: "auth.v1.Tokens";
|
|
17
|
+
access: string;
|
|
18
|
+
refresh: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
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
|
+
function createBaseTokens(): Tokens {
|
|
82
|
+
return { $type: "auth.v1.Tokens", access: "", refresh: "" };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const Tokens: MessageFns<Tokens, "auth.v1.Tokens"> = {
|
|
86
|
+
$type: "auth.v1.Tokens" as const,
|
|
87
|
+
|
|
88
|
+
encode(message: Tokens, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
89
|
+
if (message.access !== "") {
|
|
90
|
+
writer.uint32(10).string(message.access);
|
|
91
|
+
}
|
|
92
|
+
if (message.refresh !== "") {
|
|
93
|
+
writer.uint32(18).string(message.refresh);
|
|
94
|
+
}
|
|
95
|
+
return writer;
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Tokens {
|
|
99
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
100
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
101
|
+
const message = createBaseTokens();
|
|
102
|
+
while (reader.pos < end) {
|
|
103
|
+
const tag = reader.uint32();
|
|
104
|
+
switch (tag >>> 3) {
|
|
105
|
+
case 1: {
|
|
106
|
+
if (tag !== 10) {
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
message.access = reader.string();
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
case 2: {
|
|
114
|
+
if (tag !== 18) {
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
message.refresh = reader.string();
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
reader.skip(tag & 7);
|
|
126
|
+
}
|
|
127
|
+
return message;
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
fromJSON(object: any): Tokens {
|
|
131
|
+
return {
|
|
132
|
+
$type: Tokens.$type,
|
|
133
|
+
access: isSet(object.access) ? globalThis.String(object.access) : "",
|
|
134
|
+
refresh: isSet(object.refresh) ? globalThis.String(object.refresh) : "",
|
|
135
|
+
};
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
toJSON(message: Tokens): unknown {
|
|
139
|
+
const obj: any = {};
|
|
140
|
+
if (message.access !== "") {
|
|
141
|
+
obj.access = message.access;
|
|
142
|
+
}
|
|
143
|
+
if (message.refresh !== "") {
|
|
144
|
+
obj.refresh = message.refresh;
|
|
145
|
+
}
|
|
146
|
+
return obj;
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
create<I extends Exact<DeepPartial<Tokens>, I>>(base?: I): Tokens {
|
|
150
|
+
return Tokens.fromPartial(base ?? ({} as any));
|
|
151
|
+
},
|
|
152
|
+
fromPartial<I extends Exact<DeepPartial<Tokens>, I>>(object: I): Tokens {
|
|
153
|
+
const message = createBaseTokens();
|
|
154
|
+
message.access = object.access ?? "";
|
|
155
|
+
message.refresh = object.refresh ?? "";
|
|
156
|
+
return message;
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
161
|
+
|
|
162
|
+
type DeepPartial<T> = T extends Builtin ? T
|
|
163
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
164
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
165
|
+
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
|
|
166
|
+
: T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
|
|
167
|
+
: Partial<T>;
|
|
168
|
+
|
|
169
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
170
|
+
type Exact<P, I extends P> = P extends Builtin ? P
|
|
171
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
|
|
172
|
+
|
|
173
|
+
function isSet(value: any): boolean {
|
|
174
|
+
return value !== null && value !== undefined;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
interface MessageFns<T, V extends string> {
|
|
178
|
+
readonly $type: V;
|
|
179
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
180
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
181
|
+
fromJSON(object: any): T;
|
|
182
|
+
toJSON(message: T): unknown;
|
|
183
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
184
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
185
|
+
}
|
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: auth/v1/user_policy.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
|
|
10
|
+
export enum AttributeType {
|
|
11
|
+
boolean = "boolean",
|
|
12
|
+
string = "string",
|
|
13
|
+
number = "number",
|
|
14
|
+
UNRECOGNIZED = "UNRECOGNIZED",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function attributeTypeFromJSON(object: any): AttributeType {
|
|
18
|
+
switch (object) {
|
|
19
|
+
case 0:
|
|
20
|
+
case "boolean":
|
|
21
|
+
return AttributeType.boolean;
|
|
22
|
+
case 1:
|
|
23
|
+
case "string":
|
|
24
|
+
return AttributeType.string;
|
|
25
|
+
case 2:
|
|
26
|
+
case "number":
|
|
27
|
+
return AttributeType.number;
|
|
28
|
+
case -1:
|
|
29
|
+
case "UNRECOGNIZED":
|
|
30
|
+
default:
|
|
31
|
+
return AttributeType.UNRECOGNIZED;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function attributeTypeToJSON(object: AttributeType): string {
|
|
36
|
+
switch (object) {
|
|
37
|
+
case AttributeType.boolean:
|
|
38
|
+
return "boolean";
|
|
39
|
+
case AttributeType.string:
|
|
40
|
+
return "string";
|
|
41
|
+
case AttributeType.number:
|
|
42
|
+
return "number";
|
|
43
|
+
case AttributeType.UNRECOGNIZED:
|
|
44
|
+
default:
|
|
45
|
+
return "UNRECOGNIZED";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function attributeTypeToNumber(object: AttributeType): number {
|
|
50
|
+
switch (object) {
|
|
51
|
+
case AttributeType.boolean:
|
|
52
|
+
return 0;
|
|
53
|
+
case AttributeType.string:
|
|
54
|
+
return 1;
|
|
55
|
+
case AttributeType.number:
|
|
56
|
+
return 2;
|
|
57
|
+
case AttributeType.UNRECOGNIZED:
|
|
58
|
+
default:
|
|
59
|
+
return -1;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface Attribute {
|
|
64
|
+
$type: "auth.v1.Attribute";
|
|
65
|
+
name: string;
|
|
66
|
+
operator: string;
|
|
67
|
+
value: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface UserPolicyRequest {
|
|
71
|
+
$type: "auth.v1.UserPolicyRequest";
|
|
72
|
+
name: string;
|
|
73
|
+
serviceId: string;
|
|
74
|
+
companyId?: string | undefined;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface UserPolicyResponse {
|
|
78
|
+
$type: "auth.v1.UserPolicyResponse";
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
serviceId: string;
|
|
82
|
+
companyId?: string | undefined;
|
|
83
|
+
attributes: Attribute[];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function createBaseAttribute(): Attribute {
|
|
87
|
+
return { $type: "auth.v1.Attribute", name: "", operator: "", value: "" };
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const Attribute: MessageFns<Attribute, "auth.v1.Attribute"> = {
|
|
91
|
+
$type: "auth.v1.Attribute" as const,
|
|
92
|
+
|
|
93
|
+
encode(message: Attribute, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
94
|
+
if (message.name !== "") {
|
|
95
|
+
writer.uint32(10).string(message.name);
|
|
96
|
+
}
|
|
97
|
+
if (message.operator !== "") {
|
|
98
|
+
writer.uint32(18).string(message.operator);
|
|
99
|
+
}
|
|
100
|
+
if (message.value !== "") {
|
|
101
|
+
writer.uint32(26).string(message.value);
|
|
102
|
+
}
|
|
103
|
+
return writer;
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Attribute {
|
|
107
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
108
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
109
|
+
const message = createBaseAttribute();
|
|
110
|
+
while (reader.pos < end) {
|
|
111
|
+
const tag = reader.uint32();
|
|
112
|
+
switch (tag >>> 3) {
|
|
113
|
+
case 1: {
|
|
114
|
+
if (tag !== 10) {
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
message.name = reader.string();
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
case 2: {
|
|
122
|
+
if (tag !== 18) {
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
message.operator = reader.string();
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
case 3: {
|
|
130
|
+
if (tag !== 26) {
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
message.value = reader.string();
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
reader.skip(tag & 7);
|
|
142
|
+
}
|
|
143
|
+
return message;
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
fromJSON(object: any): Attribute {
|
|
147
|
+
return {
|
|
148
|
+
$type: Attribute.$type,
|
|
149
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
150
|
+
operator: isSet(object.operator) ? globalThis.String(object.operator) : "",
|
|
151
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
toJSON(message: Attribute): unknown {
|
|
156
|
+
const obj: any = {};
|
|
157
|
+
if (message.name !== "") {
|
|
158
|
+
obj.name = message.name;
|
|
159
|
+
}
|
|
160
|
+
if (message.operator !== "") {
|
|
161
|
+
obj.operator = message.operator;
|
|
162
|
+
}
|
|
163
|
+
if (message.value !== "") {
|
|
164
|
+
obj.value = message.value;
|
|
165
|
+
}
|
|
166
|
+
return obj;
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
create<I extends Exact<DeepPartial<Attribute>, I>>(base?: I): Attribute {
|
|
170
|
+
return Attribute.fromPartial(base ?? ({} as any));
|
|
171
|
+
},
|
|
172
|
+
fromPartial<I extends Exact<DeepPartial<Attribute>, I>>(object: I): Attribute {
|
|
173
|
+
const message = createBaseAttribute();
|
|
174
|
+
message.name = object.name ?? "";
|
|
175
|
+
message.operator = object.operator ?? "";
|
|
176
|
+
message.value = object.value ?? "";
|
|
177
|
+
return message;
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
function createBaseUserPolicyRequest(): UserPolicyRequest {
|
|
182
|
+
return { $type: "auth.v1.UserPolicyRequest", name: "", serviceId: "", companyId: undefined };
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export const UserPolicyRequest: MessageFns<UserPolicyRequest, "auth.v1.UserPolicyRequest"> = {
|
|
186
|
+
$type: "auth.v1.UserPolicyRequest" as const,
|
|
187
|
+
|
|
188
|
+
encode(message: UserPolicyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
189
|
+
if (message.name !== "") {
|
|
190
|
+
writer.uint32(10).string(message.name);
|
|
191
|
+
}
|
|
192
|
+
if (message.serviceId !== "") {
|
|
193
|
+
writer.uint32(18).string(message.serviceId);
|
|
194
|
+
}
|
|
195
|
+
if (message.companyId !== undefined) {
|
|
196
|
+
writer.uint32(26).string(message.companyId);
|
|
197
|
+
}
|
|
198
|
+
return writer;
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
decode(input: BinaryReader | Uint8Array, length?: number): UserPolicyRequest {
|
|
202
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
203
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
204
|
+
const message = createBaseUserPolicyRequest();
|
|
205
|
+
while (reader.pos < end) {
|
|
206
|
+
const tag = reader.uint32();
|
|
207
|
+
switch (tag >>> 3) {
|
|
208
|
+
case 1: {
|
|
209
|
+
if (tag !== 10) {
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
message.name = reader.string();
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
case 2: {
|
|
217
|
+
if (tag !== 18) {
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
message.serviceId = reader.string();
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
case 3: {
|
|
225
|
+
if (tag !== 26) {
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
message.companyId = reader.string();
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
reader.skip(tag & 7);
|
|
237
|
+
}
|
|
238
|
+
return message;
|
|
239
|
+
},
|
|
240
|
+
|
|
241
|
+
fromJSON(object: any): UserPolicyRequest {
|
|
242
|
+
return {
|
|
243
|
+
$type: UserPolicyRequest.$type,
|
|
244
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
245
|
+
serviceId: isSet(object.serviceId)
|
|
246
|
+
? globalThis.String(object.serviceId)
|
|
247
|
+
: isSet(object.service_id)
|
|
248
|
+
? globalThis.String(object.service_id)
|
|
249
|
+
: "",
|
|
250
|
+
companyId: isSet(object.companyId)
|
|
251
|
+
? globalThis.String(object.companyId)
|
|
252
|
+
: isSet(object.company_id)
|
|
253
|
+
? globalThis.String(object.company_id)
|
|
254
|
+
: undefined,
|
|
255
|
+
};
|
|
256
|
+
},
|
|
257
|
+
|
|
258
|
+
toJSON(message: UserPolicyRequest): unknown {
|
|
259
|
+
const obj: any = {};
|
|
260
|
+
if (message.name !== "") {
|
|
261
|
+
obj.name = message.name;
|
|
262
|
+
}
|
|
263
|
+
if (message.serviceId !== "") {
|
|
264
|
+
obj.serviceId = message.serviceId;
|
|
265
|
+
}
|
|
266
|
+
if (message.companyId !== undefined) {
|
|
267
|
+
obj.companyId = message.companyId;
|
|
268
|
+
}
|
|
269
|
+
return obj;
|
|
270
|
+
},
|
|
271
|
+
|
|
272
|
+
create<I extends Exact<DeepPartial<UserPolicyRequest>, I>>(base?: I): UserPolicyRequest {
|
|
273
|
+
return UserPolicyRequest.fromPartial(base ?? ({} as any));
|
|
274
|
+
},
|
|
275
|
+
fromPartial<I extends Exact<DeepPartial<UserPolicyRequest>, I>>(object: I): UserPolicyRequest {
|
|
276
|
+
const message = createBaseUserPolicyRequest();
|
|
277
|
+
message.name = object.name ?? "";
|
|
278
|
+
message.serviceId = object.serviceId ?? "";
|
|
279
|
+
message.companyId = object.companyId ?? undefined;
|
|
280
|
+
return message;
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
function createBaseUserPolicyResponse(): UserPolicyResponse {
|
|
285
|
+
return { $type: "auth.v1.UserPolicyResponse", id: "", name: "", serviceId: "", companyId: undefined, attributes: [] };
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export const UserPolicyResponse: MessageFns<UserPolicyResponse, "auth.v1.UserPolicyResponse"> = {
|
|
289
|
+
$type: "auth.v1.UserPolicyResponse" as const,
|
|
290
|
+
|
|
291
|
+
encode(message: UserPolicyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
292
|
+
if (message.id !== "") {
|
|
293
|
+
writer.uint32(10).string(message.id);
|
|
294
|
+
}
|
|
295
|
+
if (message.name !== "") {
|
|
296
|
+
writer.uint32(18).string(message.name);
|
|
297
|
+
}
|
|
298
|
+
if (message.serviceId !== "") {
|
|
299
|
+
writer.uint32(26).string(message.serviceId);
|
|
300
|
+
}
|
|
301
|
+
if (message.companyId !== undefined) {
|
|
302
|
+
writer.uint32(34).string(message.companyId);
|
|
303
|
+
}
|
|
304
|
+
for (const v of message.attributes) {
|
|
305
|
+
Attribute.encode(v!, writer.uint32(42).fork()).join();
|
|
306
|
+
}
|
|
307
|
+
return writer;
|
|
308
|
+
},
|
|
309
|
+
|
|
310
|
+
decode(input: BinaryReader | Uint8Array, length?: number): UserPolicyResponse {
|
|
311
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
312
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
313
|
+
const message = createBaseUserPolicyResponse();
|
|
314
|
+
while (reader.pos < end) {
|
|
315
|
+
const tag = reader.uint32();
|
|
316
|
+
switch (tag >>> 3) {
|
|
317
|
+
case 1: {
|
|
318
|
+
if (tag !== 10) {
|
|
319
|
+
break;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
message.id = reader.string();
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
case 2: {
|
|
326
|
+
if (tag !== 18) {
|
|
327
|
+
break;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
message.name = reader.string();
|
|
331
|
+
continue;
|
|
332
|
+
}
|
|
333
|
+
case 3: {
|
|
334
|
+
if (tag !== 26) {
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
message.serviceId = reader.string();
|
|
339
|
+
continue;
|
|
340
|
+
}
|
|
341
|
+
case 4: {
|
|
342
|
+
if (tag !== 34) {
|
|
343
|
+
break;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
message.companyId = reader.string();
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
case 5: {
|
|
350
|
+
if (tag !== 42) {
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
message.attributes.push(Attribute.decode(reader, reader.uint32()));
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
359
|
+
break;
|
|
360
|
+
}
|
|
361
|
+
reader.skip(tag & 7);
|
|
362
|
+
}
|
|
363
|
+
return message;
|
|
364
|
+
},
|
|
365
|
+
|
|
366
|
+
fromJSON(object: any): UserPolicyResponse {
|
|
367
|
+
return {
|
|
368
|
+
$type: UserPolicyResponse.$type,
|
|
369
|
+
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
370
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
371
|
+
serviceId: isSet(object.serviceId)
|
|
372
|
+
? globalThis.String(object.serviceId)
|
|
373
|
+
: isSet(object.service_id)
|
|
374
|
+
? globalThis.String(object.service_id)
|
|
375
|
+
: "",
|
|
376
|
+
companyId: isSet(object.companyId)
|
|
377
|
+
? globalThis.String(object.companyId)
|
|
378
|
+
: isSet(object.company_id)
|
|
379
|
+
? globalThis.String(object.company_id)
|
|
380
|
+
: undefined,
|
|
381
|
+
attributes: globalThis.Array.isArray(object?.attributes)
|
|
382
|
+
? object.attributes.map((e: any) => Attribute.fromJSON(e))
|
|
383
|
+
: [],
|
|
384
|
+
};
|
|
385
|
+
},
|
|
386
|
+
|
|
387
|
+
toJSON(message: UserPolicyResponse): unknown {
|
|
388
|
+
const obj: any = {};
|
|
389
|
+
if (message.id !== "") {
|
|
390
|
+
obj.id = message.id;
|
|
391
|
+
}
|
|
392
|
+
if (message.name !== "") {
|
|
393
|
+
obj.name = message.name;
|
|
394
|
+
}
|
|
395
|
+
if (message.serviceId !== "") {
|
|
396
|
+
obj.serviceId = message.serviceId;
|
|
397
|
+
}
|
|
398
|
+
if (message.companyId !== undefined) {
|
|
399
|
+
obj.companyId = message.companyId;
|
|
400
|
+
}
|
|
401
|
+
if (message.attributes?.length) {
|
|
402
|
+
obj.attributes = message.attributes.map((e) => Attribute.toJSON(e));
|
|
403
|
+
}
|
|
404
|
+
return obj;
|
|
405
|
+
},
|
|
406
|
+
|
|
407
|
+
create<I extends Exact<DeepPartial<UserPolicyResponse>, I>>(base?: I): UserPolicyResponse {
|
|
408
|
+
return UserPolicyResponse.fromPartial(base ?? ({} as any));
|
|
409
|
+
},
|
|
410
|
+
fromPartial<I extends Exact<DeepPartial<UserPolicyResponse>, I>>(object: I): UserPolicyResponse {
|
|
411
|
+
const message = createBaseUserPolicyResponse();
|
|
412
|
+
message.id = object.id ?? "";
|
|
413
|
+
message.name = object.name ?? "";
|
|
414
|
+
message.serviceId = object.serviceId ?? "";
|
|
415
|
+
message.companyId = object.companyId ?? undefined;
|
|
416
|
+
message.attributes = object.attributes?.map((e) => Attribute.fromPartial(e)) || [];
|
|
417
|
+
return message;
|
|
418
|
+
},
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
422
|
+
|
|
423
|
+
type DeepPartial<T> = T extends Builtin ? T
|
|
424
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
425
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
426
|
+
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
|
|
427
|
+
: T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
|
|
428
|
+
: Partial<T>;
|
|
429
|
+
|
|
430
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
431
|
+
type Exact<P, I extends P> = P extends Builtin ? P
|
|
432
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
|
|
433
|
+
|
|
434
|
+
function isSet(value: any): boolean {
|
|
435
|
+
return value !== null && value !== undefined;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
interface MessageFns<T, V extends string> {
|
|
439
|
+
readonly $type: V;
|
|
440
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
441
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
442
|
+
fromJSON(object: any): T;
|
|
443
|
+
toJSON(message: T): unknown;
|
|
444
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
445
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
446
|
+
}
|