@greatapps/common 1.1.123 → 1.1.124

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 (52) hide show
  1. package/dist/modules/accounts/actions/account-management.action.mjs +15 -15
  2. package/dist/modules/accounts/actions/account-management.action.mjs.map +1 -1
  3. package/dist/modules/accounts/actions/find-current-account.action.mjs +1 -1
  4. package/dist/modules/accounts/actions/find-current-account.action.mjs.map +1 -1
  5. package/dist/modules/accounts/actions/list-currencies.action.mjs +1 -1
  6. package/dist/modules/accounts/actions/list-currencies.action.mjs.map +1 -1
  7. package/dist/modules/accounts/actions/list-timezones.action.mjs +1 -1
  8. package/dist/modules/accounts/actions/list-timezones.action.mjs.map +1 -1
  9. package/dist/modules/auth/actions/logout.action.mjs +1 -1
  10. package/dist/modules/auth/actions/logout.action.mjs.map +1 -1
  11. package/dist/modules/auth/actions/register.action.mjs +1 -1
  12. package/dist/modules/auth/actions/register.action.mjs.map +1 -1
  13. package/dist/modules/auth/actions/verify-two-factor.action.mjs +1 -1
  14. package/dist/modules/auth/actions/verify-two-factor.action.mjs.map +1 -1
  15. package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs +1 -1
  16. package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs.map +1 -1
  17. package/dist/modules/projects/actions/add-project-user.action.mjs +1 -1
  18. package/dist/modules/projects/actions/add-project-user.action.mjs.map +1 -1
  19. package/dist/modules/projects/actions/list-available-users.action.mjs +1 -1
  20. package/dist/modules/projects/actions/list-available-users.action.mjs.map +1 -1
  21. package/dist/modules/projects/actions/list-project-users.action.mjs +1 -1
  22. package/dist/modules/projects/actions/list-project-users.action.mjs.map +1 -1
  23. package/dist/modules/projects/actions/remove-project-user.action.mjs +1 -1
  24. package/dist/modules/projects/actions/remove-project-user.action.mjs.map +1 -1
  25. package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs +1 -1
  26. package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs.map +1 -1
  27. package/dist/modules/users/action/find-user-by-id.action.mjs +1 -1
  28. package/dist/modules/users/action/find-user-by-id.action.mjs.map +1 -1
  29. package/dist/modules/users/action/list-messages.action.mjs +1 -1
  30. package/dist/modules/users/action/list-messages.action.mjs.map +1 -1
  31. package/dist/modules/users/action/mark-all-messages-as-read.action.mjs +1 -1
  32. package/dist/modules/users/action/mark-all-messages-as-read.action.mjs.map +1 -1
  33. package/dist/modules/users/action/mark-message-as-read.action.mjs +1 -1
  34. package/dist/modules/users/action/mark-message-as-read.action.mjs.map +1 -1
  35. package/package.json +1 -1
  36. package/src/modules/accounts/actions/account-management.action.ts +15 -15
  37. package/src/modules/accounts/actions/find-current-account.action.ts +1 -1
  38. package/src/modules/accounts/actions/list-currencies.action.ts +1 -1
  39. package/src/modules/accounts/actions/list-timezones.action.ts +1 -1
  40. package/src/modules/auth/actions/logout.action.ts +1 -1
  41. package/src/modules/auth/actions/register.action.ts +1 -1
  42. package/src/modules/auth/actions/verify-two-factor.action.ts +1 -1
  43. package/src/modules/ia-credits/actions/list-ia-credits.action.ts +1 -1
  44. package/src/modules/projects/actions/add-project-user.action.ts +1 -1
  45. package/src/modules/projects/actions/list-available-users.action.ts +1 -1
  46. package/src/modules/projects/actions/list-project-users.action.ts +1 -1
  47. package/src/modules/projects/actions/remove-project-user.action.ts +1 -1
  48. package/src/modules/subscriptions/actions/list-subscriptions.action.ts +1 -1
  49. package/src/modules/users/action/find-user-by-id.action.ts +1 -1
  50. package/src/modules/users/action/list-messages.action.ts +1 -1
  51. package/src/modules/users/action/mark-all-messages-as-read.action.ts +1 -1
  52. package/src/modules/users/action/mark-message-as-read.action.ts +1 -1
@@ -2,46 +2,46 @@
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { accountService } from "../services/account.service";
4
4
  import { twoFactorService } from "../services/two-factor.service";
