@ssoeasy-dev/proto 1.1.0-beta.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.
- package/LICENSE +22 -0
- package/README.md +171 -0
- package/gen/ts/auth/v1/auth.ts +1462 -0
- package/gen/ts/auth/v1/common.ts +120 -0
- package/gen/ts/auth/v1/permission.ts +173 -0
- package/gen/ts/auth/v1/user_policy.ts +454 -0
- package/gen/ts/auth/v1/verification.ts +627 -0
- package/gen/ts/common/v1/types.ts +100 -0
- package/gen/ts/companies/v1/employee.ts +418 -0
- package/gen/ts/companies/v1/owner.ts +326 -0
- package/gen/ts/companies/v1/service.ts +150 -0
- package/gen/ts/companies/v1/subscription.ts +160 -0
- package/gen/ts/index.auth.ts +8 -0
- package/gen/ts/index.auth.v1.ts +12 -0
- package/gen/ts/index.common.ts +8 -0
- package/gen/ts/index.common.v1.ts +8 -0
- package/gen/ts/index.companies.ts +8 -0
- package/gen/ts/index.companies.v1.ts +11 -0
- package/gen/ts/index.ts +8 -0
- package/package.json +65 -0
- package/proto/auth/v1/auth.proto +89 -0
- package/proto/auth/v1/common.proto +8 -0
- package/proto/auth/v1/permission.proto +15 -0
- package/proto/auth/v1/user_policy.proto +30 -0
- package/proto/auth/v1/verification.proto +48 -0
- package/proto/common/v1/types.proto +7 -0
- package/proto/companies/v1/employee.proto +26 -0
- package/proto/companies/v1/owner.proto +23 -0
- package/proto/companies/v1/service.proto +14 -0
- package/proto/companies/v1/subscription.proto +14 -0
|
@@ -0,0 +1,120 @@
|
|
|
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: auth/v1/common.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
|
|
10
|
+
export interface Tokens {
|
|
11
|
+
$type: "auth.v1.Tokens";
|
|
12
|
+
access: string;
|
|
13
|
+
refresh: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function createBaseTokens(): Tokens {
|
|
17
|
+
return { $type: "auth.v1.Tokens", access: "", refresh: "" };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Tokens: MessageFns<Tokens, "auth.v1.Tokens"> = {
|
|
21
|
+
$type: "auth.v1.Tokens" as const,
|
|
22
|
+
|
|
23
|
+
encode(message: Tokens, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
24
|
+
if (message.access !== "") {
|
|
25
|
+
writer.uint32(10).string(message.access);
|
|
26
|
+
}
|
|
27
|
+
if (message.refresh !== "") {
|
|
28
|
+
writer.uint32(18).string(message.refresh);
|
|
29
|
+
}
|
|
30
|
+
return writer;
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Tokens {
|
|
34
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
35
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
36
|
+
const message = createBaseTokens();
|
|
37
|
+
while (reader.pos < end) {
|
|
38
|
+
const tag = reader.uint32();
|
|
39
|
+
switch (tag >>> 3) {
|
|
40
|
+
case 1: {
|
|
41
|
+
if (tag !== 10) {
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message.access = reader.string();
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
case 2: {
|
|
49
|
+
if (tag !== 18) {
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
message.refresh = reader.string();
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
reader.skip(tag & 7);
|
|
61
|
+
}
|
|
62
|
+
return message;
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
fromJSON(object: any): Tokens {
|
|
66
|
+
return {
|
|
67
|
+
$type: Tokens.$type,
|
|
68
|
+
access: isSet(object.access) ? globalThis.String(object.access) : "",
|
|
69
|
+
refresh: isSet(object.refresh) ? globalThis.String(object.refresh) : "",
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
toJSON(message: Tokens): unknown {
|
|
74
|
+
const obj: any = {};
|
|
75
|
+
if (message.access !== "") {
|
|
76
|
+
obj.access = message.access;
|
|
77
|
+
}
|
|
78
|
+
if (message.refresh !== "") {
|
|
79
|
+
obj.refresh = message.refresh;
|
|
80
|
+
}
|
|
81
|
+
return obj;
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
create<I extends Exact<DeepPartial<Tokens>, I>>(base?: I): Tokens {
|
|
85
|
+
return Tokens.fromPartial(base ?? ({} as any));
|
|
86
|
+
},
|
|
87
|
+
fromPartial<I extends Exact<DeepPartial<Tokens>, I>>(object: I): Tokens {
|
|
88
|
+
const message = createBaseTokens();
|
|
89
|
+
message.access = object.access ?? "";
|
|
90
|
+
message.refresh = object.refresh ?? "";
|
|
91
|
+
return message;
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
96
|
+
|
|
97
|
+
type DeepPartial<T> = T extends Builtin ? T
|
|
98
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
99
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
100
|
+
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
|
|
101
|
+
: T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
|
|
102
|
+
: Partial<T>;
|
|
103
|
+
|
|
104
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
105
|
+
type Exact<P, I extends P> = P extends Builtin ? P
|
|
106
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
|
|
107
|
+
|
|
108
|
+
function isSet(value: any): boolean {
|
|
109
|
+
return value !== null && value !== undefined;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
interface MessageFns<T, V extends string> {
|
|
113
|
+
readonly $type: V;
|
|
114
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
115
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
116
|
+
fromJSON(object: any): T;
|
|
117
|
+
toJSON(message: T): unknown;
|
|
118
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
119
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
120
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
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: auth/v1/permission.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 CheckPermissionRequest {
|
|
13
|
+
$type: "auth.v1.CheckPermissionRequest";
|
|
14
|
+
id: string;
|
|
15
|
+
token: string;
|
|
16
|
+
companyId?: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function createBaseCheckPermissionRequest(): CheckPermissionRequest {
|
|
20
|
+
return { $type: "auth.v1.CheckPermissionRequest", id: "", token: "", companyId: undefined };
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const CheckPermissionRequest: MessageFns<CheckPermissionRequest, "auth.v1.CheckPermissionRequest"> = {
|
|
24
|
+
$type: "auth.v1.CheckPermissionRequest" as const,
|
|
25
|
+
|
|
26
|
+
encode(message: CheckPermissionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
27
|
+
if (message.id !== "") {
|
|
28
|
+
writer.uint32(10).string(message.id);
|
|
29
|
+
}
|
|
30
|
+
if (message.token !== "") {
|
|
31
|
+
writer.uint32(18).string(message.token);
|
|
32
|
+
}
|
|
33
|
+
if (message.companyId !== undefined) {
|
|
34
|
+
writer.uint32(26).string(message.companyId);
|
|
35
|
+
}
|
|
36
|
+
return writer;
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
decode(input: BinaryReader | Uint8Array, length?: number): CheckPermissionRequest {
|
|
40
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
41
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
42
|
+
const message = createBaseCheckPermissionRequest();
|
|
43
|
+
while (reader.pos < end) {
|
|
44
|
+
const tag = reader.uint32();
|
|
45
|
+
switch (tag >>> 3) {
|
|
46
|
+
case 1: {
|
|
47
|
+
if (tag !== 10) {
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message.id = reader.string();
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
case 2: {
|
|
55
|
+
if (tag !== 18) {
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
message.token = reader.string();
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
case 3: {
|
|
63
|
+
if (tag !== 26) {
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
message.companyId = reader.string();
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
reader.skip(tag & 7);
|
|
75
|
+
}
|
|
76
|
+
return message;
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
fromJSON(object: any): CheckPermissionRequest {
|
|
80
|
+
return {
|
|
81
|
+
$type: CheckPermissionRequest.$type,
|
|
82
|
+
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
83
|
+
token: isSet(object.token) ? globalThis.String(object.token) : "",
|
|
84
|
+
companyId: isSet(object.companyId)
|
|
85
|
+
? globalThis.String(object.companyId)
|
|
86
|
+
: isSet(object.company_id)
|
|
87
|
+
? globalThis.String(object.company_id)
|
|
88
|
+
: undefined,
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
toJSON(message: CheckPermissionRequest): unknown {
|
|
93
|
+
const obj: any = {};
|
|
94
|
+
if (message.id !== "") {
|
|
95
|
+
obj.id = message.id;
|
|
96
|
+
}
|
|
97
|
+
if (message.token !== "") {
|
|
98
|
+
obj.token = message.token;
|
|
99
|
+
}
|
|
100
|
+
if (message.companyId !== undefined) {
|
|
101
|
+
obj.companyId = message.companyId;
|
|
102
|
+
}
|
|
103
|
+
return obj;
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
create<I extends Exact<DeepPartial<CheckPermissionRequest>, I>>(base?: I): CheckPermissionRequest {
|
|
107
|
+
return CheckPermissionRequest.fromPartial(base ?? ({} as any));
|
|
108
|
+
},
|
|
109
|
+
fromPartial<I extends Exact<DeepPartial<CheckPermissionRequest>, I>>(object: I): CheckPermissionRequest {
|
|
110
|
+
const message = createBaseCheckPermissionRequest();
|
|
111
|
+
message.id = object.id ?? "";
|
|
112
|
+
message.token = object.token ?? "";
|
|
113
|
+
message.companyId = object.companyId ?? undefined;
|
|
114
|
+
return message;
|
|
115
|
+
},
|
|
116
|
+
};
|
|
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 as typeof CheckPermissionRequest,
|
|
126
|
+
requestStream: false,
|
|
127
|
+
responseType: StatusResponse as typeof 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
|
+
|
|
148
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
149
|
+
|
|
150
|
+
type DeepPartial<T> = T extends Builtin ? T
|
|
151
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
152
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
153
|
+
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
|
|
154
|
+
: T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
|
|
155
|
+
: Partial<T>;
|
|
156
|
+
|
|
157
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
158
|
+
type Exact<P, I extends P> = P extends Builtin ? P
|
|
159
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never };
|
|
160
|
+
|
|
161
|
+
function isSet(value: any): boolean {
|
|
162
|
+
return value !== null && value !== undefined;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
interface MessageFns<T, V extends string> {
|
|
166
|
+
readonly $type: V;
|
|
167
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
168
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
169
|
+
fromJSON(object: any): T;
|
|
170
|
+
toJSON(message: T): unknown;
|
|
171
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
172
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
173
|
+
}
|