@open-mercato/core 0.6.6-develop.6339.1.193c6c7c71 → 0.6.6-develop.6344.1.c4b17c07c4
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/.turbo/turbo-build.log +1 -1
- package/dist/modules/catalog/components/products/ProductComplianceSection.js +1 -1
- package/dist/modules/catalog/components/products/ProductComplianceSection.js.map +2 -2
- package/dist/modules/catalog/data/validators.js +1 -1
- package/dist/modules/catalog/data/validators.js.map +2 -2
- package/dist/modules/communication_channels/backend/communication_channels/channels/[id]/page.js +1 -1
- package/dist/modules/communication_channels/backend/communication_channels/channels/[id]/page.js.map +2 -2
- package/dist/modules/communication_channels/lib/route-mutation-guard.js +19 -29
- package/dist/modules/communication_channels/lib/route-mutation-guard.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js +4 -4
- package/dist/modules/customers/backend/customers/deals/pipeline/page.js.map +2 -2
- package/dist/modules/customers/components/calendar/CalendarScreen.js +1 -1
- package/dist/modules/customers/components/calendar/CalendarScreen.js.map +2 -2
- package/dist/modules/integrations/api/[id]/credentials/route.js +14 -4
- package/dist/modules/integrations/api/[id]/credentials/route.js.map +2 -2
- package/dist/modules/integrations/lib/credentials-masking.js +50 -0
- package/dist/modules/integrations/lib/credentials-masking.js.map +7 -0
- package/dist/modules/notifications/lib/routeHelpers.js +18 -25
- package/dist/modules/notifications/lib/routeHelpers.js.map +2 -2
- package/dist/modules/payment_gateways/backend/payment-gateways/page.js +1 -1
- package/dist/modules/payment_gateways/backend/payment-gateways/page.js.map +2 -2
- package/package.json +7 -7
- package/src/modules/catalog/components/products/ProductComplianceSection.tsx +1 -1
- package/src/modules/catalog/data/validators.ts +1 -1
- package/src/modules/communication_channels/backend/communication_channels/channels/[id]/page.tsx +1 -1
- package/src/modules/communication_channels/lib/route-mutation-guard.ts +32 -32
- package/src/modules/customers/backend/customers/deals/pipeline/page.tsx +4 -4
- package/src/modules/customers/components/calendar/CalendarScreen.tsx +1 -1
- package/src/modules/integrations/api/[id]/credentials/route.ts +18 -4
- package/src/modules/integrations/lib/credentials-masking.ts +95 -0
- package/src/modules/notifications/lib/routeHelpers.ts +18 -26
- package/src/modules/payment_gateways/backend/payment-gateways/page.tsx +1 -1
|
@@ -2,10 +2,7 @@ import { z } from 'zod'
|
|
|
2
2
|
import type { AwilixContainer } from 'awilix'
|
|
3
3
|
import { resolveRequestContext } from '@open-mercato/shared/lib/api/context'
|
|
4
4
|
import { isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'
|
|
5
|
-
import {
|
|
6
|
-
runCrudMutationGuardAfterSuccess,
|
|
7
|
-
validateCrudMutationGuard,
|
|
8
|
-
} from '@open-mercato/shared/lib/crud/mutation-guard'
|
|
5
|
+
import { runRouteMutationGuards } from '@open-mercato/shared/lib/crud/route-mutation-guard'
|
|
9
6
|
import { resolveTranslations } from '@open-mercato/shared/lib/i18n/server'
|
|
10
7
|
import { resolveNotificationService, type NotificationService } from './notificationService'
|
|
11
8
|
|
|
@@ -106,33 +103,28 @@ export async function runGuardedNotificationWrite<T>(
|
|
|
106
103
|
options: NotificationMutationGuardOptions,
|
|
107
104
|
write: () => Promise<T>,
|
|
108
105
|
): Promise<GuardedNotificationWriteResult<T>> {
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
106
|
+
const guarded = await runRouteMutationGuards({
|
|
107
|
+
container,
|
|
108
|
+
req,
|
|
109
|
+
auth: {
|
|
110
|
+
userId: scope.userId ?? '',
|
|
111
|
+
tenantId: scope.tenantId,
|
|
112
|
+
organizationId: scope.organizationId,
|
|
113
|
+
},
|
|
114
|
+
input: {
|
|
115
|
+
resourceKind: options.resourceKind,
|
|
116
|
+
resourceId: options.resourceId ?? null,
|
|
117
|
+
operation: options.operation,
|
|
118
|
+
mutationPayload: options.payload ?? null,
|
|
119
|
+
},
|
|
123
120
|
})
|
|
124
|
-
if (
|
|
125
|
-
return { ok: false, response:
|
|
121
|
+
if (!guarded.ok) {
|
|
122
|
+
return { ok: false, response: guarded.response }
|
|
126
123
|
}
|
|
127
124
|
|
|
128
125
|
const result = await write()
|
|
129
126
|
|
|
130
|
-
|
|
131
|
-
await runCrudMutationGuardAfterSuccess(container, {
|
|
132
|
-
...guardScope,
|
|
133
|
-
metadata: guardResult.metadata ?? null,
|
|
134
|
-
})
|
|
135
|
-
}
|
|
127
|
+
await guarded.runAfterSuccess()
|
|
136
128
|
|
|
137
129
|
return { ok: true, result }
|
|
138
130
|
}
|
|
@@ -354,7 +354,7 @@ export default function PaymentTransactionsPage() {
|
|
|
354
354
|
}, [loadDetail, loadRows, runMutation, selectedId, t])
|
|
355
355
|
|
|
356
356
|
const providerOptions = React.useMemo(() => {
|
|
357
|
-
const values = Array.from(new Set(rows.map((row) => row.providerKey).filter(Boolean))).sort()
|
|
357
|
+
const values = Array.from(new Set(rows.map((row) => row.providerKey).filter(Boolean))).sort((a, b) => a.localeCompare(b))
|
|
358
358
|
return values.map((value) => ({
|
|
359
359
|
label: formatTypeLabel(value),
|
|
360
360
|
value,
|