@open-mercato/core 0.6.7-develop.6606.1.3b1ec9b1ea → 0.6.7-develop.6621.1.cdbe9dee3d

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 (102) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/modules/auth/api/session/refresh.js +12 -11
  3. package/dist/modules/auth/api/session/refresh.js.map +2 -2
  4. package/dist/modules/auth/lib/rateLimitCheck.js +4 -4
  5. package/dist/modules/auth/lib/rateLimitCheck.js.map +2 -2
  6. package/dist/modules/catalog/api/categories/route.js +8 -14
  7. package/dist/modules/catalog/api/categories/route.js.map +2 -2
  8. package/dist/modules/catalog/api/tags/route.js +3 -10
  9. package/dist/modules/catalog/api/tags/route.js.map +2 -2
  10. package/dist/modules/customers/api/interactions/[id]/visibility/route.js +15 -17
  11. package/dist/modules/customers/api/interactions/[id]/visibility/route.js.map +2 -2
  12. package/dist/modules/customers/api/people/[id]/email-threads/route.js +6 -4
  13. package/dist/modules/customers/api/people/[id]/email-threads/route.js.map +2 -2
  14. package/dist/modules/customers/api/people/[id]/emails/route.js +19 -17
  15. package/dist/modules/customers/api/people/[id]/emails/route.js.map +2 -2
  16. package/dist/modules/customers/components/detail/CustomFieldValuesList.js +22 -5
  17. package/dist/modules/customers/components/detail/CustomFieldValuesList.js.map +2 -2
  18. package/dist/modules/customers/components/detail/create/CreateDealForm.js +5 -2
  19. package/dist/modules/customers/components/detail/create/CreateDealForm.js.map +2 -2
  20. package/dist/modules/customers/components/detail/customFieldUtils.js +10 -3
  21. package/dist/modules/customers/components/detail/customFieldUtils.js.map +2 -2
  22. package/dist/modules/directory/backend/directory/organizations/[id]/edit/page.meta.js +4 -2
  23. package/dist/modules/directory/backend/directory/organizations/[id]/edit/page.meta.js.map +2 -2
  24. package/dist/modules/directory/backend/directory/tenants/[id]/edit/page.meta.js +4 -2
  25. package/dist/modules/directory/backend/directory/tenants/[id]/edit/page.meta.js.map +2 -2
  26. package/dist/modules/integrations/api/[id]/credentials/route.js +10 -7
  27. package/dist/modules/integrations/api/[id]/credentials/route.js.map +2 -2
  28. package/dist/modules/integrations/api/[id]/health/route.js +6 -4
  29. package/dist/modules/integrations/api/[id]/health/route.js.map +2 -2
  30. package/dist/modules/integrations/api/[id]/route.js +4 -2
  31. package/dist/modules/integrations/api/[id]/route.js.map +2 -2
  32. package/dist/modules/integrations/api/[id]/state/route.js +7 -5
  33. package/dist/modules/integrations/api/[id]/state/route.js.map +2 -2
  34. package/dist/modules/integrations/api/[id]/version/route.js +7 -5
  35. package/dist/modules/integrations/api/[id]/version/route.js.map +2 -2
  36. package/dist/modules/integrations/api/logs/route.js +4 -2
  37. package/dist/modules/integrations/api/logs/route.js.map +2 -2
  38. package/dist/modules/integrations/api/route.js +4 -2
  39. package/dist/modules/integrations/api/route.js.map +2 -2
  40. package/dist/modules/integrations/api/umes-read.js +2 -1
  41. package/dist/modules/integrations/api/umes-read.js.map +2 -2
  42. package/dist/modules/integrations/lib/organization-scope.js +12 -0
  43. package/dist/modules/integrations/lib/organization-scope.js.map +7 -0
  44. package/dist/modules/payment_gateways/lib/gateway-service.js +10 -1
  45. package/dist/modules/payment_gateways/lib/gateway-service.js.map +2 -2
  46. package/dist/modules/sales/api/document-history/route.js +6 -9
  47. package/dist/modules/sales/api/document-history/route.js.map +2 -2
  48. package/dist/modules/sales/api/quotes/accept/route.js +3 -3
  49. package/dist/modules/sales/api/quotes/accept/route.js.map +2 -2
  50. package/dist/modules/sales/api/returns/[id]/route.js +6 -9
  51. package/dist/modules/sales/api/returns/[id]/route.js.map +2 -2
  52. package/dist/modules/sales/backend/sales/documents/[id]/page.js +6 -2
  53. package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
  54. package/dist/modules/sales/components/documents/AddressesSection.js +6 -4
  55. package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
  56. package/dist/modules/sales/workflows.js +1 -1
  57. package/dist/modules/sales/workflows.js.map +1 -1
  58. package/dist/modules/workflows/api/definitions/[id]/route.js +10 -1
  59. package/dist/modules/workflows/api/definitions/[id]/route.js.map +2 -2
  60. package/dist/modules/workflows/lib/event-trigger-service.js +44 -3
  61. package/dist/modules/workflows/lib/event-trigger-service.js.map +2 -2
  62. package/package.json +7 -7
  63. package/src/modules/auth/api/session/refresh.ts +19 -11
  64. package/src/modules/auth/lib/rateLimitCheck.ts +4 -4
  65. package/src/modules/catalog/api/categories/route.ts +14 -16
  66. package/src/modules/catalog/api/tags/route.ts +6 -10
  67. package/src/modules/catalog/i18n/pl.json +9 -9
  68. package/src/modules/customer_accounts/i18n/pl.json +129 -129
  69. package/src/modules/customers/api/interactions/[id]/visibility/route.ts +24 -20
  70. package/src/modules/customers/api/people/[id]/email-threads/route.ts +10 -6
  71. package/src/modules/customers/api/people/[id]/emails/route.ts +25 -21
  72. package/src/modules/customers/components/detail/CustomFieldValuesList.tsx +28 -4
  73. package/src/modules/customers/components/detail/create/CreateDealForm.tsx +7 -2
  74. package/src/modules/customers/components/detail/customFieldUtils.ts +15 -3
  75. package/src/modules/data_sync/i18n/pl.json +68 -68
  76. package/src/modules/directory/backend/directory/organizations/[id]/edit/page.meta.ts +4 -2
  77. package/src/modules/directory/backend/directory/tenants/[id]/edit/page.meta.ts +4 -2
  78. package/src/modules/integrations/api/[id]/credentials/route.ts +10 -7
  79. package/src/modules/integrations/api/[id]/health/route.ts +6 -4
  80. package/src/modules/integrations/api/[id]/route.ts +4 -2
  81. package/src/modules/integrations/api/[id]/state/route.ts +7 -5
  82. package/src/modules/integrations/api/[id]/version/route.ts +7 -5
  83. package/src/modules/integrations/api/logs/route.ts +4 -2
  84. package/src/modules/integrations/api/route.ts +4 -2
  85. package/src/modules/integrations/api/umes-read.ts +2 -1
  86. package/src/modules/integrations/i18n/de.json +0 -76
  87. package/src/modules/integrations/i18n/en.json +0 -76
  88. package/src/modules/integrations/i18n/es.json +0 -76
  89. package/src/modules/integrations/i18n/pl.json +0 -76
  90. package/src/modules/integrations/lib/organization-scope.ts +27 -0
  91. package/src/modules/payment_gateways/lib/gateway-service.ts +12 -1
  92. package/src/modules/sales/api/document-history/route.ts +10 -9
  93. package/src/modules/sales/api/quotes/accept/route.ts +3 -3
  94. package/src/modules/sales/api/returns/[id]/route.ts +10 -9
  95. package/src/modules/sales/backend/sales/documents/[id]/page.tsx +26 -19
  96. package/src/modules/sales/components/documents/AddressesSection.tsx +8 -4
  97. package/src/modules/sales/i18n/pl.json +24 -24
  98. package/src/modules/sales/workflows.ts +1 -1
  99. package/src/modules/staff/i18n/pl.json +178 -178
  100. package/src/modules/workflows/api/definitions/[id]/route.ts +14 -1
  101. package/src/modules/workflows/i18n/pl.json +128 -128
  102. package/src/modules/workflows/lib/event-trigger-service.ts +87 -8
