@ssoeasy-dev/proto 1.1.1-beta.7 → 1.1.1-beta.8
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
CHANGED
|
@@ -86,6 +86,18 @@ export interface AuthorizeRequest {
|
|
|
86
86
|
serviceId: string;
|
|
87
87
|
tokens?: Tokens | undefined;
|
|
88
88
|
code?: CodeVerifier | undefined;
|
|
89
|
+
companyId: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface GetCompanyIdByCodeRequest {
|
|
93
|
+
$type: "auth.v1.GetCompanyIdByCodeRequest";
|
|
94
|
+
code: string;
|
|
95
|
+
serviceId: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface GetCompanyIdByCodeResponse {
|
|
99
|
+
$type: "auth.v1.GetCompanyIdByCodeResponse";
|
|
100
|
+
companyId: string;
|
|
89
101
|
}
|
|
90
102
|
|
|
91
103
|
function createBaseGetMeRequest(): GetMeRequest {
|
|
@@ -1015,7 +1027,7 @@ export const CodeVerifier: MessageFns<CodeVerifier, "auth.v1.CodeVerifier"> = {
|
|
|
1015
1027
|
};
|
|
1016
1028
|
|
|
1017
1029
|
function createBaseAuthorizeRequest(): AuthorizeRequest {
|
|
1018
|
-
return { $type: "auth.v1.AuthorizeRequest", serviceId: "", tokens: undefined, code: undefined };
|
|
1030
|
+
return { $type: "auth.v1.AuthorizeRequest", serviceId: "", tokens: undefined, code: undefined, companyId: "" };
|
|
1019
1031
|
}
|
|
1020
1032
|
|
|
1021
1033
|
export const AuthorizeRequest: MessageFns<AuthorizeRequest, "auth.v1.AuthorizeRequest"> = {
|
|
@@ -1031,6 +1043,9 @@ export const AuthorizeRequest: MessageFns<AuthorizeRequest, "auth.v1.AuthorizeRe
|
|
|
1031
1043
|
if (message.code !== undefined) {
|
|
1032
1044
|
CodeVerifier.encode(message.code, writer.uint32(26).fork()).join();
|
|
1033
1045
|
}
|
|
1046
|
+
if (message.companyId !== "") {
|
|
1047
|
+
writer.uint32(34).string(message.companyId);
|
|
1048
|
+
}
|
|
1034
1049
|
return writer;
|
|
1035
1050
|
},
|
|
1036
1051
|
|
|
@@ -1065,6 +1080,14 @@ export const AuthorizeRequest: MessageFns<AuthorizeRequest, "auth.v1.AuthorizeRe
|
|
|
1065
1080
|
message.code = CodeVerifier.decode(reader, reader.uint32());
|
|
1066
1081
|
continue;
|
|
1067
1082
|
}
|
|
1083
|
+
case 4: {
|
|
1084
|
+
if (tag !== 34) {
|
|
1085
|
+
break;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
message.companyId = reader.string();
|
|
1089
|
+
continue;
|
|
1090
|
+
}
|
|
1068
1091
|
}
|
|
1069
1092
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1070
1093
|
break;
|
|
@@ -1084,6 +1107,11 @@ export const AuthorizeRequest: MessageFns<AuthorizeRequest, "auth.v1.AuthorizeRe
|
|
|
1084
1107
|
: "",
|
|
1085
1108
|
tokens: isSet(object.tokens) ? Tokens.fromJSON(object.tokens) : undefined,
|
|
1086
1109
|
code: isSet(object.code) ? CodeVerifier.fromJSON(object.code) : undefined,
|
|
1110
|
+
companyId: isSet(object.companyId)
|
|
1111
|
+
? globalThis.String(object.companyId)
|
|
1112
|
+
: isSet(object.company_id)
|
|
1113
|
+
? globalThis.String(object.company_id)
|
|
1114
|
+
: "",
|
|
1087
1115
|
};
|
|
1088
1116
|
},
|
|
1089
1117
|
|
|
@@ -1098,6 +1126,9 @@ export const AuthorizeRequest: MessageFns<AuthorizeRequest, "auth.v1.AuthorizeRe
|
|
|
1098
1126
|
if (message.code !== undefined) {
|
|
1099
1127
|
obj.code = CodeVerifier.toJSON(message.code);
|
|
1100
1128
|
}
|
|
1129
|
+
if (message.companyId !== "") {
|
|
1130
|
+
obj.companyId = message.companyId;
|
|
1131
|
+
}
|
|
1101
1132
|
return obj;
|
|
1102
1133
|
},
|
|
1103
1134
|
|
|
@@ -1113,10 +1144,162 @@ export const AuthorizeRequest: MessageFns<AuthorizeRequest, "auth.v1.AuthorizeRe
|
|
|
1113
1144
|
message.code = (object.code !== undefined && object.code !== null)
|
|
1114
1145
|
? CodeVerifier.fromPartial(object.code)
|
|
1115
1146
|
: undefined;
|
|
1147
|
+
message.companyId = object.companyId ?? "";
|
|
1116
1148
|
return message;
|
|
1117
1149
|
},
|
|
1118
1150
|
};
|
|
1119
1151
|
|
|
1152
|
+
function createBaseGetCompanyIdByCodeRequest(): GetCompanyIdByCodeRequest {
|
|
1153
|
+
return { $type: "auth.v1.GetCompanyIdByCodeRequest", code: "", serviceId: "" };
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
export const GetCompanyIdByCodeRequest: MessageFns<GetCompanyIdByCodeRequest, "auth.v1.GetCompanyIdByCodeRequest"> = {
|
|
1157
|
+
$type: "auth.v1.GetCompanyIdByCodeRequest" as const,
|
|
1158
|
+
|
|
1159
|
+
encode(message: GetCompanyIdByCodeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1160
|
+
if (message.code !== "") {
|
|
1161
|
+
writer.uint32(10).string(message.code);
|
|
1162
|
+
}
|
|
1163
|
+
if (message.serviceId !== "") {
|
|
1164
|
+
writer.uint32(18).string(message.serviceId);
|
|
1165
|
+
}
|
|
1166
|
+
return writer;
|
|
1167
|
+
},
|
|
1168
|
+
|
|
1169
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetCompanyIdByCodeRequest {
|
|
1170
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1171
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1172
|
+
const message = createBaseGetCompanyIdByCodeRequest();
|
|
1173
|
+
while (reader.pos < end) {
|
|
1174
|
+
const tag = reader.uint32();
|
|
1175
|
+
switch (tag >>> 3) {
|
|
1176
|
+
case 1: {
|
|
1177
|
+
if (tag !== 10) {
|
|
1178
|
+
break;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
message.code = reader.string();
|
|
1182
|
+
continue;
|
|
1183
|
+
}
|
|
1184
|
+
case 2: {
|
|
1185
|
+
if (tag !== 18) {
|
|
1186
|
+
break;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
message.serviceId = reader.string();
|
|
1190
|
+
continue;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1194
|
+
break;
|
|
1195
|
+
}
|
|
1196
|
+
reader.skip(tag & 7);
|
|
1197
|
+
}
|
|
1198
|
+
return message;
|
|
1199
|
+
},
|
|
1200
|
+
|
|
1201
|
+
fromJSON(object: any): GetCompanyIdByCodeRequest {
|
|
1202
|
+
return {
|
|
1203
|
+
$type: GetCompanyIdByCodeRequest.$type,
|
|
1204
|
+
code: isSet(object.code) ? globalThis.String(object.code) : "",
|
|
1205
|
+
serviceId: isSet(object.serviceId)
|
|
1206
|
+
? globalThis.String(object.serviceId)
|
|
1207
|
+
: isSet(object.service_id)
|
|
1208
|
+
? globalThis.String(object.service_id)
|
|
1209
|
+
: "",
|
|
1210
|
+
};
|
|
1211
|
+
},
|
|
1212
|
+
|
|
1213
|
+
toJSON(message: GetCompanyIdByCodeRequest): unknown {
|
|
1214
|
+
const obj: any = {};
|
|
1215
|
+
if (message.code !== "") {
|
|
1216
|
+
obj.code = message.code;
|
|
1217
|
+
}
|
|
1218
|
+
if (message.serviceId !== "") {
|
|
1219
|
+
obj.serviceId = message.serviceId;
|
|
1220
|
+
}
|
|
1221
|
+
return obj;
|
|
1222
|
+
},
|
|
1223
|
+
|
|
1224
|
+
create<I extends Exact<DeepPartial<GetCompanyIdByCodeRequest>, I>>(base?: I): GetCompanyIdByCodeRequest {
|
|
1225
|
+
return GetCompanyIdByCodeRequest.fromPartial(base ?? ({} as any));
|
|
1226
|
+
},
|
|
1227
|
+
fromPartial<I extends Exact<DeepPartial<GetCompanyIdByCodeRequest>, I>>(object: I): GetCompanyIdByCodeRequest {
|
|
1228
|
+
const message = createBaseGetCompanyIdByCodeRequest();
|
|
1229
|
+
message.code = object.code ?? "";
|
|
1230
|
+
message.serviceId = object.serviceId ?? "";
|
|
1231
|
+
return message;
|
|
1232
|
+
},
|
|
1233
|
+
};
|
|
1234
|
+
|
|
1235
|
+
function createBaseGetCompanyIdByCodeResponse(): GetCompanyIdByCodeResponse {
|
|
1236
|
+
return { $type: "auth.v1.GetCompanyIdByCodeResponse", companyId: "" };
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
export const GetCompanyIdByCodeResponse: MessageFns<GetCompanyIdByCodeResponse, "auth.v1.GetCompanyIdByCodeResponse"> =
|
|
1240
|
+
{
|
|
1241
|
+
$type: "auth.v1.GetCompanyIdByCodeResponse" as const,
|
|
1242
|
+
|
|
1243
|
+
encode(message: GetCompanyIdByCodeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1244
|
+
if (message.companyId !== "") {
|
|
1245
|
+
writer.uint32(10).string(message.companyId);
|
|
1246
|
+
}
|
|
1247
|
+
return writer;
|
|
1248
|
+
},
|
|
1249
|
+
|
|
1250
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetCompanyIdByCodeResponse {
|
|
1251
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1252
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1253
|
+
const message = createBaseGetCompanyIdByCodeResponse();
|
|
1254
|
+
while (reader.pos < end) {
|
|
1255
|
+
const tag = reader.uint32();
|
|
1256
|
+
switch (tag >>> 3) {
|
|
1257
|
+
case 1: {
|
|
1258
|
+
if (tag !== 10) {
|
|
1259
|
+
break;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
message.companyId = reader.string();
|
|
1263
|
+
continue;
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1267
|
+
break;
|
|
1268
|
+
}
|
|
1269
|
+
reader.skip(tag & 7);
|
|
1270
|
+
}
|
|
1271
|
+
return message;
|
|
1272
|
+
},
|
|
1273
|
+
|
|
1274
|
+
fromJSON(object: any): GetCompanyIdByCodeResponse {
|
|
1275
|
+
return {
|
|
1276
|
+
$type: GetCompanyIdByCodeResponse.$type,
|
|
1277
|
+
companyId: isSet(object.companyId)
|
|
1278
|
+
? globalThis.String(object.companyId)
|
|
1279
|
+
: isSet(object.company_id)
|
|
1280
|
+
? globalThis.String(object.company_id)
|
|
1281
|
+
: "",
|
|
1282
|
+
};
|
|
1283
|
+
},
|
|
1284
|
+
|
|
1285
|
+
toJSON(message: GetCompanyIdByCodeResponse): unknown {
|
|
1286
|
+
const obj: any = {};
|
|
1287
|
+
if (message.companyId !== "") {
|
|
1288
|
+
obj.companyId = message.companyId;
|
|
1289
|
+
}
|
|
1290
|
+
return obj;
|
|
1291
|
+
},
|
|
1292
|
+
|
|
1293
|
+
create<I extends Exact<DeepPartial<GetCompanyIdByCodeResponse>, I>>(base?: I): GetCompanyIdByCodeResponse {
|
|
1294
|
+
return GetCompanyIdByCodeResponse.fromPartial(base ?? ({} as any));
|
|
1295
|
+
},
|
|
1296
|
+
fromPartial<I extends Exact<DeepPartial<GetCompanyIdByCodeResponse>, I>>(object: I): GetCompanyIdByCodeResponse {
|
|
1297
|
+
const message = createBaseGetCompanyIdByCodeResponse();
|
|
1298
|
+
message.companyId = object.companyId ?? "";
|
|
1299
|
+
return message;
|
|
1300
|
+
},
|
|
1301
|
+
};
|
|
1302
|
+
|
|
1120
1303
|
export type AuthServiceDefinition = typeof AuthServiceDefinition;
|
|
1121
1304
|
export const AuthServiceDefinition = {
|
|
1122
1305
|
name: "AuthService",
|
|
@@ -1170,6 +1353,14 @@ export const AuthServiceDefinition = {
|
|
|
1170
1353
|
responseStream: false,
|
|
1171
1354
|
options: {},
|
|
1172
1355
|
},
|
|
1356
|
+
getCompanyIdByCode: {
|
|
1357
|
+
name: "GetCompanyIdByCode",
|
|
1358
|
+
requestType: GetCompanyIdByCodeRequest as typeof GetCompanyIdByCodeRequest,
|
|
1359
|
+
requestStream: false,
|
|
1360
|
+
responseType: GetCompanyIdByCodeResponse as typeof GetCompanyIdByCodeResponse,
|
|
1361
|
+
responseStream: false,
|
|
1362
|
+
options: {},
|
|
1363
|
+
},
|
|
1173
1364
|
},
|
|
1174
1365
|
} as const;
|
|
1175
1366
|
|
|
@@ -1186,6 +1377,10 @@ export interface AuthServiceImplementation<CallContextExt = {}> {
|
|
|
1186
1377
|
authorize(request: AuthorizeRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Tokens>>;
|
|
1187
1378
|
logout(request: Tokens, context: CallContext & CallContextExt): Promise<DeepPartial<StatusResponse>>;
|
|
1188
1379
|
getMe(request: GetMeRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetMeResponse>>;
|
|
1380
|
+
getCompanyIdByCode(
|
|
1381
|
+
request: GetCompanyIdByCodeRequest,
|
|
1382
|
+
context: CallContext & CallContextExt,
|
|
1383
|
+
): Promise<DeepPartial<GetCompanyIdByCodeResponse>>;
|
|
1189
1384
|
}
|
|
1190
1385
|
|
|
1191
1386
|
export interface AuthServiceClient<CallOptionsExt = {}> {
|
|
@@ -1201,6 +1396,10 @@ export interface AuthServiceClient<CallOptionsExt = {}> {
|
|
|
1201
1396
|
authorize(request: DeepPartial<AuthorizeRequest>, options?: CallOptions & CallOptionsExt): Promise<Tokens>;
|
|
1202
1397
|
logout(request: DeepPartial<Tokens>, options?: CallOptions & CallOptionsExt): Promise<StatusResponse>;
|
|
1203
1398
|
getMe(request: DeepPartial<GetMeRequest>, options?: CallOptions & CallOptionsExt): Promise<GetMeResponse>;
|
|
1399
|
+
getCompanyIdByCode(
|
|
1400
|
+
request: DeepPartial<GetCompanyIdByCodeRequest>,
|
|
1401
|
+
options?: CallOptions & CallOptionsExt,
|
|
1402
|
+
): Promise<GetCompanyIdByCodeResponse>;
|
|
1204
1403
|
}
|
|
1205
1404
|
|
|
1206
1405
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.5
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: companies/v1/subscription.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import type { CallContext, CallOptions } from "nice-grpc-common";
|
|
10
|
+
import { StatusResponse } from "../../common/v1/types";
|
|
11
|
+
|
|
12
|
+
export interface CheckSubscriptionRequest {
|
|
13
|
+
$type: "companies.v1.CheckSubscriptionRequest";
|
|
14
|
+
companyId: string;
|
|
15
|
+
serviceId: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function createBaseCheckSubscriptionRequest(): CheckSubscriptionRequest {
|
|
19
|
+
return { $type: "companies.v1.CheckSubscriptionRequest", companyId: "", serviceId: "" };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const CheckSubscriptionRequest: MessageFns<CheckSubscriptionRequest, "companies.v1.CheckSubscriptionRequest"> = {
|
|
23
|
+
$type: "companies.v1.CheckSubscriptionRequest" as const,
|
|
24
|
+
|
|
25
|
+
encode(message: CheckSubscriptionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
26
|
+
if (message.companyId !== "") {
|
|
27
|
+
writer.uint32(10).string(message.companyId);
|
|
28
|
+
}
|
|
29
|
+
if (message.serviceId !== "") {
|
|
30
|
+
writer.uint32(18).string(message.serviceId);
|
|
31
|
+
}
|
|
32
|
+
return writer;
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
decode(input: BinaryReader | Uint8Array, length?: number): CheckSubscriptionRequest {
|
|
36
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
37
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
38
|
+
const message = createBaseCheckSubscriptionRequest();
|
|
39
|
+
while (reader.pos < end) {
|
|
40
|
+
const tag = reader.uint32();
|
|
41
|
+
switch (tag >>> 3) {
|
|
42
|
+
case 1: {
|
|
43
|
+
if (tag !== 10) {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
message.companyId = reader.string();
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
case 2: {
|
|
51
|
+
if (tag !== 18) {
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
message.serviceId = reader.string();
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
reader.skip(tag & 7);
|
|
63
|
+
}
|
|
64
|
+
return message;
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
fromJSON(object: any): CheckSubscriptionRequest {
|
|
68
|
+
return {
|
|
69
|
+
$type: CheckSubscriptionRequest.$type,
|
|
70
|
+
companyId: isSet(object.companyId)
|
|
71
|
+
? globalThis.String(object.companyId)
|
|
72
|
+
: isSet(object.company_id)
|
|
73
|
+
? globalThis.String(object.company_id)
|
|
74
|
+
: "",
|
|
75
|
+
serviceId: isSet(object.serviceId)
|
|
76
|
+
? globalThis.String(object.serviceId)
|
|
77
|
+
: isSet(object.service_id)
|
|
78
|
+
? globalThis.String(object.service_id)
|
|
79
|
+
: "",
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
toJSON(message: CheckSubscriptionRequest): unknown {
|
|
84
|
+
const obj: any = {};
|
|
85
|
+
if (message.companyId !== "") {
|
|
86
|
+
obj.companyId = message.companyId;
|
|
87
|
+
}
|
|
88
|
+
if (message.serviceId !== "") {
|
|
89
|
+
obj.serviceId = message.serviceId;
|
|
90
|
+
}
|
|
91
|
+
return obj;
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
create<I extends Exact<DeepPartial<CheckSubscriptionRequest>, I>>(base?: I): CheckSubscriptionRequest {
|
|
95
|
+
return CheckSubscriptionRequest.fromPartial(base ?? ({} as any));
|
|
96
|
+
},
|
|
97
|
+
fromPartial<I extends Exact<DeepPartial<CheckSubscriptionRequest>, I>>(object: I): CheckSubscriptionRequest {
|
|
98
|
+
const message = createBaseCheckSubscriptionRequest();
|
|
99
|
+
message.companyId = object.companyId ?? "";
|
|
100
|
+
message.serviceId = object.serviceId ?? "";
|
|
101
|
+
return message;
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type SubscriptionServiceDefinition = typeof SubscriptionServiceDefinition;
|
|
106
|
+
export const SubscriptionServiceDefinition = {
|
|
107
|
+
name: "SubscriptionService",
|
|
108
|
+
fullName: "companies.v1.SubscriptionService",
|
|
109
|
+
methods: {
|
|
110
|
+
checkSubscription: {
|
|
111
|
+
name: "CheckSubscription",
|
|
112
|
+
requestType: CheckSubscriptionRequest as typeof CheckSubscriptionRequest,
|
|
113
|
+
requestStream: false,
|
|
114
|
+
responseType: StatusResponse as typeof StatusResponse,
|
|
115
|
+
responseStream: false,
|
|
116
|
+
options: {},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
} as const;
|
|
120
|
+
|
|
121
|
+
export interface SubscriptionServiceImplementation<CallContextExt = {}> {
|
|
122
|
+
checkSubscription(
|
|
123
|
+
request: CheckSubscriptionRequest,
|
|
124
|
+
context: CallContext & CallContextExt,
|
|
125
|
+
): Promise<DeepPartial<StatusResponse>>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface SubscriptionServiceClient<CallOptionsExt = {}> {
|
|
129
|
+
checkSubscription(
|
|
130
|
+
request: DeepPartial<CheckSubscriptionRequest>,
|
|
131
|
+
options?: CallOptions & CallOptionsExt,
|
|
132
|
+
): Promise<StatusResponse>;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
136
|
+
|
|
137
|
+
type DeepPartial<T> = T extends Builtin ? T
|
|
138
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
139
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
140
|
+
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
|
|
141
|
+
: T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
|
|
142
|
+
: Partial<T>;
|
|
143
|
+
|
|
144
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
145
|
+
type Exact<P, I extends P> = P extends Builtin ? P
|
|
146
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
|
|
147
|
+
|
|
148
|
+
function isSet(value: any): boolean {
|
|
149
|
+
return value !== null && value !== undefined;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
interface MessageFns<T, V extends string> {
|
|
153
|
+
readonly $type: V;
|
|
154
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
155
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
156
|
+
fromJSON(object: any): T;
|
|
157
|
+
toJSON(message: T): unknown;
|
|
158
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
159
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
160
|
+
}
|
package/package.json
CHANGED
package/proto/auth/v1/auth.proto
CHANGED
|
@@ -14,6 +14,7 @@ service AuthService {
|
|
|
14
14
|
rpc Authorize(AuthorizeRequest) returns (auth.v1.Tokens);
|
|
15
15
|
rpc Logout(Tokens) returns (common.v1.StatusResponse);
|
|
16
16
|
rpc GetMe(GetMeRequest) returns (GetMeResponse);
|
|
17
|
+
rpc GetCompanyIdByCode(GetCompanyIdByCodeRequest) returns (GetCompanyIdByCodeResponse);
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
message GetMeRequest {
|
|
@@ -74,4 +75,14 @@ message AuthorizeRequest {
|
|
|
74
75
|
string service_id = 1;
|
|
75
76
|
optional auth.v1.Tokens tokens = 2;
|
|
76
77
|
optional CodeVerifier code = 3;
|
|
78
|
+
string company_id = 4;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
message GetCompanyIdByCodeRequest {
|
|
82
|
+
string code = 1;
|
|
83
|
+
string service_id = 2;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message GetCompanyIdByCodeResponse {
|
|
87
|
+
string company_id = 1;
|
|
77
88
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package companies.v1;
|
|
4
|
+
|
|
5
|
+
import "common/v1/types.proto";
|
|
6
|
+
|
|
7
|
+
service SubscriptionService {
|
|
8
|
+
rpc CheckSubscription(CheckSubscriptionRequest) returns (common.v1.StatusResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
message CheckSubscriptionRequest {
|
|
12
|
+
string company_id = 1;
|
|
13
|
+
string service_id = 2;
|
|
14
|
+
}
|
|
15
|
+
|