@routr/common 2.0.8-alpha.20 → 2.0.8-alpha.21

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.
@@ -151,7 +151,7 @@ function serviceAPI(options) {
151
151
  });
152
152
  }),
153
153
  del: (ref) => new Promise((resolve, reject) => {
154
- client.get({ ref }, meta, (err) => err ? reject(fire(err, apiAddr)) : resolve());
154
+ client.delete({ ref }, meta, (err) => err ? reject(fire(err, apiAddr)) : resolve());
155
155
  })
156
156
  };
157
157
  }
@@ -0,0 +1,36 @@
1
+ import { LoadBalancingAlgorithm } from "../types";
2
+ import { TrunkURI } from "./types";
3
+ export declare const hasValidHeadersOrThrow: (headers: {
4
+ name: string;
5
+ value: string;
6
+ }[]) => void;
7
+ export declare const isValidBalancingAlgorithmOrThrow: (aor: string, algorithm: LoadBalancingAlgorithm) => void;
8
+ export declare const hasACLRulesOrThrow: (acl: {
9
+ deny: string[];
10
+ allow: string[];
11
+ }) => void;
12
+ export declare const hasValidACLRulesOrThrow: (acl: {
13
+ deny: string[];
14
+ allow: string[];
15
+ }) => void;
16
+ export declare const hasRefenceOrThrow: (ref: string) => void;
17
+ export declare const hasNameOrThrow: (name: string) => void;
18
+ export declare const isValidNameOrThrow: (name: string) => void;
19
+ export declare const hasUsernameOrThrow: (username: string) => void;
20
+ export declare const isValidUsernameOrThrow: (username: string) => void;
21
+ export declare const hasPasswordOrThrow: (password: string) => void;
22
+ export declare const hasDomainUriOrThrow: (domainUri: string) => void;
23
+ export declare const isValidDomainUriOrThrow: (domainUri: string) => void;
24
+ export declare const hasTelUrlOrThrow: (telUrl: string) => void;
25
+ export declare const isValidSessionAffinityHeaderOrThrow: (sessionAffinityHeader: string) => void;
26
+ export declare const hasCityOrThrow: (city: string) => void;
27
+ export declare const hasCountryOrThrow: (country: string) => void;
28
+ export declare const hasCountryISOCodeOrThrow: (countryIsoCode: string) => void;
29
+ export declare const hasInboundUriOrThrow: (inboundUri: string) => void;
30
+ export declare const isValidInboundUriOrThrow: (inboundUri: string) => void;
31
+ export declare const hasAOROrThrow: (aor: string) => void;
32
+ export declare const isValidAOROrThrow: (aor: string) => void;
33
+ export declare const hasAORLinkOrThrow: (aorLink: string) => void;
34
+ export declare const isValidAORLinkOrThrow: (aorLink: string) => void;
35
+ export declare const isValidContactAddressOrThrow: (contactAddress: string) => void;
36
+ export declare const hasValidOutboundUrisOrThrow: (outboundUris: TrunkURI[]) => void;
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hasValidOutboundUrisOrThrow = exports.isValidContactAddressOrThrow = exports.isValidAORLinkOrThrow = exports.hasAORLinkOrThrow = exports.isValidAOROrThrow = exports.hasAOROrThrow = exports.isValidInboundUriOrThrow = exports.hasInboundUriOrThrow = exports.hasCountryISOCodeOrThrow = exports.hasCountryOrThrow = exports.hasCityOrThrow = exports.isValidSessionAffinityHeaderOrThrow = exports.hasTelUrlOrThrow = exports.isValidDomainUriOrThrow = exports.hasDomainUriOrThrow = exports.hasPasswordOrThrow = exports.isValidUsernameOrThrow = exports.hasUsernameOrThrow = exports.isValidNameOrThrow = exports.hasNameOrThrow = exports.hasRefenceOrThrow = exports.hasValidACLRulesOrThrow = exports.hasACLRulesOrThrow = exports.isValidBalancingAlgorithmOrThrow = exports.hasValidHeadersOrThrow = void 0;
4
+ /*
5
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
6
+ * http://github.com/fonoster
7
+ *
8
+ * This file is part of Routr.
9
+ *
10
+ * Licensed under the MIT License (the "License");
11
+ * you may not use this file except in compliance with
12
+ * the License. You may obtain a copy of the License at
13
+ *
14
+ * https://opensource.org/licenses/MIT
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */
22
+ const errors_1 = require("../errors");
23
+ const validations_1 = require("./validations");
24
+ const validOrThrow = (method, value) => {
25
+ const R = method(value);
26
+ if (R instanceof errors_1.BadRequestError) {
27
+ throw R;
28
+ }
29
+ };
30
+ const hasValidHeadersOrThrow = (headers) => {
31
+ const E = (0, validations_1.hasValidHeaders)(headers);
32
+ if (E instanceof errors_1.BadRequestError) {
33
+ throw E;
34
+ }
35
+ };
36
+ exports.hasValidHeadersOrThrow = hasValidHeadersOrThrow;
37
+ const isValidBalancingAlgorithmOrThrow = (aor, algorithm) => {
38
+ const E = (0, validations_1.isValidBalancingAlgorithm)(aor, algorithm);
39
+ if (E instanceof errors_1.BadRequestError) {
40
+ throw E;
41
+ }
42
+ };
43
+ exports.isValidBalancingAlgorithmOrThrow = isValidBalancingAlgorithmOrThrow;
44
+ const hasACLRulesOrThrow = (acl) => validOrThrow(validations_1.hasACLRules, acl);
45
+ exports.hasACLRulesOrThrow = hasACLRulesOrThrow;
46
+ const hasValidACLRulesOrThrow = (acl) => validOrThrow(validations_1.hasValidACLRules, acl);
47
+ exports.hasValidACLRulesOrThrow = hasValidACLRulesOrThrow;
48
+ const hasRefenceOrThrow = (ref) => validOrThrow(validations_1.hasReference, ref);
49
+ exports.hasRefenceOrThrow = hasRefenceOrThrow;
50
+ const hasNameOrThrow = (name) => validOrThrow(validations_1.hasName, name);
51
+ exports.hasNameOrThrow = hasNameOrThrow;
52
+ const isValidNameOrThrow = (name) => validOrThrow(validations_1.isValidName, name);
53
+ exports.isValidNameOrThrow = isValidNameOrThrow;
54
+ const hasUsernameOrThrow = (username) => validOrThrow(validations_1.hasUsername, username);
55
+ exports.hasUsernameOrThrow = hasUsernameOrThrow;
56
+ const isValidUsernameOrThrow = (username) => validOrThrow(validations_1.isValidUsername, username);
57
+ exports.isValidUsernameOrThrow = isValidUsernameOrThrow;
58
+ const hasPasswordOrThrow = (password) => validOrThrow(validations_1.hasPassword, password);
59
+ exports.hasPasswordOrThrow = hasPasswordOrThrow;
60
+ const hasDomainUriOrThrow = (domainUri) => validOrThrow(validations_1.hasDomainUri, domainUri);
61
+ exports.hasDomainUriOrThrow = hasDomainUriOrThrow;
62
+ const isValidDomainUriOrThrow = (domainUri) => validOrThrow(validations_1.isValidDomainUri, domainUri);
63
+ exports.isValidDomainUriOrThrow = isValidDomainUriOrThrow;
64
+ const hasTelUrlOrThrow = (telUrl) => validOrThrow(validations_1.hasTelUrl, telUrl);
65
+ exports.hasTelUrlOrThrow = hasTelUrlOrThrow;
66
+ const isValidSessionAffinityHeaderOrThrow = (sessionAffinityHeader) => validOrThrow(validations_1.isValidSessionAffinityHeader, sessionAffinityHeader);
67
+ exports.isValidSessionAffinityHeaderOrThrow = isValidSessionAffinityHeaderOrThrow;
68
+ const hasCityOrThrow = (city) => validOrThrow(validations_1.hasCity, city);
69
+ exports.hasCityOrThrow = hasCityOrThrow;
70
+ const hasCountryOrThrow = (country) => validOrThrow(validations_1.hasCountry, country);
71
+ exports.hasCountryOrThrow = hasCountryOrThrow;
72
+ const hasCountryISOCodeOrThrow = (countryIsoCode) => validOrThrow(validations_1.hasCountryISOCode, countryIsoCode);
73
+ exports.hasCountryISOCodeOrThrow = hasCountryISOCodeOrThrow;
74
+ const hasInboundUriOrThrow = (inboundUri) => validOrThrow(validations_1.hasInboundUri, inboundUri);
75
+ exports.hasInboundUriOrThrow = hasInboundUriOrThrow;
76
+ const isValidInboundUriOrThrow = (inboundUri) => validOrThrow(validations_1.isValidInboundUri, inboundUri);
77
+ exports.isValidInboundUriOrThrow = isValidInboundUriOrThrow;
78
+ const hasAOROrThrow = (aor) => validOrThrow(validations_1.hasAOR, aor);
79
+ exports.hasAOROrThrow = hasAOROrThrow;
80
+ const isValidAOROrThrow = (aor) => validOrThrow(validations_1.isValidAOR, aor);
81
+ exports.isValidAOROrThrow = isValidAOROrThrow;
82
+ const hasAORLinkOrThrow = (aorLink) => validOrThrow(validations_1.hasAORLink, aorLink);
83
+ exports.hasAORLinkOrThrow = hasAORLinkOrThrow;
84
+ const isValidAORLinkOrThrow = (aorLink) => validOrThrow(validations_1.isValidAORLink, aorLink);
85
+ exports.isValidAORLinkOrThrow = isValidAORLinkOrThrow;
86
+ const isValidContactAddressOrThrow = (contactAddress) => validOrThrow(validations_1.isValidContactAddress, contactAddress);
87
+ exports.isValidContactAddressOrThrow = isValidContactAddressOrThrow;
88
+ const hasValidOutboundUrisOrThrow = (outboundUris) => outboundUris === null || outboundUris === void 0 ? void 0 : outboundUris.forEach((uri) => {
89
+ if ((0, validations_1.hasHost)(uri.host) instanceof errors_1.BadRequestError) {
90
+ throw (0, validations_1.hasHost)(uri.host);
91
+ }
92
+ if ((0, validations_1.isValidHost)(uri.host) instanceof errors_1.BadRequestError) {
93
+ throw (0, validations_1.isValidHost)(uri.host);
94
+ }
95
+ if ((0, validations_1.isValidPort)(uri.port + "") instanceof errors_1.BadRequestError) {
96
+ throw (0, validations_1.isValidPort)(uri.port + "");
97
+ }
98
+ if ((0, validations_1.isValidPriority)(uri.priority + "") instanceof errors_1.BadRequestError) {
99
+ throw (0, validations_1.isValidPriority)(uri.priority + "");
100
+ }
101
+ if ((0, validations_1.isValidWeight)(uri.weight + "") instanceof errors_1.BadRequestError) {
102
+ throw (0, validations_1.isValidWeight)(uri.priority + "");
103
+ }
104
+ });
105
+ exports.hasValidOutboundUrisOrThrow = hasValidOutboundUrisOrThrow;
@@ -3,3 +3,5 @@ export * from "./client";
3
3
  export * from "./types";