@@ -102,150 +102,150 @@
102
102
  "workflows.activities.waitUntilDescription": "Konkretna data i godzina, do której czekać",
103
103
  "workflows.backToList": "Powrót do przepływów",
104
104
  "workflows.backend.definitions.visual_editor.title": "Wizualny Edytor Przepływów Pracy",
105
- "workflows.checkoutDemo.cart.decreaseQty": "Decrease quantity",
105
+ "workflows.checkoutDemo.cart.decreaseQty": "Zmniejsz ilość",
106
106
  "workflows.checkoutDemo.cart.empty.hint": "Dodaj produkty z listy powyżej",
107
107
  "workflows.checkoutDemo.cart.empty.title": "Twój koszyk jest pusty",
108
- "workflows.checkoutDemo.cart.increaseQty": "Increase quantity",
109
- "workflows.checkoutDemo.cart.pricePerUnitSuffix": "each",
110
- "workflows.checkoutDemo.cart.removeItemTitle": "Remove from cart",
111
- "workflows.checkoutDemo.cart.selectHint": "Select products from the dropdown to add them to your cart",
112
- "workflows.checkoutDemo.cart.shipping": "Shipping",
113
- "workflows.checkoutDemo.cart.subtotal": "Subtotal",
114
- "workflows.checkoutDemo.cart.tax": "Tax (8%)",
115
- "workflows.checkoutDemo.cart.total": "Total",
116
- "workflows.checkoutDemo.cartValidation.available": "✓ Available",
117
- "workflows.checkoutDemo.cartValidation.inventoryCheck": "Checking cart items and inventory availability...",
118
- "workflows.checkoutDemo.cartValidation.processingActivities": "Processing background activities...",
119
- "workflows.checkoutDemo.cartValidation.processingActivitiesHint": "The workflow is waiting for async tasks to complete before proceeding.",
120
- "workflows.checkoutDemo.cartValidation.qtyPrefix": "Qty:",
121
- "workflows.checkoutDemo.cartValidation.title": "Validating Cart",
122
- "workflows.checkoutDemo.cartValidation.totalPrefix": "Total:",
123
- "workflows.checkoutDemo.checkout.fixValidationErrors": "Fix Validation Errors",
124
- "workflows.checkoutDemo.checkout.pleaseSelectCustomer": "Please select a customer to continue",
125
- "workflows.checkoutDemo.checkout.selectCustomerFirst": "Select Customer to Continue",
126
- "workflows.checkoutDemo.checkout.start": "Start Checkout Workflow",
127
- "workflows.checkoutDemo.checkout.starting": "Starting...",
128
- "workflows.checkoutDemo.checkout.validating": "Validating...",
129
- "workflows.checkoutDemo.checkout.workflowStarted": "Workflow Started",
130
- "workflows.checkoutDemo.completed.emailSent": "✉️ A confirmation email has been sent to demo@example.com",
131
- "workflows.checkoutDemo.completed.orderDateLabel": "Order Date:",
132
- "workflows.checkoutDemo.completed.orderItemsLabel": "Order Items:",
133
- "workflows.checkoutDemo.completed.orderNumberPrefix": "Order #",
134
- "workflows.checkoutDemo.completed.paymentMethodLabel": "Payment Method:",
135
- "workflows.checkoutDemo.completed.paymentMethodValue": "Credit Card ****4242",
136
- "workflows.checkoutDemo.completed.startNew": "Start New Order",
137
- "workflows.checkoutDemo.completed.title": "Order Confirmed!",
138
- "workflows.checkoutDemo.completed.totalPaidLabel": "Total Paid:",
108
+ "workflows.checkoutDemo.cart.increaseQty": "Zwiększ ilość",
109
+ "workflows.checkoutDemo.cart.pricePerUnitSuffix": "za szt.",
110
+ "workflows.checkoutDemo.cart.removeItemTitle": "Usuń z koszyka",
111
+ "workflows.checkoutDemo.cart.selectHint": "Wybierz produkty z listy, aby dodać je do koszyka",
112
+ "workflows.checkoutDemo.cart.shipping": "Dostawa",
113
+ "workflows.checkoutDemo.cart.subtotal": "Suma częściowa",
114
+ "workflows.checkoutDemo.cart.tax": "Podatek (8%)",
115
+ "workflows.checkoutDemo.cart.total": "Razem",
116
+ "workflows.checkoutDemo.cartValidation.available": "✓ Dostępny",
117
+ "workflows.checkoutDemo.cartValidation.inventoryCheck": "Sprawdzanie pozycji koszyka i dostępności w magazynie...",
118
+ "workflows.checkoutDemo.cartValidation.processingActivities": "Przetwarzanie działań w tle...",
119
+ "workflows.checkoutDemo.cartValidation.processingActivitiesHint": "Workflow czeka na zakończenie zadań asynchronicznych, zanim przejdzie dalej.",
120
+ "workflows.checkoutDemo.cartValidation.qtyPrefix": "Ilość:",
121
+ "workflows.checkoutDemo.cartValidation.title": "Walidacja koszyka",
122
+ "workflows.checkoutDemo.cartValidation.totalPrefix": "Razem:",
123
+ "workflows.checkoutDemo.checkout.fixValidationErrors": "Popraw błędy walidacji",
124
+ "workflows.checkoutDemo.checkout.pleaseSelectCustomer": "Wybierz klienta, aby kontynuować",
125
+ "workflows.checkoutDemo.checkout.selectCustomerFirst": "Wybierz klienta, aby kontynuować",
126
+ "workflows.checkoutDemo.checkout.start": "Uruchom workflow zakupu",
127
+ "workflows.checkoutDemo.checkout.starting": "Uruchamianie...",
128
+ "workflows.checkoutDemo.checkout.validating": "Walidacja...",
129
+ "workflows.checkoutDemo.checkout.workflowStarted": "Workflow uruchomiony",
130
+ "workflows.checkoutDemo.completed.emailSent": "✉️ E-mail z potwierdzeniem został wysłany na demo@example.com",
131
+ "workflows.checkoutDemo.completed.orderDateLabel": "Data zamówienia:",
132
+ "workflows.checkoutDemo.completed.orderItemsLabel": "Pozycje zamówienia:",
133
+ "workflows.checkoutDemo.completed.orderNumberPrefix": "Zamówienie nr ",
134
+ "workflows.checkoutDemo.completed.paymentMethodLabel": "Metoda płatności:",
135
+ "workflows.checkoutDemo.completed.paymentMethodValue": "Karta kredytowa ****4242",
136
+ "workflows.checkoutDemo.completed.startNew": "Rozpocznij nowe zamówienie",
137
+ "workflows.checkoutDemo.completed.title": "Zamówienie potwierdzone!",
138
+ "workflows.checkoutDemo.completed.totalPaidLabel": "Zapłacono łącznie:",
139
139
  "workflows.checkoutDemo.currency.label": "Waluta",
