@greatapps/common 1.1.660 → 1.1.661
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -3
- package/src/server.ts +0 -8
- package/src/modules/cards/actions/find-card-by-id.action.ts +0 -8
- package/src/modules/cards/actions/list-cards.action.ts +0 -8
- package/src/modules/charges/actions/find-charge-by-id.action.ts +0 -8
- package/src/modules/charges/actions/list-charges.action.ts +0 -9
- package/src/modules/ia-credits/actions/list-ia-credits.action.ts +0 -8
- package/src/modules/pages/actions/count-pages.action.ts +0 -10
- package/src/modules/plans/actions/find-plan-by-id.action.ts +0 -8
- package/src/modules/plans/actions/list-plans.action.ts +0 -17
- package/src/modules/projects/actions/list-all-account-users.action.ts +0 -9
- package/src/modules/projects/actions/list-available-users.action.ts +0 -9
- package/src/modules/users/action/list-messages.action.ts +0 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@greatapps/common",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.661",
|
|
4
4
|
"description": "Shared library for GreatApps frontend applications",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@hookform/resolvers": "^5.2.2",
|
|
80
|
-
"zod": "^4.
|
|
80
|
+
"zod": "^4.3.6",
|
|
81
81
|
"@tanstack/react-query": "^5.95.2",
|
|
82
82
|
"@tanstack/react-query-devtools": "^5.95.2",
|
|
83
83
|
"@types/node": "^25.5.0",
|
|
@@ -90,7 +90,6 @@
|
|
|
90
90
|
"react-hook-form": "^7.72.0",
|
|
91
91
|
"tsup": "^8.5.1",
|
|
92
92
|
"typescript": "^5.9.3",
|
|
93
|
-
"zod": "^4.3.6",
|
|
94
93
|
"zustand": "^5.0.12"
|
|
95
94
|
},
|
|
96
95
|
"peerDependencies": {
|
package/src/server.ts
CHANGED
|
@@ -27,21 +27,14 @@ export { findUserById } from './modules/users/action/find-user-by-id.action';
|
|
|
27
27
|
export { findCurrentAccount } from './modules/accounts/actions/find-current-account.action';
|
|
28
28
|
export { getAccountTokenAction } from './modules/accounts/actions/get-account-token.action';
|
|
29
29
|
export { listSubscriptionsAction } from './modules/subscriptions/actions/list-subscriptions.action';
|
|
30
|
-
export { findPlanByIdAction } from './modules/plans/actions/find-plan-by-id.action';
|
|
31
|
-
export { listPlansAction } from './modules/plans/actions/list-plans.action';
|
|
32
30
|
export { calculateSubscriptionAction } from './modules/subscriptions/actions/calculate-subscription.action';
|
|
33
31
|
export { updateSubscriptionPlanAction } from './modules/subscriptions/actions/update-subscription-plan.action';
|
|
34
32
|
export { updateSubscriptionPaymentAction } from './modules/subscriptions/actions/update-subscription-payment.action';
|
|
35
|
-
export { listCardsAction } from './modules/cards/actions/list-cards.action';
|
|
36
33
|
export { createCardAction } from './modules/cards/actions/create-card.action';
|
|
37
34
|
export { createSetupIntentAction } from './modules/cards/actions/create-setup-intent.action';
|
|
38
|
-
export { listChargesAction } from './modules/charges/actions/list-charges.action';
|
|
39
|
-
export { findChargeByIdAction } from './modules/charges/actions/find-charge-by-id.action';
|
|
40
35
|
export { chargeActionAction } from './modules/charges/actions/charge-action.action';
|
|
41
36
|
export { resolvePlanExtrasPrices } from './modules/subscriptions/utils/resolve-plan-extras-prices';
|
|
42
37
|
export { hasSubscriptionExpired } from './modules/subscriptions/utils/has-subscription-expired';
|
|
43
|
-
export { listIaCreditsAction } from './modules/ia-credits/actions/list-ia-credits.action';
|
|
44
|
-
export { countPagesAction } from './modules/pages/actions/count-pages.action';
|
|
45
38
|
|
|
46
39
|
// Project Services & Actions (server-only)
|
|
47
40
|
export { projectsService } from './modules/projects/services/projects.service';
|
|
@@ -54,7 +47,6 @@ export { deleteProjectAction } from './modules/projects/actions/delete-project.a
|
|
|
54
47
|
// Project Users Services & Actions (server-only)
|
|
55
48
|
export { projectUsersService } from './modules/projects/services/project-users.service';
|
|
56
49
|
export { listProjectUsersAction } from './modules/projects/actions/list-project-users.action';
|
|
57
|
-
export { listAvailableUsersAction } from './modules/projects/actions/list-available-users.action';
|
|
58
50
|
export { addProjectUserAction } from './modules/projects/actions/add-project-user.action';
|
|
59
51
|
export { removeProjectUserAction } from './modules/projects/actions/remove-project-user.action';
|
|
60
52
|
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use server';
|
|
2
|
-
|
|
3
|
-
import { safeServerAction } from '../../../utils/safeServerAction';
|
|
4
|
-
import { cardsService } from '../services/cards.service';
|
|
5
|
-
|
|
6
|
-
export async function findCardByIdAction(id: number) {
|
|
7
|
-
return safeServerAction(() => cardsService.findCardById(id));
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use server';
|
|
2
|
-
|
|
3
|
-
import { safeServerAction } from '../../../utils/safeServerAction';
|
|
4
|
-
import { chargesService } from '../services/charges.service';
|
|
5
|
-
|
|
6
|
-
export async function findChargeByIdAction(chargeId: string | number) {
|
|
7
|
-
return safeServerAction(() => chargesService.findChargeById(chargeId));
|
|
8
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
'use server';
|
|
2
|
-
|
|
3
|
-
import { safeServerAction } from '../../../utils/safeServerAction';
|
|
4
|
-
import type { FindChargesParams } from '../types/charge.type';
|
|
5
|
-
import { chargesService } from '../services/charges.service';
|
|
6
|
-
|
|
7
|
-
export async function listChargesAction(params?: Partial<FindChargesParams>) {
|
|
8
|
-
return safeServerAction(() => chargesService.listCharges(params));
|
|
9
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use server';
|
|
2
|
-
|
|
3
|
-
import { safeServerAction } from '../../../utils/safeServerAction';
|
|
4
|
-
import { iaCreditsService } from '../services/ia-credits.service';
|
|
5
|
-
|
|
6
|
-
export async function listIaCreditsAction(subscriptionId: number | string) {
|
|
7
|
-
return safeServerAction(() => iaCreditsService.listOperations(subscriptionId));
|
|
8
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
'use server';
|
|
2
|
-
|
|
3
|
-
import { safeServerAction } from '../../../utils/safeServerAction';
|
|
4
|
-
import { pagesService } from '../services/pages.service';
|
|
5
|
-
|
|
6
|
-
export async function countPagesAction() {
|
|
7
|
-
return safeServerAction(async () => ({
|
|
8
|
-
total: await pagesService.countPages(),
|
|
9
|
-
}));
|
|
10
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use server';
|
|
2
|
-
|
|
3
|
-
import { safeServerAction } from '../../../utils/safeServerAction';
|
|
4
|
-
import { plansService } from '../services/plans.service';
|
|
5
|
-
|
|
6
|
-
export async function findPlanByIdAction(idPlan: number | string) {
|
|
7
|
-
return safeServerAction(() => plansService.findById(idPlan));
|
|
8
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use server';
|
|
2
|
-
|
|
3
|
-
import { plansService, safeServerAction } from '@greatapps/common/server';
|
|
4
|
-
|
|
5
|
-
export async function listPlansAction() {
|
|
6
|
-
return safeServerAction(async () => {
|
|
7
|
-
const { data: apiPlans } = await plansService.listPlans({
|
|
8
|
-
active: true,
|
|
9
|
-
search: 'client',
|
|
10
|
-
sort: 'id:ASC',
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
if (!apiPlans?.length) return [];
|
|
14
|
-
|
|
15
|
-
return [...apiPlans].sort((a, b) => a.value - b.value);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
'use server';
|
|
2
|
-
|
|
3
|
-
import { safeServerAction } from '../../../utils/safeServerAction';
|
|
4
|
-
import { projectUsersService } from '../services/project-users.service';
|
|
5
|
-
import type { ListUsersParams } from '../types';
|
|
6
|
-
|
|
7
|
-
export async function listAllAccountUsersAction(params: ListUsersParams = {}) {
|
|
8
|
-
return safeServerAction(() => projectUsersService.listAllAccountUsers(params));
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
'use server';
|
|
2
|
-
|
|
3
|
-
import { safeServerAction } from '../../../utils/safeServerAction';
|
|
4
|
-
import { projectUsersService } from '../services/project-users.service';
|
|
5
|
-
import type { ListUsersParams } from '../types';
|
|
6
|
-
|
|
7
|
-
export async function listAvailableUsersAction(projectId: number, params: ListUsersParams = {}) {
|
|
8
|
-
return safeServerAction(() => projectUsersService.listNotInProject(projectId, params));
|
|
9
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
'use server';
|
|
2
|
-
|
|
3
|
-
import { safeServerAction } from '../../../utils/safeServerAction';
|
|
4
|
-
import { messagesService } from '../services/messages.service';
|
|
5
|
-
import type { FindMessagesParams } from '../schema/messages.schema';
|
|
6
|
-
import { findWhitelabel } from '../../whitelabel/actions/find-whitelabel.action';
|
|
7
|
-
|
|
8
|
-
export async function listMessagesAction(params?: Partial<FindMessagesParams>) {
|
|
9
|
-
return safeServerAction(async () => {
|
|
10
|
-
const [result, whitelabel] = await Promise.all([
|
|
11
|
-
messagesService.listMessages(params),
|
|
12
|
-
findWhitelabel(),
|
|
13
|
-
]);
|
|
14
|
-
|
|
15
|
-
const urlMap: Record<string, string> = {
|
|
16
|
-
pages_url: whitelabel?.pages_url ?? '',
|
|
17
|
-
accounts_url: whitelabel?.accounts_url ?? '',
|
|
18
|
-
editor_url: whitelabel?.editor_url ?? '',
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
return { data: result.data.map((message) => ({
|
|
22
|
-
...message,
|
|
23
|
-
url: message.url.replace(/\{(pages_url|accounts_url|editor_url)\}/g, (_, key) => urlMap[key] ?? ''),
|
|
24
|
-
})), total: result.total, totalUnread: result.totalUnread };
|
|
25
|
-
});
|
|
26
|
-
}
|