@open-mercato/core 0.6.1-develop.3291.1.6fad645fd0 → 0.6.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.
- package/.turbo/turbo-build.log +1 -1
- package/AGENTS.md +14 -0
- package/dist/modules/auth/backend/roles/[id]/edit/page.js +2 -1
- package/dist/modules/auth/backend/roles/[id]/edit/page.js.map +2 -2
- package/dist/modules/auth/backend/users/[id]/edit/page.js +2 -5
- package/dist/modules/auth/backend/users/[id]/edit/page.js.map +2 -2
- package/dist/modules/catalog/ai-agents.js +47 -5
- package/dist/modules/catalog/ai-agents.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/categories/[id]/edit/page.js +2 -5
- package/dist/modules/catalog/backend/catalog/categories/[id]/edit/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js +4 -3
- package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js +2 -9
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js +2 -9
- package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js.map +2 -2
- package/dist/modules/customers/ai-agents.js +174 -1
- package/dist/modules/customers/ai-agents.js.map +2 -2
- package/dist/modules/customers/ai-tools/deal-analyzer-pack.js +196 -0
- package/dist/modules/customers/ai-tools/deal-analyzer-pack.js.map +7 -0
- package/dist/modules/customers/ai-tools.js +3 -1
- package/dist/modules/customers/ai-tools.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies/page.js +11 -1
- package/dist/modules/customers/backend/customers/companies/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/page.js +11 -1
- package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people/page.js +11 -1
- package/dist/modules/customers/backend/customers/people/page.js.map +2 -2
- package/dist/modules/customers/commands/companies.js +37 -15
- package/dist/modules/customers/commands/companies.js.map +2 -2
- package/dist/modules/customers/components/detail/AiActionChips.js +2 -2
- package/dist/modules/customers/components/detail/AiActionChips.js.map +2 -2
- package/dist/modules/customers/components/detail/ChangelogTab.js +3 -9
- package/dist/modules/customers/components/detail/ChangelogTab.js.map +2 -2
- package/dist/modules/customers/components/detail/changelogValues.js +35 -0
- package/dist/modules/customers/components/detail/changelogValues.js.map +7 -0
- package/dist/modules/customers/components/detail/customFieldUtils.js +1 -1
- package/dist/modules/customers/components/detail/customFieldUtils.js.map +1 -1
- package/dist/modules/customers/components/formConfig.js +3 -2
- package/dist/modules/customers/components/formConfig.js.map +2 -2
- package/dist/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.js +4 -9
- package/dist/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.client.js +302 -0
- package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.client.js.map +7 -0
- package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.js +17 -0
- package/dist/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.js.map +7 -0
- package/dist/modules/customers/widgets/injection/ai-deal-detail-trigger/widget.client.js +2 -2
- package/dist/modules/customers/widgets/injection/ai-deal-detail-trigger/widget.client.js.map +2 -2
- package/dist/modules/customers/widgets/injection-table.js +2 -2
- package/dist/modules/customers/widgets/injection-table.js.map +2 -2
- package/dist/modules/directory/backend/directory/organizations/[id]/edit/page.js +2 -5
- package/dist/modules/directory/backend/directory/organizations/[id]/edit/page.js.map +2 -2
- package/dist/modules/directory/backend/directory/tenants/[id]/edit/page.js +2 -5
- package/dist/modules/directory/backend/directory/tenants/[id]/edit/page.js.map +2 -2
- package/dist/modules/resources/backend/resources/resources/[id]/page.js +2 -5
- package/dist/modules/resources/backend/resources/resources/[id]/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/channels/[channelId]/edit/page.js +2 -25
- package/dist/modules/sales/backend/sales/channels/[channelId]/edit/page.js.map +2 -2
- package/dist/modules/sales/components/channels/ChannelOfferForm.js +2 -43
- package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +2 -2
- package/dist/modules/sales/components/documents/LineItemDialog.js +162 -42
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/customFieldHelpers.js +4 -31
- package/dist/modules/sales/components/documents/customFieldHelpers.js.map +2 -2
- package/package.json +16 -8
- package/src/modules/auth/backend/roles/[id]/edit/page.tsx +2 -1
- package/src/modules/auth/backend/users/[id]/edit/page.tsx +2 -5
- package/src/modules/business_rules/migrations/.snapshot-open-mercato.json +746 -394
- package/src/modules/catalog/ai-agents.ts +62 -4
- package/src/modules/catalog/backend/catalog/categories/[id]/edit/page.tsx +2 -5
- package/src/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.tsx +4 -3
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +2 -12
- package/src/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.tsx +2 -10
- package/src/modules/catalog/migrations/.snapshot-open-mercato.json +2519 -1307
- package/src/modules/customer_accounts/migrations/.snapshot-open-mercato.json +828 -834
- package/src/modules/customers/AGENTS.md +6 -1
- package/src/modules/customers/ai-agents.ts +213 -6
- package/src/modules/customers/ai-tools/deal-analyzer-pack.ts +286 -0
- package/src/modules/customers/ai-tools.ts +2 -0
- package/src/modules/customers/backend/customers/companies/page.tsx +10 -0
- package/src/modules/customers/backend/customers/deals/page.tsx +10 -0
- package/src/modules/customers/backend/customers/people/page.tsx +10 -0
- package/src/modules/customers/commands/companies.ts +38 -14
- package/src/modules/customers/components/detail/AiActionChips.tsx +2 -2
- package/src/modules/customers/components/detail/ChangelogTab.tsx +3 -10
- package/src/modules/customers/components/detail/changelogValues.ts +42 -0
- package/src/modules/customers/components/detail/customFieldUtils.ts +1 -1
- package/src/modules/customers/components/formConfig.tsx +3 -2
- package/src/modules/customers/i18n/de.json +7 -0
- package/src/modules/customers/i18n/en.json +7 -0
- package/src/modules/customers/i18n/es.json +7 -0
- package/src/modules/customers/i18n/pl.json +7 -0
- package/src/modules/customers/migrations/.snapshot-open-mercato.json +2313 -2336
- package/src/modules/customers/widgets/injection/ai-assistant-trigger/widget.client.tsx +4 -6
- package/src/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.client.tsx +358 -0
- package/src/modules/customers/widgets/injection/ai-deal-analyzer-trigger/widget.ts +34 -0
- package/src/modules/customers/widgets/injection/ai-deal-detail-trigger/widget.client.tsx +2 -2
- package/src/modules/customers/widgets/injection-table.ts +12 -9
- package/src/modules/data_sync/migrations/.snapshot-open-mercato.json +554 -210
- package/src/modules/dictionaries/migrations/.snapshot-open-mercato.json +146 -146
- package/src/modules/directory/backend/directory/organizations/[id]/edit/page.tsx +2 -5
- package/src/modules/directory/backend/directory/tenants/[id]/edit/page.tsx +2 -5
- package/src/modules/directory/migrations/.snapshot-open-mercato.json +273 -140
- package/src/modules/feature_toggles/migrations/.snapshot-open-mercato.json +242 -137
- package/src/modules/integrations/migrations/.snapshot-open-mercato.json +498 -195
- package/src/modules/payment_gateways/migrations/.snapshot-open-mercato.json +158 -157
- package/src/modules/perspectives/migrations/.snapshot-open-mercato.json +274 -129
- package/src/modules/planner/migrations/.snapshot-open-mercato.json +327 -157
- package/src/modules/progress/AGENTS.md +72 -0
- package/src/modules/resources/backend/resources/resources/[id]/page.tsx +2 -5
- package/src/modules/resources/migrations/.snapshot-open-mercato.json +920 -470
- package/src/modules/sales/backend/sales/channels/[channelId]/edit/page.tsx +2 -27
- package/src/modules/sales/components/channels/ChannelOfferForm.tsx +2 -49
- package/src/modules/sales/components/documents/LineItemDialog.tsx +214 -78
- package/src/modules/sales/components/documents/customFieldHelpers.ts +4 -43
- package/src/modules/sales/i18n/de.json +3 -0
- package/src/modules/sales/i18n/en.json +3 -0
- package/src/modules/sales/i18n/es.json +3 -0
- package/src/modules/sales/i18n/pl.json +3 -0
- package/src/modules/sales/migrations/.snapshot-open-mercato.json +4740 -4778
- package/src/modules/shipping_carriers/migrations/.snapshot-open-mercato.json +340 -81
- package/src/modules/staff/migrations/.snapshot-open-mercato.json +1439 -729
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { normalizeCustomFieldResponse } from "@open-mercato/shared/lib/custom-fields/normalize";
|
|
2
|
+
import { extractCustomFieldEntries } from "@open-mercato/shared/lib/crud/custom-fields-client";
|
|
2
3
|
const normalizeCustomFieldSubmitValue = (value) => {
|
|
3
4
|
if (Array.isArray(value)) return value.filter((entry) => entry !== void 0);
|
|
4
5
|
if (value === void 0) return null;
|
|
@@ -17,37 +18,9 @@ const prefixCustomFieldValues = (input) => {
|
|
|
17
18
|
};
|
|
18
19
|
const extractCustomFieldValues = (source) => {
|
|
19
20
|
if (!source || typeof source !== "object") return {};
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
const trimmed = key.trim();
|
|
24
|
-
if (!trimmed.length) return;
|
|
25
|
-
const normalizedKey = trimmed.startsWith("cf_") ? trimmed : trimmed.startsWith("cf:") ? `cf_${trimmed.slice(3)}` : `cf_${trimmed}`;
|
|
26
|
-
if (normalizedKey.endsWith("__is_multi")) return;
|
|
27
|
-
merged[normalizedKey] = value;
|
|
28
|
-
};
|
|
29
|
-
Object.entries(source).forEach(([key, value]) => {
|
|
30
|
-
if (key.startsWith("cf_") || key.startsWith("cf:")) {
|
|
31
|
-
assign(key, value);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
const customValues = source.customValues ?? source.custom_values;
|
|
35
|
-
if (customValues && typeof customValues === "object" && !Array.isArray(customValues)) {
|
|
36
|
-
Object.entries(customValues).forEach(([key, value]) => assign(key, value));
|
|
37
|
-
}
|
|
38
|
-
const customFields = source.customFields ?? source.custom_fields;
|
|
39
|
-
if (Array.isArray(customFields)) {
|
|
40
|
-
;
|
|
41
|
-
customFields.forEach((entry) => {
|
|
42
|
-
const key = typeof entry?.key === "string" ? entry.key : typeof entry?.id === "string" ? entry.id : null;
|
|
43
|
-
if (!key) return;
|
|
44
|
-
assign(key, entry?.value);
|
|
45
|
-
});
|
|
46
|
-
} else if (customFields && typeof customFields === "object") {
|
|
47
|
-
Object.entries(customFields).forEach(([key, value]) => assign(key, value));
|
|
48
|
-
}
|
|
49
|
-
const normalized = normalizeCustomFieldResponse(merged);
|
|
50
|
-
return normalized ? prefixCustomFieldValues(normalized) : prefixCustomFieldValues(merged);
|
|
21
|
+
const extracted = extractCustomFieldEntries(source);
|
|
22
|
+
const normalized = normalizeCustomFieldResponse(extracted);
|
|
23
|
+
return normalized ? prefixCustomFieldValues(normalized) : prefixCustomFieldValues(extracted);
|
|
51
24
|
};
|
|
52
25
|
export {
|
|
53
26
|
extractCustomFieldValues,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/sales/components/documents/customFieldHelpers.ts"],
|
|
4
|
-
"sourcesContent": ["import { normalizeCustomFieldResponse } from '@open-mercato/shared/lib/custom-fields/normalize'\n\nexport const normalizeCustomFieldSubmitValue = (value: unknown): unknown => {\n if (Array.isArray(value)) return value.filter((entry) => entry !== undefined)\n if (value === undefined) return null\n return value\n}\n\nexport const prefixCustomFieldValues = (input?: Record<string, unknown> | null): Record<string, unknown> => {\n if (!input || typeof input !== 'object') return {}\n return Object.entries(input).reduce<Record<string, unknown>>((acc, [key, value]) => {\n const trimmedKey = key.trim()\n if (!trimmedKey.length) return acc\n const normalizedKey = trimmedKey.startsWith('cf_')\n ? trimmedKey\n : trimmedKey.startsWith('cf:')\n ? `cf_${trimmedKey.slice(3)}`\n : `cf_${trimmedKey}`\n if (normalizedKey.endsWith('__is_multi')) return acc\n acc[normalizedKey] = value\n return acc\n }, {})\n}\n\nexport const extractCustomFieldValues = (source?: Record<string, unknown> | null): Record<string, unknown> => {\n if (!source || typeof source !== 'object') return {}\n const
|
|
5
|
-
"mappings": "AAAA,SAAS,oCAAoC;
|
|
4
|
+
"sourcesContent": ["import { normalizeCustomFieldResponse } from '@open-mercato/shared/lib/custom-fields/normalize'\nimport { extractCustomFieldEntries } from '@open-mercato/shared/lib/crud/custom-fields-client'\n\nexport const normalizeCustomFieldSubmitValue = (value: unknown): unknown => {\n if (Array.isArray(value)) return value.filter((entry) => entry !== undefined)\n if (value === undefined) return null\n return value\n}\n\nexport const prefixCustomFieldValues = (input?: Record<string, unknown> | null): Record<string, unknown> => {\n if (!input || typeof input !== 'object') return {}\n return Object.entries(input).reduce<Record<string, unknown>>((acc, [key, value]) => {\n const trimmedKey = key.trim()\n if (!trimmedKey.length) return acc\n const normalizedKey = trimmedKey.startsWith('cf_')\n ? trimmedKey\n : trimmedKey.startsWith('cf:')\n ? `cf_${trimmedKey.slice(3)}`\n : `cf_${trimmedKey}`\n if (normalizedKey.endsWith('__is_multi')) return acc\n acc[normalizedKey] = value\n return acc\n }, {})\n}\n\nexport const extractCustomFieldValues = (source?: Record<string, unknown> | null): Record<string, unknown> => {\n if (!source || typeof source !== 'object') return {}\n const extracted = extractCustomFieldEntries(source)\n const normalized = normalizeCustomFieldResponse(extracted)\n return normalized ? prefixCustomFieldValues(normalized) : prefixCustomFieldValues(extracted)\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oCAAoC;AAC7C,SAAS,iCAAiC;AAEnC,MAAM,kCAAkC,CAAC,UAA4B;AAC1E,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO,MAAM,OAAO,CAAC,UAAU,UAAU,MAAS;AAC5E,MAAI,UAAU,OAAW,QAAO;AAChC,SAAO;AACT;AAEO,MAAM,0BAA0B,CAAC,UAAoE;AAC1G,MAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO,CAAC;AACjD,SAAO,OAAO,QAAQ,KAAK,EAAE,OAAgC,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM;AAClF,UAAM,aAAa,IAAI,KAAK;AAC5B,QAAI,CAAC,WAAW,OAAQ,QAAO;AAC/B,UAAM,gBAAgB,WAAW,WAAW,KAAK,IAC7C,aACA,WAAW,WAAW,KAAK,IACzB,MAAM,WAAW,MAAM,CAAC,CAAC,KACzB,MAAM,UAAU;AACtB,QAAI,cAAc,SAAS,YAAY,EAAG,QAAO;AACjD,QAAI,aAAa,IAAI;AACrB,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACP;AAEO,MAAM,2BAA2B,CAAC,WAAqE;AAC5G,MAAI,CAAC,UAAU,OAAO,WAAW,SAAU,QAAO,CAAC;AACnD,QAAM,YAAY,0BAA0B,MAAM;AAClD,QAAM,aAAa,6BAA6B,SAAS;AACzD,SAAO,aAAa,wBAAwB,UAAU,IAAI,wBAAwB,SAAS;AAC7F;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/core",
|
|
3
|
-
"version": "0.6.1
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -234,25 +234,34 @@
|
|
|
234
234
|
"mammoth": "^1.9.0",
|
|
235
235
|
"pdfjs-dist": "^5.7.284",
|
|
236
236
|
"semver": "^7.8.0",
|
|
237
|
-
"ts-pattern": "^5.0.0"
|
|
237
|
+
"ts-pattern": "^5.0.0",
|
|
238
|
+
"zod": "^4.3.6"
|
|
238
239
|
},
|
|
239
240
|
"peerDependencies": {
|
|
240
|
-
"@open-mercato/ai-assistant": "0.6.1
|
|
241
|
-
"@open-mercato/shared": "0.6.1
|
|
241
|
+
"@open-mercato/ai-assistant": "0.6.1",
|
|
242
|
+
"@open-mercato/shared": "0.6.1",
|
|
243
|
+
"@open-mercato/ui": "0.6.1",
|
|
244
|
+
"react": "^19.0.0",
|
|
245
|
+
"react-dom": "^19.0.0"
|
|
242
246
|
},
|
|
243
247
|
"devDependencies": {
|
|
244
|
-
"@open-mercato/ai-assistant": "0.6.1
|
|
245
|
-
"@open-mercato/shared": "0.6.1
|
|
248
|
+
"@open-mercato/ai-assistant": "0.6.1",
|
|
249
|
+
"@open-mercato/shared": "0.6.1",
|
|
250
|
+
"@open-mercato/ui": "0.6.1",
|
|
246
251
|
"@testing-library/dom": "^10.4.1",
|
|
247
252
|
"@testing-library/jest-dom": "^6.9.1",
|
|
248
253
|
"@testing-library/react": "^16.3.1",
|
|
249
254
|
"@types/chance": "^1.1.8",
|
|
250
255
|
"@types/html-to-text": "^9.0.4",
|
|
251
256
|
"@types/jest": "^30.0.0",
|
|
257
|
+
"@types/react": "^19.2.14",
|
|
258
|
+
"@types/react-dom": "^19.2.3",
|
|
252
259
|
"@types/semver": "^7.5.8",
|
|
253
260
|
"chance": "^1.1.13",
|
|
254
261
|
"jest": "^30.4.2",
|
|
255
262
|
"jest-environment-jsdom": "^30.4.1",
|
|
263
|
+
"react": "19.2.6",
|
|
264
|
+
"react-dom": "19.2.6",
|
|
256
265
|
"ts-jest": "^29.4.9"
|
|
257
266
|
},
|
|
258
267
|
"publishConfig": {
|
|
@@ -262,6 +271,5 @@
|
|
|
262
271
|
"type": "git",
|
|
263
272
|
"url": "https://github.com/open-mercato/open-mercato",
|
|
264
273
|
"directory": "packages/core"
|
|
265
|
-
}
|
|
266
|
-
"stableVersion": "0.6.0"
|
|
274
|
+
}
|
|
267
275
|
}
|
|
@@ -10,6 +10,7 @@ import { WidgetVisibilityEditor, type WidgetVisibilityEditorHandle } from '@open
|
|
|
10
10
|
import { E } from '#generated/entities.ids.generated'
|
|
11
11
|
import { TenantSelect } from '@open-mercato/core/modules/directory/components/TenantSelect'
|
|
12
12
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
13
|
+
import { extractCustomFieldEntries } from '@open-mercato/shared/lib/crud/custom-fields-client'
|
|
13
14
|
|
|
14
15
|
type EditRoleFormValues = {
|
|
15
16
|
name?: string
|
|
@@ -51,7 +52,7 @@ export default function EditRolePage({ params }: { params?: { id?: string } }) {
|
|
|
51
52
|
const found = (foundList?.[0] ?? null) as RoleRecord | null
|
|
52
53
|
if (!cancelled) {
|
|
53
54
|
setActorIsSuperAdmin(Boolean(result?.isSuperAdmin))
|
|
54
|
-
setInitial(found
|
|
55
|
+
setInitial(found ? { ...found, ...extractCustomFieldEntries(found) } : null)
|
|
55
56
|
const tenant = found && typeof found.tenantId === 'string' ? found.tenantId : null
|
|
56
57
|
setSelectedTenantId(tenant)
|
|
57
58
|
}
|
|
@@ -14,6 +14,7 @@ import { WidgetVisibilityEditor, type WidgetVisibilityEditorHandle } from '@open
|
|
|
14
14
|
import { Button } from '@open-mercato/ui/primitives/button'
|
|
15
15
|
import { flash } from '@open-mercato/ui/backend/FlashMessages'
|
|
16
16
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
17
|
+
import { extractCustomFieldEntries } from '@open-mercato/shared/lib/crud/custom-fields-client'
|
|
17
18
|
import { formatPasswordRequirements, getPasswordPolicy } from '@open-mercato/shared/lib/auth/passwordPolicy'
|
|
18
19
|
import { UserConsentsPanel } from '@open-mercato/core/modules/auth/components/UserConsentsPanel'
|
|
19
20
|
|
|
@@ -206,11 +207,7 @@ export default function EditUserPage({ params }: { params?: { id?: string } }) {
|
|
|
206
207
|
hasPassword: item.hasPassword !== false,
|
|
207
208
|
})
|
|
208
209
|
setSelectedTenantId(item.tenantId ? String(item.tenantId) : null)
|
|
209
|
-
const custom
|
|
210
|
-
for (const [key, value] of Object.entries(item)) {
|
|
211
|
-
if (key.startsWith('cf_')) custom[key] = value as unknown
|
|
212
|
-
else if (key.startsWith('cf:')) custom[`cf_${key.slice(3)}`] = value as unknown
|
|
213
|
-
}
|
|
210
|
+
const custom = extractCustomFieldEntries(item as Record<string, unknown>)
|
|
214
211
|
setCustomFieldValues(custom)
|
|
215
212
|
}
|
|
216
213
|
}
|