@fonoster/common 0.6.2-alpha.0 → 0.6.6

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.
@@ -45,9 +45,9 @@ message Acl {
45
45
  // The list of denied IP addresses
46
46
  repeated string deny = 4;
47
47
  // The date the Acl was created
48
- int64 created_at = 5;
48
+ int32 created_at = 5;
49
49
  // The date the Acl was last updated
50
- int64 updated_at = 6;
50
+ int32 updated_at = 6;
51
51
  }
52
52
 
53
53
  // The request message for the Acl.CreateAcl method
@@ -20,9 +20,6 @@ syntax = "proto3";
20
20
 
21
21
  package fonoster.agents.v1beta2;
22
22
 
23
- import "domains.proto";
24
- import "credentials.proto";
25
-
26
23
  // The Agents service definition
27
24
  service Agents {
28
25
  // Create a new Agent
@@ -39,6 +36,22 @@ service Agents {
39
36
 
40
37
  // The message for a new Agent
41
38
  message Agent {
39
+ message Domain {
40
+ // The unique identifier of the Domain
41
+ string ref = 1;
42
+ // The name of the Domain
43
+ string name = 2;
44
+ // The domain of the Domain
45
+ string domain_uri = 3;
46
+ }
47
+ message Credentials {
48
+ // The unique identifier of the Credentials
49
+ string ref = 1;
50
+ // The friendly name of the Credentials
51
+ string name = 2;
52
+ // The username of the Credentials
53
+ string username = 3;
54
+ }
42
55
  // The unique identifier of the Agent
43
56
  string ref = 1;
44
57
  // The name of the Agent
@@ -50,17 +63,17 @@ message Agent {
50
63
  // The enabled status of the Agent
51
64
  bool enabled = 5;
52
65
  // The created_at timestamp of the Agent
53
- int64 created_at = 6;
66
+ int32 created_at = 6;
54
67
  // The updated_at timestamp of the Agent
55
- int64 updated_at = 7;
68
+ int32 updated_at = 7;
56
69
  // The maximum number of contacts that can be created for this Agent
57
70
  int32 max_contacts = 8;
58
71
  // Value to override the expires requested by the Agent
59
72
  int32 expires = 9;
60
73
  // The domain of the Agent
61
- fonoster.domains.v1beta2.Domain domain = 10;
74
+ Domain domain = 10;
62
75
  // The credentials of the Agent
63
- fonoster.credentials.v1beta2.Credentials credentials = 11;
76
+ Credentials credentials = 11;
64
77
  }
65
78
 
66
79
  // The request message for Agents.CreateAgent
@@ -150,6 +163,6 @@ message ListAgentsResponse {
150
163
  }
151
164
 
152
165
  enum Privacy {
153
- PRIVATE = 0;
154
- NONE = 1;
166
+ NONE = 0;
167
+ PRIVATE = 1;
155
168
  }
@@ -68,9 +68,9 @@ message Application {
68
68
  // Conversation product
69
69
  ProductContainer conversation = 7;
70
70
  // Creation time
71
- int64 created_at = 8;
71
+ int32 created_at = 8;
72
72
  // Update time
73
- int64 updated_at = 9;
73
+ int32 updated_at = 9;
74
74
  }
75
75
 
76
76
  // Request to create a new application
@@ -20,9 +20,6 @@ syntax = "proto3";
20
20
 
21
21
  package fonoster.calls.v1beta2;
22
22
 
23
- // TODO: Consider using Timestamp instead of int64
24
- // import "google/protobuf/timestamp.proto";
25
-
26
23
  // Calls service definition
27
24
  service Calls {
28
25
  // Call a number and returns the call status
@@ -86,9 +83,9 @@ message CallDetailRecord {
86
83
  // Hangup cause
87
84
  HangupCause hangup_cause = 4;
88
85
  // Start time of the call
89
- int64 started_at = 5;
86
+ int32 started_at = 5;
90
87
  // End time of the call
91
- int64 ended_at = 6;
88
+ int32 ended_at = 6;
92
89
  // The from number (E.164 format or SIP URI)
93
90
  string from = 7;
94
91
  // The to number (E.164 format or SIP URI)
@@ -111,7 +108,7 @@ message CreateCallRequest {
111
108
 
112
109
  // The response message for Calls.Call
113
110
  message CreateCallResponse {
114
- // The refence of the call
111
+ // The reference of the call
115
112
  string ref = 1;
116
113
  }
117
114
 
@@ -157,7 +154,7 @@ message TrackCallRequest {
157
154
 
158
155
  // The response message for Calls.TrackCall
159
156
  message TrackCallResponse {
160
- // The refence of the call
157
+ // The reference of the call
161
158
  string ref = 1;
162
159
  // The call status
163
160
  CallStatus status = 2;
@@ -42,12 +42,10 @@ message Credentials {
42
42
  string name = 2;
43
43
  // The username of the Credentials
44
44
  string username = 3;
45
- // The password of the Credentials
46
- string password = 4;
47
45
  // The time the Credentials was created
48
- int64 created_at = 5;
46
+ int32 created_at = 4;
49
47
  // The time the Credentials was updated
50
- int64 updated_at = 6;
48
+ int32 updated_at = 5;
51
49
  }
52
50
 
53
51
  // The request message for the Credentials.CreateCredentials method
@@ -37,15 +37,15 @@ service Domains {
37
37
  // The message for the Domain resource
38
38
  message Domain {
39
39
  // The unique identifier of the Domain
40
- string ref = 2;
40
+ string ref = 1;
41
41
  // The name of the Domain
42
- string name = 3;
42
+ string name = 2;
43
43
  // The URI of the Domain
44
- string domain_uri = 4;
44
+ string domain_uri = 3;
45
45
  // The date of creation of the Domain
46
- int64 created_at = 5;
46
+ int32 created_at = 4;
47
47
  // The date of the last update
48
- int64 updated_at = 6;
48
+ int32 updated_at = 5;
49
49
  }
50
50
 
51
51
  // EgressPolicy defines the policy for egress traffic
@@ -35,8 +35,7 @@ service Identity {
35
35
 
36
36
  // User specific actions
37
37
  rpc CreateUser (CreateUserRequest) returns (CreateUserResponse) {}
38
- // TODO: Should get the User instead of GetUserResponse (renaming)
39
- rpc GetUser (GetUserRequest) returns (GetUserResponse) {}
38
+ rpc GetUser (GetUserRequest) returns (User) {}
40
39
  rpc UpdateUser (UpdateUserRequest) returns (UpdateUserResponse) {}
41
40
  rpc DeleteUser (DeleteUserRequest) returns (DeleteUserResponse) {}
42
41
 
@@ -141,13 +140,13 @@ message GetUserRequest {
141
140
  string ref = 1;
142
141
  }
143
142
 
144
- message GetUserResponse {
143
+ message User {
145
144
  string ref = 1;
146
145
  string email = 2;
147
146
  string name = 3;
148
147
  string avatar = 4;
149
- int64 created_at = 5;
150
- int64 updated_at = 6;
148
+ int32 created_at = 5;
149
+ int32 updated_at = 6;
151
150
  }
152
151
 
153
152
  message UpdateUserRequest {
@@ -173,8 +172,8 @@ message Workspace {
173
172
  string ref = 1;
174
173
  string name = 2;
175
174
  string owner_ref = 3;
176
- int64 created_at = 4;
177
- int64 updated_at = 5;
175
+ int32 created_at = 4;
176
+ int32 updated_at = 5;
178
177
  }
179
178
 
180
179
  // ApiKey Resources
@@ -223,8 +222,8 @@ message ApiKey {
223
222
  string access_key_id = 2;
224
223
  string role = 3;
225
224
  int32 expires_at = 4;
226
- int64 created_at = 5;
227
- int64 updated_at = 6;
225
+ int32 created_at = 5;
226
+ int32 updated_at = 6;
228
227
  }
229
228
 
230
229
  // Token Exchange Resources
@@ -20,8 +20,6 @@ syntax = "proto3";
20
20
 
21
21
  package fonoster.numbers.v1beta2;
22
22
 
23
- import "trunks.proto";
24
-
25
23
  // The Numbers service definition
26
24
  service Numbers {
27
25
  // Create a new Number
@@ -38,6 +36,12 @@ service Numbers {
38
36
 
39
37
  // The message for the Number resource
40
38
  message Number {
39
+ message Trunk {
40
+ // The unique identifier of the Trunk
41
+ string ref = 1;
42
+ // The name of the Trunk
43
+ string name = 2;
44
+ }
41
45
  // The unique identifier of the Number
42
46
  string ref = 1;
43
47
  // The name of the Number
@@ -51,11 +55,11 @@ message Number {
51
55
  // The country_iso_code of the Number
52
56
  string country_iso_code = 6;
53
57
  // The date when the Number was created
54
- int64 created_at = 7;
58
+ int32 created_at = 7;
55
59
  // The date when the Number was last updated
56
- int64 updated_at = 8;
60
+ int32 updated_at = 8;
57
61
  // The trunk this number is associated with
58
- fonoster.trunks.v1beta2.Trunk trunk = 9;
62
+ Trunk trunk = 9;
59
63
  // This dictates how the number will handle incoming calls
60
64
  oneof ingress_handler {
61
65
  // The call will be forwarded to this agent
@@ -43,9 +43,9 @@ message Secret {
43
43
  // The actual secret
44
44
  string secret = 3;
45
45
  // The time the Secret was created
46
- int64 created_at = 4;
46
+ int32 created_at = 4;
47
47
  // The time the Secret was updated
48
- int64 updated_at = 5;
48
+ int32 updated_at = 5;
49
49
  }
50
50
 
51
51
  // The request message for the Secrets.CreateSecret method
@@ -20,9 +20,6 @@ syntax = "proto3";
20
20
 
21
21
  package fonoster.trunks.v1beta2;
22
22
 
23
- import "acls.proto";
24
- import "credentials.proto";
25
-
26
23
  // The Trunks service definition
27
24
  service Trunks {
28
25
  // Create a new Trunk
@@ -57,6 +54,24 @@ message TrunkURI {
57
54
 
58
55
  // The message for the Trunk resource
59
56
  message Trunk {
57
+ message Acl {
58
+ // The reference of the AccessControlList
59
+ string ref = 1;
60
+ // The name of the AccessControlList
61
+ string name = 2;
62
+ // The list of IP addresses that are allowed to access the Trunks
63
+ repeated string allow = 3;
64
+ // The list of IP addresses that are denied to access the Trunks
65
+ repeated string deny = 4;
66
+ }
67
+ message Credentials {
68
+ // The reference of the Credentials
69
+ string ref = 1;
70
+ // The name of the Credentials
71
+ string name = 2;
72
+ // The username of the Credentials
73
+ string username = 3;
74
+ }
60
75
  // The reference of the Trunk
61
76
  string ref = 1;
62
77
  // The name of the Trunk
@@ -66,15 +81,15 @@ message Trunk {
66
81
  // The URI for inbound requests
67
82
  string inbound_uri = 4;
68
83
  // The date and time when the Trunk was created
69
- int64 created_at = 5;
84
+ int32 created_at = 5;
70
85
  // The date and time when the Trunk was last updated
71
- int64 updated_at = 6;
86
+ int32 updated_at = 6;
72
87
  // The list of IP addresses that are allowed to access the Trunks
73
- fonoster.acls.v1beta2.Acl access_control_list = 7;
88
+ Acl access_control_list = 7;
74
89
  // The credentials to use when authenticating with the Trunk
75
- fonoster.credentials.v1beta2.Credentials inbound_credentials = 8;
90
+ Credentials inbound_credentials = 8;
76
91
  // The credentials to use when authenticating with the Provider
77
- fonoster.credentials.v1beta2.Credentials outbound_credentials = 9;
92
+ Credentials outbound_credentials = 9;
78
93
  // The list of URIs for the Trunk
79
94
  repeated TrunkURI uris = 10;
80
95
  }
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.datesMapper = void 0;
4
4
  const datesMapper = (item) => {
5
5
  var _a, _b;
6
- return (Object.assign(Object.assign({}, item), { createdAt: (_a = item === null || item === void 0 ? void 0 : item.createdAt) === null || _a === void 0 ? void 0 : _a.getTime(), updatedAt: (_b = item === null || item === void 0 ? void 0 : item.updatedAt) === null || _b === void 0 ? void 0 : _b.getTime() }));
6
+ return (Object.assign(Object.assign({}, item), { createdAt: ((_a = item === null || item === void 0 ? void 0 : item.createdAt) === null || _a === void 0 ? void 0 : _a.getTime()) / 1000, updatedAt: ((_b = item === null || item === void 0 ? void 0 : item.updatedAt) === null || _b === void 0 ? void 0 : _b.getTime()) / 1000 }));
7
7
  };
8
8
  exports.datesMapper = datesMapper;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonoster/common",
3
- "version": "0.6.2-alpha.0",
3
+ "version": "0.6.6",
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.6.1",
21
+ "@fonoster/logger": "^0.6.2",
22
22
  "@grpc/grpc-js": "~1.10.6",
23
23
  "@grpc/proto-loader": "^0.7.12",
24
24
  "grpc-health-check": "^2.0.2",
@@ -42,5 +42,5 @@
42
42
  "devDependencies": {
43
43
  "@types/nodemailer": "^6.4.14"
44
44
  },
45
- "gitHead": "16ee05408eb3680afbf5ad2d313e889e89e3ef6d"
45
+ "gitHead": "258137711c4897a4bda49de369db1722da17ec3f"
46
46
  }