140
140
  "workflows.checkoutDemo.customer.loading": "Ładowanie klientów...",
141
141
  "workflows.checkoutDemo.customer.noneFound": "Nie znaleziono klientów. Najpierw utwórz klienta.",
142
142
  "workflows.checkoutDemo.customer.selectLabel": "Wybierz klienta",
143
143
  "workflows.checkoutDemo.customer.selectPlaceholder": "-- Wybierz klienta --",
144
- "workflows.checkoutDemo.customerInfo.errorLoadingTask": "Error loading task",
145
- "workflows.checkoutDemo.customerInfo.loading": "Loading task...",
146
- "workflows.checkoutDemo.customerInfo.noTaskHint": "The user task may still be creating. This usually takes less than a second.",
147
- "workflows.checkoutDemo.customerInfo.noTaskTitle": "No task found",
148
- "workflows.checkoutDemo.customerInfo.promptHint": "The workflow is paused waiting for customer details. Complete the form to continue checkout.",
149
- "workflows.checkoutDemo.customerInfo.promptTitle": "Please provide your shipping information",
150
- "workflows.checkoutDemo.customerInfo.refresh": "Refresh",
151
- "workflows.checkoutDemo.customerInfo.retry": "Retry",
152
- "workflows.checkoutDemo.customerInfo.submit": "Complete & Continue Checkout",
153
- "workflows.checkoutDemo.customerInfo.submitting": "Submitting...",
154
- "workflows.checkoutDemo.customerInfo.title": "Customer Information Required",
155
- "workflows.checkoutDemo.customerInfo.unknownError": "Unknown error",
156
- "workflows.checkoutDemo.events.detailsLink": "Details",
157
- "workflows.checkoutDemo.events.liveBadge": "Live",
158
- "workflows.checkoutDemo.events.title": "Workflow Events",
159
- "workflows.checkoutDemo.events.viewAllLink": "View all events →",
160
- "workflows.checkoutDemo.events.viewAllPrefix": "View all",
161
- "workflows.checkoutDemo.events.viewAllSuffix": "events →",
162
- "workflows.checkoutDemo.events.viewData": "View event data",
163
- "workflows.checkoutDemo.failed.message": "Unfortunately, your order could not be processed. Please try again.",
164
- "workflows.checkoutDemo.failed.title": "Order Failed",
165
- "workflows.checkoutDemo.failed.tryAgain": "Try Again",
166
- "workflows.checkoutDemo.features.businessRulesIntegration.body": " Guard rules validate transitions with detailed failure information",
167
- "workflows.checkoutDemo.features.businessRulesIntegration.label": "Business Rules Integration:",
168
- "workflows.checkoutDemo.features.completeOrderFlow.body": " Experience the full checkout journey from cart to confirmation with async payment processing",
169
- "workflows.checkoutDemo.features.completeOrderFlow.label": "Complete Order Flow:",
170
- "workflows.checkoutDemo.features.interactiveUi.body": " Left panel dynamically updates to show cart validation, payment initiation, webhook waiting, and order confirmation screens",
171
- "workflows.checkoutDemo.features.interactiveUi.label": "Interactive UI Changes:",
172
- "workflows.checkoutDemo.features.liveEventTimeline.body": " New workflow events appear in real-time including SIGNAL_AWAITING and SIGNAL_RECEIVED",
173
- "workflows.checkoutDemo.features.liveEventTimeline.label": "Live Event Timeline:",
174
- "workflows.checkoutDemo.features.realtimeProgress.body": " Watch the workflow progress through steps automatically with live status updates",
175
- "workflows.checkoutDemo.features.realtimeProgress.label": "Real-time Progress Tracking:",
176
- "workflows.checkoutDemo.features.signalFlow.body": " Demonstrates real-world webhook pattern with WAIT_FOR_SIGNAL step type",
177
- "workflows.checkoutDemo.features.signalFlow.label": "Signal-Based Payment Flow:",
178
- "workflows.checkoutDemo.features.startPreconditions.body": " Validate business rules before workflow can start (e.g., cart not empty) with localized error messages",
179
- "workflows.checkoutDemo.features.startPreconditions.label": "START Step Pre-conditions:",
180
- "workflows.checkoutDemo.features.title": "Features",
181
- "workflows.checkoutDemo.features.userTaskIntegration.body": " Form-based user input with workflow pause/resume on task completion",
182
- "workflows.checkoutDemo.features.userTaskIntegration.label": "User Task Integration:",
183
- "workflows.checkoutDemo.features.viewAllWorkflowsLink": "View all workflows →",
184
- "workflows.checkoutDemo.features.webhookSimulation.body": " Test signal-based workflow resumption with simulated payment provider webhook",
185
- "workflows.checkoutDemo.features.webhookSimulation.label": "Webhook Simulation:",
186
- "workflows.checkoutDemo.formField.selectOption": "-- Select an option --",
187
- "workflows.checkoutDemo.orderConfirmation.creatingRecord": "Creating order record",
188
- "workflows.checkoutDemo.orderConfirmation.paymentSuccess": "Payment Successful!",
189
- "workflows.checkoutDemo.orderConfirmation.sendingEmail": "Sending confirmation email",
190
- "workflows.checkoutDemo.orderConfirmation.title": "Creating Order",
191
- "workflows.checkoutDemo.orderConfirmation.transactionIdPrefix": "Transaction ID: ",
192
- "workflows.checkoutDemo.orderConfirmation.updatingInventory": "Updating inventory",
144
+ "workflows.checkoutDemo.customerInfo.errorLoadingTask": "Błąd ładowania zadania",
145
+ "workflows.checkoutDemo.customerInfo.loading": "Ładowanie zadania...",
146
+ "workflows.checkoutDemo.customerInfo.noTaskHint": "Zadanie użytkownika może się jeszcze tworzyć. Zwykle trwa to poniżej sekundy.",
147
+ "workflows.checkoutDemo.customerInfo.noTaskTitle": "Nie znaleziono zadania",
148
+ "workflows.checkoutDemo.customerInfo.promptHint": "Workflow jest wstrzymany i czeka na dane klienta. Wypełnij formularz, aby kontynuować zakup.",
149
+ "workflows.checkoutDemo.customerInfo.promptTitle": "Podaj dane do wysyłki",
150
+ "workflows.checkoutDemo.customerInfo.refresh": "Odśwież",
151
+ "workflows.checkoutDemo.customerInfo.retry": "Ponów",
152
+ "workflows.checkoutDemo.customerInfo.submit": "Zapisz i kontynuuj zakup",
153
+ "workflows.checkoutDemo.customerInfo.submitting": "Wysyłanie...",
154
+ "workflows.checkoutDemo.customerInfo.title": "Wymagane dane klienta",
155
+ "workflows.checkoutDemo.customerInfo.unknownError": "Nieznany błąd",
156
+ "workflows.checkoutDemo.events.detailsLink": "Szczegóły",
157
+ "workflows.checkoutDemo.events.liveBadge": "Na żywo",
158
+ "workflows.checkoutDemo.events.title": "Zdarzenia workflow",
159
+ "workflows.checkoutDemo.events.viewAllLink": "Zobacz wszystkie zdarzenia →",
160
+ "workflows.checkoutDemo.events.viewAllPrefix": "Zobacz wszystkie",
161
+ "workflows.checkoutDemo.events.viewAllSuffix": "zdarzenia →",
162
+ "workflows.checkoutDemo.events.viewData": "Zobacz dane zdarzenia",
163
+ "workflows.checkoutDemo.failed.message": "Niestety nie udało się przetworzyć zamówienia. Spróbuj ponownie.",
164
+ "workflows.checkoutDemo.failed.title": "Zamówienie nieudane",
165
+ "workflows.checkoutDemo.failed.tryAgain": "Spróbuj ponownie",
166
+ "workflows.checkoutDemo.features.businessRulesIntegration.body": " Reguły strażnicze walidują przejścia, zwracając szczegółowe informacje o niepowodzeniu",
167
+ "workflows.checkoutDemo.features.businessRulesIntegration.label": "Integracja z regułami biznesowymi:",
168
+ "workflows.checkoutDemo.features.completeOrderFlow.body": " Przejdź pełną ścieżkę zakupu od koszyka po potwierdzenie, z asynchroniczną obsługą płatności",
169
+ "workflows.checkoutDemo.features.completeOrderFlow.label": "Pełna ścieżka zamówienia:",
170
+ "workflows.checkoutDemo.features.interactiveUi.body": " Lewy panel dynamicznie pokazuje kolejne ekrany: walidację koszyka, inicjowanie płatności, oczekiwanie na webhook i potwierdzenie zamówienia",
171
+ "workflows.checkoutDemo.features.interactiveUi.label": "Interaktywne zmiany interfejsu:",
172
+ "workflows.checkoutDemo.features.liveEventTimeline.body": " Nowe zdarzenia workflow pojawiają się na bieżąco, w tym SIGNAL_AWAITING i SIGNAL_RECEIVED",
173
+ "workflows.checkoutDemo.features.liveEventTimeline.label": " zdarzeń na żywo:",
174
+ "workflows.checkoutDemo.features.realtimeProgress.body": " Obserwuj, jak workflow automatycznie przechodzi przez kolejne kroki, ze statusem aktualizowanym na bieżąco",
175
+ "workflows.checkoutDemo.features.realtimeProgress.label": "Śledzenie postępu w czasie rzeczywistym:",
176
+ "workflows.checkoutDemo.features.signalFlow.body": " Pokazuje realny wzorzec webhooka z krokiem typu WAIT_FOR_SIGNAL",
177
+ "workflows.checkoutDemo.features.signalFlow.label": "Płatność oparta na sygnale:",
178
+ "workflows.checkoutDemo.features.startPreconditions.body": " Walidacja reguł biznesowych przed uruchomieniem workflow (np. koszyk nie może być pusty) z komunikatami błędów w języku użytkownika",
179
+ "workflows.checkoutDemo.features.startPreconditions.label": "Warunki wstępne kroku START:",
180
+ "workflows.checkoutDemo.features.title": "Funkcje",
181
+ "workflows.checkoutDemo.features.userTaskIntegration.body": " Dane wprowadzane przez użytkownika w formularzu, z wstrzymaniem i wznowieniem workflow po wykonaniu zadania",
182
+ "workflows.checkoutDemo.features.userTaskIntegration.label": "Integracja z zadaniami użytkownika:",
183
+ "workflows.checkoutDemo.features.viewAllWorkflowsLink": "Zobacz wszystkie workflowy →",
184
+ "workflows.checkoutDemo.features.webhookSimulation.body": " Przetestuj wznowienie workflow sygnałem, symulując webhook od dostawcy płatności",
185
+ "workflows.checkoutDemo.features.webhookSimulation.label": "Symulacja webhooka:",
186
+ "workflows.checkoutDemo.formField.selectOption": "-- Wybierz opcję --",
187
+ "workflows.checkoutDemo.orderConfirmation.creatingRecord": "Tworzenie rekordu zamówienia",
188
+ "workflows.checkoutDemo.orderConfirmation.paymentSuccess": "Płatność zrealizowana!",
189
+ "workflows.checkoutDemo.orderConfirmation.sendingEmail": "Wysyłanie e-maila z potwierdzeniem",
190
+ "workflows.checkoutDemo.orderConfirmation.title": "Tworzenie zamówienia",
191
+ "workflows.checkoutDemo.orderConfirmation.transactionIdPrefix": "ID transakcji: ",
192
+ "workflows.checkoutDemo.orderConfirmation.updatingInventory": "Aktualizacja stanów magazynowych",
193
193
  "workflows.checkoutDemo.orderSummary.title": "Podsumowanie zamówienia",
