@routr/common 2.0.8-alpha.3 → 2.0.8-alpha.30
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 +43 -4
- package/dist/auth.js +63 -1
- package/dist/connect/api/client.d.ts +3 -0
- package/dist/connect/api/client.js +158 -0
- package/dist/connect/api/index.d.ts +2 -0
- package/dist/connect/api/index.js +36 -0
- package/dist/connect/api/types.d.ts +51 -0
- package/dist/connect/api/types.js +2 -0
- package/dist/connect/assertions.d.ts +37 -0
- package/dist/connect/assertions.js +112 -0
- package/dist/connect/client.d.ts +8 -0
- package/dist/connect/{grpc_client.js → client.js} +44 -6
- package/dist/connect/config.d.ts +113 -0
- package/dist/connect/config.js +2 -0
- package/dist/connect/connect_error.d.ts +21 -0
- package/dist/connect/connect_error.js +44 -0
- package/dist/connect/index.d.ts +7 -2
- package/dist/connect/index.js +7 -2
- package/dist/connect/mappers/acl.d.ts +3 -0
- package/dist/connect/mappers/acl.js +19 -0
- package/dist/connect/mappers/agent.d.ts +3 -0
- package/dist/connect/mappers/agent.js +42 -0
- package/dist/connect/mappers/assertions.d.ts +3 -0
- package/dist/connect/mappers/assertions.js +43 -0
- package/dist/connect/mappers/credentials.d.ts +3 -0
- package/dist/connect/mappers/credentials.js +18 -0
- package/dist/connect/mappers/domain.d.ts +3 -0
- package/dist/connect/mappers/domain.js +19 -0
- package/dist/connect/mappers/index.d.ts +7 -0
- package/dist/connect/mappers/index.js +41 -0
- package/dist/connect/mappers/number.d.ts +3 -0
- package/dist/connect/mappers/number.js +26 -0
- package/dist/connect/mappers/peer.d.ts +3 -0
- package/dist/connect/mappers/peer.js +26 -0
- package/dist/connect/mappers/trunk.d.ts +3 -0
- package/dist/connect/mappers/trunk.js +34 -0
- package/dist/connect/protos/acl.proto +112 -0
- package/dist/connect/protos/agents.proto +153 -0
- package/dist/connect/protos/credentials.proto +114 -0
- package/dist/connect/protos/domains.proto +146 -0
- package/dist/connect/protos/numbers.proto +166 -0
- package/dist/connect/protos/peers.proto +174 -0
- package/dist/connect/protos/trunks.proto +178 -0
- package/dist/connect/schemas/acl.d.ts +66 -0
- package/dist/connect/schemas/acl.js +85 -0
- package/dist/connect/schemas/agent.d.ts +61 -0
- package/dist/connect/schemas/agent.js +80 -0
- package/dist/connect/schemas/crendentials.d.ts +59 -0
- package/dist/connect/schemas/crendentials.js +78 -0
- package/dist/connect/schemas/domain.d.ts +72 -0
- package/dist/connect/schemas/domain.js +91 -0
- package/dist/connect/schemas/index.d.ts +1 -0
- package/dist/connect/schemas/index.js +35 -0
- package/dist/connect/schemas/number.d.ts +81 -0
- package/dist/connect/schemas/number.js +100 -0
- package/dist/connect/schemas/peer.d.ts +84 -0
- package/dist/connect/schemas/peer.js +103 -0
- package/dist/connect/schemas/trunk.d.ts +125 -0
- package/dist/connect/schemas/trunk.js +157 -0
- package/dist/connect/schemas/validators.d.ts +2 -0
- package/dist/connect/schemas/validators.js +43 -0
- package/dist/connect/types.d.ts +91 -23
- package/dist/connect/types.js +17 -37
- package/dist/connect/validations.d.ts +43 -0
- package/dist/connect/validations.js +272 -0
- package/dist/envs.d.ts +2 -0
- package/dist/envs.js +23 -0
- package/dist/errors.d.ts +35 -1
- package/dist/errors.js +51 -5
- package/dist/helper.d.ts +17 -4
- package/dist/helper.js +81 -7
- package/dist/index.d.ts +6 -4
- package/dist/index.js +6 -7
- package/dist/protos/common.proto +0 -2
- package/dist/protos/location.proto +22 -7
- package/dist/protos/processor.proto +2 -1
- package/dist/protos/sipmessage.proto +7 -0
- package/dist/service.d.ts +2 -2
- package/dist/service.js +1 -1
- package/dist/types.d.ts +118 -88
- package/dist/types.js +77 -69
- package/package.json +13 -5
- package/dist/connect/data_api.d.ts +0 -11
- package/dist/connect/data_api.js +0 -91
- package/dist/connect/grpc_client.d.ts +0 -1
- package/dist/protos/resources.proto +0 -108
|
@@ -25,16 +25,17 @@ option java_package = "io.routr.location";
|
|
|
25
25
|
option java_outer_classname = "LocationProto";
|
|
26
26
|
option objc_class_prefix = "LC";
|
|
27
27
|
|
|
28
|
+
import "google/protobuf/empty.proto";
|
|
28
29
|
import "common.proto";
|
|
29
30
|
import "processor.proto";
|
|
30
31
|
|
|
31
32
|
service Location {
|
|
32
|
-
rpc AddRoute (AddRouteRequest) returns (
|
|
33
|
+
rpc AddRoute (AddRouteRequest) returns (.google.protobuf.Empty) {}
|
|
33
34
|
rpc FindRoutes (FindRoutesRequest) returns (FindRoutesResponse) {}
|
|
34
|
-
rpc RemoveRoutes (RemoveRoutesRequest) returns (
|
|
35
|
+
rpc RemoveRoutes (RemoveRoutesRequest) returns (.google.protobuf.Empty) {}
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
// A binding
|
|
38
|
+
// A binding created by an actual endpoint (Softphone, PBX, Conference System, etc.)
|
|
38
39
|
message Route {
|
|
39
40
|
string user = 1;
|
|
40
41
|
string host = 2;
|
|
@@ -44,11 +45,13 @@ message Route {
|
|
|
44
45
|
int32 expires = 6;
|
|
45
46
|
int32 session_count = 7;
|
|
46
47
|
string edge_port_ref = 8;
|
|
47
|
-
fonoster.routr.processor.v2draft1.NetInterface
|
|
48
|
+
repeated fonoster.routr.processor.v2draft1.NetInterface listening_points = 9;
|
|
49
|
+
repeated string localnets = 10;
|
|
50
|
+
repeated string external_addrs = 11;
|
|
48
51
|
// During route creation, an endpoint can request to add labels than can later be
|
|
49
52
|
// used as selectors. For example, a Softphone can add a label `priority=1` to indicate
|
|
50
53
|
// that it is the prefered endpoint for the given AOR.
|
|
51
|
-
map<string, string> labels =
|
|
54
|
+
map<string, string> labels = 12;
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
message AddRouteRequest {
|
|
@@ -58,8 +61,20 @@ message AddRouteRequest {
|
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
message FindRoutesRequest {
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
message Backend {
|
|
65
|
+
enum Algoritm {
|
|
66
|
+
ROUND_ROBIN = 0;
|
|
67
|
+
LEAST_SESSIONS = 1;
|
|
68
|
+
}
|
|
69
|
+
string ref = 1;
|
|
70
|
+
bool with_session_affinity = 2;
|
|
71
|
+
Algoritm algorithm = 3;
|
|
72
|
+
}
|
|
73
|
+
string call_id = 1;
|
|
74
|
+
string aor = 2;
|
|
75
|
+
string session_affinity_ref = 3;
|
|
76
|
+
Backend backend = 4;
|
|
77
|
+
map<string, string> labels = 5;
|
|
63
78
|
}
|
|
64
79
|
|
|
65
80
|
message FindRoutesResponse {
|
|
@@ -130,6 +130,11 @@ message Via {
|
|
|
130
130
|
int32 port = 2;
|
|
131
131
|
string branch = 3;
|
|
132
132
|
string transport = 4;
|
|
133
|
+
bool r_port_flag = 5;
|
|
134
|
+
int32 r_port = 6;
|
|
135
|
+
string received = 7;
|
|
136
|
+
string m_addr = 8;
|
|
137
|
+
int32 ttl = 9;
|
|
133
138
|
}
|
|
134
139
|
|
|
135
140
|
message SipURI {
|
|
@@ -207,4 +212,6 @@ message SIPMessage {
|
|
|
207
212
|
repeated Via via = 13;
|
|
208
213
|
repeated Route route = 14;
|
|
209
214
|
repeated RecordRoute record_route = 15;
|
|
215
|
+
string reason_phrase = 16;
|
|
216
|
+
string body = 17;
|
|
210
217
|
}
|
package/dist/service.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ObjectProto, ServiceInfo } from "./types";
|
|
2
|
-
import {
|
|
2
|
+
import { ServiceDefinitionNotFoundError } from "./errors";
|
|
3
3
|
export declare const PROCESSOR_OBJECT_PROTO: unknown;
|
|
4
4
|
export declare const LOCATION_OBJECT_PROTO: unknown;
|
|
5
5
|
/**
|
|
@@ -8,7 +8,7 @@ export declare const LOCATION_OBJECT_PROTO: unknown;
|
|
|
8
8
|
* @param {ObjectProt} objectProto - The object proto to load.
|
|
9
9
|
* @return {A} The proto definition.
|
|
10
10
|
*/
|
|
11
|
-
export declare function getObjectProto<A>(objectProto: ObjectProto): A |
|
|
11
|
+
export declare function getObjectProto<A>(objectProto: ObjectProto): A | ServiceDefinitionNotFoundError;
|
|
12
12
|
/**
|
|
13
13
|
* Creates a new service using the given service definition.
|
|
14
14
|
*
|
package/dist/service.js
CHANGED
|
@@ -62,7 +62,7 @@ function getObjectProto(objectProto) {
|
|
|
62
62
|
const objProto = (_b = (_a = grpc.loadPackageDefinition(definitions)) === null || _a === void 0 ? void 0 : _a.fonoster) === null || _b === void 0 ? void 0 : _b.routr[objectProto.name];
|
|
63
63
|
return (objProto === null || objProto === void 0 ? void 0 : objProto[objectProto.version])
|
|
64
64
|
? objProto[objectProto.version]
|
|
65
|
-
: new errors_1.
|
|
65
|
+
: new errors_1.ServiceDefinitionNotFoundError(objectProto.name, objectProto.version);
|
|
66
66
|
}
|
|
67
67
|
exports.getObjectProto = getObjectProto;
|
|
68
68
|
/**
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import * as grpc from "@grpc/grpc-js";
|
|
1
2
|
import { ServiceDefinition } from "@grpc/proto-loader";
|
|
3
|
+
import { JsonArray, JsonValue, Struct } from "pb-util/build";
|
|
4
|
+
export type JsonData = Record<string, string | number | boolean | JsonValue | JsonArray | Struct>;
|
|
2
5
|
export declare enum Method {
|
|
3
6
|
UNKNOWN = "UNKNOWN",
|
|
4
7
|
REGISTER = "REGISTER",
|
|
@@ -13,23 +16,33 @@ export declare enum Method {
|
|
|
13
16
|
OPTIONS = "OPTIONS"
|
|
14
17
|
}
|
|
15
18
|
export declare enum Transport {
|
|
16
|
-
TCP = "
|
|
17
|
-
UDP = "
|
|
18
|
-
TLS = "
|
|
19
|
-
SCTP = "
|
|
20
|
-
WS = "
|
|
21
|
-
WSS = "
|
|
19
|
+
TCP = "TCP",
|
|
20
|
+
UDP = "UDP",
|
|
21
|
+
TLS = "TLS",
|
|
22
|
+
SCTP = "SCTP",
|
|
23
|
+
WS = "WS",
|
|
24
|
+
WSS = "WSS"
|
|
25
|
+
}
|
|
26
|
+
export declare enum LoadBalancingAlgorithm {
|
|
27
|
+
UNSPECIFIED = "UNSPECIFIED",
|
|
28
|
+
ROUND_ROBIN = "ROUND_ROBIN",
|
|
29
|
+
LEAST_SESSIONS = "LEAST_SESSIONS"
|
|
22
30
|
}
|
|
23
31
|
export declare enum ExtraHeader {
|
|
24
32
|
REQUEST_URI = "X-Request-Uri",
|
|
25
33
|
GATEWAY_AUTH = "X-Gateway-Auth",
|
|
26
34
|
EDGEPORT_REF = "X-Edgeport-Ref",
|
|
27
|
-
SESSION_COUNT = "X-Session-Count"
|
|
35
|
+
SESSION_COUNT = "X-Session-Count",
|
|
36
|
+
DOD_NUMBER = "X-DOD-Number",
|
|
37
|
+
DOD_PRIVACY = "X-DOD-Privacy"
|
|
28
38
|
}
|
|
29
39
|
export declare enum Privacy {
|
|
30
|
-
NONE = "
|
|
31
|
-
PRIVATE = "
|
|
40
|
+
NONE = "NONE",
|
|
41
|
+
PRIVATE = "ID"
|
|
32
42
|
}
|
|
43
|
+
export type AuthorizationAlgorithm = "MD5";
|
|
44
|
+
export type AuthorizationScheme = "Digest";
|
|
45
|
+
export type Qop = "auth" | "auth-int" | "";
|
|
33
46
|
export interface NetInterface {
|
|
34
47
|
host: string;
|
|
35
48
|
port: number;
|
|
@@ -57,6 +70,7 @@ export interface ProcessorConfig {
|
|
|
57
70
|
export interface MiddlewareConfig {
|
|
58
71
|
ref: string;
|
|
59
72
|
addr: string;
|
|
73
|
+
postProcessor: boolean;
|
|
60
74
|
}
|
|
61
75
|
export interface ServiceInfo {
|
|
62
76
|
name: string;
|
|
@@ -72,32 +86,32 @@ export interface ObjectProto {
|
|
|
72
86
|
export interface AuthChallengeRequest {
|
|
73
87
|
realm: string;
|
|
74
88
|
domain: string;
|
|
75
|
-
scheme: string;
|
|
76
|
-
nonce: string;
|
|
77
|
-
algorithm: string;
|
|
78
|
-
qop: string;
|
|
79
89
|
opaque: string;
|
|
80
90
|
stale: boolean;
|
|
91
|
+
nonce: string;
|
|
92
|
+
scheme: AuthorizationScheme;
|
|
93
|
+
algorithm: AuthorizationAlgorithm;
|
|
94
|
+
qop: Qop;
|
|
81
95
|
}
|
|
82
96
|
export interface AuthChallengeResponse {
|
|
83
97
|
realm: string;
|
|
84
98
|
domain: string;
|
|
85
|
-
scheme: string;
|
|
86
99
|
cNonce: string;
|
|
100
|
+
nonce: string;
|
|
87
101
|
nonceCount: number;
|
|
88
102
|
response: string;
|
|
89
103
|
username: string;
|
|
90
|
-
nonce: string;
|
|
91
|
-
algorithm: string;
|
|
92
|
-
qop: string;
|
|
93
104
|
opaque: string;
|
|
94
105
|
stale: boolean;
|
|
95
106
|
uri: string;
|
|
96
|
-
method:
|
|
107
|
+
method: Method;
|
|
108
|
+
scheme: AuthorizationScheme;
|
|
109
|
+
algorithm: AuthorizationAlgorithm;
|
|
110
|
+
qop: Qop;
|
|
97
111
|
}
|
|
98
112
|
export declare enum HeaderModifierAction {
|
|
99
|
-
ADD =
|
|
100
|
-
REMOVE =
|
|
113
|
+
ADD = 0,
|
|
114
|
+
REMOVE = 1
|
|
101
115
|
}
|
|
102
116
|
export interface HeaderModifier {
|
|
103
117
|
name: string;
|
|
@@ -110,72 +124,81 @@ export interface Route {
|
|
|
110
124
|
port: number;
|
|
111
125
|
transport: Transport;
|
|
112
126
|
registeredOn?: number;
|
|
127
|
+
/**
|
|
128
|
+
* Number of active sessions. This is used to determine if a route is
|
|
129
|
+
* overloaded and for load balancing.
|
|
130
|
+
*
|
|
131
|
+
* This value is reported by the endpoint during the REGISTER request,
|
|
132
|
+
* using the X-Session-Count header.
|
|
133
|
+
*/
|
|
113
134
|
sessionCount?: number;
|
|
114
135
|
expires?: number;
|
|
115
136
|
edgePortRef: string;
|
|
116
|
-
|
|
137
|
+
listeningPoints: NetInterface[];
|
|
138
|
+
localnets: string[];
|
|
139
|
+
externalAddrs: string[];
|
|
117
140
|
labels?: Map<string, string>;
|
|
118
141
|
headers?: HeaderModifier[];
|
|
119
142
|
}
|
|
120
143
|
export declare enum ResponseType {
|
|
121
|
-
UNKNOWN =
|
|
122
|
-
TRYING =
|
|
123
|
-
RINGING =
|
|
124
|
-
CALL_IS_BEING_FORWARDED =
|
|
125
|
-
QUEUED =
|
|
126
|
-
SESSION_PROGRESS =
|
|
127
|
-
SUCCESS =
|
|
128
|
-
OK =
|
|
129
|
-
ACCEPTED =
|
|
130
|
-
REDIRECTION =
|
|
131
|
-
MULTIPLE_CHOICES =
|
|
132
|
-
MOVED_PERMANENTLY =
|
|
133
|
-
MOVED_TEMPORARILY =
|
|
134
|
-
USE_PROXY =
|
|
135
|
-
ALTERNATIVE_SERVICE =
|
|
136
|
-
CLIENT_ERROR =
|
|
137
|
-
BAD_REQUEST =
|
|
138
|
-
UNAUTHORIZED =
|
|
139
|
-
PAYMENT_REQUIRED =
|
|
140
|
-
FORBIDDEN =
|
|
141
|
-
NOT_FOUND =
|
|
142
|
-
METHOD_NOT_ALLOWED =
|
|
143
|
-
NOT_ACCEPTABLE =
|
|
144
|
-
PROXY_AUTHENTICATION_REQUIRED =
|
|
145
|
-
REQUEST_TIMEOUT =
|
|
146
|
-
GONE =
|
|
147
|
-
REQUEST_ENTITY_TOO_LARGE =
|
|
148
|
-
REQUEST_URI_TOO_LONG =
|
|
149
|
-
UNSUPPORTED_MEDIA_TYPE =
|
|
150
|
-
UNSUPPORTED_URI_SCHEME =
|
|
151
|
-
BAD_EXTENSION =
|
|
152
|
-
EXTENSION_REQUIRED =
|
|
153
|
-
INTERVAL_TOO_BRIEF =
|
|
154
|
-
TEMPORARILY_UNAVAILABLE =
|
|
155
|
-
CALL_OR_TRANSACTION_DOES_NOT_EXIST =
|
|
156
|
-
LOOP_DETECTED =
|
|
157
|
-
TOO_MANY_HOPS =
|
|
158
|
-
ADDRESS_INCOMPLETE =
|
|
159
|
-
AMBIGUOUS =
|
|
160
|
-
BUSY_HERE =
|
|
161
|
-
REQUEST_TERMINATED =
|
|
162
|
-
NOT_ACCEPTABLE_HERE =
|
|
163
|
-
BAD_EVENT =
|
|
164
|
-
REQUEST_PENDING =
|
|
165
|
-
UNDECIPHERABLE =
|
|
166
|
-
SERVER_ERROR =
|
|
167
|
-
SERVER_INTERNAL_ERROR =
|
|
168
|
-
NOT_IMPLEMENTED =
|
|
169
|
-
BAD_GATEWAY =
|
|
170
|
-
SERVICE_UNAVAILABLE =
|
|
171
|
-
SERVER_TIMEOUT =
|
|
172
|
-
VERSION_NOT_SUPPORTED =
|
|
173
|
-
MESSAGE_TOO_LARGE =
|
|
174
|
-
GLOBAL_ERROR =
|
|
175
|
-
BUSY_EVERYWHERE =
|
|
176
|
-
DECLINE =
|
|
177
|
-
DOES_NOT_EXIST_ANYWHERE =
|
|
178
|
-
SESSION_NOT_ACCEPTABLE =
|
|
144
|
+
UNKNOWN = "UNKNOWN",
|
|
145
|
+
TRYING = "TRYING",
|
|
146
|
+
RINGING = "RINGING",
|
|
147
|
+
CALL_IS_BEING_FORWARDED = "CALL_IS_BEING_FORWARDED",
|
|
148
|
+
QUEUED = "QUEUED",
|
|
149
|
+
SESSION_PROGRESS = "SESSION_PROGRESS",
|
|
150
|
+
SUCCESS = "SUCCESS",
|
|
151
|
+
OK = "OK",
|
|
152
|
+
ACCEPTED = "ACCEPTED",
|
|
153
|
+
REDIRECTION = "REDIRECTION",
|
|
154
|
+
MULTIPLE_CHOICES = "MULTIPLE_CHOICES",
|
|
155
|
+
MOVED_PERMANENTLY = "MOVED_PERMANENTLY",
|
|
156
|
+
MOVED_TEMPORARILY = "MOVED_TEMPORARILY",
|
|
157
|
+
USE_PROXY = "USE_PROXY",
|
|
158
|
+
ALTERNATIVE_SERVICE = "ALTERNATIVE_SERVICE",
|
|
159
|
+
CLIENT_ERROR = "CLIENT_ERROR",
|
|
160
|
+
BAD_REQUEST = "BAD_REQUEST",
|
|
161
|
+
UNAUTHORIZED = "UNAUTHORIZED",
|
|
162
|
+
PAYMENT_REQUIRED = "PAYMENT_REQUIRED",
|
|
163
|
+
FORBIDDEN = "FORBIDDEN",
|
|
164
|
+
NOT_FOUND = "NOT_FOUND",
|
|
165
|
+
METHOD_NOT_ALLOWED = "METHOD_NOT_ALLOWED",
|
|
166
|
+
NOT_ACCEPTABLE = "NOT_ACCEPTABLE",
|
|
167
|
+
PROXY_AUTHENTICATION_REQUIRED = "PROXY_AUTHENTICATION_REQUIRED",
|
|
168
|
+
REQUEST_TIMEOUT = "REQUEST_TIMEOUT",
|
|
169
|
+
GONE = "GONE",
|
|
170
|
+
REQUEST_ENTITY_TOO_LARGE = "REQUEST_ENTITY_TOO_LARGE",
|
|
171
|
+
REQUEST_URI_TOO_LONG = "REQUEST_URI_TOO_LONG",
|
|
172
|
+
UNSUPPORTED_MEDIA_TYPE = "UNSUPPORTED_MEDIA_TYPE",
|
|
173
|
+
UNSUPPORTED_URI_SCHEME = "UNSUPPORTED_URI_SCHEME",
|
|
174
|
+
BAD_EXTENSION = "BAD_EXTENSION",
|
|
175
|
+
EXTENSION_REQUIRED = "EXTENSION_REQUIRED",
|
|
176
|
+
INTERVAL_TOO_BRIEF = "INTERVAL_TOO_BRIEF",
|
|
177
|
+
TEMPORARILY_UNAVAILABLE = "TEMPORARILY_UNAVAILABLE",
|
|
178
|
+
CALL_OR_TRANSACTION_DOES_NOT_EXIST = "CALL_OR_TRANSACTION_DOES_NOT_EXIST",
|
|
179
|
+
LOOP_DETECTED = "LOOP_DETECTED",
|
|
180
|
+
TOO_MANY_HOPS = "TOO_MANY_HOPS",
|
|
181
|
+
ADDRESS_INCOMPLETE = "ADDRESS_INCOMPLETE",
|
|
182
|
+
AMBIGUOUS = "AMBIGUOUS",
|
|
183
|
+
BUSY_HERE = "BUSY_HERE",
|
|
184
|
+
REQUEST_TERMINATED = "REQUEST_TERMINATED",
|
|
185
|
+
NOT_ACCEPTABLE_HERE = "NOT_ACCEPTABLE_HERE",
|
|
186
|
+
BAD_EVENT = "BAD_EVENT",
|
|
187
|
+
REQUEST_PENDING = "REQUEST_PENDING",
|
|
188
|
+
UNDECIPHERABLE = "UNDECIPHERABLE",
|
|
189
|
+
SERVER_ERROR = "SERVER_ERROR",
|
|
190
|
+
SERVER_INTERNAL_ERROR = "SERVER_INTERNAL_ERROR",
|
|
191
|
+
NOT_IMPLEMENTED = "NOT_IMPLEMENTED",
|
|
192
|
+
BAD_GATEWAY = "BAD_GATEWAY",
|
|
193
|
+
SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
|
|
194
|
+
SERVER_TIMEOUT = "SERVER_TIMEOUT",
|
|
195
|
+
VERSION_NOT_SUPPORTED = "VERSION_NOT_SUPPORTED",
|
|
196
|
+
MESSAGE_TOO_LARGE = "MESSAGE_TOO_LARGE",
|
|
197
|
+
GLOBAL_ERROR = "GLOBAL_ERROR",
|
|
198
|
+
BUSY_EVERYWHERE = "BUSY_EVERYWHERE",
|
|
199
|
+
DECLINE = "DECLINE",
|
|
200
|
+
DOES_NOT_EXIST_ANYWHERE = "DOES_NOT_EXIST_ANYWHERE",
|
|
201
|
+
SESSION_NOT_ACCEPTABLE = "SESSION_NOT_ACCEPTABLE"
|
|
179
202
|
}
|
|
180
203
|
export interface WWWAuthenticate {
|
|
181
204
|
realm: string;
|
|
@@ -189,17 +212,17 @@ export interface WWWAuthenticate {
|
|
|
189
212
|
}
|
|
190
213
|
export interface Authorization {
|
|
191
214
|
realm: string;
|
|
192
|
-
scheme:
|
|
215
|
+
scheme: AuthorizationScheme;
|
|
193
216
|
nonce: string;
|
|
194
217
|
cNonce: string;
|
|
195
218
|
nonceCount: number;
|
|
196
219
|
response: string;
|
|
197
220
|
username: string;
|
|
198
221
|
uri: string;
|
|
199
|
-
algorithm:
|
|
200
|
-
qop:
|
|
222
|
+
algorithm: AuthorizationAlgorithm;
|
|
223
|
+
qop: Qop;
|
|
201
224
|
opaque: string;
|
|
202
|
-
method?:
|
|
225
|
+
method?: Method;
|
|
203
226
|
}
|
|
204
227
|
export interface CallID {
|
|
205
228
|
callId: string;
|
|
@@ -216,12 +239,17 @@ export interface Via {
|
|
|
216
239
|
port: number;
|
|
217
240
|
branch?: string;
|
|
218
241
|
transport: Transport;
|
|
242
|
+
received?: string;
|
|
243
|
+
rPortFlag?: boolean;
|
|
244
|
+
rPort?: number;
|
|
245
|
+
ttl?: number;
|
|
246
|
+
mAddr?: string;
|
|
219
247
|
}
|
|
220
248
|
export interface SipURI {
|
|
221
249
|
user?: string;
|
|
222
250
|
host: string;
|
|
223
251
|
port?: number;
|
|
224
|
-
transportParam:
|
|
252
|
+
transportParam: Transport;
|
|
225
253
|
mAddrParam?: string;
|
|
226
254
|
userParam?: string;
|
|
227
255
|
ttlParam?: number;
|
|
@@ -281,10 +309,11 @@ export interface SIPMessage {
|
|
|
281
309
|
wwwAuthenticate?: WWWAuthenticate;
|
|
282
310
|
maxForwards: MaxForwards;
|
|
283
311
|
authorization?: Authorization;
|
|
284
|
-
extensions
|
|
285
|
-
via
|
|
286
|
-
route
|
|
287
|
-
recordRoute
|
|
312
|
+
extensions: Extension[];
|
|
313
|
+
via: Via[];
|
|
314
|
+
route: RouteHeader[];
|
|
315
|
+
recordRoute: RecordRoute[];
|
|
316
|
+
body?: string;
|
|
288
317
|
}
|
|
289
318
|
export interface GrpcCallback {
|
|
290
319
|
(error: Error | {
|
|
@@ -293,4 +322,5 @@ export interface GrpcCallback {
|
|
|
293
322
|
}
|
|
294
323
|
export interface GrpcCall {
|
|
295
324
|
request: Record<string, any>;
|
|
325
|
+
metadata?: grpc.Metadata;
|
|
296
326
|
}
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MessageType = exports.ResponseType = exports.HeaderModifierAction = exports.Privacy = exports.ExtraHeader = exports.Transport = exports.Method = void 0;
|
|
3
|
+
exports.MessageType = exports.ResponseType = exports.HeaderModifierAction = exports.Privacy = exports.ExtraHeader = exports.LoadBalancingAlgorithm = exports.Transport = exports.Method = void 0;
|
|
4
4
|
var Method;
|
|
5
5
|
(function (Method) {
|
|
6
6
|
Method["UNKNOWN"] = "UNKNOWN";
|
|
@@ -17,90 +17,98 @@ var Method;
|
|
|
17
17
|
})(Method = exports.Method || (exports.Method = {}));
|
|
18
18
|
var Transport;
|
|
19
19
|
(function (Transport) {
|
|
20
|
-
Transport["TCP"] = "
|
|
21
|
-
Transport["UDP"] = "
|
|
22
|
-
Transport["TLS"] = "
|
|
23
|
-
Transport["SCTP"] = "
|
|
24
|
-
Transport["WS"] = "
|
|
25
|
-
Transport["WSS"] = "
|
|
20
|
+
Transport["TCP"] = "TCP";
|
|
21
|
+
Transport["UDP"] = "UDP";
|
|
22
|
+
Transport["TLS"] = "TLS";
|
|
23
|
+
Transport["SCTP"] = "SCTP";
|
|
24
|
+
Transport["WS"] = "WS";
|
|
25
|
+
Transport["WSS"] = "WSS";
|
|
26
26
|
})(Transport = exports.Transport || (exports.Transport = {}));
|
|
27
|
+
var LoadBalancingAlgorithm;
|
|
28
|
+
(function (LoadBalancingAlgorithm) {
|
|
29
|
+
LoadBalancingAlgorithm["UNSPECIFIED"] = "UNSPECIFIED";
|
|
30
|
+
LoadBalancingAlgorithm["ROUND_ROBIN"] = "ROUND_ROBIN";
|
|
31
|
+
LoadBalancingAlgorithm["LEAST_SESSIONS"] = "LEAST_SESSIONS";
|
|
32
|
+
})(LoadBalancingAlgorithm = exports.LoadBalancingAlgorithm || (exports.LoadBalancingAlgorithm = {}));
|
|
27
33
|
var ExtraHeader;
|
|
28
34
|
(function (ExtraHeader) {
|
|
29
35
|
ExtraHeader["REQUEST_URI"] = "X-Request-Uri";
|
|
30
36
|
ExtraHeader["GATEWAY_AUTH"] = "X-Gateway-Auth";
|
|
31
37
|
ExtraHeader["EDGEPORT_REF"] = "X-Edgeport-Ref";
|
|
32
38
|
ExtraHeader["SESSION_COUNT"] = "X-Session-Count";
|
|
39
|
+
ExtraHeader["DOD_NUMBER"] = "X-DOD-Number";
|
|
40
|
+
ExtraHeader["DOD_PRIVACY"] = "X-DOD-Privacy";
|
|
33
41
|
})(ExtraHeader = exports.ExtraHeader || (exports.ExtraHeader = {}));
|
|
34
42
|
var Privacy;
|
|
35
43
|
(function (Privacy) {
|
|
36
|
-
Privacy["NONE"] = "
|
|
37
|
-
Privacy["PRIVATE"] = "
|
|
44
|
+
Privacy["NONE"] = "NONE";
|
|
45
|
+
Privacy["PRIVATE"] = "ID";
|
|
38
46
|
})(Privacy = exports.Privacy || (exports.Privacy = {}));
|
|
39
47
|
var HeaderModifierAction;
|
|
40
48
|
(function (HeaderModifierAction) {
|
|
41
|
-
HeaderModifierAction["ADD"] = "
|
|
42
|
-
HeaderModifierAction["REMOVE"] = "
|
|
49
|
+
HeaderModifierAction[HeaderModifierAction["ADD"] = 0] = "ADD";
|
|
50
|
+
HeaderModifierAction[HeaderModifierAction["REMOVE"] = 1] = "REMOVE";
|
|
43
51
|
})(HeaderModifierAction = exports.HeaderModifierAction || (exports.HeaderModifierAction = {}));
|
|
44
52
|
var ResponseType;
|
|
45
53
|
(function (ResponseType) {
|
|
46
|
-
ResponseType[
|
|
47
|
-
ResponseType[
|
|
48
|
-
ResponseType[
|
|
49
|
-
ResponseType[
|
|
50
|
-
ResponseType[
|
|
51
|
-
ResponseType[
|
|
52
|
-
ResponseType[
|
|
53
|
-
ResponseType[
|
|
54
|
-
ResponseType[
|
|
55
|
-
ResponseType[
|
|
56
|
-
ResponseType[
|
|
57
|
-
ResponseType[
|
|
58
|
-
ResponseType[
|
|
59
|
-
ResponseType[
|
|
60
|
-
ResponseType[
|
|
61
|
-
ResponseType[
|
|
62
|
-
ResponseType[
|
|
63
|
-
ResponseType[
|
|
64
|
-
ResponseType[
|
|
65
|
-
ResponseType[
|
|
66
|
-
ResponseType[
|
|
67
|
-
ResponseType[
|
|
68
|
-
ResponseType[
|
|
69
|
-
ResponseType[
|
|
70
|
-
ResponseType[
|
|
71
|
-
ResponseType[
|
|
72
|
-
ResponseType[
|
|
73
|
-
ResponseType[
|
|
74
|
-
ResponseType[
|
|
75
|
-
ResponseType[
|
|
76
|
-
ResponseType[
|
|
77
|
-
ResponseType[
|
|
78
|
-
ResponseType[
|
|
79
|
-
ResponseType[
|
|
80
|
-
ResponseType[
|
|
81
|
-
ResponseType[
|
|
82
|
-
ResponseType[
|
|
83
|
-
ResponseType[
|
|
84
|
-
ResponseType[
|
|
85
|
-
ResponseType[
|
|
86
|
-
ResponseType[
|
|
87
|
-
ResponseType[
|
|
88
|
-
ResponseType[
|
|
89
|
-
ResponseType[
|
|
90
|
-
ResponseType[
|
|
91
|
-
ResponseType[
|
|
92
|
-
ResponseType[
|
|
93
|
-
ResponseType[
|
|
94
|
-
ResponseType[
|
|
95
|
-
ResponseType[
|
|
96
|
-
ResponseType[
|
|
97
|
-
ResponseType[
|
|
98
|
-
ResponseType[
|
|
99
|
-
ResponseType[
|
|
100
|
-
ResponseType[
|
|
101
|
-
ResponseType[
|
|
102
|
-
ResponseType[
|
|
103
|
-
ResponseType[
|
|
54
|
+
ResponseType["UNKNOWN"] = "UNKNOWN";
|
|
55
|
+
ResponseType["TRYING"] = "TRYING";
|
|
56
|
+
ResponseType["RINGING"] = "RINGING";
|
|
57
|
+
ResponseType["CALL_IS_BEING_FORWARDED"] = "CALL_IS_BEING_FORWARDED";
|
|
58
|
+
ResponseType["QUEUED"] = "QUEUED";
|
|
59
|
+
ResponseType["SESSION_PROGRESS"] = "SESSION_PROGRESS";
|
|
60
|
+
ResponseType["SUCCESS"] = "SUCCESS";
|
|
61
|
+
ResponseType["OK"] = "OK";
|
|
62
|
+
ResponseType["ACCEPTED"] = "ACCEPTED";
|
|
63
|
+
ResponseType["REDIRECTION"] = "REDIRECTION";
|
|
64
|
+
ResponseType["MULTIPLE_CHOICES"] = "MULTIPLE_CHOICES";
|
|
65
|
+
ResponseType["MOVED_PERMANENTLY"] = "MOVED_PERMANENTLY";
|
|
66
|
+
ResponseType["MOVED_TEMPORARILY"] = "MOVED_TEMPORARILY";
|
|
67
|
+
ResponseType["USE_PROXY"] = "USE_PROXY";
|
|
68
|
+
ResponseType["ALTERNATIVE_SERVICE"] = "ALTERNATIVE_SERVICE";
|
|
69
|
+
ResponseType["CLIENT_ERROR"] = "CLIENT_ERROR";
|
|
70
|
+
ResponseType["BAD_REQUEST"] = "BAD_REQUEST";
|
|
71
|
+
ResponseType["UNAUTHORIZED"] = "UNAUTHORIZED";
|
|
72
|
+
ResponseType["PAYMENT_REQUIRED"] = "PAYMENT_REQUIRED";
|
|
73
|
+
ResponseType["FORBIDDEN"] = "FORBIDDEN";
|
|
74
|
+
ResponseType["NOT_FOUND"] = "NOT_FOUND";
|
|
75
|
+
ResponseType["METHOD_NOT_ALLOWED"] = "METHOD_NOT_ALLOWED";
|
|
76
|
+
ResponseType["NOT_ACCEPTABLE"] = "NOT_ACCEPTABLE";
|
|
77
|
+
ResponseType["PROXY_AUTHENTICATION_REQUIRED"] = "PROXY_AUTHENTICATION_REQUIRED";
|
|
78
|
+
ResponseType["REQUEST_TIMEOUT"] = "REQUEST_TIMEOUT";
|
|
79
|
+
ResponseType["GONE"] = "GONE";
|
|
80
|
+
ResponseType["REQUEST_ENTITY_TOO_LARGE"] = "REQUEST_ENTITY_TOO_LARGE";
|
|
81
|
+
ResponseType["REQUEST_URI_TOO_LONG"] = "REQUEST_URI_TOO_LONG";
|
|
82
|
+
ResponseType["UNSUPPORTED_MEDIA_TYPE"] = "UNSUPPORTED_MEDIA_TYPE";
|
|
83
|
+
ResponseType["UNSUPPORTED_URI_SCHEME"] = "UNSUPPORTED_URI_SCHEME";
|
|
84
|
+
ResponseType["BAD_EXTENSION"] = "BAD_EXTENSION";
|
|
85
|
+
ResponseType["EXTENSION_REQUIRED"] = "EXTENSION_REQUIRED";
|
|
86
|
+
ResponseType["INTERVAL_TOO_BRIEF"] = "INTERVAL_TOO_BRIEF";
|
|
87
|
+
ResponseType["TEMPORARILY_UNAVAILABLE"] = "TEMPORARILY_UNAVAILABLE";
|
|
88
|
+
ResponseType["CALL_OR_TRANSACTION_DOES_NOT_EXIST"] = "CALL_OR_TRANSACTION_DOES_NOT_EXIST";
|
|
89
|
+
ResponseType["LOOP_DETECTED"] = "LOOP_DETECTED";
|
|
90
|
+
ResponseType["TOO_MANY_HOPS"] = "TOO_MANY_HOPS";
|
|
91
|
+
ResponseType["ADDRESS_INCOMPLETE"] = "ADDRESS_INCOMPLETE";
|
|
92
|
+
ResponseType["AMBIGUOUS"] = "AMBIGUOUS";
|
|
93
|
+
ResponseType["BUSY_HERE"] = "BUSY_HERE";
|
|
94
|
+
ResponseType["REQUEST_TERMINATED"] = "REQUEST_TERMINATED";
|
|
95
|
+
ResponseType["NOT_ACCEPTABLE_HERE"] = "NOT_ACCEPTABLE_HERE";
|
|
96
|
+
ResponseType["BAD_EVENT"] = "BAD_EVENT";
|
|
97
|
+
ResponseType["REQUEST_PENDING"] = "REQUEST_PENDING";
|
|
98
|
+
ResponseType["UNDECIPHERABLE"] = "UNDECIPHERABLE";
|
|
99
|
+
ResponseType["SERVER_ERROR"] = "SERVER_ERROR";
|
|
100
|
+
ResponseType["SERVER_INTERNAL_ERROR"] = "SERVER_INTERNAL_ERROR";
|
|
101
|
+
ResponseType["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED";
|
|
102
|
+
ResponseType["BAD_GATEWAY"] = "BAD_GATEWAY";
|
|
103
|
+
ResponseType["SERVICE_UNAVAILABLE"] = "SERVICE_UNAVAILABLE";
|
|
104
|
+
ResponseType["SERVER_TIMEOUT"] = "SERVER_TIMEOUT";
|
|
105
|
+
ResponseType["VERSION_NOT_SUPPORTED"] = "VERSION_NOT_SUPPORTED";
|
|
106
|
+
ResponseType["MESSAGE_TOO_LARGE"] = "MESSAGE_TOO_LARGE";
|
|
107
|
+
ResponseType["GLOBAL_ERROR"] = "GLOBAL_ERROR";
|
|
108
|
+
ResponseType["BUSY_EVERYWHERE"] = "BUSY_EVERYWHERE";
|
|
109
|
+
ResponseType["DECLINE"] = "DECLINE";
|
|
110
|
+
ResponseType["DOES_NOT_EXIST_ANYWHERE"] = "DOES_NOT_EXIST_ANYWHERE";
|
|
111
|
+
ResponseType["SESSION_NOT_ACCEPTABLE"] = "SESSION_NOT_ACCEPTABLE";
|
|
104
112
|
})(ResponseType = exports.ResponseType || (exports.ResponseType = {}));
|
|
105
113
|
var MessageType;
|
|
106
114
|
(function (MessageType) {
|
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.30",
|
|
4
4
|
"description": "Common package",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/routr#readme",
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"prebuild": "rimraf ./dist tsconfig.tsbuildinfo",
|
|
12
12
|
"build": "tsc -b tsconfig.json",
|
|
13
|
-
"postbuild": "
|
|
13
|
+
"postbuild": "cp -a src/protos dist/protos && cp -a src/connect/protos dist/connect/protos"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@fonoster/logger": "0.3.18",
|
|
17
|
-
"@grpc/grpc-js": "^1.
|
|
17
|
+
"@grpc/grpc-js": "^1.8.4",
|
|
18
18
|
"@grpc/proto-loader": "^0.6.9",
|
|
19
19
|
"@opentelemetry/api": "^1.0.4",
|
|
20
20
|
"@opentelemetry/exporter-jaeger": "^1.0.4",
|
|
@@ -24,9 +24,14 @@
|
|
|
24
24
|
"@opentelemetry/sdk-trace-base": "^1.0.4",
|
|
25
25
|
"@opentelemetry/sdk-trace-node": "^1.0.4",
|
|
26
26
|
"@opentelemetry/semantic-conventions": "^1.0.4",
|
|
27
|
+
"ajv": "^6.12.6",
|
|
27
28
|
"fp-ts": "^2.11.8",
|
|
28
29
|
"ip-utils": "^2.4.0",
|
|
29
|
-
"
|
|
30
|
+
"js-yaml": "^4.1.0",
|
|
31
|
+
"pb-util": "^1.0.3",
|
|
32
|
+
"phone": "^3.1.32",
|
|
33
|
+
"toml": "^3.0.0",
|
|
34
|
+
"validator": "^13.7.0"
|
|
30
35
|
},
|
|
31
36
|
"directories": {
|
|
32
37
|
"src": "src",
|
|
@@ -45,5 +50,8 @@
|
|
|
45
50
|
"bugs": {
|
|
46
51
|
"url": "https://github.com/fonoster/routr/issues"
|
|
47
52
|
},
|
|
48
|
-
"
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/js-yaml": "^4.0.5"
|
|
55
|
+
},
|
|
56
|
+
"gitHead": "6466c3e5262850c85dc6d15eec3e25f915a37667"
|
|
49
57
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FindParameters, Resource } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Data API for the Connect module.
|
|
4
|
-
*
|
|
5
|
-
* @param {string} apiAddr - The address of the API server
|
|
6
|
-
* @return {Promise<Resource[]>}
|
|
7
|
-
*/
|
|
8
|
-
export declare function dataAPI(apiAddr: string): {
|
|
9
|
-
get: (ref: string) => Promise<Resource>;
|
|
10
|
-
findBy: (request: FindParameters) => Promise<Resource[]>;
|
|
11
|
-
};
|