@bwi-mentorspaces/application-utils-npm 0.0.5 → 0.0.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.
Files changed (115) hide show
  1. package/chat/index.d.ts +36 -36
  2. package/chat/index.js +58 -58
  3. package/chat/stream/enum/index.d.ts +33 -27
  4. package/chat/stream/enum/index.js +41 -34
  5. package/chat/stream/enum/index.js.map +1 -1
  6. package/chat/stream/index.d.ts +9 -9
  7. package/chat/stream/index.js +17 -17
  8. package/chat/stream/models/_/channel.data.d.ts +19 -19
  9. package/chat/stream/models/_/channel.data.js +2 -2
  10. package/chat/stream/models/_/channel.member.d.ts +14 -14
  11. package/chat/stream/models/_/channel.member.js +11 -11
  12. package/chat/stream/models/_/channel.response.d.ts +8 -8
  13. package/chat/stream/models/_/channel.response.js +2 -2
  14. package/chat/stream/models/_/event.data.d.ts +16 -0
  15. package/chat/stream/models/_/event.data.js +4 -0
  16. package/chat/stream/models/_/event.data.js.map +1 -0
  17. package/chat/stream/models/_/message.response.d.ts +8 -8
  18. package/chat/stream/models/_/message.response.js +2 -2
  19. package/chat/stream/models/_/stream.config.d.ts +22 -22
  20. package/chat/stream/models/_/stream.config.js +2 -2
  21. package/chat/stream/models/_/user.response.d.ts +8 -8
  22. package/chat/stream/models/_/user.response.js +2 -2
  23. package/chat/stream/models/index.d.ts +9 -7
  24. package/chat/stream/models/index.js +5 -5
  25. package/chat/stream/models/index.js.map +1 -1
  26. package/chat/stream/stream.api.d.ts +63 -63
  27. package/chat/stream/stream.api.js +76 -76
  28. package/chat/stream/stream.auth.d.ts +70 -70
  29. package/chat/stream/stream.auth.js +80 -80
  30. package/chat/stream/stream.base.d.ts +56 -56
  31. package/chat/stream/stream.base.js +93 -93
  32. package/chat/stream/stream.channel.d.ts +132 -118
  33. package/chat/stream/stream.channel.js +306 -285
  34. package/chat/stream/stream.channel.js.map +1 -1
  35. package/chat/stream/stream.error.d.ts +19 -19
  36. package/chat/stream/stream.error.js +17 -17
  37. package/chat/stream/stream.member.d.ts +75 -75
  38. package/chat/stream/stream.member.js +175 -175
  39. package/chat/stream/stream.message.d.ts +59 -59
  40. package/chat/stream/stream.message.js +112 -112
  41. package/chat/stream/stream.user.d.ts +49 -49
  42. package/chat/stream/stream.user.js +90 -90
  43. package/core/_/api-error.d.ts +24 -24
  44. package/core/_/api-error.js +21 -21
  45. package/core/_/api-response.d.ts +25 -25
  46. package/core/_/api-response.js +21 -21
  47. package/core/_/cors-headers.d.ts +16 -16
  48. package/core/_/cors-headers.js +32 -32
  49. package/core/_/model.d.ts +39 -31
  50. package/core/_/model.js +2 -2
  51. package/core/_/service-request.d.ts +66 -66
  52. package/core/_/service-request.js +104 -104
  53. package/core/_/service-request.js.map +1 -1
  54. package/core/index.d.ts +10 -10
  55. package/core/index.js +11 -11
  56. package/deployment/_/serverless.d.ts +26 -26
  57. package/deployment/_/serverless.js +43 -43
  58. package/deployment/index.d.ts +2 -2
  59. package/deployment/index.js +5 -5
  60. package/endpoint-test-factory/_/test-factory.d.ts +45 -45
  61. package/endpoint-test-factory/_/test-factory.js +91 -91
  62. package/endpoint-test-factory/index.d.ts +2 -2
  63. package/endpoint-test-factory/index.js +5 -5
  64. package/enums/index.d.ts +92 -92
  65. package/enums/index.js +2 -2
  66. package/meet/index.d.ts +36 -36
  67. package/meet/index.js +58 -58
  68. package/meet/twilio/enum/index.d.ts +6 -6
  69. package/meet/twilio/enum/index.js +10 -10
  70. package/meet/twilio/index.d.ts +5 -5
  71. package/meet/twilio/index.js +11 -11
  72. package/meet/twilio/models/_/room.data.d.ts +6 -6
  73. package/meet/twilio/models/_/room.data.js +2 -2
  74. package/meet/twilio/models/_/twilio.config.d.ts +29 -29
  75. package/meet/twilio/models/_/twilio.config.js +2 -2
  76. package/meet/twilio/models/index.d.ts +3 -3
  77. package/meet/twilio/models/index.js +2 -2
  78. package/meet/twilio/twilio.api.d.ts +28 -28
  79. package/meet/twilio/twilio.api.js +45 -45
  80. package/meet/twilio/twilio.auth.d.ts +55 -55
  81. package/meet/twilio/twilio.auth.js +83 -83
  82. package/meet/twilio/twilio.base.d.ts +41 -41
  83. package/meet/twilio/twilio.base.js +53 -53
  84. package/meet/twilio/twilio.room.d.ts +46 -46
  85. package/meet/twilio/twilio.room.js +124 -124
  86. package/package.json +57 -57
  87. package/swagger/_/swagger.config.d.ts +21 -21
  88. package/swagger/_/swagger.config.js +2 -2
  89. package/swagger/_/swagger.d.ts +37 -37
  90. package/swagger/_/swagger.js +78 -78
  91. package/swagger/index.d.ts +3 -3
  92. package/swagger/index.js +5 -5
  93. package/types/index.d.ts +19 -19
  94. package/types/index.js +2 -2
  95. package/utils/_/encoder.d.ts +19 -19
  96. package/utils/_/encoder.js +27 -27
  97. package/utils/_/encryptor.d.ts +26 -26
  98. package/utils/_/encryptor.js +67 -67
  99. package/utils/_/hasher.d.ts +25 -25
  100. package/utils/_/hasher.js +63 -63
  101. package/utils/_/object-mapper.d.ts +12 -12
  102. package/utils/_/object-mapper.js +22 -22
  103. package/utils/_/string-formatter.d.ts +34 -34
  104. package/utils/_/string-formatter.js +49 -49
  105. package/utils/_/utc-date.d.ts +35 -35
  106. package/utils/_/utc-date.js +84 -84
  107. package/utils/index.d.ts +7 -7
  108. package/utils/index.js +15 -15
  109. package/validators/_/checker.d.ts +62 -62
  110. package/validators/_/checker.js +98 -98
  111. package/validators/_/regex.d.ts +98 -98
  112. package/validators/_/regex.js +142 -142
  113. package/validators/_/regex.js.map +1 -1
  114. package/validators/index.d.ts +3 -3
  115. package/validators/index.js +7 -7