194
- "workflows.checkoutDemo.paymentInitiation.amountLabel": "Amount:",
195
- "workflows.checkoutDemo.paymentInitiation.detailsTitle": "Payment Details",
196
- "workflows.checkoutDemo.paymentInitiation.methodLabel": "Method:",
197
- "workflows.checkoutDemo.paymentInitiation.methodValue": "Credit Card ****4242",
198
- "workflows.checkoutDemo.paymentInitiation.sending": "Sending payment request...",
199
- "workflows.checkoutDemo.paymentInitiation.title": "Initiating Payment",
194
+ "workflows.checkoutDemo.paymentInitiation.amountLabel": "Kwota:",
195
+ "workflows.checkoutDemo.paymentInitiation.detailsTitle": "Szczegóły płatności",
196
+ "workflows.checkoutDemo.paymentInitiation.methodLabel": "Metoda:",
197
+ "workflows.checkoutDemo.paymentInitiation.methodValue": "Karta kredytowa ****4242",
198
+ "workflows.checkoutDemo.paymentInitiation.sending": "Wysyłanie żądania płatności...",
199
+ "workflows.checkoutDemo.paymentInitiation.title": "Inicjowanie płatności",
200
200
  "workflows.checkoutDemo.product.addLabel": "Dodaj produkty do koszyka",
