@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.
@@ -0,0 +1,8 @@
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
+
6
+ /* eslint-disable */
7
+
8
+ export * as common from "./index.common";
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@ssoeasy-dev/proto",
3
+ "version": "1.1.0-beta.1",
4
+ "description": "gRPC proto contracts and generated TypeScript clients for SSOEasy",
5
+ "main": "gen/ts/index.ts",
6
+ "types": "gen/ts/index.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./gen/ts/index.ts",
10
+ "default": "./gen/ts/index.ts"
11
+ },
12
+ "./auth": {
13
+ "types": "./gen/ts/index.auth.ts",
14
+ "default": "./gen/ts/index.auth.ts"
15
+ },
16
+ "./companies": {
17
+ "types": "./gen/ts/index.companies.ts",
18
+ "default": "./gen/ts/index.companies.ts"
19
+ },
20
+ "./common": {
21
+ "types": "./gen/ts/index.common.ts",
22
+ "default": "./gen/ts/index.common.ts"
23
+ }
24
+ },
25
+ "files": [
26
+ "gen/ts/**/*",
27
+ "proto/**/*.proto",
28
+ "README.md",
29
+ "LICENSE"
30
+ ],
31
+ "dependencies": {
32
+ "@bufbuild/protobuf": "^2.0.0",
33
+ "long": "^5.2.3",
34
+ "nice-grpc": "^2.1.10",
35
+ "nice-grpc-common": "^2.0.2",
36
+ "rxjs": "7.8.2"
37
+ },
38
+ "devDependencies": {
39
+ "semver": "^7.6.0",
40
+ "ts-proto": "2.11.5"
41
+ },
42
+ "peerDependencies": {
43
+ "@grpc/grpc-js": "^1.9.0"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public",
47
+ "registry": "https://registry.npmjs.org/"
48
+ },
49
+ "repository": {
50
+ "type": "git",
51
+ "url": "https://github.com/ssoeasy-dev/proto.git"
52
+ },
53
+ "keywords": [
54
+ "grpc",
55
+ "proto",
56
+ "typescript",
57
+ "sso",
58
+ "ssoeasy"
59
+ ],
60
+ "license": "MIT",
61
+ "scripts": {
62
+ "generate": "buf generate --template buf.gen.ts.yaml",
63
+ "clean": "rm -rf gen/ts"
64
+ }
65
+ }
@@ -0,0 +1,89 @@
1
+ syntax = "proto3";
2
+
3
+ package auth.v1;
4
+
5
+ import "auth/v1/common.proto";
6
+ import "auth/v1/user_policy.proto";
7
+ import "auth/v1/verification.proto";
8
+ import "common/v1/types.proto";
9
+
10
+ service AuthService {
11
+ rpc Registration(RegistrationRequest) returns (RegistrationResponse);
12
+ rpc RegistrationCompensate(RegistrationCompensateRequest) returns (common.v1.StatusResponse);
13
+ rpc Login(LoginRequest) returns (LoginResponse);
14
+ rpc Authorize(AuthorizeRequest) returns (auth.v1.Tokens);
15
+ rpc Logout(Tokens) returns (common.v1.StatusResponse);
16
+ rpc GetMe(GetMeRequest) returns (GetMeResponse);
17
+ rpc GetCompanyIdByCode(GetCompanyIdByCodeRequest) returns (GetCompanyIdByCodeResponse);
18
+ }
19
+
20
+ message GetMeRequest {
21
+ string token = 1;
22
+ }
23
+
24
+ message GetMeResponse {
25
+ string user_id = 1;
26
+ string login = 2;
27
+ }
28
+
29
+ message AuthCode {
30
+ string id = 1;
31
+ string value = 2;
32
+ int64 expires_at = 3;
33
+ }
34
+
35
+ message RegistrationRequest {
36
+ string login = 1;
37
+ string password = 2;
38
+ optional auth.v1.VerificationType verification_type = 3;
39
+ repeated auth.v1.UserPolicyRequest policies = 4;
40
+ }
41
+
42
+ message RegistrationResponse {
43
+ string user_id = 1;
44
+ string credential_id = 2;
45
+ repeated auth.v1.UserPolicyResponse policies = 3;
46
+ optional auth.v1.Verification verification = 4;
47
+ }
48
+
49
+ message RegistrationCompensateRequest {
50
+ string user_id = 1;
51
+ string credential_id = 2;
52
+ optional string verification_id = 3;
53
+ repeated string policy_ids = 4;
54
+ }
55
+
56
+ message LoginRequest {
57
+ string login = 1;
58
+ string password = 2;
59
+ string code_challenge = 3;
60
+ string service_id = 4;
61
+ optional auth.v1.VerificationType verification_type = 5;
62
+ }
63
+
64
+ message LoginResponse {
65
+ optional AuthCode code = 1;
66
+ optional auth.v1.Verification verification = 2;
67
+ }
68
+
69
+ message CodeVerifier {
70
+ string code = 1;
71
+ string verifier = 2;
72
+ }
73
+
74
+ message AuthorizeRequest {
75
+ string service_id = 1;
76
+ optional auth.v1.Tokens tokens = 2;
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 user_id = 1;
88
+ optional string company_id = 2;
89
+ }
@@ -0,0 +1,8 @@
1
+ syntax = "proto3";
2
+
3
+ package auth.v1;
4
+
5
+ message Tokens {
6
+ string access = 1;
7
+ string refresh = 2;
8
+ }
@@ -0,0 +1,15 @@
1
+ syntax = "proto3";
2
+
3
+ package auth.v1;
4
+
5
+ import "common/v1/types.proto";
6
+
7
+ service PermissionService {
8
+ rpc CheckPermission(CheckPermissionRequest) returns (common.v1.StatusResponse);
9
+ }
10
+
11
+ message CheckPermissionRequest {
12
+ string id = 1;
13
+ string token = 2;
14
+ optional string company_id = 3;
15
+ }
@@ -0,0 +1,30 @@
1
+ syntax = "proto3";
2
+
3
+ package auth.v1;
4
+
5
+ enum AttributeType {
6
+ ATTRIBUTE_TYPE_UNSPECIFIED = 0;
7
+ ATTRIBUTE_TYPE_BOOLEAN = 1;
8
+ ATTRIBUTE_TYPE_STRING = 2;
9
+ ATTRIBUTE_TYPE_NUMBER = 3;
10
+ }
11
+
12
+ message Attribute {
13
+ string name = 1;
14
+ string operator = 2;
15
+ string value = 3;
16
+ }
17
+
18
+ message UserPolicyRequest {
19
+ string name = 1;
20
+ string service_id = 2;
21
+ optional string company_id = 3;
22
+ }
23
+
24
+ message UserPolicyResponse {
25
+ string id = 1;
26
+ string name = 2;
27
+ string service_id = 3;
28
+ optional string company_id = 4;
29
+ repeated Attribute attributes = 5;
30
+ }
@@ -0,0 +1,48 @@
1
+ syntax = "proto3";
2
+
3
+ package auth.v1;
4
+
5
+ import "common/v1/types.proto";
6
+
7
+ service VerificationService {
8
+ rpc Verificate(VerificateRequest) returns (common.v1.StatusResponse);
9
+ rpc Refresh(RefreshRequest) returns (Verification);
10
+ rpc CheckStatus(CheckStatusRequest) returns (CheckStatusResponse);
11
+ }
12
+
13
+ enum VerificationType {
14
+ VERIFICATION_TYPE_UNSPECIFIED = 0;
15
+ VERIFICATION_TYPE_EMAIL_CODE = 1;
16
+ VERIFICATION_TYPE_EMAIL_LINK = 2;
17
+ }
18
+
19
+ message Verification {
20
+ string id = 1;
21
+ string value = 2;
22
+ int64 expires_at = 3;
23
+ }
24
+
25
+ message VerificateRequest {
26
+ string id = 1;
27
+ string value = 2;
28
+ }
29
+
30
+ message RefreshRequest {
31
+ string user_id = 1;
32
+ VerificationType type = 2;
33
+ }
34
+
35
+ enum VerificationStatus {
36
+ VERIFICATION_STATUS_UNSPECIFIED = 0;
37
+ VERIFICATION_STATUS_WAIT = 1;
38
+ VERIFICATION_STATUS_EXPIRES = 2;
39
+ VERIFICATION_STATUS_VERIFIED = 3;
40
+ }
41
+
42
+ message CheckStatusRequest {
43
+ string id = 1;
44
+ }
45
+
46
+ message CheckStatusResponse {
47
+ VerificationStatus status = 1;
48
+ }
@@ -0,0 +1,7 @@
1
+ syntax = "proto3";
2
+
3
+ package common.v1;
4
+
5
+ message StatusResponse {
6
+ bool success = 1;
7
+ }
@@ -0,0 +1,26 @@
1
+ syntax = "proto3";
2
+
3
+ package companies.v1;
4
+
5
+ service EmployeeService {
6
+ rpc GetByUserId(GetByUserIdRequest) returns (GetByUserIdResponse);
7
+ }
8
+
9
+ message GetByUserIdRequest {
10
+ string user_id = 1;
11
+ optional string service_id = 2;
12
+ }
13
+
14
+ message EmployeeCompany {
15
+ string id = 1;
16
+ string name = 2;
17
+ optional string service_name = 3;
18
+ optional string subscription_id = 4;
19
+ optional bool subscription_is_active = 5;
20
+ }
21
+
22
+ message GetByUserIdResponse {
23
+ string firstname = 1;
24
+ string lastname = 2;
25
+ repeated EmployeeCompany companies = 3;
26
+ }
@@ -0,0 +1,23 @@
1
+ syntax = "proto3";
2
+
3
+ package companies.v1;
4
+
5
+ import "common/v1/types.proto";
6
+
7
+ service OwnerService {
8
+ rpc RegisterOwner(RegisterOwnerRequest) returns (RegisterOwnerResponse);
9
+ rpc RegisterOwnerCompensate(RegisterOwnerResponse) returns (common.v1.StatusResponse);
10
+ }
11
+
12
+ message RegisterOwnerRequest {
13
+ string email = 1;
14
+ string firstname = 2;
15
+ string lastname = 3;
16
+ }
17
+
18
+ message RegisterOwnerResponse {
19
+ string company_id = 1;
20
+ string employee_id = 2;
21
+ string subscription_id = 3;
22
+ string employee_company_id = 4;
23
+ }
@@ -0,0 +1,14 @@
1
+ syntax = "proto3";
2
+
3
+ package companies.v1;
4
+
5
+ import "common/v1/types.proto";
6
+
7
+ service ServiceService {
8
+ rpc CheckUri(CheckUriRequest) returns (common.v1.StatusResponse);
9
+ }
10
+
11
+ message CheckUriRequest {
12
+ string uri = 1;
13
+ string service_id = 2;
14
+ }
@@ -0,0 +1,14 @@
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
+ }