@asteby/metacore-runtime-react 53.25.0 → 53.26.0

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 (363) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/action-modal-dispatcher.d.ts +3 -3
  3. package/dist/action-modal-dispatcher.js +31 -31
  4. package/dist/action-priority.d.ts +1 -1
  5. package/dist/activity-diff.d.ts +1 -1
  6. package/dist/activity-diff.js +1 -1
  7. package/dist/activity-timeline.d.ts +2 -2
  8. package/dist/activity-timeline.js +3 -3
  9. package/dist/activity-value-renderer.d.ts +1 -1
  10. package/dist/activity-value-renderer.js +3 -3
  11. package/dist/addon-loader.d.ts +1 -1
  12. package/dist/addon-loader.js +3 -3
  13. package/dist/addon-page-host.js +1 -1
  14. package/dist/addon-page-loader.d.ts +2 -2
  15. package/dist/addon-page-loader.js +3 -3
  16. package/dist/api-context.js +4 -4
  17. package/dist/approval-gate.d.ts +1 -1
  18. package/dist/approval-gate.js +5 -5
  19. package/dist/assist-interview.d.ts +1 -1
  20. package/dist/assist-interview.js +1 -1
  21. package/dist/attention/index.d.ts +3 -3
  22. package/dist/attention/index.js +3 -3
  23. package/dist/attention/use-nav-badges.js +2 -2
  24. package/dist/attribute-classes.d.ts +1 -1
  25. package/dist/audit-info.d.ts +1 -1
  26. package/dist/audit-info.js +5 -5
  27. package/dist/bulk-image-dialog.d.ts +1 -1
  28. package/dist/bulk-image-dialog.js +5 -5
  29. package/dist/bulk-image-import.d.ts +2 -2
  30. package/dist/bulk-image-import.js +1 -1
  31. package/dist/bulk-image-target.d.ts +1 -1
  32. package/dist/bulk-image-target.js +1 -1
  33. package/dist/bulk-image-wizard.d.ts +1 -1
  34. package/dist/bulk-image-wizard.js +5 -5
  35. package/dist/business/catalog-product-search.d.ts +1 -1
  36. package/dist/business/customer-picker.js +4 -4
  37. package/dist/business/document-editor-model.d.ts +3 -3
  38. package/dist/business/document-editor-model.js +4 -4
  39. package/dist/business/document-editor-panels.d.ts +3 -3
  40. package/dist/business/document-editor-panels.js +1 -1
  41. package/dist/business/document-editor.d.ts +2 -2
  42. package/dist/business/document-editor.js +22 -22
  43. package/dist/business/document-lines.d.ts +2 -2
  44. package/dist/business/document-lines.js +3 -3
  45. package/dist/business/field-errors.d.ts +1 -1
  46. package/dist/business/field-errors.js +1 -1
  47. package/dist/business/format.js +1 -1
  48. package/dist/business/index.d.ts +29 -29
  49. package/dist/business/index.js +29 -29
  50. package/dist/business/inspection-checklist.d.ts +1 -1
  51. package/dist/business/inspection-checklist.js +2 -2
  52. package/dist/business/inspection.d.ts +1 -1
  53. package/dist/business/inspection.js +2 -2
  54. package/dist/business/line-items-editor.d.ts +3 -3
  55. package/dist/business/line-items-editor.js +5 -5
  56. package/dist/business/line-items.d.ts +1 -1
  57. package/dist/business/line-items.js +2 -2
  58. package/dist/business/line-product-cell.d.ts +2 -2
  59. package/dist/business/line-product-cell.js +2 -2
  60. package/dist/business/payment-allocator.d.ts +1 -1
  61. package/dist/business/payment-allocator.js +2 -2
  62. package/dist/business/payment-capture.d.ts +1 -1
  63. package/dist/business/payment-capture.js +3 -3
  64. package/dist/business/payment.js +1 -1
  65. package/dist/business/print-send-dialog.js +1 -1
  66. package/dist/business/product-display.d.ts +1 -1
  67. package/dist/business/product-options.d.ts +1 -1
  68. package/dist/business/product-options.js +4 -4
  69. package/dist/business/product-picker.d.ts +1 -1
  70. package/dist/business/product-picker.js +3 -3
  71. package/dist/business/product-search.d.ts +2 -2
  72. package/dist/business/product-search.js +1 -1
  73. package/dist/business/refund-destination.d.ts +1 -1
  74. package/dist/business/refund-destination.js +2 -2
  75. package/dist/business/refund.js +1 -1
  76. package/dist/business/relate-documents.js +1 -1
  77. package/dist/business/return-wizard.d.ts +2 -2
  78. package/dist/business/return-wizard.js +4 -4
  79. package/dist/business/return.d.ts +2 -2
  80. package/dist/business/return.js +2 -2
  81. package/dist/business/vehicle-picker.js +3 -3
  82. package/dist/cache-coherence.js +3 -3
  83. package/dist/capability-providers/index.d.ts +3 -3
  84. package/dist/capability-providers/index.js +3 -3
  85. package/dist/capability-providers/provider-sortable-list.d.ts +1 -1
  86. package/dist/capability-providers/provider-sortable-list.js +1 -1
  87. package/dist/collection-cell.js +1 -1
  88. package/dist/column-filter-field.d.ts +1 -1
  89. package/dist/column-visibility.d.ts +1 -1
  90. package/dist/custom-stages.d.ts +2 -2
  91. package/dist/custom-stages.js +1 -1
  92. package/dist/dashboard-grid.d.ts +1 -1
  93. package/dist/dashboard-grid.js +3 -3
  94. package/dist/dialogs/create-record-dialog.d.ts +1 -1
  95. package/dist/dialogs/create-record-dialog.js +1 -1
  96. package/dist/dialogs/dynamic-record.d.ts +5 -5
  97. package/dist/dialogs/dynamic-record.js +41 -41
  98. package/dist/dialogs/export.d.ts +1 -1
  99. package/dist/dialogs/export.js +2 -2
  100. package/dist/dialogs/import.d.ts +1 -1
  101. package/dist/dialogs/import.js +3 -3
  102. package/dist/dialogs/inline-relation-rows.d.ts +3 -3
  103. package/dist/dialogs/inline-relation-rows.js +3 -3
  104. package/dist/dialogs/inline-relations.d.ts +3 -3
  105. package/dist/dialogs/inline-relations.js +3 -3
  106. package/dist/dialogs/normalize-submit.d.ts +1 -1
  107. package/dist/dialogs/normalize-submit.js +3 -3
  108. package/dist/dialogs/use-inline-relations.d.ts +1 -1
  109. package/dist/dialogs/use-inline-relations.js +3 -3
  110. package/dist/dialogs/view-record-dialog.d.ts +1 -1
  111. package/dist/dialogs/view-record-dialog.js +1 -1
  112. package/dist/display-value.js +1 -1
  113. package/dist/document/action-bar.d.ts +1 -1
  114. package/dist/document/action-bar.js +1 -1
  115. package/dist/document/document-header.d.ts +2 -2
  116. package/dist/document/document-header.js +2 -2
  117. package/dist/document/document-page.d.ts +3 -3
  118. package/dist/document/document-page.js +9 -9
  119. package/dist/document/document-timeline.d.ts +2 -2
  120. package/dist/document/document-timeline.js +2 -2
  121. package/dist/document/evaluate.d.ts +1 -1
  122. package/dist/document/evaluate.js +1 -1
  123. package/dist/document/format.d.ts +1 -1
  124. package/dist/document/index.d.ts +13 -13
  125. package/dist/document/index.js +13 -13
  126. package/dist/document/registry.d.ts +1 -1
  127. package/dist/document/secondary-bar.js +2 -2
  128. package/dist/document/smart-buttons.js +1 -1
  129. package/dist/document/status-badge.d.ts +1 -1
  130. package/dist/document/use-document-sources.d.ts +1 -1
  131. package/dist/document/use-document-sources.js +2 -2
  132. package/dist/document-form-dialog.d.ts +2 -2
  133. package/dist/document-form-dialog.js +16 -16
  134. package/dist/document-template-editor.js +1 -1
  135. package/dist/dynamic-columns-shim.d.ts +1 -1
  136. package/dist/dynamic-columns.d.ts +3 -3
  137. package/dist/dynamic-columns.js +19 -19
  138. package/dist/dynamic-crud-page.d.ts +2 -2
  139. package/dist/dynamic-crud-page.js +13 -13
  140. package/dist/dynamic-date-field.d.ts +1 -1
  141. package/dist/dynamic-date-field.js +1 -1
  142. package/dist/dynamic-form-schema.d.ts +2 -2
  143. package/dist/dynamic-form-schema.js +4 -4
  144. package/dist/dynamic-form.d.ts +10 -10
  145. package/dist/dynamic-form.js +24 -24
  146. package/dist/dynamic-icon.js +1 -1
  147. package/dist/dynamic-kanban.d.ts +3 -3
  148. package/dist/dynamic-kanban.js +25 -25
  149. package/dist/dynamic-line-items.d.ts +1 -1
  150. package/dist/dynamic-line-items.js +6 -6
  151. package/dist/dynamic-multi-select-field.d.ts +1 -1
  152. package/dist/dynamic-multi-select-field.js +7 -7
  153. package/dist/dynamic-relation-helpers.d.ts +1 -1
  154. package/dist/dynamic-relation-helpers.js +2 -2
  155. package/dist/dynamic-relation.d.ts +2 -2
  156. package/dist/dynamic-relation.js +15 -15
  157. package/dist/dynamic-relations.d.ts +2 -2
  158. package/dist/dynamic-relations.js +1 -1
  159. package/dist/dynamic-row-actions.d.ts +1 -1
  160. package/dist/dynamic-row-actions.js +5 -5
  161. package/dist/dynamic-select-field.d.ts +3 -3
  162. package/dist/dynamic-select-field.js +11 -11
  163. package/dist/dynamic-table.d.ts +2 -2
  164. package/dist/dynamic-table.js +24 -24
  165. package/dist/dynamic-view.d.ts +4 -4
  166. package/dist/dynamic-view.js +7 -7
  167. package/dist/entity-select.js +4 -4
  168. package/dist/field-validation-ui.d.ts +2 -2
  169. package/dist/field-widget-registry.d.ts +1 -1
  170. package/dist/form-layout-ui.d.ts +1 -1
  171. package/dist/form-layout.d.ts +1 -1
  172. package/dist/form-layout.js +1 -1
  173. package/dist/genui/index.d.ts +1 -1
  174. package/dist/genui/index.js +1 -1
  175. package/dist/genui/settings-block.d.ts +1 -1
  176. package/dist/genui/settings-block.js +3 -3
  177. package/dist/host-api-client.d.ts +11 -1
  178. package/dist/host-api-client.d.ts.map +1 -1
  179. package/dist/host-api-client.js +21 -14
  180. package/dist/host-api.d.ts +9 -1
  181. package/dist/host-api.d.ts.map +1 -1
  182. package/dist/host-api.js +57 -2
  183. package/dist/hotswap-reload-policy.d.ts +1 -1
  184. package/dist/hotswap-reload-policy.js +1 -1
  185. package/dist/icon-picker-field.d.ts +1 -1
  186. package/dist/icon-picker-field.js +3 -3
  187. package/dist/icon-resolvers.d.ts +1 -1
  188. package/dist/icon-resolvers.js +1 -1
  189. package/dist/icon-spec.js +1 -1
  190. package/dist/index.d.ts +165 -165
  191. package/dist/index.d.ts.map +1 -1
  192. package/dist/index.js +148 -148
  193. package/dist/license/index.d.ts +6 -6
  194. package/dist/license/index.js +6 -6
  195. package/dist/license/license-expiry-banner.d.ts +1 -1
  196. package/dist/license/license-expiry-banner.js +3 -3
  197. package/dist/license/license-gate.d.ts +1 -1
  198. package/dist/license/license-gate.js +5 -5
  199. package/dist/license/license-status-badge.d.ts +1 -1
  200. package/dist/license/license-status-badge.js +1 -1
  201. package/dist/license/use-license-t.d.ts +1 -1
  202. package/dist/license/use-license-t.js +1 -1
  203. package/dist/license/view.d.ts +1 -1
  204. package/dist/license/view.js +1 -1
  205. package/dist/list-include.d.ts +1 -1
  206. package/dist/manifest-hotswap-subscriber.d.ts +1 -1
  207. package/dist/manifest-hotswap-subscriber.js +1 -1
  208. package/dist/metadata-cache.d.ts +1 -1
  209. package/dist/metadata-cache.js +1 -1
  210. package/dist/model-action-toolbar.d.ts +1 -1
  211. package/dist/model-action-toolbar.js +7 -7
  212. package/dist/nav-permissions.d.ts +1 -1
  213. package/dist/nav-permissions.js +1 -1
  214. package/dist/navigation-builder.d.ts +1 -1
  215. package/dist/navigation-builder.js +1 -1
  216. package/dist/option-display.d.ts +1 -1
  217. package/dist/option-display.js +2 -2
  218. package/dist/option-filter.d.ts +1 -1
  219. package/dist/option-when.d.ts +1 -1
  220. package/dist/org-runtime-provider.d.ts +2 -2
  221. package/dist/org-runtime-provider.js +2 -2
  222. package/dist/permissions-context.d.ts +1 -1
  223. package/dist/permissions-manager.js +4 -4
  224. package/dist/primitives/aging.js +1 -1
  225. package/dist/primitives/allocation.js +1 -1
  226. package/dist/primitives/approvals.d.ts +1 -1
  227. package/dist/primitives/contributions.js +1 -1
  228. package/dist/primitives/document-kinds.d.ts +1 -1
  229. package/dist/primitives/index.d.ts +7 -7
  230. package/dist/primitives/index.js +7 -7
  231. package/dist/primitives/panels.d.ts +1 -1
  232. package/dist/primitives/use-contributions.d.ts +2 -2
  233. package/dist/primitives/use-contributions.js +2 -2
  234. package/dist/print-document-button.d.ts +1 -1
  235. package/dist/print-document-button.js +1 -1
  236. package/dist/provenance.js +3 -3
  237. package/dist/query-batch.d.ts +1 -1
  238. package/dist/query-batch.js +1 -1
  239. package/dist/record-actions.d.ts +2 -2
  240. package/dist/record-actions.js +2 -2
  241. package/dist/record-history.d.ts +2 -2
  242. package/dist/record-history.js +3 -3
  243. package/dist/record-picker-dialog.js +3 -3
  244. package/dist/record-picker-option.d.ts +1 -1
  245. package/dist/record-picker-option.js +1 -1
  246. package/dist/record-picker.js +2 -2
  247. package/dist/record-prefill-bar.js +1 -1
  248. package/dist/relation-gallery.js +1 -1
  249. package/dist/requires-addon.d.ts +1 -1
  250. package/dist/rich-cells.js +2 -2
  251. package/dist/rich-url.js +1 -1
  252. package/dist/row-actions-menu.js +5 -5
  253. package/dist/server-error.js +2 -2
  254. package/dist/setup/addon-config-surface.d.ts +3 -3
  255. package/dist/setup/addon-config-surface.js +10 -10
  256. package/dist/setup/connector-blocks-model.d.ts +1 -1
  257. package/dist/setup/connector-blocks.d.ts +1 -1
  258. package/dist/setup/connector-blocks.js +6 -6
  259. package/dist/setup/flow-model.d.ts +1 -1
  260. package/dist/setup/health-card.d.ts +1 -1
  261. package/dist/setup/health-card.js +2 -2
  262. package/dist/setup/index.d.ts +12 -12
  263. package/dist/setup/index.js +12 -12
  264. package/dist/setup/records-table.d.ts +1 -1
  265. package/dist/setup/records-table.js +2 -2
  266. package/dist/setup/setup-flow.d.ts +1 -1
  267. package/dist/setup/setup-flow.js +7 -7
  268. package/dist/setup/setup-form-step.d.ts +1 -1
  269. package/dist/setup/setup-form-step.js +4 -4
  270. package/dist/setup/step-status-badge.d.ts +1 -1
  271. package/dist/setup/step-status-badge.js +2 -2
  272. package/dist/setup/tone.d.ts +1 -1
  273. package/dist/setup/types.d.ts +2 -2
  274. package/dist/sidebar-layout-manager.d.ts +1 -1
  275. package/dist/sidebar-layout-manager.js +2 -2
  276. package/dist/slot.js +1 -1
  277. package/dist/slots/addon-slot.js +4 -4
  278. package/dist/slots/index.d.ts +2 -2
  279. package/dist/slots/index.js +2 -2
  280. package/dist/stage-automations.d.ts +2 -2
  281. package/dist/stage-automations.js +1 -1
  282. package/dist/stage-layout.js +1 -1
  283. package/dist/stage-overrides.d.ts +1 -1
  284. package/dist/stage-overrides.js +1 -1
  285. package/dist/supervised-action.js +1 -1
  286. package/dist/testing.d.ts +1 -1
  287. package/dist/testing.js +1 -1
  288. package/dist/tri-state-boolean.d.ts +2 -2
  289. package/dist/tri-state-boolean.js +1 -1
  290. package/dist/types.d.ts +1 -1
  291. package/dist/upload-field.d.ts +1 -1
  292. package/dist/upload-field.js +4 -4
  293. package/dist/use-addon-installed-probe.js +3 -3
  294. package/dist/use-addon-settings.d.ts +1 -1
  295. package/dist/use-addon-settings.js +1 -1
  296. package/dist/use-dynamic-filters.d.ts +2 -2
  297. package/dist/use-dynamic-filters.js +6 -6
  298. package/dist/use-edge-device.d.ts +1 -1
  299. package/dist/use-edge-device.js +2 -2
  300. package/dist/use-facet-loaders.d.ts +1 -1
  301. package/dist/use-facet-loaders.js +1 -1
  302. package/dist/use-flip-animation.d.ts +1 -1
  303. package/dist/use-flip-animation.js +1 -1
  304. package/dist/use-host-api-client.d.ts +2 -2
  305. package/dist/use-host-api-client.d.ts.map +1 -1
  306. package/dist/use-host-api-client.js +6 -4
  307. package/dist/use-option-ids.d.ts +1 -1
  308. package/dist/use-option-ids.js +2 -2
  309. package/dist/use-options-resolver.d.ts +2 -2
  310. package/dist/use-options-resolver.js +4 -4
  311. package/dist/use-org-document-templates.js +1 -1
  312. package/dist/use-print-document.js +1 -1
  313. package/dist/use-record-mutation-tick.js +1 -1
  314. package/dist/validator.d.ts +2 -2
  315. package/dist/validator.js +1 -1
  316. package/dist/view-system/card-spec.d.ts +1 -1
  317. package/dist/view-system/cards-view.d.ts +1 -1
  318. package/dist/view-system/cards-view.js +2 -2
  319. package/dist/view-system/index.d.ts +9 -9
  320. package/dist/view-system/index.js +9 -9
  321. package/dist/view-system/model-view.d.ts +3 -3
  322. package/dist/view-system/model-view.js +7 -7
  323. package/dist/view-system/saved-views.d.ts +1 -1
  324. package/dist/view-system/use-view-mode.d.ts +1 -1
  325. package/dist/view-system/view-state.d.ts +1 -1
  326. package/dist/view-system/view-switcher.d.ts +1 -1
  327. package/dist/view-system/view-toolbar.d.ts +1 -1
  328. package/dist/view-system/view-toolbar.js +2 -2
  329. package/dist/views/calendar-view.d.ts +1 -1
  330. package/dist/views/calendar-view.js +2 -2
  331. package/dist/views/chart-view.d.ts +2 -2
  332. package/dist/views/chart-view.js +2 -2
  333. package/dist/views/data-source.d.ts +2 -2
  334. package/dist/views/index.d.ts +3 -3
  335. package/dist/views/index.js +2 -2
  336. package/dist/views/map-view.d.ts +1 -1
  337. package/dist/views/map-view.js +3 -3
  338. package/dist/views/panels.d.ts +1 -1
  339. package/dist/views/panels.js +3 -3
  340. package/dist/views/registry.d.ts +2 -2
  341. package/dist/views/registry.js +12 -12
  342. package/dist/views/split-view.d.ts +1 -1
  343. package/dist/views/split-view.js +4 -4
  344. package/dist/views/timeline-view.d.ts +1 -1
  345. package/dist/views/timeline-view.js +3 -3
  346. package/dist/views/types.d.ts +2 -2
  347. package/dist/widgets/charts.d.ts +1 -1
  348. package/dist/widgets/charts.js +2 -2
  349. package/dist/widgets/lazy-charts.d.ts +1 -1
  350. package/dist/widgets/lazy-charts.js +2 -2
  351. package/dist/widgets/renderers.d.ts +2 -2
  352. package/dist/widgets/renderers.js +2 -2
  353. package/dist/widgets/widget-card.d.ts +1 -1
  354. package/dist/widgets/widget-card.js +2 -2
  355. package/dist/widgets/widget-renderer.d.ts +1 -1
  356. package/dist/widgets/widget-renderer.js +4 -4
  357. package/package.json +9 -9
  358. package/src/__tests__/host-api-client.test.tsx +16 -0
  359. package/src/__tests__/host-api.test.ts +50 -0
  360. package/src/host-api-client.ts +31 -14
  361. package/src/host-api.ts +54 -1
  362. package/src/index.ts +2 -1
  363. package/src/use-host-api-client.ts +5 -3