@@ -1,62 +1,62 @@
1
- /**
2
- * Class to run value checks for validation purposes
3
- */
4
- export declare abstract class Checker {
5
- /**
6
- * Method to match value against the Regular Expression
7
- *
8
- * @param {RegExp} regex regular expression to match the value format
9
- * @param {string} value value to match
10
- * @returns {boolean} is matched
11
- */
12
- static isMatch(regex: RegExp, value: string): boolean;
13
- /**
14
- * Method to check if value is null or empty
15
- *
16
- * @param {string | undefined | null} value a value to validate
17
- * @returns {boolean} is null or empty
18
- */
19
- static isNullOrEmpty(value: string | undefined | null): boolean;
20
- /**
21
- * Method to check if the number is modular (returns 0)
22
- *
23
- * @param {number} mod mod factor
24
- * @param {number} value number to run mod function on
25
- * @returns {boolean} is modular number
26
- */
27
- static isModularBy(mod: number, value: number): boolean;
28
- /**
29
- * Method to check min length of a value
30
- *
31
- * @param {number} length min length
32
- * @param {string} value value to check
33
- * @returns {boolean} if value's length is greater or equal to the length param
34
- */
35
- static hasMinLength(length: number, value: string): boolean;
36
- /**
37
- * Method to check max length of a value
38
- *
39
- * @param {number} length max length
40
- * @param {string} value value to check
41
- * @returns {boolean} if value's length is less or equal to the length param
42
- */
43
- static hasMaxLength(length: number, value: string): boolean;
44
- /**
45
- * Method to check exact length of a value
46
- *
47
- * @param {number} length exact length
48
- * @param {string} value value to check
49
- * @returns {boolean} if value's length is exact length as the length param
50
- */
51
- static hasExactLength(length: number, value: string): boolean;
52
- /**
53
- * Check a specific name or string
54
- *
55
- * @param {number} min minimum length
56
- * @param {number} max maximum length
57
- * @param {string} value string value to check
58
- * @param {boolean} isRequired if the value is required
59
- * @returns {boolean} true / false
60
- */
61
- static isStringValid(min: number, max: number, value: string, isRequired?: boolean): boolean;
62
- }
1
+ /**
2
+ * Class to run value checks for validation purposes
3
+ */
4
+ export declare abstract class Checker {
5
+ /**
6
+ * Method to match value against the Regular Expression
7
+ *
8
+ * @param {RegExp} regex regular expression to match the value format
9
+ * @param {string} value value to match
10
+ * @returns {boolean} is matched
11
+ */
12
+ static isMatch(regex: RegExp, value: string): boolean;
13
+ /**
14
+ * Method to check if value is null or empty
15
+ *
16
+ * @param {string | undefined | null} value a value to validate
17
+ * @returns {boolean} is null or empty
18
+ */
19
+ static isNullOrEmpty(value: string | undefined | null): boolean;
20
+ /**
21
+ * Method to check if the number is modular (returns 0)
22
+ *
23
+ * @param {number} mod mod factor
24
+ * @param {number} value number to run mod function on
25
+ * @returns {boolean} is modular number
26
+ */
27
+ static isModularBy(mod: number, value: number): boolean;
28
+ /**
29
+ * Method to check min length of a value
30
+ *
31
+ * @param {number} length min length
32
+ * @param {string} value value to check
33
+ * @returns {boolean} if value's length is greater or equal to the length param
34
+ */
35
+ static hasMinLength(length: number, value: string): boolean;
36
+ /**
37
+ * Method to check max length of a value
38
+ *
39
+ * @param {number} length max length
40
+ * @param {string} value value to check
41
+ * @returns {boolean} if value's length is less or equal to the length param
42
+ */
43
+ static hasMaxLength(length: number, value: string): boolean;
44
+ /**
45
+ * Method to check exact length of a value
46
+ *
47
+ * @param {number} length exact length
48
+ * @param {string} value value to check
49
+ * @returns {boolean} if value's length is exact length as the length param
50
+ */
51
+ static hasExactLength(length: number, value: string): boolean;
52
+ /**
53
+ * Check a specific name or string
54
+ *
55
+ * @param {number} min minimum length
56
+ * @param {number} max maximum length
57
+ * @param {string} value string value to check
58
+ * @param {boolean} isRequired if the value is required
59
+ * @returns {boolean} true / false
60
+ */
61
+ static isStringValid(min: number, max: number, value: string, isRequired?: boolean): boolean;
62
+ }
@@ -1,99 +1,99 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Checker = void 0;
4
- /**
5
- * Class to run value checks for validation purposes
6
- */
7
- class Checker {
8
- /**
9
- * Method to match value against the Regular Expression
10
- *
11
- * @param {RegExp} regex regular expression to match the value format
12
- * @param {string} value value to match
13
- * @returns {boolean} is matched
14
- */
15
- static isMatch(regex, value) {
16
- return regex.test(value);
17
- }
18
- /**
19
- * Method to check if value is null or empty
20
- *
21
- * @param {string | undefined | null} value a value to validate
22
- * @returns {boolean} is null or empty
23
- */
24
- static isNullOrEmpty(value) {
25
- if (value === undefined) {
26
- return true;
27
- }
28
- if (value === null) {
29
- return true;
30
- }
31
- return /^\s*$/.test(value.toString()) || value.toString().trim().length === 0;
32
- }
33
- /**
34
- * Method to check if the number is modular (returns 0)
35
- *
36
- * @param {number} mod mod factor
37
- * @param {number} value number to run mod function on
38
- * @returns {boolean} is modular number
39
- */
40
- static isModularBy(mod, value) {
41
- return value % mod == 0;
42
- }
43
- /**
44
- * Method to check min length of a value
45
- *
46
- * @param {number} length min length
47
- * @param {string} value value to check
48
- * @returns {boolean} if value's length is greater or equal to the length param
49
- */
50
- static hasMinLength(length, value) {
51
- return value.length >= length;
52
- }
53
- /**
54
- * Method to check max length of a value
55
- *
56
- * @param {number} length max length
57
- * @param {string} value value to check
58
- * @returns {boolean} if value's length is less or equal to the length param
59
- */
60
- static hasMaxLength(length, value) {
61
- return value.length <= length;
62
- }
63
- /**
64
- * Method to check exact length of a value
65
- *
66
- * @param {number} length exact length
67
- * @param {string} value value to check
68
- * @returns {boolean} if value's length is exact length as the length param
69
- */
70
- static hasExactLength(length, value) {
71
- return value.length == length;
72
- }
73
- /**
74
- * Check a specific name or string
75
- *
76
- * @param {number} min minimum length
77
- * @param {number} max maximum length
78
- * @param {string} value string value to check
79
- * @param {boolean} isRequired if the value is required
80
- * @returns {boolean} true / false
81
- */
82
- static isStringValid(min, max, value, isRequired = true) {
83
- if (isRequired && Checker.isNullOrEmpty(value)) {
84
- return false;
85
- }
86
- if (!isRequired && Checker.isNullOrEmpty(value)) {
87
- return true;
88
- }
89
- if (!Checker.isNullOrEmpty(value)) {
90
- // check value
91
- const minLength = Checker.hasMinLength(min, value);
92
- const maxLength = Checker.hasMaxLength(max, value);
93
- //return the result.
94
- return minLength && maxLength;
95
- }
96
- }
97
- }
98
- exports.Checker = Checker;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Checker = void 0;
4
+ /**
5
+ * Class to run value checks for validation purposes
6
+ */
7
+ class Checker {
8
+ /**
9
+ * Method to match value against the Regular Expression
10
+ *
11
+ * @param {RegExp} regex regular expression to match the value format
12
+ * @param {string} value value to match
13
+ * @returns {boolean} is matched
14
+ */
15
+ static isMatch(regex, value) {
16
+ return regex.test(value);
17
+ }
18
+ /**
19
+ * Method to check if value is null or empty
20
+ *
21
+ * @param {string | undefined | null} value a value to validate
22
+ * @returns {boolean} is null or empty
23
+ */
24
+ static isNullOrEmpty(value) {
25
+ if (value === undefined) {
26
+ return true;
27
+ }
28
+ if (value === null) {
29
+ return true;
30
+ }
31
+ return /^\s*$/.test(value.toString()) || value.toString().trim().length === 0;
32
+ }
33
+ /**
34
+ * Method to check if the number is modular (returns 0)
35
+ *
36
+ * @param {number} mod mod factor
37
+ * @param {number} value number to run mod function on
38
+ * @returns {boolean} is modular number
39
+ */
40
+ static isModularBy(mod, value) {
41
+ return value % mod == 0;
42
+ }
43
+ /**
44
+ * Method to check min length of a value
45
+ *
46
+ * @param {number} length min length
47
+ * @param {string} value value to check
48
+ * @returns {boolean} if value's length is greater or equal to the length param
49
+ */
50
+ static hasMinLength(length, value) {
51
+ return value.length >= length;
52
+ }
53
+ /**
54
+ * Method to check max length of a value
55
+ *
56
+ * @param {number} length max length
57
+ * @param {string} value value to check
58
+ * @returns {boolean} if value's length is less or equal to the length param
59
+ */
60
+ static hasMaxLength(length, value) {
61
+ return value.length <= length;
62
+ }
63
+ /**
64
+ * Method to check exact length of a value
65
+ *
66
+ * @param {number} length exact length
67
+ * @param {string} value value to check
68
+ * @returns {boolean} if value's length is exact length as the length param
69
+ */
70
+ static hasExactLength(length, value) {
71
+ return value.length == length;
72
+ }
73
+ /**
74
+ * Check a specific name or string
75
+ *
76
+ * @param {number} min minimum length
77
+ * @param {number} max maximum length
78
+ * @param {string} value string value to check
79
+ * @param {boolean} isRequired if the value is required
80
+ * @returns {boolean} true / false
81
+ */
82
+ static isStringValid(min, max, value, isRequired = true) {
83
+ if (isRequired && Checker.isNullOrEmpty(value)) {
84
+ return false;
85
+ }
86
+ if (!isRequired && Checker.isNullOrEmpty(value)) {
87
+ return true;
88
+ }
89
+ if (!Checker.isNullOrEmpty(value)) {
90
+ // check value
91
+ const minLength = Checker.hasMinLength(min, value);
92
+ const maxLength = Checker.hasMaxLength(max, value);
93
+ //return the result.
94
+ return minLength && maxLength;
95
+ }
96
+ }
97
+ }
98
+ exports.Checker = Checker;
99
99
  //# sourceMappingURL=checker.js.map
