@routr/common 2.3.0 → 2.4.1

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 CHANGED
@@ -1,14 +1,5 @@
1
- import { AuthChallengeRequest, AuthChallengeResponse, ResponseType } from "./types";
1
+ import { AuthChallengeResponse, ResponseType } from "./types";
2
2
  export declare const generateNonce: (algorithm?: string) => string;
3
- export declare const buildAuthChallenge: (request: AuthChallengeRequest) => {
4
- realm: string;
5
- scheme: "Digest";
6
- algorithm: "MD5";
7
- qop: import("./types").Qop;
8
- opaque: string;
9
- stale: boolean;
10
- nonce: string;
11
- };
12
3
  export declare const calculateAuthResponse: (res: AuthChallengeResponse, credentials: {
13
4
  username: string;
14
5
  secret: string;
package/dist/auth.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createForbideenResponse = exports.createServerInternalErrorResponse = exports.createUnauthorizedResponseWithoutChallenge = exports.createUnauthorizedResponse = exports.getCredentials = exports.calculateAuthResponse = exports.buildAuthChallenge = exports.generateNonce = void 0;
6
+ exports.createForbideenResponse = exports.createServerInternalErrorResponse = exports.createUnauthorizedResponseWithoutChallenge = exports.createUnauthorizedResponse = exports.getCredentials = exports.calculateAuthResponse = exports.generateNonce = void 0;
7
7
  /*
8
8
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
9
9
  * http://github.com/fonoster/routr
@@ -29,19 +29,6 @@ const md5hex = (str, algorithm = DEFAULT_ALGORITHM) => crypto_1.default.createHa
29
29
  const decToHex = (dec) => (dec + Math.pow(16, 8)).toString(16).substr(-8);
30
30
  const generateNonce = (algorithm = DEFAULT_ALGORITHM) => md5hex(`${new Date().getTime()}${Math.random()}`, algorithm);
31
31
  exports.generateNonce = generateNonce;
32
- const buildAuthChallenge = (request) => {
33
- const { realm, scheme, algorithm, qop, opaque, stale } = request;
34
- return {
35
- realm,
36
- scheme,
37
- algorithm,
38
- qop,
39
- opaque,
40
- stale,
41
- nonce: (0, exports.generateNonce)(algorithm)
42
- };
43
- };
44
- exports.buildAuthChallenge = buildAuthChallenge;
45
32
  const calculateAuthResponse = (res, credentials) => {
46
33
  if (!credentials)
47
34
  return null;
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /*
18
18
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
19
- * http://github.com/fonoster
19
+ * http://github.com/fonoster/routr
20
20
  *
21
21
  * This file is part of Routr.
22
22
  *
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hasValidOutboundUrisOrThrow = exports.isValidE164OrThrow = 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
4
  /*
5
5
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
6
- * http://github.com/fonoster
6
+ * http://github.com/fonoster/routr
7
7
  *
8
8
  * This file is part of Routr.
9
9
  *
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.convertToErrorResponse = exports.CodeToResponseTypeMap = void 0;
4
4
  /*
5
5
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
6
- * http://github.com/fonoster
6
+ * http://github.com/fonoster/routr
7
7
  *
8
8
  * This file is part of Routr.
9
9
  *
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /*
18
18
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
19
- * http://github.com/fonoster
19
+ * http://github.com/fonoster/routr
20
20
  *
21
21
  * This file is part of Routr.
22
22
  *
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mapToAgent = void 0;
4
4
  /*
5
5
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
6
- * http://github.com/fonoster
6
+ * http://github.com/fonoster/routr
7
7
  *
8
8
  * This file is part of Routr.
9
9
  *
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.assertValidAorSchema = exports.assertValidSchema = void 0;
4
4
  /*
5
5
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
6
- * http://github.com/fonoster
6
+ * http://github.com/fonoster/routr
7
7
  *
8
8
  * This file is part of Routr.
9
9
  *
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /*
18
18
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
19
- * http://github.com/fonoster
19
+ * http://github.com/fonoster/routr
20
20
  *
21
21
  * This file is part of Routr.
22
22
  *
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  /*
4
4
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
5
- * http://github.com/fonoster
5
+ * http://github.com/fonoster/routr
6
6
  *
7
7
  * This file is part of Routr.
8
8
  *
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  /*
4
4
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
5
- * http://github.com/fonoster
5
+ * http://github.com/fonoster/routr
6
6
  *
7
7
  * This file is part of Routr.
8
8
  *
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  /*
4
4
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
5
- * http://github.com/fonoster
5
+ * http://github.com/fonoster/routr
6
6
  *
7
7
  * This file is part of Routr.
8
8
  *
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  /*
4
4
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
5
- * http://github.com/fonoster
5
+ * http://github.com/fonoster/routr
6
6
  *
7
7
  * This file is part of Routr.
8
8
  *
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /*
18
18
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
19
- * http://github.com/fonoster
19
+ * http://github.com/fonoster/routr
20
20
  *
21
21
  * This file is part of Routr.
22
22
  *
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  /*
4
4
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
5
- * http://github.com/fonoster
5
+ * http://github.com/fonoster/routr
6
6
  *
7
7
  * This file is part of Routr.
8
8
  *
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  /*
4
4
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
5
- * http://github.com/fonoster
5
+ * http://github.com/fonoster/routr
6
6
  *
7
7
  * This file is part of Routr.
8
8
  *
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  /*
4
4
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
5
- * http://github.com/fonoster
5
+ * http://github.com/fonoster/routr
6
6
  *
7
7
  * This file is part of Routr.
8
8
  *
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.schemaValidators = void 0;
7
7
  /*
8
8
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
9
- * http://github.com/fonoster
9
+ * http://github.com/fonoster/routr
10
10
  *
11
11
  * This file is part of Routr.
12
12
  *
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.isValidE164 = 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
27
  /*
28
28
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
29
- * http://github.com/fonoster
29
+ * http://github.com/fonoster/routr
30
30
  *
31
31
  * This file is part of Routr.
32
32
  *
package/dist/envs.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ENFORCE_E164_WITH_MOBILE_PREFIX = exports.ENFORCE_E164 = void 0;
4
4
  /*
5
5
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
6
- * http://github.com/fonoster
6
+ * http://github.com/fonoster/routr
7
7
  *
8
8
  * This file is part of Routr.
9
9
  *
package/dist/errors.js CHANGED
@@ -30,7 +30,7 @@ exports.BadRequestError = exports.ResourceNotFoundError = exports.UnimplementedE
30
30
  *
31
31
  * This file is part of Routr
32
32
  *
33
- * Licensed under the MIT License (the "License")
33
+ * Licensed under the MIT License (the "License");
34
34
  * you may not use this file except in compliance with
35
35
  * the License. You may obtain a copy of the License at
36
36
  *
package/dist/helper.js CHANGED
@@ -33,7 +33,7 @@ exports.toPascaleCase = exports.readConfigFile = exports.getListeningPoint = exp
33
33
  *
34
34
  * This file is part of Routr
35
35
  *
36
- * Licensed under the MIT License (the "License")
36
+ * Licensed under the MIT License (the "License");
37
37
  * you may not use this file except in compliance with
38
38
  * the License. You may obtain a copy of the License at
39
39
  *
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ exports.Verifier = exports.Environment = exports.ConnectSchemas = exports.Common
30
30
  *
31
31
  * This file is part of Routr
32
32
  *
33
- * Licensed under the MIT License (the "License")
33
+ * Licensed under the MIT License (the "License");
34
34
  * you may not use this file except in compliance with
35
35
  * the License. You may obtain a copy of the License at
36
36
  *
package/dist/ip_utils.js CHANGED
@@ -7,7 +7,7 @@ exports.getLocalnetIp = exports.isLocalnet = exports.addressCount = exports.hasI
7
7
  *
8
8
  * This file is part of Routr
9
9
  *
10
- * Licensed under the MIT License (the "License")
10
+ * Licensed under the MIT License (the "License");
11
11
  * you may not use this file except in compliance with
12
12
  * the License. You may obtain a copy of the License at
13
13
  *
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /*
18
18
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
19
- * http://github.com/fonoster
19
+ * http://github.com/fonoster/routr
20
20
  *
21
21
  * This file is part of Routr.
22
22
  *
package/dist/service.js CHANGED
@@ -30,7 +30,7 @@ exports.getObjectProto = exports.LOCATION_OBJECT_PROTO = exports.PROCESSOR_OBJEC
30
30
  *
31
31
  * This file is part of Routr
32
32
  *
33
- * Licensed under the MIT License (the "License")
33
+ * Licensed under the MIT License (the "License");
34
34
  * you may not use this file except in compliance with
35
35
  * the License. You may obtain a copy of the License at
36
36
  *
package/dist/tracer.js CHANGED
@@ -10,7 +10,7 @@ exports.init = void 0;
10
10
  *
11
11
  * This file is part of Routr
12
12
  *
13
- * Licensed under the MIT License (the "License")
13
+ * Licensed under the MIT License (the "License");
14
14
  * you may not use this file except in compliance with
15
15
  * the License. You may obtain a copy of the License at
16
16
  *
package/dist/types.d.ts CHANGED
@@ -86,16 +86,6 @@ export interface ObjectProto {
86
86
  path: string;
87
87
  version: string;
88
88
  }
89
- export interface AuthChallengeRequest {
90
- realm: string;
91
- domain: string;
92
- opaque: string;
93
- stale: boolean;
94
- nonce: string;
95
- scheme: AuthorizationScheme;
96
- algorithm: AuthorizationAlgorithm;
97
- qop: Qop;
98
- }
99
89
  export interface AuthChallengeResponse {
100
90
  realm: string;
101
91
  domain: string;
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /*
18
18
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
19
- * http://github.com/fonoster
19
+ * http://github.com/fonoster/routr
20
20
  *
21
21
  * This file is part of Routr.
22
22
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/common",
3
- "version": "2.3.0",
3
+ "version": "2.4.1",
4
4
  "description": "Common package",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/routr#readme",
@@ -55,5 +55,5 @@
55
55
  "devDependencies": {
56
56
  "@types/js-yaml": "^4.0.5"
57
57
  },
58
- "gitHead": "a07009852c37cf04303a5adef42bdac75a747a32"
58
+ "gitHead": "3897ad320d98a0d17ca7dd552fc0ca7c5a84368d"
59
59
  }