@@ -13,7 +13,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  // is scoped by the FK AND every scope column.
14
14
  import { useMemo } from 'react';
15
15
  import { cn } from '@asteby/metacore-ui/lib';
16
- import { DynamicRelation } from './dynamic-relation';
16
+ import { DynamicRelation } from './dynamic-relation.js';
17
17
  /**
18
18
  * Normalizes the parent id off the record, tolerating a custom `parentIdKey`.
19
19
  * Returns `undefined` when unusable so callers can guard rendering.
@@ -1,4 +1,4 @@
1
- import type { TableMetadata } from './types';
1
+ import type { TableMetadata } from './types.js';
2
2
  /**
3
3
  * Destino de una acción link. La query (`?create=…&from_id=…`) va como `search`:
4
4
  * metida en `to` el router la tomaba como parte del path y la ruta no casaba.
@@ -25,11 +25,11 @@ import { useNavigate } from '@tanstack/react-router';
25
25
  import { useTranslation } from 'react-i18next';
26
26
  import { toast } from 'sonner';
27
27
  import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from '@asteby/metacore-ui/primitives';
28
- import { useApi } from './api-context';
29
- import { useReasonPrompt } from './reason-prompt';
30
- import { ActionModalDispatcher } from './action-modal-dispatcher';
31
- import { DynamicRecordDialog } from './dialogs/dynamic-record';
32
- import { RequiresAddonDialog, resolveRequiresAddon } from './requires-addon';
28
+ import { useApi } from './api-context.js';
29
+ import { useReasonPrompt } from './reason-prompt.js';
30
+ import { ActionModalDispatcher } from './action-modal-dispatcher.js';
31
+ import { DynamicRecordDialog } from './dialogs/dynamic-record.js';
32
+ import { RequiresAddonDialog, resolveRequiresAddon } from './requires-addon.js';
33
33
  /**
34
34
  * Destino de una acción link. La query (`?create=…&from_id=…`) va como `search`:
35
35
  * metida en `to` el router la tomaba como parte del path y la ruta no casaba.
@@ -1,6 +1,6 @@
1
- import { type ResolvedOption } from './use-options-resolver';
2
- import type { ActionFieldDef } from './types';
3
- export { OptionLead, OptionThumb } from './record-picker-option';
1
+ import { type ResolvedOption } from './use-options-resolver.js';
2
+ import type { ActionFieldDef } from './types.js';
3
+ export { OptionLead, OptionThumb } from './record-picker-option.js';
4
4
  /**
5
5
  * Default hint shown when a cascading picker's depended-on field is still
6
6
  * empty. Domain-neutral on purpose; a caller may override it per field via
@@ -25,20 +25,20 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
25
25
  // the same ref on screen). While it resolves the trigger reads "Cargando…",
26
26
  // never the raw id; an id that no longer exists reads "(registro eliminado)".
27
27
  import { useEffect, useRef, useState } from 'react';
28
- import { getOptionFilter } from './option-filter';
28
+ import { getOptionFilter } from './option-filter.js';
29
29
  import { useTranslation } from 'react-i18next';
30
30
  import { Badge, Button } from '@asteby/metacore-ui/primitives';
31
31
  import { Check, ScanLine } from 'lucide-react';
32
- import { BarcodeScanner } from './barcode-scanner';
33
- import { RecordPicker } from './record-picker';
34
- import { OptionLead } from './record-picker-option';
35
- import { OptionDisplayRow, OptionDisplayValue, getOptionDisplay, hasOptionDisplays } from './option-display';
36
- import { recordLabel, requestRecordCreate, requestRecordEdit, withSearchPrefill } from './record-picker-actions';
37
- import { useOptionsResolver } from './use-options-resolver';
38
- import { useResolveOptionIds } from './use-option-ids';
39
- import { useDebouncedValue } from './use-debounced-value';
40
- import { getDependsOn, getFieldRef, resolveOptionsSource } from './dynamic-form-schema';
41
- export { OptionLead, OptionThumb } from './record-picker-option';
32
+ import { BarcodeScanner } from './barcode-scanner.js';
33
+ import { RecordPicker } from './record-picker.js';
34
+ import { OptionLead } from './record-picker-option.js';
35
+ import { OptionDisplayRow, OptionDisplayValue, getOptionDisplay, hasOptionDisplays } from './option-display.js';
36
+ import { recordLabel, requestRecordCreate, requestRecordEdit, withSearchPrefill } from './record-picker-actions.js';
37
+ import { useOptionsResolver } from './use-options-resolver.js';
38
+ import { useResolveOptionIds } from './use-option-ids.js';
39
+ import { useDebouncedValue } from './use-debounced-value.js';
40
+ import { getDependsOn, getFieldRef, resolveOptionsSource } from './dynamic-form-schema.js';
41
+ export { OptionLead, OptionThumb } from './record-picker-option.js';
42
42
  /**
43
43
  * Default hint shown when a cascading picker's depended-on field is still
44
44
  * empty. Domain-neutral on purpose; a caller may override it per field via
@@ -1,7 +1,7 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type ColumnDef } from '@tanstack/react-table';
3
- import type { GetDynamicColumns, RowActionPredicate } from './dynamic-columns-shim';
4
- import type { ActionDefinition } from './types';
3
+ import type { GetDynamicColumns, RowActionPredicate } from './dynamic-columns-shim.js';
4
+ import type { ActionDefinition } from './types.js';
5
5
  /** Drops every persisted first-page row set (all scopes). */