@@ -1,98 +1,98 @@
1
- /**
2
- * Abstract class that provides Regular Expression patterns for validation
3
- */
4
- export declare abstract class Regex {
5
- /**
6
- * Method that provides regular expression for alphabetic character validation
7
- *
8
- * @param {boolean} includeSpaces flag to include space or not in the pattern
9
- * @returns {RegExp} regular expression
10
- */
11
- static alpha(includeSpaces: boolean): RegExp;
12
- /**
13
- * Method that provides regular express for alpha-numeric character validation
14
- *
15
- * @param {boolean} includeSpaces flag to include space or not in the pattern
16
- * @returns {RegExp} regular expression
17
- */
18
- static alphaNumeric(includeSpaces: boolean): RegExp;
19
- /**
20
- * Method that provides regular expression for numeric character validation
21
- *
22
- * @returns {RegExp} regular expression
23
- */
24
- static numeric(): RegExp;
25
- /**
26
- * Method that provides regular expression for a value that contains a number validation
27
- *
28
- * @returns {RegExp} regular expression
29
- */
30
- static hasNumber(): RegExp;
31
- /**
32
- * Method that provides regular expression for a value that contains special characters validation
33
- *
34
- * @returns {RegExp} regular expression
35
- */
36
- static hasSpecialCharacter(): RegExp;
37
- /**
38
- * Method that provides regular expression for a value that is all upper case validation
39
- *
40
- * @returns {RegExp} regular expression
41
- */
42
- static isAllUpperCase(): RegExp;
43
- /**
44
- * Method that provides regular expression for a value that contains upper case validation
45
- *
46
- * @returns {RegExp} regular expression
47
- */
48
- static hasUpperCase(): RegExp;
49
- /**
50
- * Method that provides regular expression for a value that is all lower case validation
51
- *
52
- * @returns {RegExp} regular expression
53
- */
54
- static isAllLowerCase(): RegExp;
55
- /**
56
- * Method that provides regular expression for a value that contains lower case validation
57
- *
58
- * @returns {RegExp} regular expression
59
- */
60
- static hasLowerCase(): RegExp;
61
- /**
62
- * Method that provides regular expression for email address validation
63
- *
64
- * @returns {RegExp} regular expression
65
- */
66
- static emailAddress(): RegExp;
67
- /**
68
- * Method that provides regular expression for a phone number validation (USA)
69
- *
70
- * @returns {RegExp} regular expression
71
- */
72
- static phoneNumber(): RegExp;
73
- /**
74
- * Method that provides regular expression for a street validation
75
- *
76
- * @returns {RegExp} regular expression
77
- */
78
- static street(): RegExp;
79
- /**
80
- * Method that provides regular expression for a time validation
81
- *
82
- * @returns {RegExp} regular expression
83
- */
84
- static time(): RegExp;
85
- /**
86
- * Method that provides regular expression for a URL validation
87
- *
88
- * @returns {RegExp} regular expression
89
- */
90
- static url(): RegExp;
91
- /**
92
- * Method that provides regular expression for a social media link validation
93
- *
94
- * @param {string} social name of the social media
95
- * @returns {RegExp} regular expression
96
- */
97
- static socialMediaLink(social: string): RegExp;
98
- }
1
+ /**
2
+ * Abstract class that provides Regular Expression patterns for validation
3
+ */
4
+ export declare abstract class Regex {
5
+ /**
6
+ * Method that provides regular expression for alphabetic character validation
7
+ *
8
+ * @param {boolean} includeSpaces flag to include space or not in the pattern
9
+ * @returns {RegExp} regular expression
10
+ */
11
+ static alpha(includeSpaces: boolean): RegExp;
12
+ /**
13
+ * Method that provides regular express for alpha-numeric character validation
14
+ *
15
+ * @param {boolean} includeSpaces flag to include space or not in the pattern
16
+ * @returns {RegExp} regular expression
17
+ */
18
+ static alphaNumeric(includeSpaces: boolean): RegExp;
19
+ /**
20
+ * Method that provides regular expression for numeric character validation
21
+ *
22
+ * @returns {RegExp} regular expression
23
+ */
24
+ static numeric(): RegExp;
25
+ /**
26
+ * Method that provides regular expression for a value that contains a number validation
27
+ *
28
+ * @returns {RegExp} regular expression
29
+ */
30
+ static hasNumber(): RegExp;
31
+ /**
32
+ * Method that provides regular expression for a value that contains special characters validation
33
+ *
34
+ * @returns {RegExp} regular expression
35
+ */
36
+ static hasSpecialCharacter(): RegExp;
37
+ /**
38
+ * Method that provides regular expression for a value that is all upper case validation
39
+ *
40
+ * @returns {RegExp} regular expression
41
+ */
42
+ static isAllUpperCase(): RegExp;
43
+ /**
44
+ * Method that provides regular expression for a value that contains upper case validation
45
+ *
46
+ * @returns {RegExp} regular expression
47
+ */
48
+ static hasUpperCase(): RegExp;
49
+ /**
50
+ * Method that provides regular expression for a value that is all lower case validation
51
+ *
52
+ * @returns {RegExp} regular expression
53
+ */
54
+ static isAllLowerCase(): RegExp;
55
+ /**
56
+ * Method that provides regular expression for a value that contains lower case validation
57
+ *
58
+ * @returns {RegExp} regular expression
59
+ */
60
+ static hasLowerCase(): RegExp;
61
+ /**
62
+ * Method that provides regular expression for email address validation
63
+ *
64
+ * @returns {RegExp} regular expression
65
+ */
66
+ static emailAddress(): RegExp;
67
+ /**
68
+ * Method that provides regular expression for a phone number validation (USA)
69
+ *
70
+ * @returns {RegExp} regular expression
71
+ */
72
+ static phoneNumber(): RegExp;
73
+ /**
74
+ * Method that provides regular expression for a street validation
75
+ *
76
+ * @returns {RegExp} regular expression
77
+ */
78
+ static street(): RegExp;
79
+ /**
80
+ * Method that provides regular expression for a time validation
81
+ *
82
+ * @returns {RegExp} regular expression
83
+ */
84
+ static time(): RegExp;
85
+ /**
86
+ * Method that provides regular expression for a URL validation
87
+ *
88
+ * @returns {RegExp} regular expression
89
+ */
90
+ static url(): RegExp;
91
+ /**
92
+ * Method that provides regular expression for a social media link validation
93
+ *
94
+ * @param {string} social name of the social media
95
+ * @returns {RegExp} regular expression
96
+ */
97
+ static socialMediaLink(social: string): RegExp;
98
+ }