201
201
  "workflows.checkoutDemo.product.loading": "Ładowanie produktów...",
202
202
  "workflows.checkoutDemo.product.noneFound": "Nie znaleziono produktów. Najpierw utwórz produkty w katalogu.",
203
203
  "workflows.checkoutDemo.product.selectPlaceholder": "-- Wybierz produkt do dodania --",
204
- "workflows.checkoutDemo.progress.advance": "Advance to Next Step →",
205
- "workflows.checkoutDemo.progress.advancing": "Advancing...",
206
- "workflows.checkoutDemo.progress.completeTask": "Complete Task →",
207
- "workflows.checkoutDemo.progress.duePrefix": "Due: ",
208
- "workflows.checkoutDemo.progress.errorDismiss": "Dismiss",
209
- "workflows.checkoutDemo.progress.errorTitle": "Error",
210
- "workflows.checkoutDemo.progress.manualProgression": "Manual Progression",
211
- "workflows.checkoutDemo.progress.manualProgressionHint": "Manually advance to the next step for testing",
212
- "workflows.checkoutDemo.progress.processing": "Processing...",
213
- "workflows.checkoutDemo.progress.prompt": "Click \"Start Checkout Workflow\" to begin",
214
- "workflows.checkoutDemo.progress.startNewCheckout": "Start New Checkout",
215
- "workflows.checkoutDemo.progress.startingWorkflow": "Starting workflow...",
204
+ "workflows.checkoutDemo.progress.advance": "Przejdź do następnego kroku →",
205
+ "workflows.checkoutDemo.progress.advancing": "Przechodzenie...",
206
+ "workflows.checkoutDemo.progress.completeTask": "Wykonaj zadanie →",
207
+ "workflows.checkoutDemo.progress.duePrefix": "Termin: ",
208
+ "workflows.checkoutDemo.progress.errorDismiss": "Zamknij",
209
+ "workflows.checkoutDemo.progress.errorTitle": "Błąd",
210
+ "workflows.checkoutDemo.progress.manualProgression": "Ręczne przejście",
211
+ "workflows.checkoutDemo.progress.manualProgressionHint": "Przejdź ręcznie do następnego kroku na potrzeby testów",
212
+ "workflows.checkoutDemo.progress.processing": "Przetwarzanie...",
213
+ "workflows.checkoutDemo.progress.prompt": "Kliknij „Uruchom workflow zakupu”, aby rozpocząć",
214
+ "workflows.checkoutDemo.progress.startNewCheckout": "Rozpocznij nowy zakup",
215
+ "workflows.checkoutDemo.progress.startingWorkflow": "Uruchamianie workflow...",
216
216
  "workflows.checkoutDemo.progress.statusLabel": "Status",