5
- function listAccountUsersAction(params) {
5
+ async function listAccountUsersAction(params) {
6
6
  return safeServerAction(async () => {
7
7
  const { users, total } = await accountService.listAccountUsers(params);
8
8
  return { data: users, total };
9
9
  });
10
10
  }
11
- function updateUserAction(user) {
11
+ async function updateUserAction(user) {
12
12
  return safeServerAction(() => accountService.updateAccountUser(user));
13
13
  }
14
- function updateAccountUserByIdAction(userId, user) {
14
+ async function updateAccountUserByIdAction(userId, user) {
15
15
  return safeServerAction(() => accountService.updateAccountUserById(userId, user));
16
16
  }
17
- function updateAccountAction(data) {
17
+ async function updateAccountAction(data) {
18
18
  return safeServerAction(() => accountService.updateAccount(data));
19
19
  }
20
- function deleteAccountUserAction(userId) {
20
+ async function deleteAccountUserAction(userId) {
21
21
  return safeServerAction(() => accountService.deleteAccountUser(userId));
22
22
  }
23
- function deleteAccountAction() {
23
+ async function deleteAccountAction() {
24
24
  return safeServerAction(() => accountService.deleteAccount());
25
25
  }
26
- function createAccountUserAction(user) {
26
+ async function createAccountUserAction(user) {
27
27
  return safeServerAction(() => accountService.createAccountUser(user));
28
28
  }
29
- function changePasswordAction(data) {
29
+ async function changePasswordAction(data) {
30
30
  return safeServerAction(() => accountService.changePassword(data));
31
31
  }
32
- function requestEmailChangeAction(newEmail) {
32
+ async function requestEmailChangeAction(newEmail) {
33
33
  return safeServerAction(() => accountService.requestContactReset("email", newEmail));
34
34
  }
35
- function confirmEmailChangeAction(token, newEmail) {
35
+ async function confirmEmailChangeAction(token, newEmail) {
36
36
  return safeServerAction(() => accountService.confirmContactReset("email", token, newEmail));
37
37
  }
38
- function requestPhoneChangeAction(newPhone) {
38
+ async function requestPhoneChangeAction(newPhone) {
39
39
  return safeServerAction(() => accountService.requestContactReset("phone", newPhone));
40
40
  }
41
- function confirmPhoneChangeAction(token, newPhone) {
41
+ async function confirmPhoneChangeAction(token, newPhone) {
42
42
  return safeServerAction(() => accountService.confirmContactReset("phone", token, newPhone));
43
43
  }
44
- function generateTwoFactorAction() {
44
+ async function generateTwoFactorAction() {
45
45
  return safeServerAction(async () => {
46
46
  const result = await twoFactorService.generate();
47
47
  return {
@@ -50,13 +50,13 @@ function generateTwoFactorAction() {
50
50
  };
51
51
  });
52
52
  }
53
- function confirmTwoFactorAction(code) {
53
+ async function confirmTwoFactorAction(code) {
54
54
  return safeServerAction(async () => {
55
55
  await twoFactorService.confirm(code);
56
56
  await accountService.updateAccountUser({ two_factor_authentication: true });
57
57
  });
58
58
  }
59
- function disableTwoFactorAction(code) {
59
+ async function disableTwoFactorAction(code) {
60
60
  return safeServerAction(async () => {
61
61
  await twoFactorService.verify(code);
62
62
  await twoFactorService.disable();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/accounts/actions/account-management.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { accountService } from '../services/account.service';\nimport type {\n AccountUsersPaginationParams,\n ChangePasswordRequest,\n CreateAccountUserRequest,\n UpdateAccountRequest,\n UpdateAccountUserRequest,\n} from '../types';\nimport { twoFactorService } from '../services/two-factor.service';\n\nexport function listAccountUsersAction(params?: AccountUsersPaginationParams) {\n return safeServerAction(async () => {\n const { users, total } = await accountService.listAccountUsers(params);\n return { data: users, total };\n });\n}\n\nexport function updateUserAction(user: UpdateAccountUserRequest) {\n return safeServerAction(() => accountService.updateAccountUser(user));\n}\n\nexport function updateAccountUserByIdAction(\n userId: number,\n user: UpdateAccountUserRequest\n) {\n return safeServerAction(() => accountService.updateAccountUserById(userId, user));\n}\n\nexport function updateAccountAction(data: UpdateAccountRequest) {\n return safeServerAction(() => accountService.updateAccount(data));\n}\n\nexport function deleteAccountUserAction(userId: number) {\n return safeServerAction(() => accountService.deleteAccountUser(userId));\n}\n\nexport function deleteAccountAction() {\n return safeServerAction(() => accountService.deleteAccount());\n}\n\nexport function createAccountUserAction(user: CreateAccountUserRequest) {\n return safeServerAction(() => accountService.createAccountUser(user));\n}\n\nexport function changePasswordAction(data: ChangePasswordRequest) {\n return safeServerAction(() => accountService.changePassword(data));\n}\n\nexport function requestEmailChangeAction(newEmail: string) {\n return safeServerAction(() => accountService.requestContactReset('email', newEmail));\n}\n\nexport function confirmEmailChangeAction(token: string, newEmail: string) {\n return safeServerAction(() => accountService.confirmContactReset('email', token, newEmail));\n}\n\nexport function requestPhoneChangeAction(newPhone: string) {\n return safeServerAction(() => accountService.requestContactReset('phone', newPhone));\n}\n\nexport function confirmPhoneChangeAction(token: string, newPhone: string) {\n return safeServerAction(() => accountService.confirmContactReset('phone', token, newPhone));\n}\n\nexport function generateTwoFactorAction() {\n return safeServerAction(async () => {\n const result = await twoFactorService.generate();\n return {\n qrcode: result.data.qrcode,\n backupCodes: result.data.backup_codes,\n };\n });\n}\n\nexport function confirmTwoFactorAction(code: string) {\n return safeServerAction(async () => {\n await twoFactorService.confirm(code);\n await accountService.updateAccountUser({ two_factor_authentication: true });\n });\n}\n\nexport function disableTwoFactorAction(code: string) {\n return safeServerAction(async () => {\n await twoFactorService.verify(code);\n await twoFactorService.disable();\n });\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAQ/B,SAAS,wBAAwB;AAE1B,SAAS,uBAAuB,QAAuC;AAC5E,SAAO,iBAAiB,YAAY;AAClC,UAAM,EAAE,OAAO,MAAM,IAAI,MAAM,eAAe,iBAAiB,MAAM;AACrE,WAAO,EAAE,MAAM,OAAO,MAAM;AAAA,EAC9B,CAAC;AACH;AAEO,SAAS,iBAAiB,MAAgC;AAC/D,SAAO,iBAAiB,MAAM,eAAe,kBAAkB,IAAI,CAAC;AACtE;AAEO,SAAS,4BACd,QACA,MACA;AACA,SAAO,iBAAiB,MAAM,eAAe,sBAAsB,QAAQ,IAAI,CAAC;AAClF;AAEO,SAAS,oBAAoB,MAA4B;AAC9D,SAAO,iBAAiB,MAAM,eAAe,cAAc,IAAI,CAAC;AAClE;AAEO,SAAS,wBAAwB,QAAgB;AACtD,SAAO,iBAAiB,MAAM,eAAe,kBAAkB,MAAM,CAAC;AACxE;AAEO,SAAS,sBAAsB;AACpC,SAAO,iBAAiB,MAAM,eAAe,cAAc,CAAC;AAC9D;AAEO,SAAS,wBAAwB,MAAgC;AACtE,SAAO,iBAAiB,MAAM,eAAe,kBAAkB,IAAI,CAAC;AACtE;AAEO,SAAS,qBAAqB,MAA6B;AAChE,SAAO,iBAAiB,MAAM,eAAe,eAAe,IAAI,CAAC;AACnE;AAEO,SAAS,yBAAyB,UAAkB;AACzD,SAAO,iBAAiB,MAAM,eAAe,oBAAoB,SAAS,QAAQ,CAAC;AACrF;AAEO,SAAS,yBAAyB,OAAe,UAAkB;AACxE,SAAO,iBAAiB,MAAM,eAAe,oBAAoB,SAAS,OAAO,QAAQ,CAAC;AAC5F;AAEO,SAAS,yBAAyB,UAAkB;AACzD,SAAO,iBAAiB,MAAM,eAAe,oBAAoB,SAAS,QAAQ,CAAC;AACrF;AAEO,SAAS,yBAAyB,OAAe,UAAkB;AACxE,SAAO,iBAAiB,MAAM,eAAe,oBAAoB,SAAS,OAAO,QAAQ,CAAC;AAC5F;AAEO,SAAS,0BAA0B;AACxC,SAAO,iBAAiB,YAAY;AAClC,UAAM,SAAS,MAAM,iBAAiB,SAAS;AAC/C,WAAO;AAAA,MACL,QAAQ,OAAO,KAAK;AAAA,MACpB,aAAa,OAAO,KAAK;AAAA,IAC3B;AAAA,EACF,CAAC;AACH;AAEO,SAAS,uBAAuB,MAAc;AACnD,SAAO,iBAAiB,YAAY;AAClC,UAAM,iBAAiB,QAAQ,IAAI;AACnC,UAAM,eAAe,kBAAkB,EAAE,2BAA2B,KAAK,CAAC;AAAA,EAC5E,CAAC;AACH;AAEO,SAAS,uBAAuB,MAAc;AACnD,SAAO,iBAAiB,YAAY;AAClC,UAAM,iBAAiB,OAAO,IAAI;AAClC,UAAM,iBAAiB,QAAQ;AAAA,EACjC,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/accounts/actions/account-management.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { accountService } from '../services/account.service';\nimport type {\n AccountUsersPaginationParams,\n ChangePasswordRequest,\n CreateAccountUserRequest,\n UpdateAccountRequest,\n UpdateAccountUserRequest,\n} from '../types';\nimport { twoFactorService } from '../services/two-factor.service';\n\nexport async function listAccountUsersAction(params?: AccountUsersPaginationParams) {\n return safeServerAction(async () => {\n const { users, total } = await accountService.listAccountUsers(params);\n return { data: users, total };\n });\n}\n\nexport async function updateUserAction(user: UpdateAccountUserRequest) {\n return safeServerAction(() => accountService.updateAccountUser(user));\n}\n\nexport async function updateAccountUserByIdAction(\n userId: number,\n user: UpdateAccountUserRequest\n) {\n return safeServerAction(() => accountService.updateAccountUserById(userId, user));\n}\n\nexport async function updateAccountAction(data: UpdateAccountRequest) {\n return safeServerAction(() => accountService.updateAccount(data));\n}\n\nexport async function deleteAccountUserAction(userId: number) {\n return safeServerAction(() => accountService.deleteAccountUser(userId));\n}\n\nexport async function deleteAccountAction() {\n return safeServerAction(() => accountService.deleteAccount());\n}\n\nexport async function createAccountUserAction(user: CreateAccountUserRequest) {\n return safeServerAction(() => accountService.createAccountUser(user));\n}\n\nexport async function changePasswordAction(data: ChangePasswordRequest) {\n return safeServerAction(() => accountService.changePassword(data));\n}\n\nexport async function requestEmailChangeAction(newEmail: string) {\n return safeServerAction(() => accountService.requestContactReset('email', newEmail));\n}\n\nexport async function confirmEmailChangeAction(token: string, newEmail: string) {\n return safeServerAction(() => accountService.confirmContactReset('email', token, newEmail));\n}\n\nexport async function requestPhoneChangeAction(newPhone: string) {\n return safeServerAction(() => accountService.requestContactReset('phone', newPhone));\n}\n\nexport async function confirmPhoneChangeAction(token: string, newPhone: string) {\n return safeServerAction(() => accountService.confirmContactReset('phone', token, newPhone));\n}\n\nexport async function generateTwoFactorAction() {\n return safeServerAction(async () => {\n const result = await twoFactorService.generate();\n return {\n qrcode: result.data.qrcode,\n backupCodes: result.data.backup_codes,\n };\n });\n}\n\nexport async function confirmTwoFactorAction(code: string) {\n return safeServerAction(async () => {\n await twoFactorService.confirm(code);\n await accountService.updateAccountUser({ two_factor_authentication: true });\n });\n}\n\nexport async function disableTwoFactorAction(code: string) {\n return safeServerAction(async () => {\n await twoFactorService.verify(code);\n await twoFactorService.disable();\n });\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAQ/B,SAAS,wBAAwB;AAEjC,eAAsB,uBAAuB,QAAuC;AAClF,SAAO,iBAAiB,YAAY;AAClC,UAAM,EAAE,OAAO,MAAM,IAAI,MAAM,eAAe,iBAAiB,MAAM;AACrE,WAAO,EAAE,MAAM,OAAO,MAAM;AAAA,EAC9B,CAAC;AACH;AAEA,eAAsB,iBAAiB,MAAgC;AACrE,SAAO,iBAAiB,MAAM,eAAe,kBAAkB,IAAI,CAAC;AACtE;AAEA,eAAsB,4BACpB,QACA,MACA;AACA,SAAO,iBAAiB,MAAM,eAAe,sBAAsB,QAAQ,IAAI,CAAC;AAClF;AAEA,eAAsB,oBAAoB,MAA4B;AACpE,SAAO,iBAAiB,MAAM,eAAe,cAAc,IAAI,CAAC;AAClE;AAEA,eAAsB,wBAAwB,QAAgB;AAC5D,SAAO,iBAAiB,MAAM,eAAe,kBAAkB,MAAM,CAAC;AACxE;AAEA,eAAsB,sBAAsB;AAC1C,SAAO,iBAAiB,MAAM,eAAe,cAAc,CAAC;AAC9D;AAEA,eAAsB,wBAAwB,MAAgC;AAC5E,SAAO,iBAAiB,MAAM,eAAe,kBAAkB,IAAI,CAAC;AACtE;AAEA,eAAsB,qBAAqB,MAA6B;AACtE,SAAO,iBAAiB,MAAM,eAAe,eAAe,IAAI,CAAC;AACnE;AAEA,eAAsB,yBAAyB,UAAkB;AAC/D,SAAO,iBAAiB,MAAM,eAAe,oBAAoB,SAAS,QAAQ,CAAC;AACrF;AAEA,eAAsB,yBAAyB,OAAe,UAAkB;AAC9E,SAAO,iBAAiB,MAAM,eAAe,oBAAoB,SAAS,OAAO,QAAQ,CAAC;AAC5F;AAEA,eAAsB,yBAAyB,UAAkB;AAC/D,SAAO,iBAAiB,MAAM,eAAe,oBAAoB,SAAS,QAAQ,CAAC;AACrF;AAEA,eAAsB,yBAAyB,OAAe,UAAkB;AAC9E,SAAO,iBAAiB,MAAM,eAAe,oBAAoB,SAAS,OAAO,QAAQ,CAAC;AAC5F;AAEA,eAAsB,0BAA0B;AAC9C,SAAO,iBAAiB,YAAY;AAClC,UAAM,SAAS,MAAM,iBAAiB,SAAS;AAC/C,WAAO;AAAA,MACL,QAAQ,OAAO,KAAK;AAAA,MACpB,aAAa,OAAO,KAAK;AAAA,IAC3B;AAAA,EACF,CAAC;AACH;AAEA,eAAsB,uBAAuB,MAAc;AACzD,SAAO,iBAAiB,YAAY;AAClC,UAAM,iBAAiB,QAAQ,IAAI;AACnC,UAAM,eAAe,kBAAkB,EAAE,2BAA2B,KAAK,CAAC;AAAA,EAC5E,CAAC;AACH;AAEA,eAAsB,uBAAuB,MAAc;AACzD,SAAO,iBAAiB,YAAY;AAClC,UAAM,iBAAiB,OAAO,IAAI;AAClC,UAAM,iBAAiB,QAAQ;AAAA,EACjC,CAAC;AACH;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use server";
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { accountService } from "../services/account.service";
4
- function findCurrentAccount() {
4
+ async function findCurrentAccount() {
5
5
  return safeServerAction(() => accountService.findCurrentAccount());
6
6
  }
7
7
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/accounts/actions/find-current-account.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { accountService } from '../services/account.service';\nimport type { Account } from '../types';\n\nexport function findCurrentAccount() {\n return safeServerAction<Account>(() => accountService.findCurrentAccount());\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAGxB,SAAS,qBAAqB;AACnC,SAAO,iBAA0B,MAAM,eAAe,mBAAmB,CAAC;AAC5E;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/accounts/actions/find-current-account.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { accountService } from '../services/account.service';\nimport type { Account } from '../types';\n\nexport async function findCurrentAccount() {\n return safeServerAction<Account>(() => accountService.findCurrentAccount());\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAG/B,eAAsB,qBAAqB;AACzC,SAAO,iBAA0B,MAAM,eAAe,mBAAmB,CAAC;AAC5E;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use server";
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { currencyService } from "../services/currency.service";
4
- function listCurrenciesAction() {
4
+ async function listCurrenciesAction() {
5
5
  return safeServerAction(() => currencyService.fetchOptions());
6
6
  }
7
7
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/accounts/actions/list-currencies.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { currencyService } from '../services/currency.service';\n\nexport function listCurrenciesAction() {\n return safeServerAction(() => currencyService.fetchOptions());\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAEzB,SAAS,uBAAuB;AACrC,SAAO,iBAAiB,MAAM,gBAAgB,aAAa,CAAC;AAC9D;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/accounts/actions/list-currencies.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { currencyService } from '../services/currency.service';\n\nexport async function listCurrenciesAction() {\n return safeServerAction(() => currencyService.fetchOptions());\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAEhC,eAAsB,uBAAuB;AAC3C,SAAO,iBAAiB,MAAM,gBAAgB,aAAa,CAAC;AAC9D;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use server";
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { timezoneService } from "../services/timezone.service";
4
- function listTimezonesAction() {
4
+ async function listTimezonesAction() {
5
5
  return safeServerAction(() => timezoneService.fetchOptions());
6
6
  }
7
7
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/accounts/actions/list-timezones.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { timezoneService } from '../services/timezone.service';\n\nexport function listTimezonesAction() {\n return safeServerAction(() => timezoneService.fetchOptions());\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAEzB,SAAS,sBAAsB;AACpC,SAAO,iBAAiB,MAAM,gBAAgB,aAAa,CAAC;AAC9D;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/accounts/actions/list-timezones.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { timezoneService } from '../services/timezone.service';\n\nexport async function listTimezonesAction() {\n return safeServerAction(() => timezoneService.fetchOptions());\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAEhC,eAAsB,sBAAsB;AAC1C,SAAO,iBAAiB,MAAM,gBAAgB,aAAa,CAAC;AAC9D;","names":[]}
@@ -2,7 +2,7 @@
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { getClientInfoFromRequest } from "../../../infra/utils/client-info";
4
4
  import { authService } from "../services/auth.service";
5
- function logoutAction() {
5
+ async function logoutAction() {
6
6
  return safeServerAction(async () => {
7
7
  const clientInfo = await getClientInfoFromRequest();
8
8
  return authService.logout(clientInfo);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/auth/actions/logout.action.ts"],"sourcesContent":["'use server';\r\n\r\nimport { safeServerAction } from '../../../utils/safeServerAction';\r\nimport { getClientInfoFromRequest } from '../../../infra/utils/client-info';\r\nimport { authService } from '../services/auth.service';\r\n\r\nexport function logoutAction() {\r\n return safeServerAction(async () => {\r\n const clientInfo = await getClientInfoFromRequest();\r\n return authService.logout(clientInfo);\r\n });\r\n}\r\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,gCAAgC;AACzC,SAAS,mBAAmB;AAErB,SAAS,eAAe;AAC7B,SAAO,iBAAiB,YAAY;AAClC,UAAM,aAAa,MAAM,yBAAyB;AAClD,WAAO,YAAY,OAAO,UAAU;AAAA,EACtC,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/auth/actions/logout.action.ts"],"sourcesContent":["'use server';\r\n\r\nimport { safeServerAction } from '../../../utils/safeServerAction';\r\nimport { getClientInfoFromRequest } from '../../../infra/utils/client-info';\r\nimport { authService } from '../services/auth.service';\r\n\r\nexport async function logoutAction() {\r\n return safeServerAction(async () => {\r\n const clientInfo = await getClientInfoFromRequest();\r\n return authService.logout(clientInfo);\r\n });\r\n}\r\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,gCAAgC;AACzC,SAAS,mBAAmB;AAE5B,eAAsB,eAAe;AACnC,SAAO,iBAAiB,YAAY;AAClC,UAAM,aAAa,MAAM,yBAAyB;AAClD,WAAO,YAAY,OAAO,UAAU;AAAA,EACtC,CAAC;AACH;","names":[]}
@@ -2,7 +2,7 @@
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { authService } from "../services/auth.service";
4
4
  import { getClientInfoFromRequest } from "../../../infra/utils/client-info";
5
- function registerAction(data) {
5
+ async function registerAction(data) {
6
6
  return safeServerAction(async () => {
7
7
  const clientInfo = await getClientInfoFromRequest();
8
8
  return authService.register(data, clientInfo);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/auth/actions/register.action.ts"],"sourcesContent":["'use server';\r\n\r\nimport { safeServerAction } from '../../../utils/safeServerAction';\r\nimport { RegisterRequest } from '../schema';\r\nimport { authService } from '../services/auth.service';\r\nimport { getClientInfoFromRequest } from '../../../infra/utils/client-info';\r\n\r\nexport function registerAction(data: RegisterRequest) {\r\n return safeServerAction(async () => {\r\n const clientInfo = await getClientInfoFromRequest();\r\n return authService.register(data, clientInfo);\r\n });\r\n}\r\n"],"mappings":";AAEA,SAAS,wBAAwB;AAEjC,SAAS,mBAAmB;AAC5B,SAAS,gCAAgC;AAElC,SAAS,eAAe,MAAuB;AACpD,SAAO,iBAAiB,YAAY;AAClC,UAAM,aAAa,MAAM,yBAAyB;AAClD,WAAO,YAAY,SAAS,MAAM,UAAU;AAAA,EAC9C,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/auth/actions/register.action.ts"],"sourcesContent":["'use server';\r\n\r\nimport { safeServerAction } from '../../../utils/safeServerAction';\r\nimport { RegisterRequest } from '../schema';\r\nimport { authService } from '../services/auth.service';\r\nimport { getClientInfoFromRequest } from '../../../infra/utils/client-info';\r\n\r\nexport async function registerAction(data: RegisterRequest) {\r\n return safeServerAction(async () => {\r\n const clientInfo = await getClientInfoFromRequest();\r\n return authService.register(data, clientInfo);\r\n });\r\n}\r\n"],"mappings":";AAEA,SAAS,wBAAwB;AAEjC,SAAS,mBAAmB;AAC5B,SAAS,gCAAgC;AAEzC,eAAsB,eAAe,MAAuB;AAC1D,SAAO,iBAAiB,YAAY;AAClC,UAAM,aAAa,MAAM,yBAAyB;AAClD,WAAO,YAAY,SAAS,MAAM,UAAU;AAAA,EAC9C,CAAC;AACH;","names":[]}
@@ -2,7 +2,7 @@
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { authService } from "../services/auth.service";
4
4
  import { getClientInfoFromRequest } from "../../../infra/utils/client-info";
5
- function verifyTwoFactorAction(cookie, code) {
5
+ async function verifyTwoFactorAction(cookie, code) {
6
6
  return safeServerAction(async () => {
7
7
  if (!/^\d{6}$/.test(code)) {
8
8
  throw new Error("Formato inv\xE1lido");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/auth/actions/verify-two-factor.action.ts"],"sourcesContent":["'use server';\r\n\r\nimport { safeServerAction } from '../../../utils/safeServerAction';\r\nimport { authService } from '../services/auth.service';\r\nimport { getClientInfoFromRequest } from '../../../infra/utils/client-info';\r\n\r\nexport function verifyTwoFactorAction(cookie: string, code: string) {\r\n return safeServerAction(async () => {\r\n if (!/^\\d{6}$/.test(code)) {\r\n throw new Error('Formato inválido');\r\n }\r\n const clientInfo = await getClientInfoFromRequest();\r\n await authService.verifyTwoFactor(cookie, code, clientInfo);\r\n });\r\n}\r\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAC5B,SAAS,gCAAgC;AAElC,SAAS,sBAAsB,QAAgB,MAAc;AAClE,SAAO,iBAAiB,YAAY;AAClC,QAAI,CAAC,UAAU,KAAK,IAAI,GAAG;AACzB,YAAM,IAAI,MAAM,qBAAkB;AAAA,IACpC;AACA,UAAM,aAAa,MAAM,yBAAyB;AAClD,UAAM,YAAY,gBAAgB,QAAQ,MAAM,UAAU;AAAA,EAC5D,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/auth/actions/verify-two-factor.action.ts"],"sourcesContent":["'use server';\r\n\r\nimport { safeServerAction } from '../../../utils/safeServerAction';\r\nimport { authService } from '../services/auth.service';\r\nimport { getClientInfoFromRequest } from '../../../infra/utils/client-info';\r\n\r\nexport async function verifyTwoFactorAction(cookie: string, code: string) {\r\n return safeServerAction(async () => {\r\n if (!/^\\d{6}$/.test(code)) {\r\n throw new Error('Formato inválido');\r\n }\r\n const clientInfo = await getClientInfoFromRequest();\r\n await authService.verifyTwoFactor(cookie, code, clientInfo);\r\n });\r\n}\r\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAC5B,SAAS,gCAAgC;AAEzC,eAAsB,sBAAsB,QAAgB,MAAc;AACxE,SAAO,iBAAiB,YAAY;AAClC,QAAI,CAAC,UAAU,KAAK,IAAI,GAAG;AACzB,YAAM,IAAI,MAAM,qBAAkB;AAAA,IACpC;AACA,UAAM,aAAa,MAAM,yBAAyB;AAClD,UAAM,YAAY,gBAAgB,QAAQ,MAAM,UAAU;AAAA,EAC5D,CAAC;AACH;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use server";
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { iaCreditsService } from "../services/ia-credits.service";
4
- function listIaCreditsAction(subscriptionId) {
4
+ async function listIaCreditsAction(subscriptionId) {
5
5
  return safeServerAction(() => iaCreditsService.listOperations(subscriptionId));
6
6
  }
7
7
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/ia-credits/actions/list-ia-credits.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { iaCreditsService } from '../services/ia-credits.service';\n\nexport function listIaCreditsAction(subscriptionId: number | string) {\n return safeServerAction(() => iaCreditsService.listOperations(subscriptionId));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAE1B,SAAS,oBAAoB,gBAAiC;AACnE,SAAO,iBAAiB,MAAM,iBAAiB,eAAe,cAAc,CAAC;AAC/E;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/ia-credits/actions/list-ia-credits.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { iaCreditsService } from '../services/ia-credits.service';\n\nexport async function listIaCreditsAction(subscriptionId: number | string) {\n return safeServerAction(() => iaCreditsService.listOperations(subscriptionId));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAEjC,eAAsB,oBAAoB,gBAAiC;AACzE,SAAO,iBAAiB,MAAM,iBAAiB,eAAe,cAAc,CAAC;AAC/E;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use server";
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { projectUsersService } from "../services/project-users.service";
4
- function addProjectUserAction(params) {
4
+ async function addProjectUserAction(params) {
5
5
  return safeServerAction(() => projectUsersService.addToProject(params));
6
6
  }
7
7
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/projects/actions/add-project-user.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { projectUsersService } from '../services/project-users.service';\nimport type { AddRemoveProjectUsersParams } from '../types';\n\nexport function addProjectUserAction(params: AddRemoveProjectUsersParams) {\n return safeServerAction(() => projectUsersService.addToProject(params));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AAG7B,SAAS,qBAAqB,QAAqC;AACxE,SAAO,iBAAiB,MAAM,oBAAoB,aAAa,MAAM,CAAC;AACxE;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/projects/actions/add-project-user.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { projectUsersService } from '../services/project-users.service';\nimport type { AddRemoveProjectUsersParams } from '../types';\n\nexport async function addProjectUserAction(params: AddRemoveProjectUsersParams) {\n return safeServerAction(() => projectUsersService.addToProject(params));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AAGpC,eAAsB,qBAAqB,QAAqC;AAC9E,SAAO,iBAAiB,MAAM,oBAAoB,aAAa,MAAM,CAAC;AACxE;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use server";
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { projectUsersService } from "../services/project-users.service";
4
- function listAvailableUsersAction(projectId, params = {}) {
4
+ async function listAvailableUsersAction(projectId, params = {}) {
5
5
  return safeServerAction(() => projectUsersService.listNotInProject(projectId, params));
6
6
  }
7
7
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/projects/actions/list-available-users.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { projectUsersService } from '../services/project-users.service';\nimport type { ListUsersParams } from '../types';\n\nexport function listAvailableUsersAction(projectId: number, params: ListUsersParams = {}) {\n return safeServerAction(() => projectUsersService.listNotInProject(projectId, params));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AAG7B,SAAS,yBAAyB,WAAmB,SAA0B,CAAC,GAAG;AACxF,SAAO,iBAAiB,MAAM,oBAAoB,iBAAiB,WAAW,MAAM,CAAC;AACvF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/projects/actions/list-available-users.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { projectUsersService } from '../services/project-users.service';\nimport type { ListUsersParams } from '../types';\n\nexport async function listAvailableUsersAction(projectId: number, params: ListUsersParams = {}) {\n return safeServerAction(() => projectUsersService.listNotInProject(projectId, params));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AAGpC,eAAsB,yBAAyB,WAAmB,SAA0B,CAAC,GAAG;AAC9F,SAAO,iBAAiB,MAAM,oBAAoB,iBAAiB,WAAW,MAAM,CAAC;AACvF;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use server";
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { projectUsersService } from "../services/project-users.service";
4
- function listProjectUsersAction(projectId, params = {}) {
4
+ async function listProjectUsersAction(projectId, params = {}) {
5
5
  return safeServerAction(() => projectUsersService.listInProject(projectId, params));
6
6
  }
7
7
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/projects/actions/list-project-users.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { projectUsersService } from '../services/project-users.service';\nimport type { ListUsersParams } from '../types';\n\nexport function listProjectUsersAction(projectId: number, params: ListUsersParams = {}) {\n return safeServerAction(() => projectUsersService.listInProject(projectId, params));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AAG7B,SAAS,uBAAuB,WAAmB,SAA0B,CAAC,GAAG;AACtF,SAAO,iBAAiB,MAAM,oBAAoB,cAAc,WAAW,MAAM,CAAC;AACpF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/projects/actions/list-project-users.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { projectUsersService } from '../services/project-users.service';\nimport type { ListUsersParams } from '../types';\n\nexport async function listProjectUsersAction(projectId: number, params: ListUsersParams = {}) {\n return safeServerAction(() => projectUsersService.listInProject(projectId, params));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AAGpC,eAAsB,uBAAuB,WAAmB,SAA0B,CAAC,GAAG;AAC5F,SAAO,iBAAiB,MAAM,oBAAoB,cAAc,WAAW,MAAM,CAAC;AACpF;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use server";
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { projectUsersService } from "../services/project-users.service";
4
- function removeProjectUserAction(params) {
4
+ async function removeProjectUserAction(params) {
5
5
  return safeServerAction(() => projectUsersService.removeFromProject(params));
6
6
  }
7
7
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/projects/actions/remove-project-user.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { projectUsersService } from '../services/project-users.service';\nimport type { AddRemoveProjectUsersParams } from '../types';\n\nexport function removeProjectUserAction(params: AddRemoveProjectUsersParams) {\n return safeServerAction(() => projectUsersService.removeFromProject(params));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AAG7B,SAAS,wBAAwB,QAAqC;AAC3E,SAAO,iBAAiB,MAAM,oBAAoB,kBAAkB,MAAM,CAAC;AAC7E;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/projects/actions/remove-project-user.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { projectUsersService } from '../services/project-users.service';\nimport type { AddRemoveProjectUsersParams } from '../types';\n\nexport async function removeProjectUserAction(params: AddRemoveProjectUsersParams) {\n return safeServerAction(() => projectUsersService.removeFromProject(params));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AAGpC,eAAsB,wBAAwB,QAAqC;AACjF,SAAO,iBAAiB,MAAM,oBAAoB,kBAAkB,MAAM,CAAC;AAC7E;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use server";
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { subscriptionsService } from "../services/subscriptions.service";
4
- function listSubscriptionsAction(params) {
4
+ async function listSubscriptionsAction(params) {
5
5
  return safeServerAction(() => subscriptionsService.listSubscriptions(params));
6
6
  }
7
7
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/subscriptions/actions/list-subscriptions.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport type { FindSubscriptionsParams } from '../types';\nimport { subscriptionsService } from '../services/subscriptions.service';\n\nexport function listSubscriptionsAction(params?: Partial<FindSubscriptionsParams>) {\n return safeServerAction(() => subscriptionsService.listSubscriptions(params));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AAEjC,SAAS,4BAA4B;AAE9B,SAAS,wBAAwB,QAA2C;AACjF,SAAO,iBAAiB,MAAM,qBAAqB,kBAAkB,MAAM,CAAC;AAC9E;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/subscriptions/actions/list-subscriptions.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport type { FindSubscriptionsParams } from '../types';\nimport { subscriptionsService } from '../services/subscriptions.service';\n\nexport async function listSubscriptionsAction(params?: Partial<FindSubscriptionsParams>) {\n return safeServerAction(() => subscriptionsService.listSubscriptions(params));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AAEjC,SAAS,4BAA4B;AAErC,eAAsB,wBAAwB,QAA2C;AACvF,SAAO,iBAAiB,MAAM,qBAAqB,kBAAkB,MAAM,CAAC;AAC9E;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use server";
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { userService } from "../services/user.service";
4
- function findUserById() {
4
+ async function findUserById() {
5
5
  return safeServerAction(() => userService.findById());
6
6
  }
7
7
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/users/action/find-user-by-id.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { userService } from '../services/user.service';\n\nexport function findUserById() {\n return safeServerAction(() => userService.findById());\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAErB,SAAS,eAAe;AAC7B,SAAO,iBAAiB,MAAM,YAAY,SAAS,CAAC;AACtD;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/users/action/find-user-by-id.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { userService } from '../services/user.service';\n\nexport async function findUserById() {\n return safeServerAction(() => userService.findById());\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAE5B,eAAsB,eAAe;AACnC,SAAO,iBAAiB,MAAM,YAAY,SAAS,CAAC;AACtD;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use server";
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { messagesService } from "../services/messages.service";
4
- function listMessagesAction(params) {
4
+ async function listMessagesAction(params) {
5
5
  return safeServerAction(async () => {
6
6
  const result = await messagesService.listMessages(params);
7
7
  return { data: result.data, total: result.total, totalUnread: result.totalUnread };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/users/action/list-messages.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { messagesService } from '../services/messages.service';\nimport type { FindMessagesParams } from '../schema/messages.schema';\n\nexport function listMessagesAction(params?: Partial<FindMessagesParams>) {\n return safeServerAction(async () => {\n const result = await messagesService.listMessages(params);\n return { data: result.data, total: result.total, totalUnread: result.totalUnread };\n });\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAGzB,SAAS,mBAAmB,QAAsC;AACvE,SAAO,iBAAiB,YAAY;AAClC,UAAM,SAAS,MAAM,gBAAgB,aAAa,MAAM;AACxD,WAAO,EAAE,MAAM,OAAO,MAAM,OAAO,OAAO,OAAO,aAAa,OAAO,YAAY;AAAA,EACnF,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/users/action/list-messages.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { messagesService } from '../services/messages.service';\nimport type { FindMessagesParams } from '../schema/messages.schema';\n\nexport async function listMessagesAction(params?: Partial<FindMessagesParams>) {\n return safeServerAction(async () => {\n const result = await messagesService.listMessages(params);\n return { data: result.data, total: result.total, totalUnread: result.totalUnread };\n });\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAGhC,eAAsB,mBAAmB,QAAsC;AAC7E,SAAO,iBAAiB,YAAY;AAClC,UAAM,SAAS,MAAM,gBAAgB,aAAa,MAAM;AACxD,WAAO,EAAE,MAAM,OAAO,MAAM,OAAO,OAAO,OAAO,aAAa,OAAO,YAAY;AAAA,EACnF,CAAC;AACH;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use server";
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { messagesService } from "../services/messages.service";
4
- function markAllMessagesAsReadAction() {
4
+ async function markAllMessagesAsReadAction() {
5
5
  return safeServerAction(() => messagesService.markAllAsRead());
6
6
  }
7
7
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/users/action/mark-all-messages-as-read.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { messagesService } from '../services/messages.service';\n\nexport function markAllMessagesAsReadAction() {\n return safeServerAction(() => messagesService.markAllAsRead());\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAEzB,SAAS,8BAA8B;AAC5C,SAAO,iBAAiB,MAAM,gBAAgB,cAAc,CAAC;AAC/D;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/users/action/mark-all-messages-as-read.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { messagesService } from '../services/messages.service';\n\nexport async function markAllMessagesAsReadAction() {\n return safeServerAction(() => messagesService.markAllAsRead());\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAEhC,eAAsB,8BAA8B;AAClD,SAAO,iBAAiB,MAAM,gBAAgB,cAAc,CAAC;AAC/D;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use server";
2
2
  import { safeServerAction } from "../../../utils/safeServerAction";
3
3
  import { messagesService } from "../services/messages.service";
4
- function markMessageAsReadAction(messageId) {
4
+ async function markMessageAsReadAction(messageId) {
5
5
  return safeServerAction(() => messagesService.markAsRead(messageId));
6
6
  }
7
7
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/users/action/mark-message-as-read.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { messagesService } from '../services/messages.service';\n\nexport function markMessageAsReadAction(messageId: string) {\n return safeServerAction(() => messagesService.markAsRead(messageId));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAEzB,SAAS,wBAAwB,WAAmB;AACzD,SAAO,iBAAiB,MAAM,gBAAgB,WAAW,SAAS,CAAC;AACrE;","names":[]}
1
+ {"version":3,"sources":["../../../../src/modules/users/action/mark-message-as-read.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { messagesService } from '../services/messages.service';\n\nexport async function markMessageAsReadAction(messageId: string) {\n return safeServerAction(() => messagesService.markAsRead(messageId));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAEhC,eAAsB,wBAAwB,WAAmB;AAC/D,SAAO,iBAAiB,MAAM,gBAAgB,WAAW,SAAS,CAAC;AACrE;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greatapps/common",
3
- "version": "1.1.123",
3
+ "version": "1.1.124",
4
4
  "description": "Shared library for GreatApps frontend applications",
5
5
  "main": "./dist/index.mjs",
6
6
  "types": "./src/index.ts",
@@ -11,61 +11,61 @@ import type {
11
11
  } from '../types';
12
12
  import { twoFactorService } from '../services/two-factor.service';
13
13
 
14
- export function listAccountUsersAction(params?: AccountUsersPaginationParams) {
14
+ export async function listAccountUsersAction(params?: AccountUsersPaginationParams) {
15
15
  return safeServerAction(async () => {
16
16
  const { users, total } = await accountService.listAccountUsers(params);
17
17
  return { data: users, total };
18
18
  });
19
19
  }
20
20
 
21
- export function updateUserAction(user: UpdateAccountUserRequest) {
21
+ export async function updateUserAction(user: UpdateAccountUserRequest) {
22
22
  return safeServerAction(() => accountService.updateAccountUser(user));
23
23
  }
24
24
 
25
- export function updateAccountUserByIdAction(
25
+ export async function updateAccountUserByIdAction(
26
26
  userId: number,
27
27
  user: UpdateAccountUserRequest
28
28
  ) {
29
29
  return safeServerAction(() => accountService.updateAccountUserById(userId, user));
30
30
  }
31
31
 
32
- export function updateAccountAction(data: UpdateAccountRequest) {
32
+ export async function updateAccountAction(data: UpdateAccountRequest) {
33
33
  return safeServerAction(() => accountService.updateAccount(data));
34
34
  }
35
35
 
36
- export function deleteAccountUserAction(userId: number) {
36
+ export async function deleteAccountUserAction(userId: number) {
37
37
  return safeServerAction(() => accountService.deleteAccountUser(userId));
38
38
  }
39
39
 
40
- export function deleteAccountAction() {
40
+ export async function deleteAccountAction() {
41
41
  return safeServerAction(() => accountService.deleteAccount());
42
42
  }
43
43
 
44
- export function createAccountUserAction(user: CreateAccountUserRequest) {
44
+ export async function createAccountUserAction(user: CreateAccountUserRequest) {
45
45
  return safeServerAction(() => accountService.createAccountUser(user));
46
46
  }
47
47
 
48
- export function changePasswordAction(data: ChangePasswordRequest) {
48
+ export async function changePasswordAction(data: ChangePasswordRequest) {
49
49
  return safeServerAction(() => accountService.changePassword(data));
50
50
  }
51
51
 
52
- export function requestEmailChangeAction(newEmail: string) {
52
+ export async function requestEmailChangeAction(newEmail: string) {
53
53
  return safeServerAction(() => accountService.requestContactReset('email', newEmail));
54
54
  }
55
55
 
56
- export function confirmEmailChangeAction(token: string, newEmail: string) {
56
+ export async function confirmEmailChangeAction(token: string, newEmail: string) {
57
57
  return safeServerAction(() => accountService.confirmContactReset('email', token, newEmail));
58
58
  }
59
59
 
60
- export function requestPhoneChangeAction(newPhone: string) {
60
+ export async function requestPhoneChangeAction(newPhone: string) {
61
61
  return safeServerAction(() => accountService.requestContactReset('phone', newPhone));
62
62
  }
63
63
 
64
- export function confirmPhoneChangeAction(token: string, newPhone: string) {
64
+ export async function confirmPhoneChangeAction(token: string, newPhone: string) {
65
65
  return safeServerAction(() => accountService.confirmContactReset('phone', token, newPhone));
66
66
  }
67
67
 
68
- export function generateTwoFactorAction() {
68
+ export async function generateTwoFactorAction() {
69
69
  return safeServerAction(async () => {
70
70
  const result = await twoFactorService.generate();
71
71
  return {
@@ -75,14 +75,14 @@ export function generateTwoFactorAction() {
75
75
  });
76
76
  }
77
77
 
78
- export function confirmTwoFactorAction(code: string) {
78
+ export async function confirmTwoFactorAction(code: string) {
79
79
  return safeServerAction(async () => {
80
80
  await twoFactorService.confirm(code);
81
81
  await accountService.updateAccountUser({ two_factor_authentication: true });
82
82
  });
83
83
  }
84
84
 
85
- export function disableTwoFactorAction(code: string) {
85
+ export async function disableTwoFactorAction(code: string) {
86
86
  return safeServerAction(async () => {
87
87
  await twoFactorService.verify(code);
88
88
  await twoFactorService.disable();
@@ -4,6 +4,6 @@ import { safeServerAction } from '../../../utils/safeServerAction';
4
4
  import { accountService } from '../services/account.service';
5
5
  import type { Account } from '../types';
6
6
 
7
- export function findCurrentAccount() {
7
+ export async function findCurrentAccount() {
8
8
  return safeServerAction<Account>(() => accountService.findCurrentAccount());
9
9
  }
@@ -3,6 +3,6 @@
3
3
  import { safeServerAction } from '../../../utils/safeServerAction';
4
4
  import { currencyService } from '../services/currency.service';
5
5
 
6
- export function listCurrenciesAction() {
6
+ export async function listCurrenciesAction() {
7
7
  return safeServerAction(() => currencyService.fetchOptions());
8
8
  }
@@ -3,6 +3,6 @@
3
3
  import { safeServerAction } from '../../../utils/safeServerAction';
4
4
  import { timezoneService } from '../services/timezone.service';
5
5
 
6
- export function listTimezonesAction() {
6
+ export async function listTimezonesAction() {
7
7
  return safeServerAction(() => timezoneService.fetchOptions());
8
8
  }
@@ -4,7 +4,7 @@ import { safeServerAction } from '../../../utils/safeServerAction';
4
4
  import { getClientInfoFromRequest } from '../../../infra/utils/client-info';
5
5
  import { authService } from '../services/auth.service';
6
6
 
7
- export function logoutAction() {
7
+ export async function logoutAction() {
8
8
  return safeServerAction(async () => {
9
9
  const clientInfo = await getClientInfoFromRequest();
10
10
  return authService.logout(clientInfo);
@@ -5,7 +5,7 @@ import { RegisterRequest } from '../schema';
5
5
  import { authService } from '../services/auth.service';
6
6
  import { getClientInfoFromRequest } from '../../../infra/utils/client-info';
7
7
 
8
- export function registerAction(data: RegisterRequest) {
8
+ export async function registerAction(data: RegisterRequest) {
9
9
  return safeServerAction(async () => {
10
10
  const clientInfo = await getClientInfoFromRequest();
11
11
  return authService.register(data, clientInfo);
@@ -4,7 +4,7 @@ import { safeServerAction } from '../../../utils/safeServerAction';
4
4
  import { authService } from '../services/auth.service';
5
5
  import { getClientInfoFromRequest } from '../../../infra/utils/client-info';
6
6
 
7
- export function verifyTwoFactorAction(cookie: string, code: string) {
7
+ export async function verifyTwoFactorAction(cookie: string, code: string) {
8
8
  return safeServerAction(async () => {
9
9
  if (!/^\d{6}$/.test(code)) {
10
10
  throw new Error('Formato inválido');
@@ -3,6 +3,6 @@
3
3
  import { safeServerAction } from '../../../utils/safeServerAction';
4
4
  import { iaCreditsService } from '../services/ia-credits.service';
5
5
 
6
- export function listIaCreditsAction(subscriptionId: number | string) {
6
+ export async function listIaCreditsAction(subscriptionId: number | string) {
7
7
  return safeServerAction(() => iaCreditsService.listOperations(subscriptionId));
8
8
  }
@@ -4,6 +4,6 @@ import { safeServerAction } from '../../../utils/safeServerAction';
4
4
  import { projectUsersService } from '../services/project-users.service';
5
5
  import type { AddRemoveProjectUsersParams } from '../types';
6
6
 
7
- export function addProjectUserAction(params: AddRemoveProjectUsersParams) {
7
+ export async function addProjectUserAction(params: AddRemoveProjectUsersParams) {
8
8
  return safeServerAction(() => projectUsersService.addToProject(params));
9
9
  }
@@ -4,6 +4,6 @@ import { safeServerAction } from '../../../utils/safeServerAction';
4
4
  import { projectUsersService } from '../services/project-users.service';
5
5
  import type { ListUsersParams } from '../types';
6
6
 
7
- export function listAvailableUsersAction(projectId: number, params: ListUsersParams = {}) {
7
+ export async function listAvailableUsersAction(projectId: number, params: ListUsersParams = {}) {
8
8
  return safeServerAction(() => projectUsersService.listNotInProject(projectId, params));
9
9
  }
@@ -4,6 +4,6 @@ import { safeServerAction } from '../../../utils/safeServerAction';
4
4
  import { projectUsersService } from '../services/project-users.service';
5
5
  import type { ListUsersParams } from '../types';
6
6
 
7
- export function listProjectUsersAction(projectId: number, params: ListUsersParams = {}) {
7
+ export async function listProjectUsersAction(projectId: number, params: ListUsersParams = {}) {
8
8
  return safeServerAction(() => projectUsersService.listInProject(projectId, params));
9
9
  }
@@ -4,6 +4,6 @@ import { safeServerAction } from '../../../utils/safeServerAction';
4
4
  import { projectUsersService } from '../services/project-users.service';
5
5
  import type { AddRemoveProjectUsersParams } from '../types';
6
6
 
7
- export function removeProjectUserAction(params: AddRemoveProjectUsersParams) {
7
+ export async function removeProjectUserAction(params: AddRemoveProjectUsersParams) {
8
8
  return safeServerAction(() => projectUsersService.removeFromProject(params));
9
9
  }
@@ -4,6 +4,6 @@ import { safeServerAction } from '../../../utils/safeServerAction';
4
4
  import type { FindSubscriptionsParams } from '../types';
5
5
  import { subscriptionsService } from '../services/subscriptions.service';
6
6
 
7
- export function listSubscriptionsAction(params?: Partial<FindSubscriptionsParams>) {
7
+ export async function listSubscriptionsAction(params?: Partial<FindSubscriptionsParams>) {
8
8
  return safeServerAction(() => subscriptionsService.listSubscriptions(params));
9
9
  }
@@ -3,6 +3,6 @@
3
3
  import { safeServerAction } from '../../../utils/safeServerAction';
4
4
  import { userService } from '../services/user.service';
5
5
 
6
- export function findUserById() {
6
+ export async function findUserById() {
7
7
  return safeServerAction(() => userService.findById());
8
8
  }
@@ -4,7 +4,7 @@ import { safeServerAction } from '../../../utils/safeServerAction';
4
4
  import { messagesService } from '../services/messages.service';
5
5
  import type { FindMessagesParams } from '../schema/messages.schema';
6
6
 
7
- export function listMessagesAction(params?: Partial<FindMessagesParams>) {
7
+ export async function listMessagesAction(params?: Partial<FindMessagesParams>) {
8
8
  return safeServerAction(async () => {
9
9
  const result = await messagesService.listMessages(params);
10
10
  return { data: result.data, total: result.total, totalUnread: result.totalUnread };
@@ -3,6 +3,6 @@
3
3
  import { safeServerAction } from '../../../utils/safeServerAction';
4
4
  import { messagesService } from '../services/messages.service';
5
5
 
6
- export function markAllMessagesAsReadAction() {
6
+ export async function markAllMessagesAsReadAction() {
7
7
  return safeServerAction(() => messagesService.markAllAsRead());
8
8
  }
@@ -3,6 +3,6 @@
3
3
  import { safeServerAction } from '../../../utils/safeServerAction';
4
4
  import { messagesService } from '../services/messages.service';
5
5
 
6
- export function markMessageAsReadAction(messageId: string) {
6
+ export async function markMessageAsReadAction(messageId: string) {
7
7
  return safeServerAction(() => messagesService.markAsRead(messageId));
8
8
  }