@routr/common 2.0.8-alpha.41 → 2.0.8-alpha.43
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/dist/auth.d.ts +9 -6
- package/dist/auth.js +13 -10
- package/dist/connect/client.js +6 -6
- package/dist/connect/protos/acl.proto +1 -1
- package/dist/connect/protos/agents.proto +3 -3
- package/dist/connect/protos/credentials.proto +1 -1
- package/dist/connect/protos/domains.proto +3 -3
- package/dist/connect/protos/numbers.proto +2 -2
- package/dist/connect/protos/peers.proto +3 -3
- package/dist/connect/protos/trunks.proto +4 -4
- package/dist/connect/schemas/acl.js +1 -1
- package/dist/connect/schemas/agent.js +1 -1
- package/dist/connect/schemas/crendentials.js +1 -1
- package/dist/connect/schemas/domain.js +1 -1
- package/dist/connect/schemas/number.js +1 -1
- package/dist/connect/schemas/peer.js +1 -1
- package/dist/connect/schemas/trunk.js +1 -1
- package/dist/connect/types.d.ts +1 -1
- package/dist/connect/types.js +1 -1
- package/dist/protos/common.proto +1 -1
- package/dist/protos/location.proto +3 -3
- package/dist/protos/processor.proto +4 -4
- package/dist/protos/requester.proto +5 -5
- package/dist/protos/sipmessage.proto +1 -1
- package/dist/service.js +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +2 -2
package/dist/auth.d.ts
CHANGED
|
@@ -24,9 +24,6 @@ export declare const createUnauthorizedResponse: (realm: string, params?: {
|
|
|
24
24
|
qop: string;
|
|
25
25
|
algorithm: string;
|
|
26
26
|
}) => {
|
|
27
|
-
metadata: {
|
|
28
|
-
accessKeyId: string;
|
|
29
|
-
};
|
|
30
27
|
message: {
|
|
31
28
|
responseType: ResponseType;
|
|
32
29
|
reasonPhrase: string;
|
|
@@ -41,18 +38,24 @@ export declare const createUnauthorizedResponse: (realm: string, params?: {
|
|
|
41
38
|
};
|
|
42
39
|
};
|
|
43
40
|
};
|
|
44
|
-
export declare const createUnauthorizedResponseWithoutChallenge: () => {
|
|
41
|
+
export declare const createUnauthorizedResponseWithoutChallenge: (metadata?: Record<string, string>) => {
|
|
42
|
+
metadata: Record<string, string>;
|
|
45
43
|
message: {
|
|
46
44
|
responseType: ResponseType;
|
|
45
|
+
reasonPhrase: string;
|
|
47
46
|
};
|
|
48
47
|
};
|
|
49
|
-
export declare const createServerInternalErrorResponse: () => {
|
|
48
|
+
export declare const createServerInternalErrorResponse: (metadata?: Record<string, string>) => {
|
|
49
|
+
metadata: Record<string, string>;
|
|
50
50
|
message: {
|
|
51
51
|
responseType: ResponseType;
|
|
52
|
+
reasonPhrase: string;
|
|
52
53
|
};
|
|
53
54
|
};
|
|
54
|
-
export declare const createForbideenResponse: () => {
|
|
55
|
+
export declare const createForbideenResponse: (metadata?: Record<string, string>) => {
|
|
56
|
+
metadata: Record<string, string>;
|
|
55
57
|
message: {
|
|
56
58
|
responseType: ResponseType;
|
|
59
|
+
reasonPhrase: string;
|
|
57
60
|
};
|
|
58
61
|
};
|
package/dist/auth.js
CHANGED
|
@@ -58,12 +58,9 @@ const getCredentials = (username, users) => users.find((user) => user.username =
|
|
|
58
58
|
exports.getCredentials = getCredentials;
|
|
59
59
|
const createUnauthorizedResponse = (realm, params = { qop: "auth", algorithm: DEFAULT_ALGORITHM }) => {
|
|
60
60
|
return {
|
|
61
|
-
metadata: {
|
|
62
|
-
accessKeyId: "xxxxxxxxx"
|
|
63
|
-
},
|
|
64
61
|
message: {
|
|
65
62
|
responseType: types_1.ResponseType.UNAUTHORIZED,
|
|
66
|
-
reasonPhrase: "
|
|
63
|
+
reasonPhrase: "Unauthorized",
|
|
67
64
|
wwwAuthenticate: {
|
|
68
65
|
scheme: "Digest",
|
|
69
66
|
realm: realm,
|
|
@@ -77,26 +74,32 @@ const createUnauthorizedResponse = (realm, params = { qop: "auth", algorithm: DE
|
|
|
77
74
|
};
|
|
78
75
|
};
|
|
79
76
|
exports.createUnauthorizedResponse = createUnauthorizedResponse;
|
|
80
|
-
const createUnauthorizedResponseWithoutChallenge = () => {
|
|
77
|
+
const createUnauthorizedResponseWithoutChallenge = (metadata) => {
|
|
81
78
|
return {
|
|
79
|
+
metadata,
|
|
82
80
|
message: {
|
|
83
|
-
responseType: types_1.ResponseType.UNAUTHORIZED
|
|
81
|
+
responseType: types_1.ResponseType.UNAUTHORIZED,
|
|
82
|
+
reasonPhrase: "Unauthorized"
|
|
84
83
|
}
|
|
85
84
|
};
|
|
86
85
|
};
|
|
87
86
|
exports.createUnauthorizedResponseWithoutChallenge = createUnauthorizedResponseWithoutChallenge;
|
|
88
|
-
const createServerInternalErrorResponse = () => {
|
|
87
|
+
const createServerInternalErrorResponse = (metadata) => {
|
|
89
88
|
return {
|
|
89
|
+
metadata,
|
|
90
90
|
message: {
|
|
91
|
-
responseType: types_1.ResponseType.SERVER_INTERNAL_ERROR
|
|
91
|
+
responseType: types_1.ResponseType.SERVER_INTERNAL_ERROR,
|
|
92
|
+
reasonPhrase: "Server Internal Error"
|
|
92
93
|
}
|
|
93
94
|
};
|
|
94
95
|
};
|
|
95
96
|
exports.createServerInternalErrorResponse = createServerInternalErrorResponse;
|
|
96
|
-
const createForbideenResponse = () => {
|
|
97
|
+
const createForbideenResponse = (metadata) => {
|
|
97
98
|
return {
|
|
99
|
+
metadata,
|
|
98
100
|
message: {
|
|
99
|
-
responseType: types_1.ResponseType.FORBIDDEN
|
|
101
|
+
responseType: types_1.ResponseType.FORBIDDEN,
|
|
102
|
+
reasonPhrase: "Forbidden"
|
|
100
103
|
}
|
|
101
104
|
};
|
|
102
105
|
};
|
package/dist/connect/client.js
CHANGED
|
@@ -70,11 +70,11 @@ function createConnectClient(options) {
|
|
|
70
70
|
const base = descriptor.fonoster.routr.connect;
|
|
71
71
|
switch (options.kind) {
|
|
72
72
|
case types_1.Kind.ACL:
|
|
73
|
-
return new base.acl.
|
|
73
|
+
return new base.acl.v2beta1.ACLService(options.apiAddr, options.credentials);
|
|
74
74
|
case types_1.Kind.CREDENTIALS:
|
|
75
|
-
return new base.credentials.
|
|
75
|
+
return new base.credentials.v2beta1.CredentialsService(options.apiAddr, options.credentials);
|
|
76
76
|
default:
|
|
77
|
-
return new base[options.kind + "s"].
|
|
77
|
+
return new base[options.kind + "s"].v2beta1[(0, helper_1.toPascaleCase)(options.kind) + "s"](options.apiAddr, options.credentials);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
exports.createConnectClient = createConnectClient;
|
|
@@ -84,11 +84,11 @@ function createConnectService(kind) {
|
|
|
84
84
|
const base = descriptor.fonoster.routr.connect;
|
|
85
85
|
switch (kind) {
|
|
86
86
|
case types_1.Kind.ACL:
|
|
87
|
-
return base.acl.
|
|
87
|
+
return base.acl.v2beta1.ACLService.service;
|
|
88
88
|
case types_1.Kind.CREDENTIALS:
|
|
89
|
-
return base.credentials.
|
|
89
|
+
return base.credentials.v2beta1.CredentialsService.service;
|
|
90
90
|
default:
|
|
91
|
-
return base[kind + "s"].
|
|
91
|
+
return base[kind + "s"].v2beta1[(0, helper_1.toPascaleCase)(kind) + "s"].service;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
exports.createConnectService = createConnectService;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
syntax = "proto3";
|
|
20
20
|
|
|
21
|
-
package fonoster.routr.connect.agents.
|
|
21
|
+
package fonoster.routr.connect.agents.v2beta1;
|
|
22
22
|
|
|
23
23
|
import "google/protobuf/struct.proto";
|
|
24
24
|
import "google/protobuf/empty.proto";
|
|
@@ -65,9 +65,9 @@ message Agent {
|
|
|
65
65
|
// The updated_at timestamp of the Agent
|
|
66
66
|
int32 updated_at = 8;
|
|
67
67
|
// The domain of the Agent
|
|
68
|
-
fonoster.routr.connect.domains.
|
|
68
|
+
fonoster.routr.connect.domains.v2beta1.Domain domain = 9;
|
|
69
69
|
// The credentials of the Agent
|
|
70
|
-
fonoster.routr.connect.credentials.
|
|
70
|
+
fonoster.routr.connect.credentials.v2beta1.Credentials credentials = 10;
|
|
71
71
|
// The extended attributes of the Agent
|
|
72
72
|
.google.protobuf.Struct extended = 11;
|
|
73
73
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
syntax = "proto3";
|
|
20
20
|
|
|
21
|
-
package fonoster.routr.connect.domains.
|
|
21
|
+
package fonoster.routr.connect.domains.v2beta1;
|
|
22
22
|
|
|
23
23
|
import "google/protobuf/struct.proto";
|
|
24
24
|
import "google/protobuf/empty.proto";
|
|
@@ -48,7 +48,7 @@ message EgressPolicy {
|
|
|
48
48
|
// Reference to the number to use for egress
|
|
49
49
|
string number_ref = 2;
|
|
50
50
|
// The egress Number
|
|
51
|
-
fonoster.routr.connect.numbers.
|
|
51
|
+
fonoster.routr.connect.numbers.v2beta1.Number number = 3;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
// The message for the Domain resource
|
|
@@ -66,7 +66,7 @@ message Domain {
|
|
|
66
66
|
// The date of the last update
|
|
67
67
|
int32 updated_at = 6;
|
|
68
68
|
// The list of IP addresses that are allowed to access the Domain
|
|
69
|
-
fonoster.routr.connect.acl.
|
|
69
|
+
fonoster.routr.connect.acl.v2beta1.AccessControlList access_control_list = 7;
|
|
70
70
|
// The egress_policy of the Domain
|
|
71
71
|
repeated EgressPolicy egress_policies = 8;
|
|
72
72
|
// The extended attributes of the Domain
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
syntax = "proto3";
|
|
20
20
|
|
|
21
|
-
package fonoster.routr.connect.numbers.
|
|
21
|
+
package fonoster.routr.connect.numbers.v2beta1;
|
|
22
22
|
|
|
23
23
|
import "google/protobuf/struct.proto";
|
|
24
24
|
import "google/protobuf/empty.proto";
|
|
@@ -67,7 +67,7 @@ message Number {
|
|
|
67
67
|
// The date when the Number was last updated
|
|
68
68
|
int32 updated_at = 12;
|
|
69
69
|
// The trunk this number is associated with
|
|
70
|
-
fonoster.routr.connect.trunks.
|
|
70
|
+
fonoster.routr.connect.trunks.v2beta1.Trunk trunk = 13;
|
|
71
71
|
// The extended attributes of the Number
|
|
72
72
|
.google.protobuf.Struct extended = 14;
|
|
73
73
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
syntax = "proto3";
|
|
20
20
|
|
|
21
|
-
package fonoster.routr.connect.peers.
|
|
21
|
+
package fonoster.routr.connect.peers.v2beta1;
|
|
22
22
|
|
|
23
23
|
import "google/protobuf/struct.proto";
|
|
24
24
|
import "google/protobuf/empty.proto";
|
|
@@ -76,9 +76,9 @@ message Peer {
|
|
|
76
76
|
// The date and time when the Peer was last updated
|
|
77
77
|
int32 updated_at = 11;
|
|
78
78
|
// The list of IP addresses that are allowed to access the Peer
|
|
79
|
-
fonoster.routr.connect.acl.
|
|
79
|
+
fonoster.routr.connect.acl.v2beta1.AccessControlList access_control_list = 12;
|
|
80
80
|
// The credentials of the Peer
|
|
81
|
-
fonoster.routr.connect.credentials.
|
|
81
|
+
fonoster.routr.connect.credentials.v2beta1.Credentials credentials = 13;
|
|
82
82
|
// The extended attributes of the Peer
|
|
83
83
|
.google.protobuf.Struct extended = 14;
|
|
84
84
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
syntax = "proto3";
|
|
20
20
|
|
|
21
|
-
package fonoster.routr.connect.trunks.
|
|
21
|
+
package fonoster.routr.connect.trunks.v2beta1;
|
|
22
22
|
|
|
23
23
|
import "google/protobuf/struct.proto";
|
|
24
24
|
import "google/protobuf/empty.proto";
|
|
@@ -76,11 +76,11 @@ message Trunk {
|
|
|
76
76
|
// The date and time when the Trunk was last updated
|
|
77
77
|
int32 updated_at = 7;
|
|
78
78
|
// The list of IP addresses that are allowed to access the Trunks
|
|
79
|
-
fonoster.routr.connect.acl.
|
|
79
|
+
fonoster.routr.connect.acl.v2beta1.AccessControlList access_control_list = 8;
|
|
80
80
|
// The credentials to use when authenticating with the Trunk
|
|
81
|
-
fonoster.routr.connect.credentials.
|
|
81
|
+
fonoster.routr.connect.credentials.v2beta1.Credentials inbound_credentials = 9;
|
|
82
82
|
// The credentials to use when authenticating with the Provider
|
|
83
|
-
fonoster.routr.connect.credentials.
|
|
83
|
+
fonoster.routr.connect.credentials.v2beta1.Credentials outbound_credentials = 10;
|
|
84
84
|
// The list of URIs for the Trunk
|
|
85
85
|
repeated TrunkURI uris = 11;
|
|
86
86
|
// The extended attributes of the Trunk
|
package/dist/connect/types.d.ts
CHANGED
package/dist/connect/types.js
CHANGED
|
@@ -14,6 +14,6 @@ var Kind;
|
|
|
14
14
|
})(Kind = exports.Kind || (exports.Kind = {}));
|
|
15
15
|
var APIVersion;
|
|
16
16
|
(function (APIVersion) {
|
|
17
|
-
APIVersion["
|
|
17
|
+
APIVersion["v2beta1"] = "v2beta1";
|
|
18
18
|
APIVersion["V2"] = "v2";
|
|
19
19
|
})(APIVersion = exports.APIVersion || (exports.APIVersion = {}));
|
package/dist/protos/common.proto
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
syntax = "proto3";
|
|
20
20
|
|
|
21
|
-
package fonoster.routr.location.
|
|
21
|
+
package fonoster.routr.location.v2beta1;
|
|
22
22
|
|
|
23
23
|
option java_multiple_files = true;
|
|
24
24
|
option java_package = "io.routr.location";
|
|
@@ -40,12 +40,12 @@ message Route {
|
|
|
40
40
|
string user = 1;
|
|
41
41
|
string host = 2;
|
|
42
42
|
string port = 3;
|
|
43
|
-
fonoster.routr.common.
|
|
43
|
+
fonoster.routr.common.v2beta1.Transport transport = 4;
|
|
44
44
|
int64 registered_on = 5;
|
|
45
45
|
int32 expires = 6;
|
|
46
46
|
int32 session_count = 7;
|
|
47
47
|
string edge_port_ref = 8;
|
|
48
|
-
repeated fonoster.routr.processor.
|
|
48
|
+
repeated fonoster.routr.processor.v2beta1.NetInterface listening_points = 9;
|
|
49
49
|
repeated string localnets = 10;
|
|
50
50
|
repeated string external_addrs = 11;
|
|
51
51
|
// During route creation, an endpoint can request to add labels than can later be
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
syntax = "proto3";
|
|
20
20
|
|
|
21
|
-
package fonoster.routr.processor.
|
|
21
|
+
package fonoster.routr.processor.v2beta1;
|
|
22
22
|
|
|
23
23
|
option java_multiple_files = true;
|
|
24
24
|
option java_package = "io.routr.processor";
|
|
@@ -69,7 +69,7 @@ enum Method {
|
|
|
69
69
|
message NetInterface {
|
|
70
70
|
string host = 1;
|
|
71
71
|
int32 port = 2;
|
|
72
|
-
fonoster.routr.common.
|
|
72
|
+
fonoster.routr.common.v2beta1.Transport transport = 3;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
message MessageRequest {
|
|
@@ -81,12 +81,12 @@ message MessageRequest {
|
|
|
81
81
|
repeated NetInterface listening_points = 5;
|
|
82
82
|
repeated string external_addrs = 6;
|
|
83
83
|
repeated string localnets = 7;
|
|
84
|
-
fonoster.routr.sipmessage.
|
|
84
|
+
fonoster.routr.sipmessage.v2beta1.SIPMessage message = 8;
|
|
85
85
|
map<string, string> metadata = 9;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
message MessageResponse {
|
|
89
89
|
NetInterface sender = 1;
|
|
90
|
-
fonoster.routr.sipmessage.
|
|
90
|
+
fonoster.routr.sipmessage.v2beta1.SIPMessage message = 2;
|
|
91
91
|
map<string, string> metadata = 3;
|
|
92
92
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
syntax = "proto3";
|
|
20
20
|
|
|
21
|
-
package fonoster.routr.requester.
|
|
21
|
+
package fonoster.routr.requester.v2beta1;
|
|
22
22
|
|
|
23
23
|
option java_multiple_files = true;
|
|
24
24
|
option java_package = "io.routr.requester";
|
|
@@ -37,11 +37,11 @@ service Requester {
|
|
|
37
37
|
|
|
38
38
|
message SendMessageRequest {
|
|
39
39
|
string target = 1;
|
|
40
|
-
fonoster.routr.processor.
|
|
41
|
-
fonoster.routr.common.
|
|
42
|
-
fonoster.routr.sipmessage.
|
|
40
|
+
fonoster.routr.processor.v2beta1.Method method = 2;
|
|
41
|
+
fonoster.routr.common.v2beta1.Transport transport = 3;
|
|
42
|
+
fonoster.routr.sipmessage.v2beta1.SIPMessage message = 4;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
message SendMessageResponse {
|
|
46
|
-
fonoster.routr.sipmessage.
|
|
46
|
+
fonoster.routr.sipmessage.v2beta1.SIPMessage message = 1;
|
|
47
47
|
}
|
package/dist/service.js
CHANGED
|
@@ -58,7 +58,7 @@ const loadOptions = {
|
|
|
58
58
|
oneofs: true
|
|
59
59
|
};
|
|
60
60
|
// TODO: Get version from the proto or package
|
|
61
|
-
const API_VERSION = "
|
|
61
|
+
const API_VERSION = "v2beta1";
|
|
62
62
|
// We currenly don't have a way to obtain the proto type
|
|
63
63
|
exports.PROCESSOR_OBJECT_PROTO = getObjectProto({
|
|
64
64
|
name: "processor",
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routr/common",
|
|
3
|
-
"version": "2.0.8-alpha.
|
|
3
|
+
"version": "2.0.8-alpha.43",
|
|
4
4
|
"description": "Common package",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/js-yaml": "^4.0.5"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "344a384c57bc0510c0daa65a7bbbd25b03d849b0"
|
|
59
59
|
}
|