sidekick-server-2 0.1.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.
Files changed (218) hide show
  1. package/README.md +223 -0
  2. package/dist/ai/index.d.ts +2 -0
  3. package/dist/ai/index.d.ts.map +1 -0
  4. package/dist/ai/index.js +2 -0
  5. package/dist/ai/index.js.map +1 -0
  6. package/dist/ai/perplexity-ai.d.ts +3 -0
  7. package/dist/ai/perplexity-ai.d.ts.map +1 -0
  8. package/dist/ai/perplexity-ai.js +28 -0
  9. package/dist/ai/perplexity-ai.js.map +1 -0
  10. package/dist/app-config.d.ts +13 -0
  11. package/dist/app-config.d.ts.map +1 -0
  12. package/dist/app-config.js +33 -0
  13. package/dist/app-config.js.map +1 -0
  14. package/dist/cors-config.d.ts +9 -0
  15. package/dist/cors-config.d.ts.map +1 -0
  16. package/dist/cors-config.js +24 -0
  17. package/dist/cors-config.js.map +1 -0
  18. package/dist/db-connection.d.ts +13 -0
  19. package/dist/db-connection.d.ts.map +1 -0
  20. package/dist/db-connection.js +22 -0
  21. package/dist/db-connection.js.map +1 -0
  22. package/dist/error-handler.d.ts +3 -0
  23. package/dist/error-handler.d.ts.map +1 -0
  24. package/dist/error-handler.js +15 -0
  25. package/dist/error-handler.js.map +1 -0
  26. package/dist/index.d.ts +19 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +87 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/local-cache.d.ts +14 -0
  31. package/dist/local-cache.d.ts.map +1 -0
  32. package/dist/local-cache.js +44 -0
  33. package/dist/local-cache.js.map +1 -0
  34. package/dist/r2-buckets/get-signed-url.d.ts +2 -0
  35. package/dist/r2-buckets/get-signed-url.d.ts.map +1 -0
  36. package/dist/r2-buckets/get-signed-url.js +22 -0
  37. package/dist/r2-buckets/get-signed-url.js.map +1 -0
  38. package/dist/r2-buckets/index.d.ts +3 -0
  39. package/dist/r2-buckets/index.d.ts.map +1 -0
  40. package/dist/r2-buckets/index.js +3 -0
  41. package/dist/r2-buckets/index.js.map +1 -0
  42. package/dist/r2-buckets/r2-client.d.ts +3 -0
  43. package/dist/r2-buckets/r2-client.d.ts.map +1 -0
  44. package/dist/r2-buckets/r2-client.js +18 -0
  45. package/dist/r2-buckets/r2-client.js.map +1 -0
  46. package/dist/r2-buckets/upload-r2.d.ts +11 -0
  47. package/dist/r2-buckets/upload-r2.d.ts.map +1 -0
  48. package/dist/r2-buckets/upload-r2.js +49 -0
  49. package/dist/r2-buckets/upload-r2.js.map +1 -0
  50. package/dist/routes/authentication/check-session.d.ts +4 -0
  51. package/dist/routes/authentication/check-session.d.ts.map +1 -0
  52. package/dist/routes/authentication/check-session.js +79 -0
  53. package/dist/routes/authentication/check-session.js.map +1 -0
  54. package/dist/routes/authentication/login-router.d.ts +3 -0
  55. package/dist/routes/authentication/login-router.d.ts.map +1 -0
  56. package/dist/routes/authentication/login-router.js +83 -0
  57. package/dist/routes/authentication/login-router.js.map +1 -0
  58. package/dist/routes/authentication/reset-password.d.ts +3 -0
  59. package/dist/routes/authentication/reset-password.d.ts.map +1 -0
  60. package/dist/routes/authentication/reset-password.js +92 -0
  61. package/dist/routes/authentication/reset-password.js.map +1 -0
  62. package/dist/routes/authentication/send-otp-router.d.ts +3 -0
  63. package/dist/routes/authentication/send-otp-router.d.ts.map +1 -0
  64. package/dist/routes/authentication/send-otp-router.js +89 -0
  65. package/dist/routes/authentication/send-otp-router.js.map +1 -0
  66. package/dist/routes/authentication/user-profile.d.ts +3 -0
  67. package/dist/routes/authentication/user-profile.d.ts.map +1 -0
  68. package/dist/routes/authentication/user-profile.js +44 -0
  69. package/dist/routes/authentication/user-profile.js.map +1 -0
  70. package/dist/routes/authentication/user-registration-router.d.ts +3 -0
  71. package/dist/routes/authentication/user-registration-router.d.ts.map +1 -0
  72. package/dist/routes/authentication/user-registration-router.js +120 -0
  73. package/dist/routes/authentication/user-registration-router.js.map +1 -0
  74. package/dist/routes/authentication/validator.d.ts +14 -0
  75. package/dist/routes/authentication/validator.d.ts.map +1 -0
  76. package/dist/routes/authentication/validator.js +69 -0
  77. package/dist/routes/authentication/validator.js.map +1 -0
  78. package/dist/routes/countries/countries-router.d.ts +3 -0
  79. package/dist/routes/countries/countries-router.d.ts.map +1 -0
  80. package/dist/routes/countries/countries-router.js +23 -0
  81. package/dist/routes/countries/countries-router.js.map +1 -0
  82. package/dist/routes/feature-flags/feature-flags.d.ts +5 -0
  83. package/dist/routes/feature-flags/feature-flags.d.ts.map +1 -0
  84. package/dist/routes/feature-flags/feature-flags.js +28 -0
  85. package/dist/routes/feature-flags/feature-flags.js.map +1 -0
  86. package/dist/routes/index.d.ts +9 -0
  87. package/dist/routes/index.d.ts.map +1 -0
  88. package/dist/routes/index.js +92 -0
  89. package/dist/routes/index.js.map +1 -0
  90. package/dist/routes/link-metadata.d.ts +3 -0
  91. package/dist/routes/link-metadata.d.ts.map +1 -0
  92. package/dist/routes/link-metadata.js +34 -0
  93. package/dist/routes/link-metadata.js.map +1 -0
  94. package/dist/routes/orgs/index.d.ts +2 -0
  95. package/dist/routes/orgs/index.d.ts.map +1 -0
  96. package/dist/routes/orgs/index.js +2 -0
  97. package/dist/routes/orgs/index.js.map +1 -0
  98. package/dist/routes/orgs/invitation.d.ts +3 -0
  99. package/dist/routes/orgs/invitation.d.ts.map +1 -0
  100. package/dist/routes/orgs/invitation.js +103 -0
  101. package/dist/routes/orgs/invitation.js.map +1 -0
  102. package/dist/routes/orgs/org-delete.d.ts +3 -0
  103. package/dist/routes/orgs/org-delete.d.ts.map +1 -0
  104. package/dist/routes/orgs/org-delete.js +53 -0
  105. package/dist/routes/orgs/org-delete.js.map +1 -0
  106. package/dist/routes/orgs/org-get.d.ts +3 -0
  107. package/dist/routes/orgs/org-get.d.ts.map +1 -0
  108. package/dist/routes/orgs/org-get.js +45 -0
  109. package/dist/routes/orgs/org-get.js.map +1 -0
  110. package/dist/routes/orgs/org-members.d.ts +12 -0
  111. package/dist/routes/orgs/org-members.d.ts.map +1 -0
  112. package/dist/routes/orgs/org-members.js +560 -0
  113. package/dist/routes/orgs/org-members.js.map +1 -0
  114. package/dist/routes/orgs/org-post.d.ts +3 -0
  115. package/dist/routes/orgs/org-post.d.ts.map +1 -0
  116. package/dist/routes/orgs/org-post.js +89 -0
  117. package/dist/routes/orgs/org-post.js.map +1 -0
  118. package/dist/routes/orgs/org-put.d.ts +3 -0
  119. package/dist/routes/orgs/org-put.d.ts.map +1 -0
  120. package/dist/routes/orgs/org-put.js +87 -0
  121. package/dist/routes/orgs/org-put.js.map +1 -0
  122. package/dist/routes/orgs/org-registration-router.d.ts +3 -0
  123. package/dist/routes/orgs/org-registration-router.d.ts.map +1 -0
  124. package/dist/routes/orgs/org-registration-router.js +12 -0
  125. package/dist/routes/orgs/org-registration-router.js.map +1 -0
  126. package/dist/routes/orgs/org-utils.d.ts +14 -0
  127. package/dist/routes/orgs/org-utils.d.ts.map +1 -0
  128. package/dist/routes/orgs/org-utils.js +234 -0
  129. package/dist/routes/orgs/org-utils.js.map +1 -0
  130. package/dist/routes/orgs/premium-org-utils.d.ts +3 -0
  131. package/dist/routes/orgs/premium-org-utils.d.ts.map +1 -0
  132. package/dist/routes/orgs/premium-org-utils.js +61 -0
  133. package/dist/routes/orgs/premium-org-utils.js.map +1 -0
  134. package/dist/routes/paid-plans/billingsdk-config.d.ts +36 -0
  135. package/dist/routes/paid-plans/billingsdk-config.d.ts.map +1 -0
  136. package/dist/routes/paid-plans/billingsdk-config.js +2 -0
  137. package/dist/routes/paid-plans/billingsdk-config.js.map +1 -0
  138. package/dist/routes/paid-plans/get-subscription-config.d.ts +3 -0
  139. package/dist/routes/paid-plans/get-subscription-config.d.ts.map +1 -0
  140. package/dist/routes/paid-plans/get-subscription-config.js +25 -0
  141. package/dist/routes/paid-plans/get-subscription-config.js.map +1 -0
  142. package/dist/routes/paid-plans/payment-gateway.d.ts +3 -0
  143. package/dist/routes/paid-plans/payment-gateway.d.ts.map +1 -0
  144. package/dist/routes/paid-plans/payment-gateway.js +324 -0
  145. package/dist/routes/paid-plans/payment-gateway.js.map +1 -0
  146. package/dist/routes/paid-plans/purchased-plans.d.ts +8 -0
  147. package/dist/routes/paid-plans/purchased-plans.d.ts.map +1 -0
  148. package/dist/routes/paid-plans/purchased-plans.js +191 -0
  149. package/dist/routes/paid-plans/purchased-plans.js.map +1 -0
  150. package/dist/routes/paid-plans/subscription-utils.d.ts +25 -0
  151. package/dist/routes/paid-plans/subscription-utils.d.ts.map +1 -0
  152. package/dist/routes/paid-plans/subscription-utils.js +156 -0
  153. package/dist/routes/paid-plans/subscription-utils.js.map +1 -0
  154. package/dist/s3-buckets/get-signed-url.d.ts +2 -0
  155. package/dist/s3-buckets/get-signed-url.d.ts.map +1 -0
  156. package/dist/s3-buckets/get-signed-url.js +22 -0
  157. package/dist/s3-buckets/get-signed-url.js.map +1 -0
  158. package/dist/s3-buckets/index.d.ts +3 -0
  159. package/dist/s3-buckets/index.d.ts.map +1 -0
  160. package/dist/s3-buckets/index.js +3 -0
  161. package/dist/s3-buckets/index.js.map +1 -0
  162. package/dist/s3-buckets/s3-client.d.ts +3 -0
  163. package/dist/s3-buckets/s3-client.d.ts.map +1 -0
  164. package/dist/s3-buckets/s3-client.js +17 -0
  165. package/dist/s3-buckets/s3-client.js.map +1 -0
  166. package/dist/s3-buckets/upload-s3.d.ts +11 -0
  167. package/dist/s3-buckets/upload-s3.d.ts.map +1 -0
  168. package/dist/s3-buckets/upload-s3.js +51 -0
  169. package/dist/s3-buckets/upload-s3.js.map +1 -0
  170. package/dist/secret.d.ts +4 -0
  171. package/dist/secret.d.ts.map +1 -0
  172. package/dist/secret.js +11 -0
  173. package/dist/secret.js.map +1 -0
  174. package/dist/socket-config.d.ts +4 -0
  175. package/dist/socket-config.d.ts.map +1 -0
  176. package/dist/socket-config.js +23 -0
  177. package/dist/socket-config.js.map +1 -0
  178. package/dist/types.d.ts +141 -0
  179. package/dist/types.d.ts.map +1 -0
  180. package/dist/types.js +2 -0
  181. package/dist/types.js.map +1 -0
  182. package/dist/utils/common-utils.d.ts +61 -0
  183. package/dist/utils/common-utils.d.ts.map +1 -0
  184. package/dist/utils/common-utils.js +99 -0
  185. package/dist/utils/common-utils.js.map +1 -0
  186. package/dist/utils/email-helper.d.ts +6 -0
  187. package/dist/utils/email-helper.d.ts.map +1 -0
  188. package/dist/utils/email-helper.js +33 -0
  189. package/dist/utils/email-helper.js.map +1 -0
  190. package/dist/utils/enums.d.ts +17 -0
  191. package/dist/utils/enums.d.ts.map +1 -0
  192. package/dist/utils/enums.js +27 -0
  193. package/dist/utils/enums.js.map +1 -0
  194. package/dist/utils/error-logger.d.ts +4 -0
  195. package/dist/utils/error-logger.d.ts.map +1 -0
  196. package/dist/utils/error-logger.js +30 -0
  197. package/dist/utils/error-logger.js.map +1 -0
  198. package/dist/utils/index.d.ts +9 -0
  199. package/dist/utils/index.d.ts.map +1 -0
  200. package/dist/utils/index.js +9 -0
  201. package/dist/utils/index.js.map +1 -0
  202. package/dist/utils/otp-helper.d.ts +5 -0
  203. package/dist/utils/otp-helper.d.ts.map +1 -0
  204. package/dist/utils/otp-helper.js +89 -0
  205. package/dist/utils/otp-helper.js.map +1 -0
  206. package/dist/utils/response-utils.d.ts +8 -0
  207. package/dist/utils/response-utils.d.ts.map +1 -0
  208. package/dist/utils/response-utils.js +37 -0
  209. package/dist/utils/response-utils.js.map +1 -0
  210. package/dist/utils/sql-helper.d.ts +27 -0
  211. package/dist/utils/sql-helper.d.ts.map +1 -0
  212. package/dist/utils/sql-helper.js +97 -0
  213. package/dist/utils/sql-helper.js.map +1 -0
  214. package/dist/utils/type.d.ts +81 -0
  215. package/dist/utils/type.d.ts.map +1 -0
  216. package/dist/utils/type.js +2 -0
  217. package/dist/utils/type.js.map +1 -0
  218. package/package.json +70 -0