217
- "workflows.checkoutDemo.progress.stepsLabel": "Steps",
218
- "workflows.checkoutDemo.progress.title": "Workflow Progress",
219
- "workflows.checkoutDemo.progress.userActionHint": "This workflow is paused waiting for user input. Please complete the task below to continue.",
220
- "workflows.checkoutDemo.progress.userActionTitle": "User Action Required",
221
- "workflows.checkoutDemo.progress.viewInAdmin": "View in Admin",
222
- "workflows.checkoutDemo.progress.waitingForInput": "Waiting for input",
223
- "workflows.checkoutDemo.progress.workflowCompleted": "Workflow Completed!",
224
- "workflows.checkoutDemo.progress.workflowCompletedHint": "All steps executed successfully",
217
+ "workflows.checkoutDemo.progress.stepsLabel": "Kroki",
218
+ "workflows.checkoutDemo.progress.title": "Postęp workflow",
219
+ "workflows.checkoutDemo.progress.userActionHint": "Ten workflow jest wstrzymany i czeka na dane od użytkownika. Wykonaj poniższe zadanie, aby kontynuować.",
220
+ "workflows.checkoutDemo.progress.userActionTitle": "Wymagane działanie użytkownika",
221
+ "workflows.checkoutDemo.progress.viewInAdmin": "Zobacz w panelu",
222
+ "workflows.checkoutDemo.progress.waitingForInput": "Oczekiwanie na dane",
223
+ "workflows.checkoutDemo.progress.workflowCompleted": "Workflow zakończony!",
224
+ "workflows.checkoutDemo.progress.workflowCompletedHint": "Wszystkie kroki wykonane pomyślnie",
225
225
  "workflows.checkoutDemo.subtitle": "Interaktywna demonstracja workflow z sygnałowym potwierdzeniem płatności (WAIT_FOR_SIGNAL)",
226
226
  "workflows.checkoutDemo.title": "Demo zamówienia z webhookami płatności",
