@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
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
$id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
type: string;
|
|
6
|
+
properties: {
|
|
7
|
+
apiVersion: {
|
|
8
|
+
enum: string[];
|
|
9
|
+
};
|
|
10
|
+
kind: {
|
|
11
|
+
enum: string[];
|
|
12
|
+
};
|
|
13
|
+
ref: {
|
|
14
|
+
description: string;
|
|
15
|
+
type: string;
|
|
16
|
+
};
|
|
17
|
+
metadata: {
|
|
18
|
+
description: string;
|
|
19
|
+
type: string;
|
|
20
|
+
properties: {
|
|
21
|
+
name: {
|
|
22
|
+
description: string;
|
|
23
|
+
type: string;
|
|
24
|
+
maxLength: number;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
required: string[];
|
|
28
|
+
};
|
|
29
|
+
spec: {
|
|
30
|
+
description: string;
|
|
31
|
+
type: string;
|
|
32
|
+
properties: {
|
|
33
|
+
inbound: {
|
|
34
|
+
description: string;
|
|
35
|
+
type: string;
|
|
36
|
+
properties: {
|
|
37
|
+
uri: {
|
|
38
|
+
description: string;
|
|
39
|
+
type: string;
|
|
40
|
+
maxLength: number;
|
|
41
|
+
};
|
|
42
|
+
accessControlListRef: {
|
|
43
|
+
description: string;
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
credentialsRef: {
|
|
47
|
+
description: string;
|
|
48
|
+
type: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
required: string[];
|
|
52
|
+
};
|
|
53
|
+
outbound: {
|
|
54
|
+
description: string;
|
|
55
|
+
type: string;
|
|
56
|
+
properties: {
|
|
57
|
+
sendRegister: {
|
|
58
|
+
description: string;
|
|
59
|
+
type: string;
|
|
60
|
+
};
|
|
61
|
+
credentialsRef: {
|
|
62
|
+
description: string;
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
uris: {
|
|
66
|
+
description: string;
|
|
67
|
+
type: string;
|
|
68
|
+
items: {
|
|
69
|
+
type: string;
|
|
70
|
+
properties: {
|
|
71
|
+
uri: {
|
|
72
|
+
description: string;
|
|
73
|
+
type: string;
|
|
74
|
+
properties: {
|
|
75
|
+
host: {
|
|
76
|
+
description: string;
|
|
77
|
+
type: string;
|
|
78
|
+
maxLength: number;
|
|
79
|
+
};
|
|
80
|
+
port: {
|
|
81
|
+
description: string;
|
|
82
|
+
type: string;
|
|
83
|
+
maximum: number;
|
|
84
|
+
};
|
|
85
|
+
transport: {
|
|
86
|
+
description: string;
|
|
87
|
+
enum: string[];
|
|
88
|
+
};
|
|
89
|
+
user: {
|
|
90
|
+
description: string;
|
|
91
|
+
type: string;
|
|
92
|
+
maxLength: number;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
required: string[];
|
|
96
|
+
};
|
|
97
|
+
weight: {
|
|
98
|
+
description: string;
|
|
99
|
+
type: string;
|
|
100
|
+
minimum: number;
|
|
101
|
+
maximum: number;
|
|
102
|
+
};
|
|
103
|
+
priority: {
|
|
104
|
+
description: string;
|
|
105
|
+
type: string;
|
|
106
|
+
minimum: number;
|
|
107
|
+
maximum: number;
|
|
108
|
+
};
|
|
109
|
+
enabled: {
|
|
110
|
+
description: string;
|
|
111
|
+
type: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
required: string[];
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
required: string[];
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
required: string[];
|
|
124
|
+
};
|
|
125
|
+
export default _default;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
|
|
5
|
+
* http://github.com/fonoster
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Routr.
|
|
8
|
+
*
|
|
9
|
+
* Licensed under the MIT License (the "License");
|
|
10
|
+
* you may not use this file except in compliance with
|
|
11
|
+
* the License. You may obtain a copy of the License at
|
|
12
|
+
*
|
|
13
|
+
* https://opensource.org/licenses/MIT
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
* See the License for the specific language governing permissions and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
exports.default = {
|
|
22
|
+
$id: "https://json-schema.org/draft/2020-12/schema",
|
|
23
|
+
title: "Agent validation schema",
|
|
24
|
+
description: "The spec defined for Peer validation",
|
|
25
|
+
type: "object",
|
|
26
|
+
properties: {
|
|
27
|
+
apiVersion: {
|
|
28
|
+
enum: ["v2draft1", "v2"]
|
|
29
|
+
},
|
|
30
|
+
kind: {
|
|
31
|
+
enum: ["Trunk", "trunk"]
|
|
32
|
+
},
|
|
33
|
+
ref: {
|
|
34
|
+
description: "Reference to the resource",
|
|
35
|
+
type: "string"
|
|
36
|
+
},
|
|
37
|
+
metadata: {
|
|
38
|
+
description: "Resource metadata",
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: {
|
|
41
|
+
name: {
|
|
42
|
+
description: "Resource's friendly name",
|
|
43
|
+
type: "string",
|
|
44
|
+
maxLength: 60
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
required: ["name"]
|
|
48
|
+
},
|
|
49
|
+
spec: {
|
|
50
|
+
description: "Operations spec for an Trunk",
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: {
|
|
53
|
+
inbound: {
|
|
54
|
+
description: "Inbound configuration",
|
|
55
|
+
type: "object",
|
|
56
|
+
properties: {
|
|
57
|
+
uri: {
|
|
58
|
+
description: "URI of the inbound endpoint",
|
|
59
|
+
type: "string",
|
|
60
|
+
maxLength: 255
|
|
61
|
+
},
|
|
62
|
+
accessControlListRef: {
|
|
63
|
+
description: "Reference to the ACL to be used for inbound traffic",
|
|
64
|
+
type: "string"
|
|
65
|
+
},
|
|
66
|
+
credentialsRef: {
|
|
67
|
+
description: "Reference to the credentials to be used for inbound traffic",
|
|
68
|
+
type: "string"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
required: ["uri"]
|
|
72
|
+
},
|
|
73
|
+
outbound: {
|
|
74
|
+
description: "Outbound configuration",
|
|
75
|
+
type: "object",
|
|
76
|
+
properties: {
|
|
77
|
+
sendRegister: {
|
|
78
|
+
description: "Whether to send register messages",
|
|
79
|
+
type: "boolean"
|
|
80
|
+
},
|
|
81
|
+
credentialsRef: {
|
|
82
|
+
description: "Reference to the credentials to be used for outbound traffic",
|
|
83
|
+
type: "string"
|
|
84
|
+
},
|
|
85
|
+
uris: {
|
|
86
|
+
description: "List of URIs to be used for outbound traffic",
|
|
87
|
+
type: "array",
|
|
88
|
+
items: {
|
|
89
|
+
type: "object",
|
|
90
|
+
properties: {
|
|
91
|
+
uri: {
|
|
92
|
+
description: "URI to be used for outbound traffic",
|
|
93
|
+
type: "object",
|
|
94
|
+
properties: {
|
|
95
|
+
host: {
|
|
96
|
+
description: "Hostname of the URI",
|
|
97
|
+
type: "string",
|
|
98
|
+
maxLength: 255
|
|
99
|
+
},
|
|
100
|
+
port: {
|
|
101
|
+
description: "Port of the URI",
|
|
102
|
+
type: "integer",
|
|
103
|
+
maximum: 65535
|
|
104
|
+
},
|
|
105
|
+
transport: {
|
|
106
|
+
description: "Transport of the URI",
|
|
107
|
+
enum: [
|
|
108
|
+
"TCP",
|
|
109
|
+
"SCTP",
|
|
110
|
+
"UDP",
|
|
111
|
+
"TLS",
|
|
112
|
+
"WS",
|
|
113
|
+
"WSS",
|
|
114
|
+
"tcp",
|
|
115
|
+
"sctp",
|
|
116
|
+
"udp",
|
|
117
|
+
"tls",
|
|
118
|
+
"ws",
|
|
119
|
+
"wss"
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
user: {
|
|
123
|
+
description: "Username of the URI",
|
|
124
|
+
type: "string",
|
|
125
|
+
maxLength: 60
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
required: ["host", "port", "transport"]
|
|
129
|
+
},
|
|
130
|
+
weight: {
|
|
131
|
+
description: "Weight of the URI",
|
|
132
|
+
type: "integer",
|
|
133
|
+
minimum: 1,
|
|
134
|
+
maximum: 65535
|
|
135
|
+
},
|
|
136
|
+
priority: {
|
|
137
|
+
description: "Priority of the URI",
|
|
138
|
+
type: "integer",
|
|
139
|
+
minimum: 0,
|
|
140
|
+
maximum: 65535
|
|
141
|
+
},
|
|
142
|
+
enabled: {
|
|
143
|
+
description: "Whether the URI is enabled",
|
|
144
|
+
type: "boolean"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
required: ["uri"]
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
required: ["uris"]
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
required: ["apiVersion", "kind", "ref", "metadata", "spec"]
|
|
157
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.schemaValidators = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* Copyright (C) 2022 by Fonoster Inc (https://fonoster.com)
|
|
9
|
+
* http://github.com/fonoster
|
|
10
|
+
*
|
|
11
|
+
* This file is part of Routr.
|
|
12
|
+
*
|
|
13
|
+
* Licensed under the MIT License (the "License");
|
|
14
|
+
* you may not use this file except in compliance with
|
|
15
|
+
* the License. You may obtain a copy of the License at
|
|
16
|
+
*
|
|
17
|
+
* https://opensource.org/licenses/MIT
|
|
18
|
+
*
|
|
19
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
+
* See the License for the specific language governing permissions and
|
|
23
|
+
* limitations under the License.
|
|
24
|
+
*/
|
|
25
|
+
const types_1 = require("../types");
|
|
26
|
+
const ajv_1 = __importDefault(require("ajv"));
|
|
27
|
+
const acl_1 = __importDefault(require("./acl"));
|
|
28
|
+
const agent_1 = __importDefault(require("./agent"));
|
|
29
|
+
const crendentials_1 = __importDefault(require("./crendentials"));
|
|
30
|
+
const domain_1 = __importDefault(require("./domain"));
|
|
31
|
+
const number_1 = __importDefault(require("./number"));
|
|
32
|
+
const peer_1 = __importDefault(require("./peer"));
|
|
33
|
+
const trunk_1 = __importDefault(require("./trunk"));
|
|
34
|
+
const validator = (schema) => new ajv_1.default().compile(schema);
|
|
35
|
+
const schemaValidators = new Map();
|
|
36
|
+
exports.schemaValidators = schemaValidators;
|
|
37
|
+
schemaValidators.set(types_1.Kind.ACL, validator(acl_1.default));
|
|
38
|
+
schemaValidators.set(types_1.Kind.AGENT, validator(agent_1.default));
|
|
39
|
+
schemaValidators.set(types_1.Kind.CREDENTIALS, validator(crendentials_1.default));
|
|
40
|
+
schemaValidators.set(types_1.Kind.DOMAIN, validator(domain_1.default));
|
|
41
|
+
schemaValidators.set(types_1.Kind.NUMBER, validator(number_1.default));
|
|
42
|
+
schemaValidators.set(types_1.Kind.PEER, validator(peer_1.default));
|
|
43
|
+
schemaValidators.set(types_1.Kind.TRUNK, validator(trunk_1.default));
|
package/dist/connect/types.d.ts
CHANGED
|
@@ -1,35 +1,103 @@
|
|
|
1
|
-
|
|
1
|
+
import { JsonObject } from "pb-util/build";
|
|
2
|
+
import { LoadBalancingAlgorithm, Privacy, Transport } from "../types";
|
|
3
|
+
export declare enum Kind {
|
|
2
4
|
AGENT = "agent",
|
|
3
5
|
PEER = "peer",
|
|
4
6
|
NUMBER = "number",
|
|
5
7
|
TRUNK = "trunk",
|
|
6
8
|
DOMAIN = "domain",
|
|
7
9
|
UNKNOWN = "unknown",
|
|
8
|
-
|
|
10
|
+
CREDENTIALS = "credentials",
|
|
11
|
+
ACL = "accesscontrollist"
|
|
9
12
|
}
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
FIND_NUMBER_BY_TELURL = "find_number_by_telurl",
|
|
15
|
-
FIND_TRUNKS_WITH_SEND_REGISTER = "find_trunks_with_send_register"
|
|
13
|
+
export type KindWithoutUnknown = Exclude<Kind, Kind.UNKNOWN>;
|
|
14
|
+
export declare enum APIVersion {
|
|
15
|
+
V2DRAFT1 = "v2draft1",
|
|
16
|
+
V2 = "v2"
|
|
16
17
|
}
|
|
17
|
-
export interface
|
|
18
|
-
kind: KIND;
|
|
19
|
-
criteria: FindCriteria;
|
|
20
|
-
parameters: Record<string, string>;
|
|
21
|
-
}
|
|
22
|
-
export interface DataAPI {
|
|
23
|
-
get: (ref: string) => Promise<Resource>;
|
|
24
|
-
findBy: (request: FindParameters) => Promise<Resource[]>;
|
|
25
|
-
}
|
|
26
|
-
export interface Resource {
|
|
18
|
+
export interface BaseConnectModel {
|
|
27
19
|
apiVersion: string;
|
|
28
|
-
kind: string;
|
|
29
20
|
ref: string;
|
|
30
|
-
|
|
21
|
+
name: string;
|
|
22
|
+
createdAt?: number;
|
|
23
|
+
updatedAt?: number;
|
|
24
|
+
extended?: JsonObject;
|
|
25
|
+
}
|
|
26
|
+
export interface AccessControlList extends BaseConnectModel {
|
|
27
|
+
allow: string[];
|
|
28
|
+
deny: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface Domain extends BaseConnectModel {
|
|
31
|
+
domainUri: string;
|
|
32
|
+
accessControlListRef?: string;
|
|
33
|
+
accessControlList?: AccessControlList;
|
|
34
|
+
egressPolicies?: EgressPolicy[];
|
|
35
|
+
}
|
|
36
|
+
export interface EgressPolicy {
|
|
37
|
+
numberRef: string;
|
|
38
|
+
number?: INumber;
|
|
39
|
+
rule: string;
|
|
40
|
+
}
|
|
41
|
+
export interface Agent extends BaseConnectModel {
|
|
42
|
+
username: string;
|
|
43
|
+
privacy: Privacy;
|
|
44
|
+
enabled: boolean;
|
|
45
|
+
domainRef?: string;
|
|
46
|
+
domain?: Domain;
|
|
47
|
+
credentialsRef?: string;
|
|
48
|
+
credentials?: Credentials;
|
|
49
|
+
}
|
|
50
|
+
export interface Credentials extends BaseConnectModel {
|
|
51
|
+
username: string;
|
|
52
|
+
password: string;
|
|
53
|
+
}
|
|
54
|
+
export interface INumber extends BaseConnectModel {
|
|
55
|
+
telUrl: string;
|
|
56
|
+
aorLink: string;
|
|
57
|
+
city: string;
|
|
58
|
+
country: string;
|
|
59
|
+
countryIsoCode: string;
|
|
60
|
+
sessionAffinityHeader: string;
|
|
61
|
+
extraHeaders: {
|
|
31
62
|
name: string;
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
|
|
63
|
+
value: string;
|
|
64
|
+
}[];
|
|
65
|
+
trunkRef?: string;
|
|
66
|
+
trunk?: Trunk;
|
|
67
|
+
}
|
|
68
|
+
export interface Trunk extends BaseConnectModel {
|
|
69
|
+
sendRegister: boolean;
|
|
70
|
+
inboundUri: string;
|
|
71
|
+
accessControlListRef?: string;
|
|
72
|
+
accessControlList?: AccessControlList;
|
|
73
|
+
inboundCredentialsRef?: string;
|
|
74
|
+
inboundCredentials?: Credentials;
|
|
75
|
+
outboundCredentialsRef?: string;
|
|
76
|
+
outboundCredentials?: Credentials;
|
|
77
|
+
uris?: TrunkURI[];
|
|
78
|
+
}
|
|
79
|
+
export interface TrunkURI {
|
|
80
|
+
ref?: string;
|
|
81
|
+
trunkRef?: string;
|
|
82
|
+
host: string;
|
|
83
|
+
port: number;
|
|
84
|
+
transport: Transport;
|
|
85
|
+
user: string;
|
|
86
|
+
weight: number;
|
|
87
|
+
priority: number;
|
|
88
|
+
enabled: boolean;
|
|
89
|
+
}
|
|
90
|
+
export interface Peer extends BaseConnectModel {
|
|
91
|
+
username: string;
|
|
92
|
+
aor: string;
|
|
93
|
+
contactAddr: string;
|
|
94
|
+
enabled: boolean;
|
|
95
|
+
accessControlListRef?: string;
|
|
96
|
+
accessControlList?: AccessControlList;
|
|
97
|
+
credentialsRef?: string;
|
|
98
|
+
credentials?: Credentials;
|
|
99
|
+
balancingAlgorithm?: LoadBalancingAlgorithm;
|
|
100
|
+
withSessionAffinity?: boolean;
|
|
35
101
|
}
|
|
102
|
+
export type ConnectModel = Agent | Peer | INumber | Trunk | Domain | Credentials | AccessControlList;
|
|
103
|
+
export type RoutableResourceUnion = Agent | Peer | INumber;
|
package/dist/connect/types.js
CHANGED
|
@@ -1,39 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* limitations under the License.
|
|
21
|
-
*/
|
|
22
|
-
var KIND;
|
|
23
|
-
(function (KIND) {
|
|
24
|
-
KIND["AGENT"] = "agent";
|
|
25
|
-
KIND["PEER"] = "peer";
|
|
26
|
-
KIND["NUMBER"] = "number";
|
|
27
|
-
KIND["TRUNK"] = "trunk";
|
|
28
|
-
KIND["DOMAIN"] = "domain";
|
|
29
|
-
KIND["UNKNOWN"] = "unknown";
|
|
30
|
-
KIND["CREDENTIAL"] = "credential";
|
|
31
|
-
})(KIND = exports.KIND || (exports.KIND = {}));
|
|
32
|
-
var FindCriteria;
|
|
33
|
-
(function (FindCriteria) {
|
|
34
|
-
FindCriteria["FIND_AGENT_BY_USERNAME"] = "find_agent_by_username";
|
|
35
|
-
FindCriteria["FIND_CREDENTIAL_BY_REFERENCE"] = "find_credential_by_reference";
|
|
36
|
-
FindCriteria["FIND_DOMAIN_BY_DOMAINURI"] = "find_domain_by_domainuri";
|
|
37
|
-
FindCriteria["FIND_NUMBER_BY_TELURL"] = "find_number_by_telurl";
|
|
38
|
-
FindCriteria["FIND_TRUNKS_WITH_SEND_REGISTER"] = "find_trunks_with_send_register";
|
|
39
|
-
})(FindCriteria = exports.FindCriteria || (exports.FindCriteria = {}));
|
|
3
|
+
exports.APIVersion = exports.Kind = void 0;
|
|
4
|
+
var Kind;
|
|
5
|
+
(function (Kind) {
|
|
6
|
+
Kind["AGENT"] = "agent";
|
|
7
|
+
Kind["PEER"] = "peer";
|
|
8
|
+
Kind["NUMBER"] = "number";
|
|
9
|
+
Kind["TRUNK"] = "trunk";
|
|
10
|
+
Kind["DOMAIN"] = "domain";
|
|
11
|
+
Kind["UNKNOWN"] = "unknown";
|
|
12
|
+
Kind["CREDENTIALS"] = "credentials";
|
|
13
|
+
Kind["ACL"] = "accesscontrollist";
|
|
14
|
+
})(Kind = exports.Kind || (exports.Kind = {}));
|
|
15
|
+
var APIVersion;
|
|
16
|
+
(function (APIVersion) {
|
|
17
|
+
APIVersion["V2DRAFT1"] = "v2draft1";
|
|
18
|
+
APIVersion["V2"] = "v2";
|
|
19
|
+
})(APIVersion = exports.APIVersion || (exports.APIVersion = {}));
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BadRequestError } from "../errors";
|
|
2
|
+
import { LoadBalancingAlgorithm } from "../types";
|
|
3
|
+
export declare const hasReference: (ref: string) => true | BadRequestError;
|
|
4
|
+
export declare const hasName: (name: string) => true | BadRequestError;
|
|
5
|
+
export declare const isValidName: (name: string) => true | BadRequestError;
|
|
6
|
+
export declare const hasUsername: (username: string) => true | BadRequestError;
|
|
7
|
+
export declare const isValidUsername: (username: string) => true | BadRequestError;
|
|
8
|
+
export declare const hasPassword: (password: string) => true | BadRequestError;
|
|
9
|
+
export declare const hasDomainUri: (domainUri: string) => true | BadRequestError;
|
|
10
|
+
export declare const isValidDomainUri: (domainUri: string) => true | BadRequestError;
|
|
11
|
+
export declare const hasTelUrl: (telUrl: string) => true | BadRequestError;
|
|
12
|
+
export declare const isValidSessionAffinityHeader: (sessionAffinityHeader: string) => true | BadRequestError;
|
|
13
|
+
export declare const isValidHeader: (header: string) => true | BadRequestError;
|
|
14
|
+
export declare const hasValidHeaders: (headers: {
|
|
15
|
+
name: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}[]) => true | BadRequestError;
|
|
18
|
+
export declare const hasAOR: (aor: string) => true | BadRequestError;
|
|
19
|
+
export declare const isValidAOR: (aor: string) => true | BadRequestError;
|
|
20
|
+
export declare const hasAORLink: (aorLink: string) => true | BadRequestError;
|
|
21
|
+
export declare const isValidAORLink: (aorLink: string) => true | BadRequestError;
|
|
22
|
+
export declare const hasCity: (city: string) => true | BadRequestError;
|
|
23
|
+
export declare const hasCountry: (country: string) => true | BadRequestError;
|
|
24
|
+
export declare const hasCountryISOCode: (countryIsoCode: string) => true | BadRequestError;
|
|
25
|
+
export declare const hasACLRules: (acl: {
|
|
26
|
+
deny: string[];
|
|
27
|
+
allow: string[];
|
|
28
|
+
}) => true | BadRequestError;
|
|
29
|
+
export declare const isValidACLRule: (rules: string[]) => true | BadRequestError;
|
|
30
|
+
export declare const hasValidACLRules: (acl: {
|
|
31
|
+
deny: string[];
|
|
32
|
+
allow: string[];
|
|
33
|
+
}) => true | BadRequestError;
|
|
34
|
+
export declare const hasInboundUri: (inboundUri: string) => true | BadRequestError;
|
|
35
|
+
export declare const isValidInboundUri: (inboundUri: string) => true | BadRequestError;
|
|
36
|
+
export declare const isValidBalancingAlgorithm: (aor: string, algorithm: LoadBalancingAlgorithm) => BadRequestError;
|
|
37
|
+
export declare const isValidPort: (port: string) => BadRequestError;
|
|
38
|
+
export declare const hasHost: (host: string) => true | BadRequestError;
|
|
39
|
+
export declare const isValidHost: (host: string) => true | BadRequestError;
|
|
40
|
+
export declare const isValidContactAddress: (contactAddress: string) => BadRequestError;
|
|
41
|
+
export declare const isValidPriority: (priority: string) => BadRequestError;
|
|
42
|
+
export declare const isValidWeight: (weight: string) => BadRequestError;
|
|
43
|
+
export declare const isValidE164: (e164Number: string, countryISOCode: string, validateMobilePrefix?: boolean) => BadRequestError;
|