4
4
  export * from "./config";
5
5
  export * from "./mappers";
6
+ export * from "./assertions";
7
+ export * from "./validations";
@@ -37,3 +37,5 @@ __exportStar(require("./client"), exports);
37
37
  __exportStar(require("./types"), exports);
38
38
  __exportStar(require("./config"), exports);
39
39
  __exportStar(require("./mappers"), exports);
40
+ __exportStar(require("./assertions"), exports);
41
+ __exportStar(require("./validations"), exports);
@@ -15,7 +15,7 @@ function mapToNumber(config) {
15
15
  name: metadata.name,
16
16
  city: metadata.geoInfo.city,
17
17
  country: metadata.geoInfo.country,
18
- countryISOCode: metadata.geoInfo.countryISOCode,
18
+ countryIsoCode: metadata.geoInfo.countryISOCode,
19
19
  telUrl: location.telUrl,
20
20
  aorLink: location.aorLink,
21
21
  sessionAffinityHeader: location.sessionAffinityHeader,
@@ -9,6 +9,7 @@ function mapToPeer(config) {
9
9
  var _a, _b;
10
10
  (0, assertions_1.assertValidSchema)(config, valid);
11
11
  (0, assertions_1.assertValidAorSchema)(config);
12
+ const normalizeAlgorithm = (algorithm) => algorithm === null || algorithm === void 0 ? void 0 : algorithm.replace(/-/g, "_").toUpperCase();
12
13
  return {
13
14
  apiVersion: config.apiVersion,
14
15
  ref: config.ref,
@@ -18,7 +19,7 @@ function mapToPeer(config) {
18
19
  contactAddr: config.spec.contactAddr,
19
20
  enabled: config.spec.enabled,
20
21
  credentialsRef: config.spec.credentialsRef,
21
- balancingAlgorithm: (_a = config.spec.loadBalancing) === null || _a === void 0 ? void 0 : _a.algorithm.toUpperCase(),
22
+ balancingAlgorithm: normalizeAlgorithm((_a = config.spec.loadBalancing) === null || _a === void 0 ? void 0 : _a.algorithm),
22
23
  withSessionAffinity: (_b = config.spec.loadBalancing) === null || _b === void 0 ? void 0 : _b.withSessionAffinity
23
24
  };
24
25
  }
@@ -96,18 +96,16 @@ message UpdateAgentRequest {
96
96
  string ref = 1;
97
97
  // The name of the Agent
98
98
  string name = 2;
99
- // The username of the Agent
100
- string username = 3;
101
99
  // The privacy settings of the Agent
102
- Privacy privacy = 4;
100
+ Privacy privacy = 3;
103
101
  // The enabled status of the Agent
104
- bool enabled = 5;
102
+ bool enabled = 4;
105
103
  // Reference to the Domain of the Agent
106
- string domain_ref = 6;
104
+ string domain_ref = 5;
107
105
  // Reference to the Credentials of the Agent
108
- string credentials_ref = 7;
106
+ string credentials_ref = 6;
109
107
  // The extended attributes of the Agent
110
- .google.protobuf.Struct extended = 8;
108
+ .google.protobuf.Struct extended = 7;
111
109
  }
112
110
 
113
111
  // The request message for the Agents.Get method
@@ -93,14 +93,12 @@ message UpdateDomainRequest {
93
93
  string ref = 1;
94
94
  // The name of the Domain
95
95
  string name = 2;
96
- // The domain_uri of the Domain
97
- string domain_uri = 3;
98
96
  // Reference to the ACL to use for this Domain
99
- string access_control_list_ref = 4;
97
+ string access_control_list_ref = 3;
100
98
  // The egress_policy of the Domain
101
- repeated EgressPolicy egress_policies = 5;
99
+ repeated EgressPolicy egress_policies = 4;
102
100
  // The extended attributes of the Domain
103
- .google.protobuf.Struct extended = 6;
101
+ .google.protobuf.Struct extended = 5;
104
102
  }
105
103
 
106
104
  // The request message for Domains.Get
@@ -110,16 +110,8 @@ message UpdateNumberRequest {
110
110
  string ref = 1;
111
111
  // The name of the Number
112
112
  string name = 2;
113
- // The tel_url of the Number
114
- string tel_url = 3;
115
113
  // The aor_link of the Number
116
114
  string aor_link = 4;
117
- // The city of the Number
118
- string city = 5;
119
- // The country of the Number
120
- string country = 6;
121
- // The country_iso_code of the Number
122
- string country_iso_code = 7;
123
115
  // The header to use for session affinity
124
116
  string session_affinity_header = 8;
125
117
  // Extra headers to send to the trunk
@@ -42,10 +42,13 @@ service Peers {
42
42
  }
43
43
 
44
44
  enum LoadBalancingAlgorithm {
45
+ // Value for situations where the load balancing algorithm is not specified
46
+ // Such as having an aor starting with "sip:"
47
+ UNSPECIFIED = 0;
45
48
  // The round robin load balancing algorithm
46
- ROUND_ROBIN = 0;
49
+ ROUND_ROBIN = 1;
47
50
  // The least sessions load balancing algorithm
48
- LEAST_SESSIONS = 1;
51
+ LEAST_SESSIONS = 2;
49
52
  }
50
53
 
51
54
  // The message for the Peer resource
@@ -63,7 +66,7 @@ message Peer {
63
66
  // The contact address of the Peer
64
67
  string contact_addr = 6;
65
68
  // The load balancing algorithm of the Peer
66
- LoadBalancingAlgorithm load_balancing_algorithm = 7;
69
+ LoadBalancingAlgorithm balancing_algorithm = 7;
67
70
  // The session affinity of the Peer
68
71
  bool with_session_affinity = 8;
69
72
  // The status of the Peer
@@ -91,7 +94,7 @@ message CreatePeerRequest {
91
94
  // The contact address of the Peer
92
95
  string contact_addr = 4;
93
96
  // The load balancing algorithm of the Peer
94
- LoadBalancingAlgorithm load_balancing_algorithm = 5;
97
+ LoadBalancingAlgorithm balancing_algorithm = 5;
95
98
  // The session affinity of the Peer
96
99
  bool with_session_affinity = 6;
97
100
  // Reference to the ACL of the Peer
@@ -110,24 +113,22 @@ message UpdatePeerRequest {
110
113
  string ref = 1;
111
114
  // The name of the Peer
112
115
  string name = 2;
113
- // The username of the Peer
114
- string username = 3;
115
116
  // The address of record of the Peer
116
- string aor = 4;
117
+ string aor = 3;
117
118
  // The contact address of the Peer
118
- string contact_addr = 5;
119
+ string contact_addr = 4;
119
120
  // The load balancing algorithm of the Peer
120
- LoadBalancingAlgorithm load_balancing_algorithm = 6;
121
+ LoadBalancingAlgorithm balancing_algorithm = 5;
121
122
  // The session affinity of the Peer
122
- bool with_session_affinity = 7;
123
+ bool with_session_affinity = 6;
123
124
  // Reference to the ACL of the Peer
124
- string access_control_list_ref = 8;
125
+ string access_control_list_ref = 7;
125
126
  // Reference to the Credentials of the Peer
126
- string credentials_ref = 9;
127
+ string credentials_ref = 8;
127
128
  // The status of the Peer
128
- bool enabled = 10;
129
+ bool enabled = 9;
129
130
  // The extended attributes of the Peer
130
- .google.protobuf.Struct extended = 11;
131
+ .google.protobuf.Struct extended = 10;
131
132
  }
132
133
 
133
134
  // The request message for the Peers.Get method
@@ -21,7 +21,6 @@ declare const _default: {
21
21
  name: {
22
22
  description: string;
23
23
  type: string;
24
- minLength: number;
25
24
  maxLength: number;
26
25
  };
27
26
  };
@@ -40,6 +39,8 @@ declare const _default: {
40
39
  type: string;
41
40
  items: {
42
41
  type: string;
42
+ minLength: number;
43
+ maxLength: number;
43
44
  };
44
45
  minItems: number;
45
46
  uniqueItems: boolean;
@@ -49,6 +50,8 @@ declare const _default: {
49
50
  type: string;
50
51
  items: {
51
52
  type: string;
53
+ minLength: number;
54
+ maxLength: number;
52
55
  };
53
56
  minItems: number;
54
57
  uniqueItems: boolean;
@@ -41,8 +41,7 @@ exports.default = {
41
41
  name: {
42
42
  description: "Resource's friendly name",
43
43
  type: "string",
44
- minLength: 3,
45
- maxLength: 64
44
+ maxLength: 60
46
45
  }
47
46
  },
48
47
  required: ["name"]
@@ -59,7 +58,9 @@ exports.default = {
59
58
  description: "Allowed list of access control rules",
60
59
  type: "array",
61
60
  items: {
62
- type: "string"
61
+ type: "string",
62
+ minLength: 7,
63
+ maxLength: 18
63
64
  },
64
65
  minItems: 1,
65
66
  uniqueItems: true
@@ -68,7 +69,9 @@ exports.default = {
68
69
  description: "Denied list of access control rules",
69
70
  type: "array",
70
71
  items: {
71
- type: "string"
72
+ type: "string",
73
+ minLength: 7,
74
+ maxLength: 18
72
75
  },
73
76
  minItems: 1,
74
77
  uniqueItems: true
@@ -21,7 +21,6 @@ declare const _default: {
21
21
  name: {
22
22
  description: string;
23
23
  type: string;
24
- minLength: number;
25
24
  maxLength: number;
26
25
  };
27
26
  };
@@ -41,8 +41,7 @@ exports.default = {
41
41
  name: {
42
42
  description: "Resource's friendly name",
43
43
  type: "string",
44
- minLength: 3,
45
- maxLength: 64
44
+ maxLength: 60
46
45
  }
47
46
  },
48
47
  required: ["name"]
@@ -54,8 +53,8 @@ exports.default = {
54
53
  username: {
55
54
  description: "The username for the Agent",
56
55
  type: "string",
57
- minLength: 3,
58
- maxLength: 64,
56
+ minLength: 4,
57
+ maxLength: 60,
59
58
  readOnly: true
60
59
  },
61
60
  domainRef: {
@@ -21,7 +21,6 @@ declare const _default: {
21
21
  name: {
22
22
  description: string;
23
23
  type: string;
24
- minLength: number;
25
24
  maxLength: number;
26
25
  };
27
26
  };
@@ -46,6 +45,7 @@ declare const _default: {
46
45
  description: string;
47
46
  type: string;
48
47
  writeOnly: boolean;
48
+ maxLength: number;
49
49
  };
50
50
  };
51
51
  required: string[];
@@ -41,8 +41,7 @@ exports.default = {
41
41
  name: {
42
42
  description: "Resource's friendly name",
43
43
  type: "string",
44
- minLength: 3,
45
- maxLength: 64
44
+ maxLength: 60
46
45
  }
47
46
  },
48
47
  required: ["name"]
@@ -59,13 +58,14 @@ exports.default = {
59
58
  description: "Username",
60
59
  type: "string",
61
60
  readOnly: true,
62
- minLength: 3,
63
- maxLength: 64
61
+ minLength: 4,
62
+ maxLength: 60
64
63
  },
65
64
  password: {
66
65
  description: "Password",
67
66
  type: "string",
68
- writeOnly: true
67
+ writeOnly: true,
68
+ maxLength: 255
69
69
  }
70
70
  },
71
71
  required: ["username", "password"]
@@ -21,7 +21,6 @@ declare const _default: {
21
21
  name: {
22
22
  description: string;
23
23
  type: string;
24
- minLength: number;
25
24
  maxLength: number;
26
25
  };
27
26
  };
@@ -38,7 +37,6 @@ declare const _default: {
38
37
  domainUri: {
39
38
  description: string;
40
39
  type: string;
41
- minLength: number;
42
40
  maxLength: number;
43
41
  };
44
42
  accessControlListRef: {
@@ -54,7 +52,6 @@ declare const _default: {
54
52
  rule: {
55
53
  description: string;
56
54
  type: string;
57
- minLength: number;
58
55
  };
59
56
  numberRef: {
60
57
  description: string;
@@ -41,8 +41,7 @@ exports.default = {
41
41
  name: {
42
42
  description: "Resource's friendly name",
43
43
  type: "string",
44
- minLength: 3,
45
- maxLength: 64
44
+ maxLength: 60
46
45
  }
47
46
  },
48
47
  required: ["name"]
@@ -58,7 +57,6 @@ exports.default = {
58
57
  domainUri: {
59
58
  description: "The URI of the Domain",
60
59
  type: "string",
61
- minLength: 3,
62
60
  maxLength: 255
63
61
  },
64
62
  accessControlListRef: {
@@ -73,8 +71,7 @@ exports.default = {
73
71
  properties: {
74
72
  rule: {
75
73
  description: "The rule for the egress policy",
76
- type: "string",
77
- minLength: 1
74
+ type: "string"
78
75
  },
79
76
  numberRef: {
80
77
  description: "The reference to the number",
@@ -21,7 +21,6 @@ declare const _default: {
21
21
  name: {
22
22
  description: string;
23
23
  type: string;
24
- minLength: number;
25
24
  maxLength: number;
26
25
  };
27
26
  };
@@ -41,8 +41,7 @@ exports.default = {
41
41
  name: {
42
42
  description: "Resource's friendly name",
43
43
  type: "string",
44
- minLength: 3,
45
- maxLength: 64
44
+ maxLength: 60
46
45
  }
47
46
  },
48
47
  required: ["name"]
@@ -66,7 +65,7 @@ exports.default = {
66
65
  aorLink: {
67
66
  description: "AOR link",
68
67
  type: "string",
69
- minLength: 3,
68
+ minLength: 5,
70
69
  maxLength: 255
71
70
  },
72
71
  sessionAffinityHeader: {
@@ -21,7 +21,6 @@ declare const _default: {
21
21
  name: {
22
22
  description: string;
23
23
  type: string;
24
- minLength: number;
25
24
  maxLength: number;
26
25
  };
27
26
  };
@@ -47,6 +46,7 @@ declare const _default: {
47
46
  contactAddr: {
48
47
  description: string;
49
48
  type: string;
49
+ minLength: number;
50
50
  maxLength: number;
51
51
  };
52
52
  credentialsRef: {
@@ -41,8 +41,7 @@ exports.default = {
41
41
  name: {
42
42
  description: "Resource's friendly name",
43
43
  type: "string",
44
- minLength: 3,
45
- maxLength: 64
44
+ maxLength: 60
46
45
  }
47
46
  },
48
47
  required: ["name"]
@@ -54,20 +53,21 @@ exports.default = {
54
53
  username: {
55
54
  description: "The username for the Peer",
56
55
  type: "string",
57
- minLength: 3,
58
- maxLength: 64,
56
+ minLength: 4,
57
+ maxLength: 60,
59
58
  readOnly: true
60
59
  },
61
60
  aor: {
62
61
  description: "Address of the Peer (acceptable schemas are sip, backend.)",
63
62
  type: "string",
64
- minLength: 3,
65
- maxLength: 255
63
+ minLength: 5,
64
+ maxLength: 323
66
65
  },
67
66
  contactAddr: {
68
67
  description: "Contact address of the Peer",
69
68
  type: "string",
70
- maxLength: 255
69
+ minLength: 7,
70
+ maxLength: 20
71
71
  },
72
72
  credentialsRef: {
73
73
  description: "The credential the Peer uses to authenticate",
@@ -21,7 +21,6 @@ declare const _default: {
21
21
  name: {
22
22
  description: string;
23
23
  type: string;
24
- minLength: number;
25
24
  maxLength: number;
26
25
  };
27
26
  };
@@ -76,10 +75,12 @@ declare const _default: {
76
75
  host: {
77
76
  description: string;
78
77
  type: string;
78
+ maxLength: number;
79
79
  };
80
80
  port: {
81
81
  description: string;
82
82
  type: string;
83
+ maximum: number;
83
84
  };
84
85
  transport: {
85
86
  description: string;
@@ -88,6 +89,7 @@ declare const _default: {
88
89
  user: {
89
90
  description: string;
90
91
  type: string;
92
+ maxLength: number;
91
93
  };
92
94
  };
93
95
  required: string[];
@@ -95,10 +97,14 @@ declare const _default: {
95
97
  weight: {
96
98
  description: string;
97
99
  type: string;
100
+ minimum: number;
101
+ maximum: number;
98
102
  };
99
103
  priority: {
100
104
  description: string;
101
105
  type: string;
106
+ minimum: number;
107
+ maximum: number;
102
108
  };
103
109
  enabled: {
104
110
  description: string;
@@ -41,8 +41,7 @@ exports.default = {
41
41
  name: {
42
42
  description: "Resource's friendly name",
43
43
  type: "string",
44
- minLength: 3,
45
- maxLength: 64
44
+ maxLength: 60
46
45
  }
47
46
  },
48
47
  required: ["name"]
@@ -95,11 +94,13 @@ exports.default = {
95
94
  properties: {
96
95
  host: {
97
96
  description: "Hostname of the URI",
98
- type: "string"
97
+ type: "string",
98
+ maxLength: 255
99
99
  },
100
100
  port: {
101
101
  description: "Port of the URI",
102
- type: "integer"
102
+ type: "integer",
103
+ maximum: 65535
103
104
  },
104
105
  transport: {
105
106
  description: "Transport of the URI",
@@ -120,18 +121,23 @@ exports.default = {
120
121
  },
121
122
  user: {
122
123
  description: "Username of the URI",
123
- type: "string"
124
+ type: "string",
125
+ maxLength: 60
124
126
  }
125
127
  },
126
128
  required: ["host", "port", "transport"]
127
129
  },
128
130
  weight: {
129
131
  description: "Weight of the URI",
130
- type: "integer"
132
+ type: "integer",
133
+ minimum: 1,
134
+ maximum: 65535
131
135
  },
132
136
  priority: {
133
137
  description: "Priority of the URI",
134
- type: "integer"
138
+ type: "integer",
139
+ minimum: 0,
140
+ maximum: 65535
135
141
  },
136
142
  enabled: {
137
143
  description: "Whether the URI is enabled",
@@ -19,8 +19,8 @@ export interface BaseConnectModel {
19
19
  apiVersion: string;
20
20
  ref: string;
21
21
  name: string;
22
- createdAt?: Date;
23
- updatedAt?: Date;
22
+ createdAt?: number;
23
+ updatedAt?: number;
24
24
  extended?: JsonObject;
25
25
  }
26
26
  export interface AccessControlList extends BaseConnectModel {
@@ -56,7 +56,7 @@ export interface INumber extends BaseConnectModel {
56
56
  aorLink: string;
57
57
  city: string;
58
58
  country: string;
59
- countryISOCode: string;
59
+ countryIsoCode: string;
60
60
  sessionAffinityHeader: string;
61
61
  extraHeaders: {
62
62
  name: string;
@@ -74,9 +74,11 @@ export interface Trunk extends BaseConnectModel {
74
74
  inboundCredentials?: Credentials;
75
75
  outboundCredentialsRef?: string;
76
76
  outboundCredentials?: Credentials;
77
- uris: TrunkURI[];
77
+ uris?: TrunkURI[];
78
78
  }
79
79
  export interface TrunkURI {
80
+ ref?: string;
81
+ trunkRef?: string;
80
82
  host: string;
81
83
  port: number;
82
84
  transport: Transport;
@@ -0,0 +1,42 @@
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;
@@ -0,0 +1,261 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.isValidWeight = exports.isValidPriority = exports.isValidContactAddress = exports.isValidHost = exports.hasHost = exports.isValidPort = exports.isValidBalancingAlgorithm = exports.isValidInboundUri = exports.hasInboundUri = exports.hasValidACLRules = exports.isValidACLRule = exports.hasACLRules = exports.hasCountryISOCode = exports.hasCountry = exports.hasCity = exports.isValidAORLink = exports.hasAORLink = exports.isValidAOR = exports.hasAOR = exports.hasValidHeaders = exports.isValidHeader = exports.isValidSessionAffinityHeader = exports.hasTelUrl = exports.isValidDomainUri = exports.hasDomainUri = exports.hasPassword = exports.isValidUsername = exports.hasUsername = exports.isValidName = exports.hasName = exports.hasReference = void 0;
27
+ /*
28
+ * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
29
+ * http://github.com/fonoster
30
+ *
31
+ * This file is part of Routr.
32
+ *
33
+ * Licensed under the MIT License (the "License");
34
+ * you may not use this file except in compliance with
35
+ * the License. You may obtain a copy of the License at
36
+ *
37
+ * https://opensource.org/licenses/MIT
38
+ *
39
+ * Unless required by applicable law or agreed to in writing, software
40
+ * distributed under the License is distributed on an "AS IS" BASIS,
41
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42
+ * See the License for the specific language governing permissions and
43
+ * limitations under the License.
44
+ */
45
+ const Validator = __importStar(require("validator"));
46
+ const errors_1 = require("../errors");
47
+ const types_1 = require("../types");
48
+ const hasReference = (ref) => ref ? true : new errors_1.BadRequestError("the reference to the resource is required");
49
+ exports.hasReference = hasReference;
50
+ const hasName = (name) => name
51
+ ? true
52
+ : new errors_1.BadRequestError("the friendly name for the resource is required");
53
+ exports.hasName = hasName;
54
+ const isValidName = (name) => {
55
+ return Validator.default.isLength(name, { min: 1, max: 60 })
56
+ ? true
57
+ : new errors_1.BadRequestError("the friendly name must have less than 60 characters");
58
+ };
59
+ exports.isValidName = isValidName;
60
+ const hasUsername = (username) => username ? true : new errors_1.BadRequestError("the username is required");
61
+ exports.hasUsername = hasUsername;
62
+ const isValidUsername = (username) => {
63
+ if (username &&
64
+ (!Validator.default.isAlphanumeric(username) ||
65
+ !Validator.default.isLowercase(username))) {
66
+ return new errors_1.BadRequestError("the username must be a lowercase, alphanumeric, and without spaces");
67
+ }
68
+ return true;
69
+ };
70
+ exports.isValidUsername = isValidUsername;
71
+ const hasPassword = (password) => password ? true : new errors_1.BadRequestError("the password is required");
72
+ exports.hasPassword = hasPassword;
73
+ const hasDomainUri = (domainUri) => domainUri ? true : new errors_1.BadRequestError("the domainUri is required");
74
+ exports.hasDomainUri = hasDomainUri;
75
+ const isValidDomainUri = (domainUri) => {
76
+ return Validator.default.isFQDN(domainUri)
77
+ ? true
78
+ : new errors_1.BadRequestError("the domainUri must be a valid fully qualified domain name");
79
+ };
80
+ exports.isValidDomainUri = isValidDomainUri;
81
+ const hasTelUrl = (telUrl) => telUrl ? true : new errors_1.BadRequestError("the telUrl is required");
82
+ exports.hasTelUrl = hasTelUrl;
83
+ // Supports alphanumeric, underscore, and dash (cannot end with dash)
84
+ const isValidAlphanumeric = (value) => {
85
+ if (value.endsWith("-")) {
86
+ return false;
87
+ }
88
+ const regex = /^[a-zA-Z0-9-]+$/;
89
+ return regex.test(value);
90
+ };
91
+ const isValidSessionAffinityHeader = (sessionAffinityHeader) => {
92
+ return sessionAffinityHeader
93
+ ? isValidAlphanumeric(sessionAffinityHeader)
94
+ ? true
95
+ : new errors_1.BadRequestError("the sessionAffinityHeader must be alphanumeric and without spaces")
96
+ : true;
97
+ };
98
+ exports.isValidSessionAffinityHeader = isValidSessionAffinityHeader;
99
+ const isValidHeader = (header) => {
100
+ return header
101
+ ? isValidAlphanumeric(header)
102
+ ? true
103
+ : new errors_1.BadRequestError("the header must be alphanumeric and without spaces")
104
+ : true;
105
+ };
106
+ exports.isValidHeader = isValidHeader;
107
+ const hasValidHeaders = (headers) => {
108
+ // eslint-disable-next-line no-loops/no-loops
109
+ for (const header of headers) {
110
+ const E = (0, exports.isValidHeader)(header.name);
111
+ if (!header.value) {
112
+ return new errors_1.BadRequestError("the header value cannot be empty");
113
+ }
114
+ if (E instanceof errors_1.BadRequestError) {
115
+ return E;
116
+ }
117
+ }
118
+ return true;
119
+ };
120
+ exports.hasValidHeaders = hasValidHeaders;
121
+ const hasAOR = (aor) => aor ? true : new errors_1.BadRequestError("the address of record (aor) is required");
122
+ exports.hasAOR = hasAOR;
123
+ const isValidAOR = (aor) => {
124
+ if (aor) {
125
+ if (!aor.startsWith("backend:") && !aor.startsWith("sip:")) {
126
+ return new errors_1.BadRequestError("the aor schema must start with `backend:` or `sip:`");
127
+ }
128
+ }
129
+ return true;
130
+ };
131
+ exports.isValidAOR = isValidAOR;
132
+ const hasAORLink = (aorLink) => aorLink ? true : new errors_1.BadRequestError("the aorLink is required");
133
+ exports.hasAORLink = hasAORLink;
134
+ const isValidAORLink = (aorLink) => {
135
+ if (aorLink) {
136
+ if (!aorLink.startsWith("backend:") && !aorLink.startsWith("sip:")) {
137
+ return new errors_1.BadRequestError("the aorLink must start with backend: or sip:");
138
+ }
139
+ }
140
+ return true;
141
+ };
142
+ exports.isValidAORLink = isValidAORLink;
143
+ const hasCity = (city) => city ? true : new errors_1.BadRequestError("the city is required");
144
+ exports.hasCity = hasCity;
145
+ const hasCountry = (country) => country ? true : new errors_1.BadRequestError("the country is required");
146
+ exports.hasCountry = hasCountry;
147
+ const hasCountryISOCode = (countryIsoCode) => countryIsoCode ? true : new errors_1.BadRequestError("the countryISOCode is required");
148
+ exports.hasCountryISOCode = hasCountryISOCode;
149
+ const hasACLRules = (acl) => {
150
+ var _a, _b;
151
+ if (!(acl === null || acl === void 0 ? void 0 : acl.deny) ||
152
+ !(acl === null || acl === void 0 ? void 0 : acl.allow) ||
153
+ ((_a = acl.deny) === null || _a === void 0 ? void 0 : _a.length) === 0 ||
154
+ ((_b = acl.allow) === null || _b === void 0 ? void 0 : _b.length) === 0) {
155
+ return new errors_1.BadRequestError("acl rules are required");
156
+ }
157
+ return true;
158
+ };
159
+ exports.hasACLRules = hasACLRules;
160
+ const isValidACLRule = (rules) => {
161
+ // eslint-disable-next-line no-loops/no-loops
162
+ for (const cidr of rules) {
163
+ if (!Validator.default.isIPRange(cidr, 4) &&
164
+ !Validator.default.isIP(cidr, 4)) {
165
+ return new errors_1.BadRequestError(`${cidr} is not a valid cidr or ip`);
166
+ }
167
+ }
168
+ return true;
169
+ };
170
+ exports.isValidACLRule = isValidACLRule;
171
+ const hasValidACLRules = (acl) => {
172
+ const deny = (0, exports.isValidACLRule)(acl === null || acl === void 0 ? void 0 : acl.deny);
173
+ if (deny instanceof errors_1.BadRequestError) {
174
+ return deny;
175
+ }
176
+ const allow = (0, exports.isValidACLRule)(acl === null || acl === void 0 ? void 0 : acl.allow);
177
+ if (allow instanceof errors_1.BadRequestError) {
178
+ return allow;
179
+ }
180
+ return true;
181
+ };
182
+ exports.hasValidACLRules = hasValidACLRules;
183
+ const hasInboundUri = (inboundUri) => inboundUri ? true : new errors_1.BadRequestError("the inboundUri is required");
184
+ exports.hasInboundUri = hasInboundUri;
185
+ const isValidInboundUri = (inboundUri) => {
186
+ if (inboundUri && !Validator.default.isFQDN(inboundUri)) {
187
+ return new errors_1.BadRequestError("the inbound URI must be a valid FQDN (e.g. sip.example.com)");
188
+ }
189
+ return true;
190
+ };
191
+ exports.isValidInboundUri = isValidInboundUri;
192
+ const isValidBalancingAlgorithm = (aor, algorithm) => {
193
+ if (aor.startsWith("backend:")) {
194
+ if (!algorithm || algorithm === types_1.LoadBalancingAlgorithm.UNSPECIFIED) {
195
+ return new errors_1.BadRequestError("when the aor schema is `backend:`, the balancing algorithm is required");
196
+ }
197
+ }
198
+ else {
199
+ if (algorithm && algorithm !== types_1.LoadBalancingAlgorithm.UNSPECIFIED) {
200
+ return new errors_1.BadRequestError("when the aor schema is `sip:`, the balancing algorithm is not allowed");
201
+ }
202
+ }
203
+ };
204
+ exports.isValidBalancingAlgorithm = isValidBalancingAlgorithm;
205
+ const isValidPort = (port) => {
206
+ if (port) {
207
+ if (!Validator.default.isPort(port)) {
208
+ return new errors_1.BadRequestError("the port must be a valid port");
209
+ }
210
+ }
211
+ };
212
+ exports.isValidPort = isValidPort;
213
+ const hasHost = (host) => host ? true : new errors_1.BadRequestError("the host is required");
214
+ exports.hasHost = hasHost;
215
+ const isValidHost = (host) => {
216
+ if (host) {
217
+ if (!Validator.default.isFQDN(host) && !Validator.default.isIP(host)) {
218
+ return new errors_1.BadRequestError("the host must be a valid FQDN or IP");
219
+ }
220
+ }
221
+ return true;
222
+ };
223
+ exports.isValidHost = isValidHost;
224
+ const isValidContactAddress = (contactAddress) => {
225
+ if (contactAddress) {
226
+ const hostPart = contactAddress.split(":")[0];
227
+ const portPart = hostPart.split(":")[1] || "5060";
228
+ if (!Validator.default.isFQDN(hostPart) &&
229
+ !Validator.default.isIP(hostPart)) {
230
+ return new errors_1.BadRequestError("the contact address must be a valid FQDN or IP");
231
+ }
232
+ if (!Validator.default.isPort(portPart)) {
233
+ return new errors_1.BadRequestError("the contact port must be a valid port");
234
+ }
235
+ }
236
+ };
237
+ exports.isValidContactAddress = isValidContactAddress;
238
+ const isValidPriority = (priority) => {
239
+ if (priority) {
240
+ if (!Validator.default.isInt(priority)) {
241
+ return new errors_1.BadRequestError("the priority must be a valid integer");
242
+ }
243
+ const p = parseInt(priority);
244
+ if (p < 0 || p > 65535) {
245
+ return new errors_1.BadRequestError("the priority must be between 0 and 65535");
246
+ }
247
+ }
248
+ };
249
+ exports.isValidPriority = isValidPriority;
250
+ const isValidWeight = (weight) => {
251
+ if (weight) {
252
+ if (!Validator.default.isInt(weight)) {
253
+ return new errors_1.BadRequestError("the priority must be a valid integer");
254
+ }
255
+ const w = parseInt(weight);
256
+ if (w < 1 || w > 65535) {
257
+ return new errors_1.BadRequestError("the weight must be between 1 and 65535");
258
+ }
259
+ }
260
+ };
261
+ exports.isValidWeight = isValidWeight;
package/dist/types.d.ts CHANGED
@@ -24,8 +24,9 @@ export declare enum Transport {
24
24
  WSS = "WSS"
25
25
  }
26
26
  export declare enum LoadBalancingAlgorithm {
27
- ROUND_ROBIN = "ROUND-ROBIN",
28
- LEAST_SESSIONS = "LEAST-SESSIONS"
27
+ UNSPECIFIED = "UNSPECIFIED",
28
+ ROUND_ROBIN = "ROUND_ROBIN",
29
+ LEAST_SESSIONS = "LEAST_SESSIONS"
29
30
  }
30
31
  export declare enum ExtraHeader {
31
32
  REQUEST_URI = "X-Request-Uri",
package/dist/types.js CHANGED
@@ -26,8 +26,9 @@ var Transport;
26
26
  })(Transport = exports.Transport || (exports.Transport = {}));
27
27
  var LoadBalancingAlgorithm;
28
28
  (function (LoadBalancingAlgorithm) {
29
- LoadBalancingAlgorithm["ROUND_ROBIN"] = "ROUND-ROBIN";
30
- LoadBalancingAlgorithm["LEAST_SESSIONS"] = "LEAST-SESSIONS";
29
+ LoadBalancingAlgorithm["UNSPECIFIED"] = "UNSPECIFIED";
30
+ LoadBalancingAlgorithm["ROUND_ROBIN"] = "ROUND_ROBIN";
31
+ LoadBalancingAlgorithm["LEAST_SESSIONS"] = "LEAST_SESSIONS";
31
32
  })(LoadBalancingAlgorithm = exports.LoadBalancingAlgorithm || (exports.LoadBalancingAlgorithm = {}));
32
33
  var ExtraHeader;
33
34
  (function (ExtraHeader) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/common",
3
- "version": "2.0.8-alpha.20",
3
+ "version": "2.0.8-alpha.21",
4
4
  "description": "Common package",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/routr#readme",
@@ -29,7 +29,8 @@
29
29
  "ip-utils": "^2.4.0",
30
30
  "js-yaml": "^4.1.0",
31
31
  "pb-util": "^1.0.3",
32
- "toml": "^3.0.0"
32
+ "toml": "^3.0.0",
33
+ "validator": "^13.7.0"
33
34
  },
34
35
  "directories": {
35
36
  "src": "src",
@@ -51,5 +52,5 @@
51
52
  "devDependencies": {
52
53
  "@types/js-yaml": "^4.0.5"
53
54
  },
54
- "gitHead": "a22ee8342d03f5dfe46fddba89ffe3e6d0d5deb6"
55
+ "gitHead": "1841d2d8d51bebfdc3af7e81435064e81b176449"
55
56
  }