6
6
  export declare function clearTableDataCache(): void;
7
7
  export interface DynamicTableProps {
@@ -13,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
13
13
  // column cells are tightly coupled to their design system).
14
14
  import { useEffect, useState, useMemo, useCallback, useRef } from 'react';
15
15
  import { useTranslation } from 'react-i18next';
16
- import { useTimeZone, useCurrency, useNumberLocale } from './org-runtime-context';
16
+ import { useTimeZone, useCurrency, useNumberLocale } from './org-runtime-context.js';
17
17
  import { format } from 'date-fns';
18
18
  import { useVirtualizer } from '@tanstack/react-virtual';
19
19
  import { flexRender, getCoreRowModel, getFacetedRowModel, getFacetedUniqueValues, getFilteredRowModel, getPaginationRowModel, getSortedRowModel, useReactTable, } from '@tanstack/react-table';
@@ -24,29 +24,29 @@ import { Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, Table
24
24
  import { DataTablePagination, DataTableToolbar, DataTableBulkActions, } from '@asteby/metacore-ui/data-table';
25
25
  import { Inbox, Download, Upload, Trash2 } from 'lucide-react';
26
26
  import { toast } from 'sonner';
27
- import { Progress } from './dialogs/_primitives';
28
- import { useMetadataCache } from './metadata-cache';
29
- import { cacheScope, onCacheScopeChange, peekCacheScope } from './cache-scope';
30
- import { useRecordMutationTick } from './use-record-mutation-tick';
31
- import { useApi, useCurrentBranch } from './api-context';
32
- import { useReasonPrompt } from './reason-prompt';
33
- import { defaultGetDynamicColumns, DATE_CELL_TYPES, aggregateOf, formatAggregateTotal } from './dynamic-columns';
34
- import { useFacetLoaders, isLongTextColumn } from './use-facet-loaders';
35
- import { translateOptionLabels } from './filter-chips';
36
- import { withBooleanUnsetOption } from './nullable-boolean';
37
- import { applyColumnFilterFields } from './column-filter-field';
38
- import { dedupeById, useInfiniteScrollSentinel } from './use-infinite-scroll';
39
- import { DYNAMIC_TABLE_CARD_ESTIMATE_PX, DYNAMIC_TABLE_ROW_ESTIMATE_PX, resolveVirtualizeThreshold, } from './table-virtualization';
40
- import { OptionsContext } from './options-context';
41
- import { RowActionsModelContext } from './row-actions-menu';
42
- import { getSearchableColumnKeys } from './column-visibility';
43
- import { visibleRelationInclude } from './list-include';
44
- import { useDebouncedValue } from './use-debounced-value';
45
- import { useCan, usePermissionsActive, useRoleGate, gateTableMetadata, modelCapability } from './permissions-context';
46
- import { useDynamicRowActions } from './dynamic-row-actions';
47
- import { ExportDialog } from './dialogs/export';
48
- import { ImportDialog } from './dialogs/import';
49
- import { buildListScopeValues, evaluateVisibleWhenForListScope, getVisibleWhen, scopeValueFromFilterToken, } from './dynamic-form-schema';
27
+ import { Progress } from './dialogs/_primitives.js';
28
+ import { useMetadataCache } from './metadata-cache.js';
29
+ import { cacheScope, onCacheScopeChange, peekCacheScope } from './cache-scope.js';
30
+ import { useRecordMutationTick } from './use-record-mutation-tick.js';
31
+ import { useApi, useCurrentBranch } from './api-context.js';
32
+ import { useReasonPrompt } from './reason-prompt.js';
33
+ import { defaultGetDynamicColumns, DATE_CELL_TYPES, aggregateOf, formatAggregateTotal } from './dynamic-columns.js';
34
+ import { useFacetLoaders, isLongTextColumn } from './use-facet-loaders.js';
35
+ import { translateOptionLabels } from './filter-chips.js';
36
+ import { withBooleanUnsetOption } from './nullable-boolean.js';
37
+ import { applyColumnFilterFields } from './column-filter-field.js';
38
+ import { dedupeById, useInfiniteScrollSentinel } from './use-infinite-scroll.js';
39
+ import { DYNAMIC_TABLE_CARD_ESTIMATE_PX, DYNAMIC_TABLE_ROW_ESTIMATE_PX, resolveVirtualizeThreshold, } from './table-virtualization.js';
40
+ import { OptionsContext } from './options-context.js';
41
+ import { RowActionsModelContext } from './row-actions-menu.js';
42
+ import { getSearchableColumnKeys } from './column-visibility.js';
43
+ import { visibleRelationInclude } from './list-include.js';
44
+ import { useDebouncedValue } from './use-debounced-value.js';
45
+ import { useCan, usePermissionsActive, useRoleGate, gateTableMetadata, modelCapability } from './permissions-context.js';
46
+ import { useDynamicRowActions } from './dynamic-row-actions.js';
47
+ import { ExportDialog } from './dialogs/export.js';
48
+ import { ImportDialog } from './dialogs/import.js';
49
+ import { buildListScopeValues, evaluateVisibleWhenForListScope, getVisibleWhen, scopeValueFromFilterToken, } from './dynamic-form-schema.js';
50
50
  // ---------------------------------------------------------------------------
51
51
  // Row-data cache (perceived performance).
52
52
  //
@@ -1,7 +1,7 @@
1
- import { type DynamicTableProps } from './dynamic-table';
2
- import { type DynamicKanbanProps } from './dynamic-kanban';
3
- import type { TableMetadata } from './types';
4
- import type { ViewDataSource } from './views/types';
1
+ import { type DynamicTableProps } from './dynamic-table.js';
2
+ import { type DynamicKanbanProps } from './dynamic-kanban.js';
3
+ import type { TableMetadata } from './types.js';
4
+ import type { ViewDataSource } from './views/types.js';
5
5
  /**
6
6
  * Pure routing decision: which renderer a `view_type` maps onto. Exported so a
7
7
  * host that resolves metadata itself can branch without mounting this wrapper.
@@ -15,13 +15,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
15
15
  // read this wrapper does to learn `view_type` is served from the same cache —
16
16
  // no duplicate network round-trip in practice.
17
17
  import { useEffect, useMemo, useState } from 'react';
18
- import { useApi } from './api-context';
19
- import { useMetadataCache } from './metadata-cache';
20
- import { cacheScope } from './cache-scope';
21
- import { DynamicTable } from './dynamic-table';
22
- import { DynamicKanban } from './dynamic-kanban';
23
- import { DeclarativeView, isDeclarativeViewType } from './views/registry';
24
- import { createApiViewDataSource } from './views/data-source';
18
+ import { useApi } from './api-context.js';
19
+ import { useMetadataCache } from './metadata-cache.js';
20
+ import { cacheScope } from './cache-scope.js';
21
+ import { DynamicTable } from './dynamic-table.js';
22
+ import { DynamicKanban } from './dynamic-kanban.js';
23
+ import { DeclarativeView, isDeclarativeViewType } from './views/registry.js';
24
+ import { createApiViewDataSource } from './views/data-source.js';
25
25
  /**
26
26
  * Pure routing decision: which renderer a `view_type` maps onto. Exported so a
27
27
  * host that resolves metadata itself can branch without mounting this wrapper.
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { RecordPicker, useLatestSearch } from './record-picker';
3
- import { recordLabel } from './record-picker-actions';
4
- import { useRecordPickerDialog } from './record-picker-dialog';
5
- import { useCan } from './permissions-context';
2
+ import { RecordPicker, useLatestSearch } from './record-picker.js';
3
+ import { recordLabel } from './record-picker-actions.js';
4
+ import { useRecordPickerDialog } from './record-picker-dialog.js';
5
+ import { useCan } from './permissions-context.js';
6
6
  /** Lowercase model → permission capability namespace (Supplier → supplier). */
7
7
  function capabilityNamespace(model) {
8
8
  return model.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase();
@@ -1,5 +1,5 @@
1
- import type { ActionFieldDef } from './types';
2
- import type { Translate } from './server-error';
1
+ import type { ActionFieldDef } from './types.js';
2
+ import type { Translate } from './server-error.js';
3
3
  /**
4
4
  * Resolve a validation path (`customer_id`, `lines.0.unit_price`) to a
5
5
  * human label using the action/modal field schema. Nested line-item paths
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { ActionFieldDef } from './types';
2
+ import type { ActionFieldDef } from './types.js';
3
3
  export interface FieldWidgetProps {
4
4
  /** The served field definition (key, label, type, widget, options…). */
5
5
  field: ActionFieldDef;
@@ -1,4 +1,4 @@
1
- import type { FieldGroup } from './form-layout';
1
+ import type { FieldGroup } from './form-layout.js';
2
2
  /**
3
3
  * Section chrome for `mode: "sections"`. Wraps a group's (already gridded)
4
4
  * fields in a titled block.
@@ -1,4 +1,4 @@
1
- import type { VisibleWhen } from './types';
1
+ import type { VisibleWhen } from './types.js';
2
2
  /** One declared section of a model form. `title`/`description` arrive already
3
3
  * localized from the kernel and are rendered verbatim. */
4
4
  export interface FormSection {
@@ -13,7 +13,7 @@
13
13
  // (`dynamic-form.tsx`, `dialogs/dynamic-record.tsx`) share one tested
14
14
  // implementation and the modal-render machinery never has to be booted under
15
15
  // happy-dom just to assert the grouping (same approach as PR #673).
16
- import { evaluateVisibleWhen, getVisibleWhen } from './dynamic-form-schema';
16
+ import { evaluateVisibleWhen, getVisibleWhen } from './dynamic-form-schema.js';
17
17
  /** The synthetic key of the orphan group (fields with no / unknown `section`). */
18
18
  export const DEFAULT_SECTION_KEY = '__default__';
19
19
  /** Reads a field's `section` reference, tolerating a camelCase alias. */
@@ -1,2 +1,2 @@
1
- export { SettingsBlock, coerceSettings, registerGenUISettingsBlock, settingsToFields, type SettingDefLike } from './settings-block';
1
+ export { SettingsBlock, coerceSettings, registerGenUISettingsBlock, settingsToFields, type SettingDefLike } from './settings-block.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- export { SettingsBlock, coerceSettings, registerGenUISettingsBlock, settingsToFields } from './settings-block';
1
+ export { SettingsBlock, coerceSettings, registerGenUISettingsBlock, settingsToFields } from './settings-block.js';
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { type GenUIBlockRendererProps } from '@asteby/metacore-genui';
3
- import type { ActionFieldDef } from '../types';
3
+ import type { ActionFieldDef } from '../types.js';
4
4
  export interface SettingDefLike {
5
5
  key: string;
6
6
  label?: string;
@@ -14,9 +14,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  import * as React from 'react';
15
15
  import { useTranslation } from 'react-i18next';
16
16
  import { registerGenUIBlockRenderer } from '@asteby/metacore-genui';
17
- import { useApi } from '../api-context';
18
- import { useAddonSettings } from '../use-addon-settings';
19
- import { DynamicForm } from '../dynamic-form';
17
+ import { useApi } from '../api-context.js';
18
+ import { useAddonSettings } from '../use-addon-settings.js';
19
+ import { DynamicForm } from '../dynamic-form.js';
20
20
  const humanize = (k) => k.replace(/[_.-]+/g, ' ').replace(/^\w/, (c) => c.toUpperCase());
21
21
  /**
22
22
  * `FromSettings`: projects an addon's setting definitions to form fields.
@@ -4,6 +4,16 @@ export { ApiError, isAbortError };
4
4
  export interface HostRequestConfig {
5
5
  params?: HostApiParams;
6
6
  signal?: AbortSignal;
7
+ /**
8
+ * Extra headers for this call (e.g. `X-Correlation-ID`), merged over the
9
+ * client's `defaultHeaders`. The host drops Authorization, X-Organization-ID
10
+ * and the other headers it owns; they can never be overridden from here.
11
+ */
12
+ headers?: Record<string, string>;
13
+ }
14
+ export interface HostApiClientOptions {
15
+ /** Headers sent on every call; per-call `headers` win over them. */
16
+ defaultHeaders?: Record<string, string>;
7
17
  }
8
18
  /** Minimal axios-like surface (what DynamicSelectField & co. call). */
9
19
  export interface AxiosLikeClient {
@@ -51,5 +61,5 @@ export interface HostApiClient {
51
61
  axiosLike(): AxiosLikeClient;
52
62
  }
53
63
  /** Build the client over the host-injected {@link HostApi}. */
54
- export declare function createHostApiClient(api: HostApi): HostApiClient;
64
+ export declare function createHostApiClient(api: HostApi, options?: HostApiClientOptions): HostApiClient;
55
65
  //# sourceMappingURL=host-api-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"host-api-client.d.ts","sourceRoot":"","sources":["../src/host-api-client.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,EACH,QAAQ,EACR,YAAY,EAIZ,KAAK,aAAa,EACrB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAA;AAEjC,MAAM,WAAW,iBAAiB;IAC9B,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,MAAM,CAAC,EAAE,WAAW,CAAA;CACvB;AAED,uEAAuE;AACvE,MAAM,WAAW,eAAe;IAC5B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;IACxE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;IACzF,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,MA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host-injected {@link HostApi}. */
35
- export function createHostApiClient(api) {
35
+ export function createHostApiClient(api, options = {}) {
36
+ const defaults = options.defaultHeaders;
37
+ // Additive: without defaults or per-call headers the config is untouched.
38
+ const cfg = (c) => {
39
+ if (!defaults)
40
+ return c;
41
+ return { ...(c ?? {}), headers: { ...defaults, ...(c?.headers ?? {}) } };
42
+ };
36
43
  const run = async (p, signal) => {
37
44
  try {
38
45
  return await p();
@@ -43,13 +50,13 @@ export function createHostApiClient(api) {
43
50
  };
44
51
  const body = (p, signal) => run(async () => unwrapEnvelope(await p()), signal);
45
52
  const client = {
46
- get: (path, c) => body(() => api.get(path, c), c?.signal),
47
- post: (path, b, c) => body(() => api.post(path, b, c), c?.signal),
48
- put: (path, b, c) => body(() => api.put(path, b, c), c?.signal),
49
- patch: (path, b, c) => body(() => api.patch(path, b, c), c?.signal),
50
- delete: (path, c) => body(() => api.delete(path, c), c?.signal),
51
- list: (path, c) => run(async () => unwrapList(await api.get(path, c)), c?.signal),
52
- blob: (path, c) => run(() => api.get(path, { ...c, responseType: 'blob' }), c?.signal),
53
+ get: (path, c) => body(() => api.get(path, cfg(c)), c?.signal),
54
+ post: (path, b, c) => body(() => api.post(path, b, cfg(c)), c?.signal),
55
+ put: (path, b, c) => body(() => api.put(path, b, cfg(c)), c?.signal),
56
+ patch: (path, b, c) => body(() => api.patch(path, b, cfg(c)), c?.signal),
57
+ delete: (path, c) => body(() => api.delete(path, cfg(c)), c?.signal),
58
+ list: (path, c) => run(async () => unwrapList(await api.get(path, cfg(c))), c?.signal),
59
+ blob: (path, c) => run(() => api.get(path, { ...cfg(c), responseType: 'blob' }), c?.signal),
53
60
  upload: (path, file, fields, opts) => {
54
61
  let form;
55
62
  if (typeof FormData !== 'undefined' && file instanceof FormData) {
@@ -61,7 +68,7 @@ export function createHostApiClient(api) {
61
68
  for (const [k, v] of Object.entries(fields ?? {}))
62
69
  form.append(k, v);
63
70
  }
64
- return body(() => api.post(path, form, opts?.signal ? { signal: opts.signal } : undefined), opts?.signal);
71
+ return body(() => api.post(path, form, cfg(opts?.signal ? { signal: opts.signal } : undefined)), opts?.signal);
65
72
  },
66
73
  axiosLike: () => {
67
74
  // Envelope kept (the runtime-react fields unwrap it themselves),
@@ -73,11 +80,11 @@ export function createHostApiClient(api) {
73
80
  return { data };
74
81
  }, signal);
75
82
  return {
76
- get: (u, c) => raw(() => api.get(u, c), c?.signal),
77
- post: (u, b, c) => raw(() => api.post(u, b, c), c?.signal),
78
- put: (u, b, c) => raw(() => api.put(u, b, c), c?.signal),
79
- patch: (u, b, c) => raw(() => api.patch(u, b, c), c?.signal),
80
- delete: (u, c) => raw(() => api.delete(u, c), c?.signal),
83
+ get: (u, c) => raw(() => api.get(u, cfg(c)), c?.signal),
84
+ post: (u, b, c) => raw(() => api.post(u, b, cfg(c)), c?.signal),
85
+ put: (u, b, c) => raw(() => api.put(u, b, cfg(c)), c?.signal),
86
+ patch: (u, b, c) => raw(() => api.patch(u, b, cfg(c)), c?.signal),
87
+ delete: (u, c) => raw(() => api.delete(u, cfg(c)), c?.signal),
81
88
  };
82
89
  },
83
90
  };
@@ -1,6 +1,6 @@
1
1
  import { HostApiError } from '@asteby/metacore-sdk';
2
2
  import type { HostApi } from '@asteby/metacore-sdk';
3
- import type { ApiClient } from './api-context';
3
+ import type { ApiClient } from './api-context.js';
4
4
  export interface CreateHostApiOptions {
5
5
  /**
6
6
  * Endpoint the host serves capability queries on (`POST`, body
@@ -17,6 +17,14 @@ export interface CreateHostApiOptions {
17
17
  }
18
18
  /** Strip transport details from any error before it reaches remote code. */
19
19
  export declare function toHostApiError(e: unknown): HostApiError;
20
+ /**
21
+ * Headers the host owns. A remote may add headers but never set these: they
22
+ * carry the credentials, the tenant scope or transport framing. Compared
23
+ * lowercase.
24
+ */
25
+ export declare const PROTECTED_HOST_HEADERS: ReadonlySet<string>;
26
+ /** Drop protected / malformed headers; returns undefined when none remain. */
27
+ export declare function sanitizeRemoteHeaders(headers: Record<string, string> | undefined): Record<string, string> | undefined;
20
28
  /** Build the remote-facing {@link HostApi} over the host's ApiClient. */
21
29
  export declare function createHostApi(client: ApiClient, options?: CreateHostApiOptions): HostApi;
22
30
  //# sourceMappingURL=host-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"host-api.d.ts","sourceRoot":"","sources":["../src/host-api.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EACR,OAAO,EAGV,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI9C,MAAM,WAAW,oBAAoB;IACjC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACtB;AAkBD,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,YAAY,CAWvD;AAuDD,yEAAyE;AACzE,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,oBAAyB,GAAG,OAAO,CA+C5F"}
1
+ {"version":3,"file":"host-api.d.ts","sourceRoot":"","sources":["../src/host-api.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EACR,OAAO,EAGV,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI9C,MAAM,WAAW,oBAAoB;IACjC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACtB;AAkBD,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,YAAY,CAWvD;AAcD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,WAAW,CAAC,MAAM,CAyBrD,CAAA;AAGF,8EAA8E;AAC9E,wBAAgB,qBAAqB,CACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAC5C,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAYpC;AA6CD,yEAAyE;AACzE,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAgD5F"}
package/dist/host-api.js CHANGED
@@ -12,7 +12,7 @@
12
12
  // credentials the host attaches.
13
13
  import { HostApiError } from '@asteby/metacore-sdk';
14
14
  import { isAbortError } from '@asteby/metacore-lib/envelope';
15
- import { batchGet } from './query-batch';
15
+ import { batchGet } from './query-batch.js';
16
16
  function errorMessage(data, fallback) {
17
17
  if (data && typeof data === 'object') {
18
18
  const d = data;
@@ -50,6 +50,57 @@ function safeData(data) {
50
50
  return undefined;
51
51
  }
52
52
  }
53
+ /**
54
+ * Headers the host owns. A remote may add headers but never set these: they
55
+ * carry the credentials, the tenant scope or transport framing. Compared
56
+ * lowercase.
57
+ */
58
+ export const PROTECTED_HOST_HEADERS = new Set([
59
+ 'authorization',
60
+ 'proxy-authorization',
61
+ 'cookie',
62
+ 'x-organization-id',
63
+ 'x-org-id',
64
+ 'x-branch-id',
65
+ 'accept-language',
66
+ 'host',
67
+ 'content-length',
68
+ 'content-type',
69
+ 'transfer-encoding',
70
+ 'origin',
71
+ 'referer',
72
+ // Reenvio / identidad de origen: el backend arma URLs publicas y decide
73
+ // tenant a partir de ellas.
74
+ 'x-forwarded-host',
75
+ 'x-forwarded-proto',
76
+ 'x-forwarded-for',
77
+ 'x-forwarded-port',
78
+ 'forwarded',
79
+ 'x-real-ip',
80
+ 'x-storefront-domain',
81
+ 'x-api-key',
82
+ 'x-http-method-override',
83
+ ]);
84
+ const PROTECTED_HEADER_PREFIXES = ['proxy-'];
85
+ /** Drop protected / malformed headers; returns undefined when none remain. */
86
+ export function sanitizeRemoteHeaders(headers) {
87
+ if (!headers || typeof headers !== 'object')
88
+ return undefined;
89
+ const out = {};
90
+ for (const [name, value] of Object.entries(headers)) {
91
+ if (typeof value !== 'string')
92
+ continue;
93
+ if (!/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/.test(name))
94
+ continue;
95
+ if (/[\r\n]/.test(value))
96
+ continue;
97
+ const lower = name.toLowerCase();
98
+ if (PROTECTED_HOST_HEADERS.has(lower) || PROTECTED_HEADER_PREFIXES.some((p) => lower.startsWith(p)))
99
+ continue;
100
+ out[name] = value;
101
+ }
102
+ return Object.keys(out).length ? out : undefined;
103
+ }
53
104
  function toConfig(opts) {
54
105
  if (!opts)
55
106
  return undefined;
@@ -60,6 +111,9 @@ function toConfig(opts) {
60
111
  config.signal = opts.signal;
61
112
  if (opts.responseType === 'blob')
62
113
  config.responseType = 'blob';
114
+ const headers = sanitizeRemoteHeaders(opts.headers);
115
+ if (headers)
116
+ config.headers = headers;
63
117
  return config;
64
118
  }
65
119
  // With `responseType: 'blob'` axios also delivers the error body as a Blob.
@@ -109,7 +163,8 @@ export function createHostApi(client, options = {}) {
109
163
  return Object.freeze({
110
164
  get: (path, opts) => {
111
165
  const args = withConfig([path], opts);
112
- const batch = options.batchGets && opts?.responseType !== 'blob';
166
+ // A GET with per-call headers cannot share a POST /q: it goes on its own.
167
+ const batch = options.batchGets && opts?.responseType !== 'blob' && !sanitizeRemoteHeaders(opts?.headers);
113
168
  return bodyOf(batch ? batchGet(client, ...args) : client.get(...args), opts);
114
169
  },
115
170
  post: (path, body, opts) => bodyOf(client.post(...withConfig([path, body], opts)), opts),
@@ -1,4 +1,4 @@
1
- import { type AddonManifestChangedMessage, type ManifestHotSwapClient, type WireHotSwapInvalidationOptions } from './manifest-hotswap-subscriber';
1
+ import { type AddonManifestChangedMessage, type ManifestHotSwapClient, type WireHotSwapInvalidationOptions } from './manifest-hotswap-subscriber.js';
2
2
  /**
3
3
  * One of three strategies for reacting to an `ADDON_MANIFEST_CHANGED` event:
4
4
  *
@@ -54,7 +54,7 @@
54
54
  // for backward compatibility (legacy hosts may still call it from `onSwap`) but
55
55
  // is a no-op under the MF runtime.
56
56
  import { useMemo, useRef, useState } from 'react';
57
- import { useManifestHotSwapSubscriber, } from './manifest-hotswap-subscriber';
57
+ import { useManifestHotSwapSubscriber, } from './manifest-hotswap-subscriber.js';
58
58
  /**
59
59
  * Pure (testable) implementation of the swap handler. Decides the action
60
60
  * given a message + config + deps, applies side effects via `deps`, and
@@ -1,4 +1,4 @@
1
- import type { ActionFieldDef } from './types';
1
+ import type { ActionFieldDef } from './types.js';
2
2
  export interface IconPickerFieldProps {
3
3
  field: ActionFieldDef;
4
4
  value: any;
@@ -14,10 +14,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
14
14
  // means image, anything else means icon.
15
15
  import { useMemo, useState } from 'react';
16
16
  import { ChevronsUpDown } from 'lucide-react';
17
- import { lucideIconNames } from './dynamic-icon';
17
+ import { lucideIconNames } from './dynamic-icon.js';
18
18
  import { Button, Input, Popover, PopoverContent, PopoverTrigger, } from '@asteby/metacore-ui/primitives';
19
- import { DynamicIcon, resolveLucideIconName } from './dynamic-icon';
20
- import { UploadField } from './upload-field';
19
+ import { DynamicIcon, resolveLucideIconName } from './dynamic-icon.js';
20
+ import { UploadField } from './upload-field.js';
21
21
  /** Icons rendered per "page" — grows as the user scrolls to the bottom. Keeps
22
22
  * the DOM light: the lucide catalog is ~1500 glyphs, so we never mount them all. */
23
23
  const PAGE = 60;
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- import { type IconSpec } from './icon-spec';
2
+ import { type IconSpec } from './icon-spec.js';
3
3
  export type IconResolver = (spec: string) => IconSpec | ReactNode | null | undefined;
4
4
  /** Outcome of resolving: a built-in spec, or a node the host rendered itself. */
5
5
  export type ResolvedIcon = IconSpec | {
@@ -1,4 +1,4 @@
1
- import { parseIconSpec } from './icon-spec';
1
+ import { parseIconSpec } from './icon-spec.js';
2
2
  const resolvers = [];
3
3
  const SPEC_KINDS = new Set(['lucide', 'emoji', 'image', 'unknown']);
4
4
  function isIconSpec(v) {
package/dist/icon-spec.js CHANGED
@@ -13,7 +13,7 @@
13
13
  // ("mdi mdi-home", "bi bi-house", "ti ti-home", "ri-home-line") and Iconify ids
14
14
  // ("mdi:home") only get the generic normalisation against Lucide; no tables.
15
15
  import dynamicIconImports from 'lucide-react/dynamicIconImports';
16
- import { FONT_AWESOME_ALIASES } from './icon-aliases';
16
+ import { FONT_AWESOME_ALIASES } from './icon-aliases.js';
17
17
  const LUCIDE_KEYS = dynamicIconImports;
18
18
  function kebabToPascal(kebab) {
19
19
  return kebab