@accesswebspero/shared 0.0.1 → 0.0.2

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/index.cjs CHANGED
@@ -20,7 +20,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
- ROLES: () => ROLES
23
+ CURRENCIES: () => CURRENCIES,
24
+ CURRENCY_SYMBOLS: () => CURRENCY_SYMBOLS,
25
+ METHODS: () => METHODS,
26
+ PAYMENT_METHODS: () => PAYMENT_METHODS,
27
+ PAYMENT_STATUSES: () => PAYMENT_STATUSES,
28
+ PROGRAM_DURATIONS: () => PROGRAM_DURATIONS,
29
+ ROLES: () => ROLES,
30
+ emailRegex: () => emailRegex,
31
+ passwordRegex: () => passwordRegex,
32
+ validateEmail: () => validateEmail,
33
+ validatePassword: () => validatePassword
24
34
  });
25
35
  module.exports = __toCommonJS(index_exports);
26
36
  var ROLES = {
@@ -33,7 +43,54 @@ var ROLES = {
33
43
  PHYSIOTHERAPIST: "physiotherapist",
34
44
  SALES_EXECUTIVE: "sales_executive"
35
45
  };
46
+ var METHODS = {
47
+ GET: "GET",
48
+ POST: "POST",
49
+ PUT: "PUT",
50
+ PATCH: "PATCH",
51
+ DELETE: "DELETE"
52
+ };
53
+ var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
54
+ var passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/;
55
+ var validateEmail = (email) => {
56
+ return emailRegex.test(email);
57
+ };
58
+ var validatePassword = (password) => {
59
+ return passwordRegex.test(password);
60
+ };
61
+ var CURRENCIES = {
62
+ INR: "INR",
63
+ USD: "USD"
64
+ };
65
+ var CURRENCY_SYMBOLS = {
66
+ [CURRENCIES.INR]: "\u20B9",
67
+ [CURRENCIES.USD]: "$"
68
+ };
69
+ var PAYMENT_METHODS = {
70
+ RAZORPAY: "razorpay"
71
+ };
72
+ var PAYMENT_STATUSES = {
73
+ PENDING: "pending",
74
+ SUCCESS: "success",
75
+ FAILED: "failed"
76
+ };
77
+ var PROGRAM_DURATIONS = {
78
+ MONTHLY: 1,
79
+ QUARTERLY: 3,
80
+ HALF_YEARLY: 6,
81
+ YEARLY: 12
82
+ };
36
83
  // Annotate the CommonJS export names for ESM import in node:
37
84
  0 && (module.exports = {
38
- ROLES
85
+ CURRENCIES,
86
+ CURRENCY_SYMBOLS,
87
+ METHODS,
88
+ PAYMENT_METHODS,
89
+ PAYMENT_STATUSES,
90
+ PROGRAM_DURATIONS,
91
+ ROLES,
92
+ emailRegex,
93
+ passwordRegex,
94
+ validateEmail,
95
+ validatePassword
39
96
  });
package/dist/index.d.cts CHANGED
@@ -8,5 +8,38 @@ declare const ROLES: {
8
8
  PHYSIOTHERAPIST: string;
9
9
  SALES_EXECUTIVE: string;
10
10
  };
11
+ declare const METHODS: {
12
+ GET: string;
13
+ POST: string;
14
+ PUT: string;
15
+ PATCH: string;
16
+ DELETE: string;
17
+ };
18
+ declare const emailRegex: RegExp;
19
+ declare const passwordRegex: RegExp;
20
+ declare const validateEmail: (email: string) => boolean;
21
+ declare const validatePassword: (password: string) => boolean;
22
+ declare const CURRENCIES: {
23
+ INR: string;
24
+ USD: string;
25
+ };
26
+ declare const CURRENCY_SYMBOLS: {
27
+ [CURRENCIES.INR]: string;
28
+ [CURRENCIES.USD]: string;
29
+ };
30
+ declare const PAYMENT_METHODS: {
31
+ RAZORPAY: string;
32
+ };
33
+ declare const PAYMENT_STATUSES: {
34
+ PENDING: string;
35
+ SUCCESS: string;
36
+ FAILED: string;
37
+ };
38
+ declare const PROGRAM_DURATIONS: {
39
+ MONTHLY: number;
40
+ QUARTERLY: number;
41
+ HALF_YEARLY: number;
42
+ YEARLY: number;
43
+ };
11
44
 
12
- export { ROLES };
45
+ export { CURRENCIES, CURRENCY_SYMBOLS, METHODS, PAYMENT_METHODS, PAYMENT_STATUSES, PROGRAM_DURATIONS, ROLES, emailRegex, passwordRegex, validateEmail, validatePassword };
package/dist/index.d.ts CHANGED
@@ -8,5 +8,38 @@ declare const ROLES: {
8
8
  PHYSIOTHERAPIST: string;
9
9
  SALES_EXECUTIVE: string;
10
10
  };
11
+ declare const METHODS: {
12
+ GET: string;
13
+ POST: string;
14
+ PUT: string;
15
+ PATCH: string;
16
+ DELETE: string;
17
+ };
18
+ declare const emailRegex: RegExp;
19
+ declare const passwordRegex: RegExp;
20
+ declare const validateEmail: (email: string) => boolean;
21
+ declare const validatePassword: (password: string) => boolean;
22
+ declare const CURRENCIES: {
23
+ INR: string;
24
+ USD: string;
25
+ };
26
+ declare const CURRENCY_SYMBOLS: {
27
+ [CURRENCIES.INR]: string;
28
+ [CURRENCIES.USD]: string;
29
+ };
30
+ declare const PAYMENT_METHODS: {
31
+ RAZORPAY: string;
32
+ };
33
+ declare const PAYMENT_STATUSES: {
34
+ PENDING: string;
35
+ SUCCESS: string;
36
+ FAILED: string;
37
+ };
38
+ declare const PROGRAM_DURATIONS: {
39
+ MONTHLY: number;
40
+ QUARTERLY: number;
41
+ HALF_YEARLY: number;
42
+ YEARLY: number;
43
+ };
11
44
 
12
- export { ROLES };
45
+ export { CURRENCIES, CURRENCY_SYMBOLS, METHODS, PAYMENT_METHODS, PAYMENT_STATUSES, PROGRAM_DURATIONS, ROLES, emailRegex, passwordRegex, validateEmail, validatePassword };
package/dist/index.js CHANGED
@@ -9,6 +9,53 @@ var ROLES = {
9
9
  PHYSIOTHERAPIST: "physiotherapist",
10
10
  SALES_EXECUTIVE: "sales_executive"
11
11
  };
12
+ var METHODS = {
13
+ GET: "GET",
14
+ POST: "POST",
15
+ PUT: "PUT",
16
+ PATCH: "PATCH",
17
+ DELETE: "DELETE"
18
+ };
19
+ var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
20
+ var passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/;
21
+ var validateEmail = (email) => {
22
+ return emailRegex.test(email);
23
+ };
24
+ var validatePassword = (password) => {
25
+ return passwordRegex.test(password);
26
+ };
27
+ var CURRENCIES = {
28
+ INR: "INR",
29
+ USD: "USD"
30
+ };
31
+ var CURRENCY_SYMBOLS = {
32
+ [CURRENCIES.INR]: "\u20B9",
33
+ [CURRENCIES.USD]: "$"
34
+ };
35
+ var PAYMENT_METHODS = {
36
+ RAZORPAY: "razorpay"
37
+ };
38
+ var PAYMENT_STATUSES = {
39
+ PENDING: "pending",
40
+ SUCCESS: "success",
41
+ FAILED: "failed"
42
+ };
43
+ var PROGRAM_DURATIONS = {
44
+ MONTHLY: 1,
45
+ QUARTERLY: 3,
46
+ HALF_YEARLY: 6,
47
+ YEARLY: 12
48
+ };
12
49
  export {
13
- ROLES
50
+ CURRENCIES,
51
+ CURRENCY_SYMBOLS,
52
+ METHODS,
53
+ PAYMENT_METHODS,
54
+ PAYMENT_STATUSES,
55
+ PROGRAM_DURATIONS,
56
+ ROLES,
57
+ emailRegex,
58
+ passwordRegex,
59
+ validateEmail,
60
+ validatePassword
14
61
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@accesswebspero/shared",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
package/src/index.ts CHANGED
@@ -7,4 +7,50 @@ export const ROLES = {
7
7
  TRAINER: 'trainer',
8
8
  PHYSIOTHERAPIST: 'physiotherapist',
9
9
  SALES_EXECUTIVE: 'sales_executive',
10
- }
10
+ };
11
+
12
+ export const METHODS = {
13
+ GET: 'GET',
14
+ POST: 'POST',
15
+ PUT: 'PUT',
16
+ PATCH: 'PATCH',
17
+ DELETE: 'DELETE',
18
+ };
19
+
20
+ export const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
21
+ export const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/;
22
+
23
+ export const validateEmail = (email: string) => {
24
+ return emailRegex.test(email);
25
+ }
26
+
27
+ export const validatePassword = (password: string) => {
28
+ return passwordRegex.test(password);
29
+ }
30
+
31
+ export const CURRENCIES = {
32
+ INR: 'INR',
33
+ USD: 'USD',
34
+ };
35
+
36
+ export const CURRENCY_SYMBOLS = {
37
+ [CURRENCIES.INR]: '₹',
38
+ [CURRENCIES.USD]: '$',
39
+ };
40
+
41
+ export const PAYMENT_METHODS = {
42
+ RAZORPAY: 'razorpay',
43
+ };
44
+
45
+ export const PAYMENT_STATUSES = {
46
+ PENDING: 'pending',
47
+ SUCCESS: 'success',
48
+ FAILED: 'failed',
49
+ };
50
+
51
+ export const PROGRAM_DURATIONS = {
52
+ MONTHLY: 1,
53
+ QUARTERLY: 3,
54
+ HALF_YEARLY: 6,
55
+ YEARLY: 12,
56
+ };