227
- "workflows.checkoutDemo.validation.errorTitle": "Cannot start checkout",
228
- "workflows.checkoutDemo.waitPayment.demoTestingHint": "Click the button below to simulate a payment provider webhook confirming the transaction.",
229
- "workflows.checkoutDemo.waitPayment.demoTestingTitle": "For Demo Testing:",
230
- "workflows.checkoutDemo.waitPayment.description": "The workflow is paused waiting for the payment provider to confirm the transaction via webhook. In production, this would be sent automatically by Stripe, PayPal, etc.",
231
- "workflows.checkoutDemo.waitPayment.dismiss": "Dismiss",
232
- "workflows.checkoutDemo.waitPayment.heading": "Awaiting Payment Provider Webhook",
233
- "workflows.checkoutDemo.waitPayment.noteLabel": "Note:",
234
- "workflows.checkoutDemo.waitPayment.noteStatusPrefix": "Workflow status is ",
235
- "workflows.checkoutDemo.waitPayment.noteStatusSuffix": ". The signal button will appear when the workflow is fully paused at this step.",
236
- "workflows.checkoutDemo.waitPayment.realWorldLabel": "Real-world scenario:",
237
- "workflows.checkoutDemo.waitPayment.realWorldPart1": "Your payment provider (Stripe, PayPal) would send a webhook to your server endpoint (e.g., ",
238
- "workflows.checkoutDemo.waitPayment.realWorldPart2": "), which would then call ",
239
- "workflows.checkoutDemo.waitPayment.realWorldPart3": " to resume the workflow.",
240
- "workflows.checkoutDemo.waitPayment.sendingSignal": "Sending Signal...",
241
- "workflows.checkoutDemo.waitPayment.sendsPrefix": "This sends a ",
242
- "workflows.checkoutDemo.waitPayment.sendsSuffix": " event",
243
- "workflows.checkoutDemo.waitPayment.signalErrorTitle": "Signal Error",
244
- "workflows.checkoutDemo.waitPayment.signalNameLabel": "Signal Name:",
245
- "workflows.checkoutDemo.waitPayment.simulateWebhook": "🔔 Simulate Payment Webhook",
227
+ "workflows.checkoutDemo.validation.errorTitle": "Nie można rozpocząć zakupu",
228
+ "workflows.checkoutDemo.waitPayment.demoTestingHint": "Kliknij przycisk poniżej, aby zasymulować webhook od dostawcy płatności potwierdzający transakcję.",
229
+ "workflows.checkoutDemo.waitPayment.demoTestingTitle": "Na potrzeby testów demo:",
230
+ "workflows.checkoutDemo.waitPayment.description": "Workflow jest wstrzymany i czeka, dostawca płatności potwierdzi transakcję webhookiem. W środowisku produkcyjnym wysłałby go automatycznie Stripe, PayPal itp.",
231
+ "workflows.checkoutDemo.waitPayment.dismiss": "Zamknij",
232
+ "workflows.checkoutDemo.waitPayment.heading": "Oczekiwanie na webhook dostawcy płatności",
233
+ "workflows.checkoutDemo.waitPayment.noteLabel": "Uwaga:",
234
+ "workflows.checkoutDemo.waitPayment.noteStatusPrefix": "Status workflow to ",
235
+ "workflows.checkoutDemo.waitPayment.noteStatusSuffix": ". Przycisk sygnału pojawi się, gdy workflow zostanie w pełni wstrzymany na tym kroku.",
236
+ "workflows.checkoutDemo.waitPayment.realWorldLabel": "Scenariusz produkcyjny:",
237
+ "workflows.checkoutDemo.waitPayment.realWorldPart1": "Twój dostawca płatności (Stripe, PayPal) wysłałby webhook na endpoint Twojego serwera (np. ",
238
+ "workflows.checkoutDemo.waitPayment.realWorldPart2": "), który następnie wywołałby ",
239
+ "workflows.checkoutDemo.waitPayment.realWorldPart3": ", aby wznowić workflow.",
240
+ "workflows.checkoutDemo.waitPayment.sendingSignal": "Wysyłanie sygnału...",
241
+ "workflows.checkoutDemo.waitPayment.sendsPrefix": "Spowoduje to wysłanie zdarzenia ",
242
+ "workflows.checkoutDemo.waitPayment.sendsSuffix": ".",
243
+ "workflows.checkoutDemo.waitPayment.signalErrorTitle": "Błąd sygnału",
244
+ "workflows.checkoutDemo.waitPayment.signalNameLabel": "Nazwa sygnału:",
245
+ "workflows.checkoutDemo.waitPayment.simulateWebhook": "🔔 Symuluj webhook płatności",
246
246
  "workflows.checkoutDemo.waitPayment.statusLabel": "Status:",
247
- "workflows.checkoutDemo.waitPayment.timeout": "Timeout: 5 minutes",
248
- "workflows.checkoutDemo.waitPayment.title": "Waiting for Payment Confirmation",
247
+ "workflows.checkoutDemo.waitPayment.timeout": "Limit czasu: 5 minut",
248
+ "workflows.checkoutDemo.waitPayment.title": "Oczekiwanie na potwierdzenie płatności",
249
249
  "workflows.common.back": "Wstecz",
250
250
  "workflows.common.browse": "Przeglądaj",
251
251
  "workflows.common.cancel": "Anuluj",
@@ -22,6 +22,8 @@ import {
22
22
  type WorkflowDefinitionTrigger,
23
23
  } from '../data/entities'
24
24
  import { startWorkflow, executeWorkflow } from './workflow-executor'
25
+ import { getAllCodeWorkflows } from './code-registry'
26
+ import { codeWorkflowUuid } from './find-definition'
25
27
  import { createLogger } from '@open-mercato/shared/lib/logger'
26
28
 
27
29
  const logger = createLogger('workflows').child({ component: 'event-trigger' })
@@ -59,7 +61,7 @@ export interface UnifiedTrigger {
59
61
  workflowDefinitionId: string
60
62
  workflowId: string
61
63
  workflowVersion: number
62
- source: 'legacy' | 'embedded'
64
+ source: 'legacy' | 'embedded' | 'code'
63
65
  tenantId: string
64
66
  organizationId: string
65
67
  }