@@ -0,0 +1,89 @@
1
+ import { appInfo } from '../../app-config.js';
2
+ import { getRequestFromRoute, isValidId } from '../../utils/common-utils.js';
3
+ import { ROLES } from '../../utils/enums.js';
4
+ import { getErrorResponseObj, getResponseObj, sendSuccessResponse, throwErrorInResponseIfErrorIsNotCustom } from '../../utils/response-utils.js';
5
+ import { initializeConnection, insertRecords } from '../../utils/sql-helper.js';
6
+ import { validateOrgRequestObj } from '../authentication/validator.js';
7
+ import { includeUsersInOrg } from './org-members.js';
8
+ const insertOrg = async (requestObj, connection, loggedInUserId) => {
9
+ const fields = ['org_name', 'org_address', 'org_state', 'org_country', 'org_external_id'];
10
+ const reqBody = getRequestFromRoute(requestObj, fields);
11
+ reqBody.org_created_by = loggedInUserId;
12
+ const isValid = validateOrgRequestObj(reqBody);
13
+ if (isValid !== true) {
14
+ throw getErrorResponseObj(isValid);
15
+ }
16
+ try {
17
+ const result = await insertRecords('auth_organization_tbl', [reqBody], connection);
18
+ // Here means success
19
+ return result;
20
+ }
21
+ catch (error) {
22
+ // Handle duplicate entry error (MySQL error code: 1062)
23
+ if (error && error.code === 'ER_DUP_ENTRY') {
24
+ throw getErrorResponseObj({
25
+ errorMsg: `${appInfo.account_type_txt.singular} already exists.`,
26
+ solution: `Please use a different ${appInfo.account_type_txt.singular} name or contact support.`,
27
+ }, error);
28
+ }
29
+ throw getErrorResponseObj({
30
+ errorMsg: error.message || `An error occurred while processing your ${appInfo.account_type_txt.singular} registration.`,
31
+ solution: 'Please try again later or contact support if the issue persists.',
32
+ }, error);
33
+ }
34
+ };
35
+ export const postOrgs = async (request, response) => {
36
+ /**
37
+ Request JSON can contain:
38
+ {
39
+ 'org_name',
40
+ 'org_address',
41
+ 'org_state',
42
+ 'org_country',
43
+ 'org_external_id',
44
+
45
+ 'included_users' : [{
46
+ user_id: 123456,
47
+ role_id: number
48
+ }]
49
+ }
50
+ */
51
+ await initializeConnection(async (connection) => {
52
+ try {
53
+ // Begin the transaction
54
+ await connection.beginTransaction();
55
+ const reqBody = request.body || {};
56
+ const loggedInUserId = request.user?.id;
57
+ if (!isValidId(loggedInUserId)) {
58
+ throw getErrorResponseObj({
59
+ errorMsg: 'Invalid logged in user.',
60
+ solution: 'Please login again and try again.',
61
+ });
62
+ }
63
+ const insertedOrg = await insertOrg(reqBody, connection, loggedInUserId);
64
+ reqBody['org_id'] = insertedOrg?.insertId;
65
+ reqBody['included_users'] = []; //reqBody['included_users']
66
+ reqBody['included_users'].push({
67
+ user_id: loggedInUserId,
68
+ role_id: ROLES.ADMIN,
69
+ });
70
+ const { insertedRecords } = await includeUsersInOrg(reqBody, loggedInUserId, connection, false);
71
+ // Commit the transaction if everything is successful
72
+ await connection.commit();
73
+ sendSuccessResponse(response, getResponseObj({
74
+ message: `${appInfo.account_type_txt.singular} has been registered successfully.`,
75
+ insertedOrgId: insertedOrg?.insertId,
76
+ insertedUserToOrg: insertedRecords,
77
+ }));
78
+ }
79
+ catch (error) {
80
+ // Rollback the transaction in case of any error
81
+ await connection.rollback();
82
+ throwErrorInResponseIfErrorIsNotCustom(response, error, {
83
+ errorMsg: `An error occurred while ${appInfo.account_type_txt.singular.toLocaleLowerCase()} registration.`,
84
+ solution: 'Please try again later or contact support if the issue persists.',
85
+ });
86
+ }
87
+ });
88
+ };
89
+ //# sourceMappingURL=org-post.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"org-post.js","sourceRoot":"","sources":["../../../src/routes/orgs/org-post.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,mBAAmB,EAAE,sCAAsC,EAAE,MAAM,+BAA+B,CAAC;AACjJ,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAA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U,CAAC,QAAQ,EAAE,CAAC;YAE5B,sCAAsC,CAAC,QAAQ,EAAE,KAAK,EAAE;gBACtD,QAAQ,EAAE,2BAA2B,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,iBAAiB,EAAE,gBAAgB;gBAC1G,QAAQ,EAAE,kEAAkE;aAC7E,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Request, Response } from 'express';
2
+ export declare const putOrgs: (request: Request, response: Response) => Promise<void>;
3
+ //# sourceMappingURL=org-put.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"org-put.d.ts","sourceRoot":"","sources":["../../../src/routes/orgs/org-put.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAe5C,eAAO,MAAM,OAAO,GAAU,SAAS,OAAO,EAAE,UAAU,QAAQ,kBAqGjE,CAAC"}
@@ -0,0 +1,87 @@
1
+ import { appInfo } from '../../app-config.js';
2
+ import { isObjectEmpty, isValidId } from '../../utils/common-utils.js';
3
+ import { getErrorResponseObj, getResponseObj, sendErrorResponse, sendSuccessResponse, throwErrorInResponseIfErrorIsNotCustom, } from '../../utils/response-utils.js';
4
+ import { initializeConnection, updateRecords } from '../../utils/sql-helper.js';
5
+ import { canWriteOrg } from './org-utils.js';
6
+ export const putOrgs = async (request, response) => {
7
+ /**
8
+ Request JSON can contain:
9
+ {
10
+ 'org_name',
11
+ 'org_address',
12
+ 'org_state',
13
+ 'org_country',
14
+ 'org_external_id'
15
+ }
16
+ */
17
+ const orgId = Number(request.params.id);
18
+ await initializeConnection(async (connection) => {
19
+ try {
20
+ if (!isValidId(orgId)) {
21
+ throw getErrorResponseObj({
22
+ errorMsg: `Invalid ${appInfo.account_type_txt.singular} details.`,
23
+ solution: 'Please provide correct information and try again.',
24
+ });
25
+ }
26
+ const { user } = request;
27
+ const loggedInUserId = user?.id;
28
+ if ((await canWriteOrg(loggedInUserId, orgId, connection)) === false) {
29
+ sendErrorResponse(response, getErrorResponseObj({
30
+ errorMsg: `You are not allowed to edit this ${appInfo.account_type_txt.singular.toLocaleLowerCase()}.`,
31
+ solution: `As you are not the administrator for this ${appInfo.account_type_txt.singular.toLocaleLowerCase()}.`,
32
+ }));
33
+ return;
34
+ }
35
+ const reqBody = request.body || {};
36
+ if (!isValidId(loggedInUserId)) {
37
+ throw getErrorResponseObj({
38
+ errorMsg: 'Invalid logged-in user.',
39
+ solution: 'Please re-login and try again.',
40
+ });
41
+ }
42
+ const updateRec = {};
43
+ if ('org_name' in reqBody) {
44
+ updateRec.org_name = reqBody.org_name;
45
+ }
46
+ if ('org_address' in reqBody) {
47
+ updateRec.org_address = reqBody.org_address;
48
+ }
49
+ if ('org_state' in reqBody) {
50
+ updateRec.org_state = reqBody.org_state;
51
+ }
52
+ if ('org_country' in reqBody) {
53
+ updateRec.org_country = reqBody.org_country;
54
+ }
55
+ if ('org_external_id' in reqBody) {
56
+ updateRec.org_external_id = reqBody.org_external_id;
57
+ }
58
+ if (isObjectEmpty(updateRec)) {
59
+ throw getErrorResponseObj({
60
+ errorMsg: `Cannot update ${appInfo.account_type_txt.singular.toLocaleLowerCase()} for an invalid request params.`,
61
+ solution: `Please provide correct ${appInfo.account_type_txt.singular.toLocaleLowerCase()} params and try again.`,
62
+ });
63
+ }
64
+ const updatedResponse = await updateRecords('auth_organization_tbl', updateRec, { org_id: orgId }, connection);
65
+ const success = updatedResponse.affectedRows > 0;
66
+ if (!success) {
67
+ throw getErrorResponseObj({
68
+ errorMsg: 'Error while updating the records.',
69
+ solution: `Please provide correct ${appInfo.account_type_txt.singular.toLocaleLowerCase()} params and try again.`,
70
+ }, updatedResponse);
71
+ }
72
+ sendSuccessResponse(response, getResponseObj({
73
+ message: `${appInfo.account_type_txt.singular} details has been updated successfully.`,
74
+ record: updateRec,
75
+ }));
76
+ }
77
+ catch (error) {
78
+ // Rollback the transaction in case of any error
79
+ await connection.rollback();
80
+ throwErrorInResponseIfErrorIsNotCustom(response, error, {
81
+ errorMsg: error.message || `An error occurred while ${appInfo.account_type_txt.singular.toLocaleLowerCase()} update.`,
82
+ solution: 'Please try again later or contact support if the issue persists.',
83
+ });
84
+ }
85
+ });
86
+ };
87
+ //# sourceMappingURL=org-put.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"org-put.js","sourceRoot":"","sources":["../../../src/routes/orgs/org-put.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,sCAAsC,GACvC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,OAAgB,EAAE,QAAkB,EAAE,EAAE;IACpE;;;;;;;;;MASE;IAEF,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAExC,MAAM,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;QAC9C,IAAI,CAAC;YACH,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;gBACtB,MAAM,mBAAmB,CAAC;oBACxB,QAAQ,EAAE,WAAW,OAAO,CAAC,gBAAgB,CAAC,QAAQ,WAAW;oBACjE,QAAQ,EAAE,mDAAmD;iBAC9D,CAAC,CAAC;YACL,CAAC;YAED,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;YACzB,MAAM,cAAc,GAAG,IAAI,EAAE,EAAE,CAAC;YAEhC,IAAI,CAAC,MAAM,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rationRouter;
3
+ //# sourceMappingURL=org-registration-router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"org-registration-router.d.ts","sourceRoot":"","sources":["../../../src/routes/orgs/org-registration-router.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,qBAAqB,4CAAmB,CAAC;AAO/C,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import express from 'express';
2
+ import { deleteOrg } from './org-delete.js';
3
+ import { getAllowedOrgs } from './org-get.js';
4
+ import { postOrgs } from './org-post.js';
5
+ import { putOrgs } from './org-put.js';
6
+ const orgRegistrationRouter = express.Router();
7
+ orgRegistrationRouter.get('/', getAllowedOrgs);
8
+ orgRegistrationRouter.post('/', postOrgs);
9
+ orgRegistrationRouter.delete('/:id', deleteOrg);
10
+ orgRegistrationRouter.put('/:id', putOrgs);
11
+ export default orgRegistrationRouter;
12
+ //# sourceMappingURL=org-registration-router.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"org-registration-router.js","sourceRoot":"","sources":["../../../src/routes/orgs/org-registration-router.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,qBAAqB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;AAE/C,qBAAqB,CAAC,GAAG,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;AAC/C,qBAAqB,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAC1C,qBAAqB,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAChD,qBAAqB,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3C,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,14 @@
1
+ export declare const invalidateOrgUserCacheForUser: (orgId: number | undefined, userId: number | undefined) => Promise<void>;
2
+ export declare const getOrgUserRecord: (orgId: number, userId: number, connection: any) => Promise<any>;
3
+ export declare const isOrgUserActive: (orgUserRecord: any) => boolean;
4
+ export declare const canWriteOrg: (loggedInUserId: number, orgId: number, connection: any) => Promise<boolean>;
5
+ export declare const getOrgCreatedBy: (orgId: number, connection: any) => Promise<any>;
6
+ interface IInvitationEmailTplProps {
7
+ invitedTo_UserName: string;
8
+ organizationName: string;
9
+ inviterName: string;
10
+ isUserHaveAnAccount: boolean;
11
+ }
12
+ export declare const getInvitationEmailTpl: ({ invitedTo_UserName, organizationName, inviterName, isUserHaveAnAccount }: IInvitationEmailTplProps) => string;
13
+ export {};
14
+ //# sourceMappingURL=org-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"org-utils.d.ts","sourceRoot":"","sources":["../../../src/routes/orgs/org-utils.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,6BAA6B,GAAU,OAAO,MAAM,GAAG,SAAS,EAAE,QAAQ,MAAM,GAAG,SAAS,kBAOxG,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,OAAO,MAAM,EAAE,QAAQ,MAAM,EAAE,YAAY,GAAG,iBAkCpF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,eAAe,GAAG,YAEjD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAU,gBAAgB,MAAM,EAAE,OAAO,MAAM,EAAE,YAAY,GAAG,qBAcvF,CAAC;AAGF,eAAO,MAAM,eAAe,GAAU,OAAO,MAAM,EAAE,YAAY,GAAG,iBAiCnE,CAAC;AAEF,UAAU,wBAAwB;IAChC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,eAAO,MAAM,qBAAqB,GAAI,4EAA4E,wBAAwB,WAmJzI,CAAC"}
@@ -0,0 +1,234 @@
1
+ import { appInfo } from '../../app-config.js';
2
+ import { getSingletonCacheInstance } from '../../local-cache.js';
3
+ import { isCustomError, isValidId } from '../../utils/common-utils.js';
4
+ import { INVITATION_ENUMS, ROLES } from '../../utils/enums.js';
5
+ import logger from '../../utils/error-logger.js';
6
+ import { getErrorResponseObj } from '../../utils/response-utils.js';
7
+ import { executeSql, isTruthyValue } from '../../utils/sql-helper.js';
8
+ const orgUserCache = await getSingletonCacheInstance('org-users-cache', 100);
9
+ export const invalidateOrgUserCacheForUser = async (orgId, userId) => {
10
+ if (!orgId || !userId || !isValidId(orgId) || !isValidId(userId)) {
11
+ return;
12
+ }
13
+ const cacheKey = `auth_organization_users_tbl_${orgId}_${userId}`;
14
+ await orgUserCache.del(cacheKey);
15
+ };
16
+ export const getOrgUserRecord = async (orgId, userId, connection) => {
17
+ try {
18
+ if (!isValidId(orgId) || !isValidId(userId)) {
19
+ throw getErrorResponseObj({
20
+ errorMsg: 'Invalid organization or user ID from getOrgUserRecord.',
21
+ solution: 'Please provide valid IDs.',
22
+ });
23
+ }
24
+ const cacheKey = `auth_organization_users_tbl_${orgId}_${userId}`;
25
+ const cachedValue = await orgUserCache.get(cacheKey);
26
+ if (cachedValue !== undefined) {
27
+ return cachedValue;
28
+ }
29
+ const sql = `SELECT org_user_role_id, user_opinion, org_user_is_active FROM auth_organization_users_tbl WHERE org_id = ${orgId} AND user_id = ${userId};`;
30
+ const allowedOrgs = (await executeSql(sql, connection));
31
+ const result = allowedOrgs[0] || null;
32
+ await orgUserCache.set(cacheKey, result);
33
+ return result;
34
+ }
35
+ catch (error) {
36
+ throw isCustomError(error)
37
+ ? error
38
+ : getErrorResponseObj({
39
+ errorMsg: 'Problem while fetching the permissions.',
40
+ solution: 'Please login again and try again.',
41
+ }, error);
42
+ }
43
+ };
44
+ export const isOrgUserActive = (orgUserRecord) => {
45
+ return isTruthyValue(orgUserRecord.org_user_is_active) && orgUserRecord.user_opinion === INVITATION_ENUMS.ACCEPTED;
46
+ };
47
+ export const canWriteOrg = async (loggedInUserId, orgId, connection) => {
48
+ try {
49
+ const org = await getOrgUserRecord(orgId, loggedInUserId, connection);
50
+ return isOrgUserActive(org) && ROLES.Is_ADMIN(org.org_user_role_id);
51
+ }
52
+ catch (error) {
53
+ throw getErrorResponseObj({
54
+ errorMsg: 'Problem while checking write permissions.',
55
+ solution: 'Please login again and try again.',
56
+ }, error);
57
+ }
58
+ };
59
+ const orgCreatedByCache = await getSingletonCacheInstance('org-created-by-cache', 50);
60
+ export const getOrgCreatedBy = async (orgId, connection) => {
61
+ try {
62
+ if (!isValidId(orgId)) {
63
+ throw getErrorResponseObj({
64
+ errorMsg: 'OrgId is invalid.',
65
+ });
66
+ }
67
+ const cacheKey = `org_created_by_${orgId}`;
68
+ const cachedValue = await orgCreatedByCache.get(cacheKey);
69
+ if (isValidId(cachedValue)) {
70
+ return cachedValue;
71
+ }
72
+ else if (cachedValue === -1) {
73
+ logger.error(`Cached orgCreatedBy is -1 for orgId: ${orgId}, this cannot be null.`);
74
+ return null;
75
+ }
76
+ const sql = `SELECT org_created_by FROM auth_organization_tbl WHERE org_id = ${orgId}`;
77
+ const orgs = await executeSql(sql, connection);
78
+ const orgCreatedBy = parseInt(orgs[0]?.org_created_by, 10) || -1;
79
+ await orgCreatedByCache.set(cacheKey, orgCreatedBy);
80
+ return orgCreatedBy;
81
+ }
82
+ catch (error) {
83
+ throw getErrorResponseObj({
84
+ errorMsg: 'Problem while fetching the organization details.',
85
+ solution: 'Please login again and try again.',
86
+ }, error);
87
+ }
88
+ };
89
+ export const getInvitationEmailTpl = ({ invitedTo_UserName, organizationName, inviterName, isUserHaveAnAccount }) => {
90
+ const acceptInvitationUrl = `${appInfo.CLIENT_URL}/infrastructure/user-invitations`;
91
+ const singUpUrl = `${appInfo.CLIENT_URL}/register`;
92
+ const loginUrl = `${appInfo.CLIENT_URL}/login`;
93
+ return `<!DOCTYPE html>
94
+ <html>
95
+ <head>
96
+ <meta charset="UTF-8" />
97
+ <title>${appInfo.appName} - ${appInfo.account_type_txt.singular} Invitation</title>
98
+ <style>
99
+ body {
100
+ font-family: Arial, sans-serif;
101
+ background-color: #f5f7fa;
102
+ margin: 0;
103
+ padding: 0;
104
+ }
105
+ .container {
106
+ width: 100%;
107
+ max-width: 480px;
108
+ margin: 30px auto;
109
+ background-color: #ffffff;
110
+ border-radius: 8px;
111
+ padding: 20px;
112
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
113
+ color: #333333;
114
+ }
115
+ .header {
116
+ font-size: 24px;
117
+ font-weight: bold;
118
+ color: ${appInfo.primaryThemeColor};
119
+ margin-bottom: 20px;
120
+ justify-content: center;
121
+ display: flex;
122
+ gap: 5px;
123
+ }
124
+ .content p {
125
+ font-size: 16px;
126
+ line-height: 1.5;
127
+ }
128
+ .org-name {
129
+ font-weight: bold;
130
+ color: ${appInfo.primaryThemeColor};
131
+ }
132
+ .button-container {
133
+ text-align: center;
134
+ margin: 30px 0;
135
+ }
136
+ .accept-button {
137
+ display: inline-block;
138
+ padding: 14px 32px;
139
+ font-size: 16px;
140
+ font-weight: bold;
141
+ color: #ffffff;
142
+ background-color: ${appInfo.primaryThemeColor};
143
+ text-decoration: none;
144
+ border-radius: 6px;
145
+ transition: background-color 0.3s;
146
+ }
147
+ .accept-button:hover {
148
+ opacity: 0.9;
149
+ }
150
+ .link-section {
151
+ margin: 20px 0;
152
+ padding: 15px;
153
+ background-color: #f9fafb;
154
+ border-radius: 6px;
155
+ border-left: 4px solid ${appInfo.primaryThemeColor};
156
+ }
157
+ .link-section p {
158
+ margin: 5px 0;
159
+ font-size: 14px;
160
+ }
161
+ .link-url {
162
+ color: ${appInfo.primaryThemeColor};
163
+ word-break: break-all;
164
+ font-size: 13px;
165
+ }
166
+ .footer {
167
+ font-size: 14px;
168
+ color: #777777;
169
+ text-align: center;
170
+ margin-top: 30px;
171
+ }
172
+ .divider {
173
+ height: 1px;
174
+ background-color: #e5e7eb;
175
+ margin: 20px 0;
176
+ }
177
+ </style>
178
+ </head>
179
+ <body>
180
+ <div class="container">
181
+ <div class="header">
182
+ <div>${appInfo.logo}</div>
183
+ <div style="margin-top: 0">${appInfo.appName}</div>
184
+ </div>
185
+ <div class="content">
186
+ <p>Hello ${invitedTo_UserName},</p>
187
+ <p>
188
+ You've been invited to join
189
+ <span class="org-name">${organizationName}</span> on ${appInfo.appName}.
190
+ </p>
191
+ <p>
192
+ ${inviterName} has invited you to collaborate and access this ${appInfo.account_type_txt.singular.toLocaleLowerCase()}.
193
+ </p>
194
+
195
+ <div class="button-container">
196
+ <a href="${acceptInvitationUrl}" class="accept-button">
197
+ View Invitation
198
+ </a>
199
+ </div>
200
+
201
+ <p style="font-size: 14px; color: #666666;">
202
+ Or copy and paste this link into your browser:
203
+ </p>
204
+ <div class="link-section">
205
+ <p style="font-weight: 600; margin-bottom: 8px;">Accept Invitation Link:</p>
206
+ <p class="link-url">${acceptInvitationUrl}</p>
207
+ </div>
208
+
209
+ <div class="divider"></div>
210
+
211
+ ${!isUserHaveAnAccount
212
+ ? `<p style="font-size: 14px;">
213
+ It appears you don't have an account with us yet. Please create an account first, and then click on the link above.
214
+ <a href="${singUpUrl}" style="color: ${appInfo.primaryThemeColor}; text-decoration: none; font-weight: 600;">
215
+ Create account
216
+ </a>
217
+ </p>`
218
+ : `<p style="font-size: 14px;">
219
+ You already have an account. Please log in first, and then click the link above.
220
+ <a href="${loginUrl}" style="color: ${appInfo.primaryThemeColor}; text-decoration: none; font-weight: 600;">
221
+ Login
222
+ </a>
223
+ </p>`}
224
+
225
+ <p style="font-size: 14px; color: #666666; margin-top: 20px;">
226
+ If you did not expect this invitation, you can safely ignore this email.
227
+ </p>
228
+ </div>
229
+ <div class="footer">${appInfo.appName}</div>
230
+ </div>
231
+ </body>
232
+ </html>`;
233
+ };
234
+ //# sourceMappingURL=org-utils.js.map
@@ -0,0 +1 @@
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AO;;;oBAGnC,CAAC;AACrB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const checkCanAllowToIncludeUsersInOrg: (orgId: number, connection: unknown) => Promise<true | undefined>;
2
+ export { checkCanAllowToIncludeUsersInOrg };
3
+ //# sourceMappingURL=premium-org-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"premium-org-utils.d.ts","sourceRoot":"","sources":["../../../src/routes/orgs/premium-org-utils.ts"],"names":[],"mappings":"AA8DA,QAAA,MAAM,gCAAgC,GAAU,OAAO,MAAM,EAAE,YAAY,OAAO,8BAYjF,CAAC;AAEF,OAAO,EAAE,gCAAgC,EAAE,CAAC"}
@@ -0,0 +1,61 @@
1
+ // import LocalCache from '../../local-cache.js';
2
+ import { appInfo } from '../../app-config.js';
3
+ import { isValidId } from '../../utils/common-utils.js';
4
+ import { INVITATION_ENUMS } from '../../utils/enums.js';
5
+ import { getErrorResponseObj } from '../../utils/response-utils.js';
6
+ import { executeSql } from '../../utils/sql-helper.js';
7
+ import { getFeatureFlags } from '../feature-flags/feature-flags.js';
8
+ import { getActivePurchasedPlan } from '../paid-plans/purchased-plans.js';
9
+ import { getOrgCreatedBy } from './org-utils.js';
10
+ // const orgCountCache = new LocalCache(50);
11
+ // const invalidateOrgCountFromCache = (orgCreatedByUserId: number) => {
12
+ // const cacheKey = `org_count_${orgCreatedByUserId}`;
13
+ // orgCountCache.del(cacheKey);
14
+ // };
15
+ const countOrgMembersByOrgCreatedByUserId = async (orgCreatedByUserId, connection) => {
16
+ if (!isValidId(orgCreatedByUserId)) {
17
+ throw getErrorResponseObj({
18
+ errorMsg: 'OrgCreatedByUserId is invalid from countOrgMembersByOrgCreatedByUserId function.',
19
+ });
20
+ }
21
+ // const cacheKey = `org_count_${orgCreatedByUserId}`;
22
+ // const cachedValue = orgCountCache.get(cacheKey);
23
+ // if (cachedValue > 0) {
24
+ // return cachedValue;
25
+ // }
26
+ const sql = `SELECT COUNT(DISTINCT ou.user_id) AS count FROM auth_organization_tbl o INNER JOIN auth_organization_users_tbl ou ON ou.org_id = o.org_id
27
+ WHERE o.org_created_by = ${orgCreatedByUserId} AND o.org_is_deleted = 0 AND ou.org_user_is_active = 1 AND
28
+ (ou.user_opinion = ${INVITATION_ENUMS.ACCEPTED} OR ou.user_opinion = ${INVITATION_ENUMS.INVITED});`;
29
+ const usersCount = await executeSql(sql, connection);
30
+ let count = Number(usersCount[0].count) || 0;
31
+ const sqlInvitedUsers = `SELECT COUNT(DISTINCT oi.email) AS count FROM auth_organization_tbl o INNER JOIN auth_invited_users_tbl oi ON oi.org_id = o.org_id
32
+ WHERE o.org_created_by = ${orgCreatedByUserId} AND o.org_is_deleted = 0 AND oi.is_deleted = 0;`;
33
+ const invitedUsersCount = await executeSql(sqlInvitedUsers, connection);
34
+ count += Number(invitedUsersCount[0].count) || 0;
35
+ // orgCountCache.set(cacheKey, count);
36
+ return count;
37
+ };
38
+ const canAllowToIncludeUsersInOrg = async (orgId, connection) => {
39
+ const orgCreatedByUserId = await getOrgCreatedBy(orgId, connection);
40
+ //getting active plan of the user
41
+ const activePurchasedPlan = (await getActivePurchasedPlan(orgCreatedByUserId, connection));
42
+ if (!activePurchasedPlan.for_no_users || activePurchasedPlan.for_no_users <= 1) {
43
+ return false;
44
+ }
45
+ const count = await countOrgMembersByOrgCreatedByUserId(orgCreatedByUserId, connection);
46
+ return count <= activePurchasedPlan.for_no_users;
47
+ };
48
+ const checkCanAllowToIncludeUsersInOrg = async (orgId, connection) => {
49
+ if (getFeatureFlags().ff_enable_paid_subscription === false) {
50
+ return true;
51
+ }
52
+ const canAllow = await canAllowToIncludeUsersInOrg(orgId, connection);
53
+ if (!canAllow) {
54
+ throw getErrorResponseObj({
55
+ errorMsg: `You have reached the limit of users to include in this ${appInfo.account_type_txt.singular.toLocaleLowerCase()}.`,
56
+ solution: `You can add/purchase premium plan to include more users.`,
57
+ });
58
+ }
59
+ };
60
+ export { checkCanAllowToIncludeUsersInOrg };
61
+ //# sourceMappingURL=premium-org-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"premium-org-utils.js","sourceRoot":"","sources":["../../../src/routes/orgs/premium-org-utils.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,4CAA4C;AAC5C,wEAAwE;AACxE,wDAAwD;AACxD,iCAAiC;AACjC,KAAK;AAEL,MAAM,mCAAmC,GAAG,KAAK,EAAE,kBAA0B,EAAE,UAAmB,EAAE,EAAE;IACpG,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACnC,MAAM,mBAAmB,CAAC;YACxB,QAAQ,EAAE,kFAAkF;SAC7F,CAAC,CAAC;IACL,CAAC;IAED,sDAAsD;IACtD,mDAAmD;IACnD,yBAAyB;IACzB,wBAAwB;IACxB,IAAI;IAEJ,MAAM,GAAG,GAAG;0CAC4B,kBAAkB;oCACxB,gBAAgB,CAAC,QAAQ,yBAAyB,gBAAgB,CAAC,OAAO,IAAI,CAAC;IAEjH,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IACrD,IAAI,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE7C,MAAM,eAAe,GAAG;sDAC4B,kBAAkB,k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AAEF,OAAO,EAAE,gCAAgC,EAAE,CAAC"}
@@ -0,0 +1,36 @@
1
+ export interface Plan {
2
+ id: string;
3
+ title: string;
4
+ description: string;
5
+ highlight?: boolean;
6
+ type?: 'monthly' | 'yearly';
7
+ currency?: string;
8
+ monthlyPrice: string;
9
+ yearlyPrice: string;
10
+ buttonText: string;
11
+ badge?: string;
12
+ planDisplayCost?: {
13
+ monthly: string;
14
+ yearly: string;
15
+ };
16
+ minUserRequired: number;
17
+ maxUserRequired: number;
18
+ features: {
19
+ name: string;
20
+ icon: string;
21
+ iconColor?: string;
22
+ }[];
23
+ }
24
+ export interface CurrentPlan {
25
+ plan: Plan;
26
+ type: 'monthly' | 'yearly' | 'custom';
27
+ price?: string;
28
+ startDate: string;
29
+ expiryDate: string;
30
+ activePlanFor: number;
31
+ paidAmount: string;
32
+ transactionId?: string;
33
+ paymentMethod: string;
34
+ status: 'active' | 'inactive' | 'past_due' | 'cancelled';
35
+ }
36
+ //# sourceMappingURL=billingsdk-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billingsdk-config.d.ts","sourceRoot":"","sources":["../../../src/routes/paid-plans/billingsdk-config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;CACL;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,CAAC;CAC1D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=billingsdk-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billingsdk-config.js","sourceRoot":"","sources":["../../../src/routes/paid-plans/billingsdk-config.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ declare const getSubscriptionConfigRouter: import("express-serve-static-core").Router;
2
+ export default getSubscriptionConfigRouter;
3
+ //# sourceMappingURL=get-subscription-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-subscription-config.d.ts","sourceRoot":"","sources":["../../../src/routes/paid-plans/get-subscription-config.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,2BAA2B,4CAAmB,CAAC;AAuBrD,eAAe,2BAA2B,CAAC"}