@fonoster/common 0.7.56 → 0.8.0

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,81 @@
1
+ /*
2
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ syntax = "proto3";
20
+
21
+ package fonoster.authz.v1beta2;
22
+
23
+ import "google/protobuf/empty.proto";
24
+
25
+ import "voice.proto";
26
+
27
+ // Authentication service definition
28
+ service Authz {
29
+ // Check if a user has permission to perform an action
30
+ rpc CheckSessionAuthorized (fonoster.voice.v1beta2.CreateSessionRequest) returns (CheckSessionAuthorizedResponse) {}
31
+ // Check if a given accessKeyId has permission to access a method
32
+ rpc CheckMethodAuthorized (CheckMethodAuthorizedRequest) returns (CheckMethodAuthorizedResponse) {}
33
+ // Charge an account with a given amount
34
+ rpc ChargeAccount (ChargeAccountRequest) returns (google.protobuf.Empty) {}
35
+ // Get the account balance
36
+ rpc GetAccountBalance (GetAccountBalanceRequest) returns (GetAccountBalanceResponse) {}
37
+ }
38
+
39
+ // Response message for the CheckVoiceRequestAuthorized method
40
+ message CheckSessionAuthorizedResponse {
41
+ // The authorization server will look for one or more parameters in the request
42
+ // to determine if the request is authorized. If the request is authorized, the
43
+ // response will have the value true.
44
+ bool authorized = 1;
45
+ }
46
+
47
+ // Request message for the CheckMethodAuthorized method
48
+ message CheckMethodAuthorizedRequest {
49
+ // The accessKeyId to check
50
+ string accessKeyId = 1;
51
+ // The method to check
52
+ string method = 2;
53
+ }
54
+
55
+ // Response message for the CheckMethodAuthorized method
56
+ message CheckMethodAuthorizedResponse {
57
+ // The authorization server will check the accessKeyId and method to determine if
58
+ // the request is authorized. If the request is authorized, the response will have
59
+ // the value true.
60
+ bool authorized = 1;
61
+ }
62
+
63
+ // Request message for the ChargeAccount method
64
+ message ChargeAccountRequest {
65
+ // The accessKeyId to charge
66
+ string accessKeyId = 1;
67
+ // The amount to charge
68
+ double amount = 2;
69
+ }
70
+
71
+ // Request message for the GetAccountBalance method
72
+ message GetAccountBalanceRequest {
73
+ // The accessKeyId to check
74
+ string accessKeyId = 1;
75
+ }
76
+
77
+ // Response message for the GetAccountBalance method
78
+ message GetAccountBalanceResponse {
79
+ // The account balance
80
+ double balance = 1;
81
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonoster/common",
3
- "version": "0.7.56",
3
+ "version": "0.8.0",
4
4
  "description": "Common library for Fonoster projects",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/fonoster#readme",
@@ -18,7 +18,7 @@
18
18
  "clean": "rimraf ./dist node_modules tsconfig.tsbuildinfo"
19
19
  },
20
20
  "dependencies": {
21
- "@fonoster/logger": "^0.7.56",
21
+ "@fonoster/logger": "^0.8.0",
22
22
  "@grpc/grpc-js": "~1.10.6",
23
23
  "@grpc/proto-loader": "^0.7.12",
24
24
  "dotenv": "^16.4.7",
@@ -45,5 +45,5 @@
45
45
  "devDependencies": {
46
46
  "@types/nodemailer": "^6.4.14"
47
47
  },
48
- "gitHead": "f918235ae68a49970b45022637347f673ca63941"
48
+ "gitHead": "9d8a6fc044fe23f4f75356c142d1ca412db5af15"
49
49
  }