@@ -413,21 +415,26 @@ async function loadLegacyTriggers(
413
415
  /**
414
416
  * Load embedded triggers from workflow definitions.
415
417
  * New triggers are embedded directly in the definition JSONB.
418
+ *
419
+ * Also returns the set of every non-deleted DB definition's `workflowId` — even
420
+ * those with no triggers — so the caller can let a materialized (customized)
421
+ * definition suppress its code-registry counterpart regardless of whether the
422
+ * customization kept any triggers (#4425).
416
423
  */
417
424
  async function loadEmbeddedTriggers(
418
425
  em: EntityManager,
419
426
  tenantId: string,
420
427
  organizationId: string
421
- ): Promise<UnifiedTrigger[]> {
428
+ ): Promise<{ triggers: UnifiedTrigger[]; workflowIds: Set<string> }> {
422
429
  const postgresEm = em as unknown as PostgreSqlEntityManager
423
- // Load all enabled definitions that may have triggers
430
+ // Load all definitions so disabled customizations still shadow their code
431
+ // counterpart. Only enabled definitions contribute embedded triggers below.
424
432
  const definitions = await findWithDecryption(
425
433
  postgresEm,
426
434
  WorkflowDefinition,
427
435
  {
428
436
  tenantId,
429
437
  organizationId,
430
- enabled: true,
431
438
  deletedAt: null,
432
439
  },
433
440
  {},
@@ -435,8 +442,12 @@ async function loadEmbeddedTriggers(
435
442
  )
436
443
 
437
444
  const triggers: UnifiedTrigger[] = []
445
+ const workflowIds = new Set<string>()
438
446
 
439
447
  for (const def of definitions) {
448
+ workflowIds.add(def.workflowId)
449
+ if (!def.enabled) continue
450
+
440
451
  const embeddedTriggers = def.definition?.triggers as WorkflowDefinitionTrigger[] | undefined
441
452
  if (!embeddedTriggers || embeddedTriggers.length === 0) continue
442
453
 
@@ -462,12 +473,70 @@ async function loadEmbeddedTriggers(
462
473
  }
463
474
  }
464
475
 
476
+ return { triggers, workflowIds }
477
+ }
478
+
479
+ /**
480
+ * Project triggers declared on code-defined workflows into UnifiedTriggers.
481
+ *
482
+ * Code workflows live only in the in-memory registry, so their `triggers`
483
+ * arrays never reached the DB-backed loaders — a code-declared trigger was inert
484
+ * until an operator ran `POST …/code:<id>/customize` to materialize the
485
+ * definition into a `workflow_definitions` row (#4425). This projects them
486
+ * directly. It is synchronous (no DB) and scoped to the caller's tenant/org via
487
+ * the deterministic virtual definition id, matching what `startWorkflow`
488
+ * persists as the instance's `definitionId` so the concurrency limit counts
489
+ * correctly.
490
+ *
491
+ * `dbBackedWorkflowIds` are workflowIds already contributed by the legacy or
492
+ * embedded (DB) sources; a code workflow whose id appears there is skipped so a
493
+ * customized DB override wins and its trigger is not double-registered.
494
+ */
495
+ export function loadCodeTriggers(
496
+ tenantId: string,
497
+ organizationId: string,
498
+ dbBackedWorkflowIds: Set<string>,
499
+ ): UnifiedTrigger[] {
500
+ const triggers: UnifiedTrigger[] = []
501
+
502
+ for (const codeDef of getAllCodeWorkflows()) {
503
+ if (!codeDef.enabled) continue
504
+ if (dbBackedWorkflowIds.has(codeDef.workflowId)) continue
505
+
506
+ const embeddedTriggers = codeDef.definition?.triggers
507
+ if (!embeddedTriggers || embeddedTriggers.length === 0) continue
508
+
509
+ const definitionId = codeWorkflowUuid(codeDef.workflowId)
510
+ for (const trigger of embeddedTriggers) {
511
+ if (!trigger.enabled) continue
512
+
513
+ triggers.push({
514
+ id: `code:${codeDef.workflowId}:${trigger.triggerId}`,
515
+ triggerId: trigger.triggerId,
516
+ name: trigger.name,
517
+ description: trigger.description ?? null,
518
+ eventPattern: trigger.eventPattern,
519
+ config: (trigger.config ?? null) as WorkflowEventTriggerConfig | null,
520
+ enabled: trigger.enabled,
521
+ priority: trigger.priority,
522
+ workflowDefinitionId: definitionId,
523
+ workflowId: codeDef.workflowId,
524
+ workflowVersion: codeDef.version,
525
+ source: 'code' as const,
526
+ tenantId,
527
+ organizationId,
528
+ })
529
+ }
530
+ }
531
+
465
532
  return triggers
466
533
  }
467
534
 
468
535
  /**
469
536
  * Load all enabled triggers for a tenant/organization with caching.
470
- * Merges both legacy (entity) triggers and embedded (definition) triggers.
537
+ * Merges legacy (entity), embedded (definition), and code-registry triggers;
538
+ * a DB-backed source for a given workflowId takes precedence over its code
539
+ * trigger so `customize` semantics are preserved.
471
540
  */
472
541
  export async function loadTriggersForTenant(
473
542
  em: EntityManager,
@@ -484,14 +553,24 @@ export async function loadTriggersForTenant(
484
553
  return cached.triggers
485
554
  }
486
555
 
487
- // Load from both sources
488
- const [legacyTriggers, embeddedTriggers] = await Promise.all([
556
+ // Load from both DB sources
557
+ const [legacyTriggers, embedded] = await Promise.all([
489
558
  loadLegacyTriggers(em, tenantId, organizationId),
490
559
  loadEmbeddedTriggers(em, tenantId, organizationId),
491
560
  ])
561
+ const embeddedTriggers = embedded.triggers
562
+
563
+ // Project code-registry triggers, letting any DB-backed definition for the
564
+ // same workflowId win (preserves `customize` override semantics — including
565
+ // a customization that removed its triggers).
566
+ const dbBackedWorkflowIds = new Set<string>([
567
+ ...embedded.workflowIds,
568
+ ...legacyTriggers.map((t) => t.workflowId),
569
+ ])
570
+ const codeTriggers = loadCodeTriggers(tenantId, organizationId, dbBackedWorkflowIds)
492
571
 
493
572
  // Merge and sort by priority (higher first)
494
- const allTriggers = [...legacyTriggers, ...embeddedTriggers]
573
+ const allTriggers = [...legacyTriggers, ...embeddedTriggers, ...codeTriggers]
495
574
  .sort((a, b) => b.priority - a.priority)
496
575
 
497
576
  // Update cache