greybel-mock-environment 1.1.6 → 1.1.7

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.
@@ -1,3 +1,4 @@
1
+ import { Service } from './service';
1
2
  export declare enum Library {
2
3
  SSH = "ssh",
3
4
  FTP = "ftp",
@@ -15,6 +16,7 @@ export declare enum Library {
15
16
  INIT = "init",
16
17
  NET = "net"
17
18
  }
19
+ export declare function getServiceLibrary(service: Service): Library | null;
18
20
  export declare enum VulnerabilityRequirements {
19
21
  LIBRARY = 0,
20
22
  REGISTER_AMOUNT = 1,
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Vulnerability = exports.VulnerabilityActionUser = exports.VulnerabilityActionList = exports.VulnerabilityAction = exports.VulnerabilityRequirementList = exports.VulnerabilityRequirements = exports.Library = void 0;
3
+ exports.Vulnerability = exports.VulnerabilityActionUser = exports.VulnerabilityActionList = exports.VulnerabilityAction = exports.VulnerabilityRequirementList = exports.VulnerabilityRequirements = exports.getServiceLibrary = exports.Library = void 0;
4
+ var service_1 = require("./service");
4
5
  var Library;
5
6
  (function (Library) {
6
7
  Library["SSH"] = "ssh";
@@ -19,6 +20,25 @@ var Library;
19
20
  Library["INIT"] = "init";
20
21
  Library["NET"] = "net";
21
22
  })(Library = exports.Library || (exports.Library = {}));
23
+ function getServiceLibrary(service) {
24
+ switch (service) {
25
+ case service_1.Service.FTP:
26
+ return Library.FTP;
27
+ case service_1.Service.HTTP:
28
+ return Library.HTTP;
29
+ case service_1.Service.RSHELL:
30
+ return Library.RSHELL;
31
+ case service_1.Service.SMTP:
32
+ return Library.SMTP;
33
+ case service_1.Service.SQL:
34
+ return Library.SQL;
35
+ case service_1.Service.SSH:
36
+ return Library.SSH;
37
+ default:
38
+ }
39
+ return null;
40
+ }
41
+ exports.getServiceLibrary = getServiceLibrary;
22
42
  var VulnerabilityRequirements;
23
43
  (function (VulnerabilityRequirements) {
24
44
  VulnerabilityRequirements[VulnerabilityRequirements["LIBRARY"] = 0] = "LIBRARY";
package/dist/utils.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { Library, Service, User } from './types';
1
+ import { User } from './types/user';
2
2
  export declare function isValidIp(target: string): boolean;
3
3
  export declare function isLanIp(target: string): boolean;
4
- export declare function getServiceLibrary(service: Service): Library | null;
5
4
  export interface PermissionSegment {
6
5
  x: boolean;
7
6
  w: boolean;
package/dist/utils.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTraversalPath = exports.getUserPath = exports.transformFlagsToPermissions = exports.getPermissionSegmentByString = exports.setPermissionSegmentValueByString = exports.getPermissionSegmentValueByString = exports.getServiceLibrary = exports.isLanIp = exports.isValidIp = void 0;
4
- var types_1 = require("./types");
3
+ exports.getTraversalPath = exports.getUserPath = exports.transformFlagsToPermissions = exports.getPermissionSegmentByString = exports.setPermissionSegmentValueByString = exports.getPermissionSegmentValueByString = exports.isLanIp = exports.isValidIp = void 0;
5
4
  function isValidIp(target) {
6
5
  return /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(target);
7
6
  }
@@ -10,25 +9,6 @@ function isLanIp(target) {
10
9
  return /^1(0|27|69\.254|72\.(1[6-9]|2[0-9]|3[0-1])|92\.168)\./.test(target);
11
10
  }
12
11
  exports.isLanIp = isLanIp;
13
- function getServiceLibrary(service) {
14
- switch (service) {
15
- case types_1.Service.FTP:
16
- return types_1.Library.FTP;
17
- case types_1.Service.HTTP:
18
- return types_1.Library.HTTP;
19
- case types_1.Service.RSHELL:
20
- return types_1.Library.RSHELL;
21
- case types_1.Service.SMTP:
22
- return types_1.Library.SMTP;
23
- case types_1.Service.SQL:
24
- return types_1.Library.SQL;
25
- case types_1.Service.SSH:
26
- return types_1.Library.SSH;
27
- default:
28
- }
29
- return null;
30
- }
31
- exports.getServiceLibrary = getServiceLibrary;
32
12
  function getPermissionSegmentValueByString(flag, flagType) {
33
13
  switch (flagType) {
34
14
  case 'x':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "greybel-mock-environment",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "Mock environment",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index",