@open-mercato/core 0.6.3-develop.3484.1.1427e58147 → 0.6.3-develop.3498.1.3956a84bc9
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/customers/ai-agents.js +10 -1
- package/dist/modules/customers/ai-agents.js.map +2 -2
- package/dist/modules/customers/ai-tools/settings-pack.js +55 -1
- package/dist/modules/customers/ai-tools/settings-pack.js.map +2 -2
- package/dist/modules/data_sync/api/options.js +2 -0
- package/dist/modules/data_sync/api/options.js.map +2 -2
- package/dist/modules/data_sync/api/run.js +9 -0
- package/dist/modules/data_sync/api/run.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/page.js +3 -2
- package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
- package/dist/modules/data_sync/components/IntegrationScheduleTab.js +8 -3
- package/dist/modules/data_sync/components/IntegrationScheduleTab.js.map +2 -2
- package/dist/modules/messages/api/route.js +2 -2
- package/dist/modules/messages/api/route.js.map +2 -2
- package/dist/modules/messages/data/validators.js +6 -5
- package/dist/modules/messages/data/validators.js.map +2 -2
- package/dist/modules/query_index/di.js +8 -6
- package/dist/modules/query_index/di.js.map +2 -2
- package/dist/modules/sync_excel/lib/adapters/customers.js +1 -0
- package/dist/modules/sync_excel/lib/adapters/customers.js.map +2 -2
- package/package.json +7 -7
- package/src/modules/customers/ai-agents.ts +10 -1
- package/src/modules/customers/ai-tools/settings-pack.ts +62 -1
- package/src/modules/data_sync/api/options.ts +2 -0
- package/src/modules/data_sync/api/run.ts +9 -0
- package/src/modules/data_sync/backend/data-sync/page.tsx +10 -0
- package/src/modules/data_sync/components/IntegrationScheduleTab.tsx +17 -3
- package/src/modules/data_sync/lib/adapter.ts +9 -0
- package/src/modules/messages/api/route.ts +2 -2
- package/src/modules/messages/data/validators.ts +6 -5
- package/src/modules/query_index/di.ts +9 -7
- package/src/modules/sync_excel/lib/adapters/customers.ts +1 -0
|
@@ -66,8 +66,8 @@ export function register(container: AppContainer) {
|
|
|
66
66
|
const makeUpsertHandler = (entityType: string) => async (payload: any, ctx: any) => {
|
|
67
67
|
try {
|
|
68
68
|
const em = ctx.resolve('em')
|
|
69
|
-
let orgId = payload?.organizationId || payload?.orgId || null
|
|
70
|
-
let tenantId = payload?.tenantId || null
|
|
69
|
+
let orgId = payload?.organizationId || payload?.orgId || ctx?.organizationId || null
|
|
70
|
+
let tenantId = payload?.tenantId || ctx?.tenantId || null
|
|
71
71
|
const id = String(payload?.id || payload?.recordId || '')
|
|
72
72
|
if (!id) return
|
|
73
73
|
if (!orgId || !tenantId) {
|
|
@@ -119,24 +119,26 @@ export function register(container: AppContainer) {
|
|
|
119
119
|
const makeDeleteHandler = (entityType: string) => async (payload: any, ctx: any) => {
|
|
120
120
|
try {
|
|
121
121
|
const em = ctx.resolve('em')
|
|
122
|
-
let orgId = payload?.organizationId || payload?.orgId || null
|
|
122
|
+
let orgId = payload?.organizationId || payload?.orgId || ctx?.organizationId || null
|
|
123
|
+
let tenantId = payload?.tenantId || ctx?.tenantId || null
|
|
123
124
|
const id = String(payload?.id || payload?.recordId || '')
|
|
124
125
|
if (!id) return
|
|
125
|
-
if (!orgId) {
|
|
126
|
+
if (!orgId || !tenantId) {
|
|
126
127
|
try {
|
|
127
128
|
const db = (em as any).getKysely()
|
|
128
129
|
const table = resolveEntityTableName(em, entityType)
|
|
129
130
|
const row = await db
|
|
130
131
|
.selectFrom(table as any)
|
|
131
|
-
.select(['organization_id' as any])
|
|
132
|
+
.select(['organization_id' as any, 'tenant_id' as any])
|
|
132
133
|
.where('id' as any, '=', id)
|
|
133
|
-
.executeTakeFirst() as { organization_id: string | null } | undefined
|
|
134
|
+
.executeTakeFirst() as { organization_id: string | null; tenant_id: string | null } | undefined
|
|
134
135
|
orgId = row?.organization_id ?? orgId
|
|
136
|
+
tenantId = row?.tenant_id ?? tenantId
|
|
135
137
|
} catch {}
|
|
136
138
|
}
|
|
137
139
|
try {
|
|
138
140
|
const bus = ctx.resolve('eventBus') as any
|
|
139
|
-
await bus.emitEvent('query_index.delete_one', { entityType, recordId: id, organizationId: orgId })
|
|
141
|
+
await bus.emitEvent('query_index.delete_one', { entityType, recordId: id, organizationId: orgId, tenantId })
|
|
140
142
|
} catch {}
|
|
141
143
|
} catch {}
|
|
142
144
|
}
|
|
@@ -993,6 +993,7 @@ async function processRow(params: {
|
|
|
993
993
|
|
|
994
994
|
export const syncExcelCustomersAdapter: DataSyncAdapter = {
|
|
995
995
|
providerKey: 'excel',
|
|
996
|
+
runMode: 'provider',
|
|
996
997
|
operationalTelemetry: true,
|
|
997
998
|
direction: 'import',
|
|
998
999
|
supportedEntities: ['customers.person'],
|