@vicacha-devs/medusa-plugin-notifications 0.0.0-stage → 0.1.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.
- package/.medusa/server/src/admin/index.cjs +4215 -0
- package/.medusa/server/src/admin/index.js +4193 -0
- package/.medusa/server/src/api/admin/mpn/broadcasts/route.js +99 -0
- package/.medusa/server/src/api/admin/mpn/channels/route.js +109 -0
- package/.medusa/server/src/api/admin/mpn/logs/route.js +33 -0
- package/.medusa/server/src/api/admin/mpn/mappings/[id]/route.js +33 -0
- package/.medusa/server/src/api/admin/mpn/mappings/route.js +51 -0
- package/.medusa/server/src/api/admin/mpn/render-template/route.js +37 -0
- package/.medusa/server/src/api/admin/mpn/sandbox/route.js +36 -0
- package/.medusa/server/src/api/admin/mpn/send/route.js +135 -0
- package/.medusa/server/src/api/admin/mpn/templates/[id]/route.js +77 -0
- package/.medusa/server/src/api/admin/mpn/templates/route.js +71 -0
- package/.medusa/server/src/api/admin/plugin/route.js +4 -0
- package/.medusa/server/src/api/middlewares.js +28 -0
- package/.medusa/server/src/api/store/mpn/consent/route.js +37 -0
- package/.medusa/server/src/api/store/mpn/webhooks/[provider]/route.js +97 -0
- package/.medusa/server/src/api/store/plugin/route.js +4 -0
- package/.medusa/server/src/api/validators.js +118 -0
- package/.medusa/server/src/hooks/index.js +7 -0
- package/.medusa/server/src/hooks/use-mpn-channels.js +13 -0
- package/.medusa/server/src/hooks/use-mpn-dispatch.js +45 -0
- package/.medusa/server/src/hooks/use-mpn-mappings.js +21 -0
- package/.medusa/server/src/hooks/use-mpn-templates.js +34 -0
- package/.medusa/server/src/hooks/use-order-notifications-widget-state.js +79 -0
- package/.medusa/server/src/hooks/use-sdk-primitives.js +113 -0
- package/.medusa/server/src/index.js +14 -0
- package/.medusa/server/src/integrations/automations-action-handler.js +112 -0
- package/.medusa/server/src/jobs/abandoned-cart-recovery.js +123 -0
- package/.medusa/server/src/jobs/log-retention-and-broadcasts.js +15 -0
- package/.medusa/server/src/modules/notifications/i18n/index.js +65 -0
- package/.medusa/server/src/modules/notifications/i18n/locales/ar.js +76 -0
- package/.medusa/server/src/modules/notifications/i18n/locales/de.js +76 -0
- package/.medusa/server/src/modules/notifications/i18n/locales/en.js +76 -0
- package/.medusa/server/src/modules/notifications/i18n/locales/es.js +76 -0
- package/.medusa/server/src/modules/notifications/i18n/locales/fr.js +76 -0
- package/.medusa/server/src/modules/notifications/i18n/locales/it.js +76 -0
- package/.medusa/server/src/modules/notifications/i18n/locales/nl.js +76 -0
- package/.medusa/server/src/modules/notifications/i18n/locales/pl.js +76 -0
- package/.medusa/server/src/modules/notifications/i18n/locales/pt.js +76 -0
- package/.medusa/server/src/modules/notifications/i18n/locales/tr.js +76 -0
- package/.medusa/server/src/modules/notifications/i18n/types.js +2 -0
- package/.medusa/server/src/modules/notifications/index.js +9 -0
- package/.medusa/server/src/modules/notifications/integrations/documents-and-b2b-resolver.js +129 -0
- package/.medusa/server/src/modules/notifications/migrations/Migration20261010000000.js +184 -0
- package/.medusa/server/src/modules/notifications/models/index.js +118 -0
- package/.medusa/server/src/modules/notifications/renderer/block-helpers.js +36 -0
- package/.medusa/server/src/modules/notifications/renderer/email.js +161 -0
- package/.medusa/server/src/modules/notifications/renderer/index.js +240 -0
- package/.medusa/server/src/modules/notifications/renderer/slack.js +114 -0
- package/.medusa/server/src/modules/notifications/renderer/telegram.js +99 -0
- package/.medusa/server/src/modules/notifications/renderer/whatsapp.js +91 -0
- package/.medusa/server/src/modules/notifications/service-helpers/channel-config.js +45 -0
- package/.medusa/server/src/modules/notifications/service-helpers/consent.js +65 -0
- package/.medusa/server/src/modules/notifications/service-helpers/delivery-log.js +29 -0
- package/.medusa/server/src/modules/notifications/service-helpers/event-conditions.js +46 -0
- package/.medusa/server/src/modules/notifications/service-helpers/external-templates.js +80 -0
- package/.medusa/server/src/modules/notifications/service-helpers/recipient-resolution.js +85 -0
- package/.medusa/server/src/modules/notifications/service-helpers/sender-profiles.js +29 -0
- package/.medusa/server/src/modules/notifications/service-helpers/template-blocks.js +81 -0
- package/.medusa/server/src/modules/notifications/service-helpers/template-catalog.js +129 -0
- package/.medusa/server/src/modules/notifications/service-helpers/template-render.js +65 -0
- package/.medusa/server/src/modules/notifications/service.js +339 -0
- package/.medusa/server/src/modules/notifications/types.js +2 -0
- package/.medusa/server/src/modules/notifications/utils/auth-presets.js +140 -0
- package/.medusa/server/src/modules/notifications/utils/interpolation.js +178 -0
- package/.medusa/server/src/modules/notifications/utils/security.js +312 -0
- package/.medusa/server/src/modules/notifications/utils/system-presets.js +651 -0
- package/.medusa/server/src/modules/notifications/utils/transformers.js +358 -0
- package/.medusa/server/src/providers/dummy-sandbox/index.js +96 -0
- package/.medusa/server/src/providers/email-smtp/index.js +187 -0
- package/.medusa/server/src/providers/index.js +7 -0
- package/.medusa/server/src/providers/slack/index.js +54 -0
- package/.medusa/server/src/providers/sms/index.js +254 -0
- package/.medusa/server/src/providers/telegram/index.js +119 -0
- package/.medusa/server/src/providers/whatsapp/index.js +371 -0
- package/.medusa/server/src/rbac.js +109 -0
- package/.medusa/server/src/sdk/client.js +186 -0
- package/.medusa/server/src/sdk/index.js +3 -0
- package/.medusa/server/src/sdk/query-keys.js +61 -0
- package/.medusa/server/src/subscribers/customer-and-document-events.js +33 -0
- package/.medusa/server/src/subscribers/fulfillment-and-inventory-events.js +30 -0
- package/.medusa/server/src/subscribers/order-events.js +28 -0
- package/.medusa/server/src/types/constants.js +129 -0
- package/.medusa/server/src/types/core.js +2 -0
- package/.medusa/server/src/types/domain.js +2 -0
- package/.medusa/server/src/types/enums.js +53 -0
- package/.medusa/server/src/types/errors.js +28 -0
- package/.medusa/server/src/types/hooks.js +2 -0
- package/.medusa/server/src/types/index.js +12 -0
- package/.medusa/server/src/types/providers.js +2 -0
- package/.medusa/server/src/types/records.js +2 -0
- package/.medusa/server/src/types/render.js +2 -0
- package/.medusa/server/src/types/sdk-api.js +2 -0
- package/.medusa/server/src/types/translations.js +2 -0
- package/.medusa/server/src/workflows/index.js +461 -0
- package/LICENSE +21 -0
- package/README.md +389 -2
- package/package.json +138 -3
- package/src/admin/README.md +123 -0
- package/src/admin/components/mpn/broadcast-consent-section.tsx +62 -0
- package/src/admin/components/mpn/broadcasts-tab.tsx +208 -0
- package/src/admin/components/mpn/channels-main-section.tsx +205 -0
- package/src/admin/components/mpn/channels-side-section.tsx +88 -0
- package/src/admin/components/mpn/channels-tab.tsx +130 -0
- package/src/admin/components/mpn/constants.ts +8 -0
- package/src/admin/components/mpn/delivery-logs-tab.tsx +70 -0
- package/src/admin/components/mpn/event-mapping-form.tsx +191 -0
- package/src/admin/components/mpn/event-mappings-tab.tsx +165 -0
- package/src/admin/components/mpn/header-bar.tsx +35 -0
- package/src/admin/components/mpn/index.ts +17 -0
- package/src/admin/components/mpn/overview-cards.tsx +103 -0
- package/src/admin/components/mpn/sandbox-tab.tsx +93 -0
- package/src/admin/components/mpn/template-editor-section.tsx +203 -0
- package/src/admin/components/mpn/template-preview-section.tsx +122 -0
- package/src/admin/components/mpn/templates-list-section.tsx +115 -0
- package/src/admin/components/mpn/templates-tab.tsx +188 -0
- package/src/admin/components/mpn/use-notification-studio.ts +84 -0
- package/src/admin/components/rbac-guard.tsx +153 -0
- package/src/admin/i18n/README.md +134 -0
- package/src/admin/i18n/index.ts +23 -0
- package/src/admin/i18n/json/ar.json +157 -0
- package/src/admin/i18n/json/de.json +157 -0
- package/src/admin/i18n/json/en.json +157 -0
- package/src/admin/i18n/json/es.json +157 -0
- package/src/admin/i18n/json/fr.json +157 -0
- package/src/admin/i18n/json/it.json +157 -0
- package/src/admin/i18n/json/nl.json +157 -0
- package/src/admin/i18n/json/pl.json +157 -0
- package/src/admin/i18n/json/pt.json +157 -0
- package/src/admin/i18n/json/tr.json +157 -0
- package/src/admin/routes/mpn/broadcasts/page.tsx +75 -0
- package/src/admin/routes/mpn/channels/page.tsx +66 -0
- package/src/admin/routes/mpn/logs/page.tsx +50 -0
- package/src/admin/routes/mpn/mappings/page.tsx +62 -0
- package/src/admin/routes/mpn/page.tsx +200 -0
- package/src/admin/routes/mpn/sandbox/page.tsx +53 -0
- package/src/admin/routes/mpn/templates/page.tsx +55 -0
- package/src/admin/tsconfig.json +23 -0
- package/src/admin/vite-env.d.ts +1 -0
- package/src/admin/widgets/order-notifications-widget.tsx +178 -0
- package/src/api/README.md +98 -0
- package/src/api/admin/mpn/broadcasts/route.ts +130 -0
- package/src/api/admin/mpn/channels/route.ts +143 -0
- package/src/api/admin/mpn/logs/route.ts +41 -0
- package/src/api/admin/mpn/mappings/[id]/route.ts +45 -0
- package/src/api/admin/mpn/mappings/route.ts +68 -0
- package/src/api/admin/mpn/render-template/route.ts +46 -0
- package/src/api/admin/mpn/sandbox/route.ts +51 -0
- package/src/api/admin/mpn/send/route.ts +163 -0
- package/src/api/admin/mpn/templates/[id]/route.ts +101 -0
- package/src/api/admin/mpn/templates/route.ts +99 -0
- package/src/api/admin/plugin/route.ts +5 -0
- package/src/api/middlewares.ts +42 -0
- package/src/api/store/mpn/consent/route.ts +45 -0
- package/src/api/store/mpn/webhooks/[provider]/route.ts +119 -0
- package/src/api/store/plugin/route.ts +5 -0
- package/src/api/validators.ts +149 -0
- package/src/hooks/index.ts +14 -0
- package/src/hooks/use-mpn-channels.ts +43 -0
- package/src/hooks/use-mpn-dispatch.ts +149 -0
- package/src/hooks/use-mpn-mappings.ts +75 -0
- package/src/hooks/use-mpn-templates.ts +120 -0
- package/src/hooks/use-order-notifications-widget-state.ts +103 -0
- package/src/hooks/use-sdk-primitives.ts +157 -0
- package/src/index.ts +16 -0
- package/src/integrations/automations-action-handler.ts +156 -0
- package/src/jobs/README.md +41 -0
- package/src/jobs/abandoned-cart-recovery.ts +152 -0
- package/src/jobs/log-retention-and-broadcasts.ts +23 -0
- package/src/links/README.md +52 -0
- package/src/modules/README.md +99 -0
- package/src/modules/notifications/i18n/index.ts +83 -0
- package/src/modules/notifications/i18n/locales/ar.ts +84 -0
- package/src/modules/notifications/i18n/locales/de.ts +83 -0
- package/src/modules/notifications/i18n/locales/en.ts +84 -0
- package/src/modules/notifications/i18n/locales/es.ts +84 -0
- package/src/modules/notifications/i18n/locales/fr.ts +82 -0
- package/src/modules/notifications/i18n/locales/it.ts +82 -0
- package/src/modules/notifications/i18n/locales/nl.ts +83 -0
- package/src/modules/notifications/i18n/locales/pl.ts +84 -0
- package/src/modules/notifications/i18n/locales/pt.ts +82 -0
- package/src/modules/notifications/i18n/locales/tr.ts +86 -0
- package/src/modules/notifications/i18n/types.ts +1 -0
- package/src/modules/notifications/index.ts +10 -0
- package/src/modules/notifications/integrations/documents-and-b2b-resolver.ts +168 -0
- package/src/modules/notifications/migrations/Migration20261010000000.ts +185 -0
- package/src/modules/notifications/models/index.ts +125 -0
- package/src/modules/notifications/renderer/block-helpers.ts +51 -0
- package/src/modules/notifications/renderer/email.ts +281 -0
- package/src/modules/notifications/renderer/index.ts +301 -0
- package/src/modules/notifications/renderer/slack.ts +168 -0
- package/src/modules/notifications/renderer/telegram.ts +161 -0
- package/src/modules/notifications/renderer/whatsapp.ts +156 -0
- package/src/modules/notifications/service-helpers/channel-config.ts +65 -0
- package/src/modules/notifications/service-helpers/consent.ts +88 -0
- package/src/modules/notifications/service-helpers/delivery-log.ts +56 -0
- package/src/modules/notifications/service-helpers/event-conditions.ts +66 -0
- package/src/modules/notifications/service-helpers/external-templates.ts +127 -0
- package/src/modules/notifications/service-helpers/recipient-resolution.ts +124 -0
- package/src/modules/notifications/service-helpers/sender-profiles.ts +34 -0
- package/src/modules/notifications/service-helpers/template-blocks.ts +116 -0
- package/src/modules/notifications/service-helpers/template-catalog.ts +170 -0
- package/src/modules/notifications/service-helpers/template-render.ts +113 -0
- package/src/modules/notifications/service.ts +588 -0
- package/src/modules/notifications/types.ts +1 -0
- package/src/modules/notifications/utils/auth-presets.ts +145 -0
- package/src/modules/notifications/utils/interpolation.ts +231 -0
- package/src/modules/notifications/utils/security.ts +378 -0
- package/src/modules/notifications/utils/system-presets.ts +695 -0
- package/src/modules/notifications/utils/transformers.ts +456 -0
- package/src/providers/README.md +92 -0
- package/src/providers/dummy-sandbox/index.ts +143 -0
- package/src/providers/email-smtp/index.ts +257 -0
- package/src/providers/index.ts +38 -0
- package/src/providers/slack/index.ts +82 -0
- package/src/providers/sms/index.ts +342 -0
- package/src/providers/telegram/index.ts +181 -0
- package/src/providers/whatsapp/index.ts +505 -0
- package/src/rbac.ts +123 -0
- package/src/sdk/client.ts +319 -0
- package/src/sdk/index.ts +48 -0
- package/src/sdk/query-keys.ts +89 -0
- package/src/subscribers/README.md +50 -0
- package/src/subscribers/customer-and-document-events.ts +36 -0
- package/src/subscribers/fulfillment-and-inventory-events.ts +35 -0
- package/src/subscribers/order-events.ts +31 -0
- package/src/types/constants.ts +143 -0
- package/src/types/core.ts +96 -0
- package/src/types/domain.ts +84 -0
- package/src/types/enums.ts +73 -0
- package/src/types/errors.ts +32 -0
- package/src/types/hooks.ts +48 -0
- package/src/types/index.ts +11 -0
- package/src/types/providers.ts +96 -0
- package/src/types/records.ts +100 -0
- package/src/types/render.ts +74 -0
- package/src/types/sdk-api.ts +228 -0
- package/src/types/translations.ts +75 -0
- package/src/workflows/README.md +67 -0
- package/src/workflows/index.ts +619 -0
- package/tsconfig.json +40 -0
|
@@ -0,0 +1,4215 @@
|
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
let _medusajs_admin_sdk = require("@medusajs/admin-sdk");
|
|
23
|
+
let _medusajs_dashboard_components = require("@medusajs/dashboard/components");
|
|
24
|
+
let _medusajs_ui = require("@medusajs/ui");
|
|
25
|
+
let react = require("react");
|
|
26
|
+
react = __toESM(react, 1);
|
|
27
|
+
let react_i18next = require("react-i18next");
|
|
28
|
+
let _medusajs_framework_utils = require("@medusajs/framework/utils");
|
|
29
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
let _medusajs_admin_shared = require("@medusajs/admin-shared");
|
|
31
|
+
let _medusajs_icons = require("@medusajs/icons");
|
|
32
|
+
let react_router_dom = require("react-router-dom");
|
|
33
|
+
let react_hook_form = require("react-hook-form");
|
|
34
|
+
// src/sdk/query-keys.ts
|
|
35
|
+
var NOTIFICATIONS_QUERY_KEY = "notifications";
|
|
36
|
+
var invalidationListeners = /* @__PURE__ */ new Set();
|
|
37
|
+
/**
|
|
38
|
+
* Hierarchical query key factory for `medusa-plugin-notifications`.
|
|
39
|
+
* Follows the same factory conventions as `boldQueryKeys` in `vicacha-medusa-plugins`.
|
|
40
|
+
*/
|
|
41
|
+
var notificationsQueryKeys = {
|
|
42
|
+
all: [NOTIFICATIONS_QUERY_KEY],
|
|
43
|
+
studio: () => [...notificationsQueryKeys.all, "studio"],
|
|
44
|
+
templatesAll: () => [...notificationsQueryKeys.all, "templates"],
|
|
45
|
+
templates: (params) => params ? [...notificationsQueryKeys.templatesAll(), params] : notificationsQueryKeys.templatesAll(),
|
|
46
|
+
template: (id) => [
|
|
47
|
+
...notificationsQueryKeys.templatesAll(),
|
|
48
|
+
"detail",
|
|
49
|
+
id
|
|
50
|
+
],
|
|
51
|
+
mappingsAll: () => [...notificationsQueryKeys.all, "mappings"],
|
|
52
|
+
mappings: (params) => params ? [...notificationsQueryKeys.mappingsAll(), params] : notificationsQueryKeys.mappingsAll(),
|
|
53
|
+
channels: () => [...notificationsQueryKeys.all, "channels"],
|
|
54
|
+
logsAll: () => [...notificationsQueryKeys.all, "logs"],
|
|
55
|
+
logs: (params) => params ? [...notificationsQueryKeys.logsAll(), params] : notificationsQueryKeys.logsAll(),
|
|
56
|
+
orderLogs: (orderId) => [
|
|
57
|
+
...notificationsQueryKeys.logsAll(),
|
|
58
|
+
"order",
|
|
59
|
+
orderId
|
|
60
|
+
],
|
|
61
|
+
broadcasts: () => [...notificationsQueryKeys.all, "broadcasts"],
|
|
62
|
+
sandbox: (params) => params ? [
|
|
63
|
+
...notificationsQueryKeys.all,
|
|
64
|
+
"sandbox",
|
|
65
|
+
params
|
|
66
|
+
] : [...notificationsQueryKeys.all, "sandbox"]
|
|
67
|
+
};
|
|
68
|
+
function matchesNotificationsQueryKeyPrefix(candidateKey, prefixKey) {
|
|
69
|
+
if (prefixKey.length > candidateKey.length) return false;
|
|
70
|
+
for (let i = 0; i < prefixKey.length; i++) {
|
|
71
|
+
const a = candidateKey[i];
|
|
72
|
+
const b = prefixKey[i];
|
|
73
|
+
if (a === b) continue;
|
|
74
|
+
if (typeof a === "object" && a !== null && typeof b === "object" && b !== null) {
|
|
75
|
+
if (JSON.stringify(a) === JSON.stringify(b)) continue;
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
function invalidateNotificationsQueries(keyPrefix = notificationsQueryKeys.all) {
|
|
82
|
+
for (const listener of invalidationListeners) listener(keyPrefix);
|
|
83
|
+
}
|
|
84
|
+
function subscribeNotificationsQueryInvalidation(listener) {
|
|
85
|
+
invalidationListeners.add(listener);
|
|
86
|
+
return () => {
|
|
87
|
+
invalidationListeners.delete(listener);
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
// src/hooks/use-sdk-primitives.ts
|
|
91
|
+
function useNotificationsQuery(queryKey, queryFn, options) {
|
|
92
|
+
const enabled = options?.enabled ?? true;
|
|
93
|
+
const [data, setData] = (0, react.useState)(void 0);
|
|
94
|
+
const [isLoading, setIsLoading] = (0, react.useState)(enabled);
|
|
95
|
+
const [isFetching, setIsFetching] = (0, react.useState)(false);
|
|
96
|
+
const [error, setError] = (0, react.useState)(null);
|
|
97
|
+
const queryFnRef = (0, react.useRef)(queryFn);
|
|
98
|
+
queryFnRef.current = queryFn;
|
|
99
|
+
const optionsRef = (0, react.useRef)(options);
|
|
100
|
+
optionsRef.current = options;
|
|
101
|
+
const serializedKey = JSON.stringify(queryKey);
|
|
102
|
+
const keyRef = (0, react.useRef)(queryKey);
|
|
103
|
+
keyRef.current = queryKey;
|
|
104
|
+
const execute = (0, react.useCallback)(async () => {
|
|
105
|
+
setIsFetching(true);
|
|
106
|
+
setError(null);
|
|
107
|
+
try {
|
|
108
|
+
const result = await queryFnRef.current();
|
|
109
|
+
setData(result);
|
|
110
|
+
optionsRef.current?.onSuccess?.(result);
|
|
111
|
+
return result;
|
|
112
|
+
} catch (err) {
|
|
113
|
+
const normalized = err instanceof Error ? err : new Error(String(err || "Unknown error"));
|
|
114
|
+
setError(normalized);
|
|
115
|
+
optionsRef.current?.onError?.(normalized);
|
|
116
|
+
return;
|
|
117
|
+
} finally {
|
|
118
|
+
setIsLoading(false);
|
|
119
|
+
setIsFetching(false);
|
|
120
|
+
}
|
|
121
|
+
}, []);
|
|
122
|
+
(0, react.useEffect)(() => {
|
|
123
|
+
if (!enabled) {
|
|
124
|
+
setIsLoading(false);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
setIsLoading(true);
|
|
128
|
+
execute();
|
|
129
|
+
}, [
|
|
130
|
+
enabled,
|
|
131
|
+
serializedKey,
|
|
132
|
+
execute
|
|
133
|
+
]);
|
|
134
|
+
(0, react.useEffect)(() => {
|
|
135
|
+
if (!enabled) return;
|
|
136
|
+
return subscribeNotificationsQueryInvalidation((invalidatedPrefix) => {
|
|
137
|
+
if (matchesNotificationsQueryKeyPrefix(keyRef.current, invalidatedPrefix)) execute();
|
|
138
|
+
});
|
|
139
|
+
}, [enabled, execute]);
|
|
140
|
+
return {
|
|
141
|
+
data,
|
|
142
|
+
isLoading,
|
|
143
|
+
isFetching,
|
|
144
|
+
error,
|
|
145
|
+
refetch: execute
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function useNotificationsMutation(mutationFn, options, defaultInvalidateKey = notificationsQueryKeys.all) {
|
|
149
|
+
const [isPending, setIsPending] = (0, react.useState)(false);
|
|
150
|
+
const [error, setError] = (0, react.useState)(null);
|
|
151
|
+
const [data, setData] = (0, react.useState)(void 0);
|
|
152
|
+
const mutationFnRef = (0, react.useRef)(mutationFn);
|
|
153
|
+
mutationFnRef.current = mutationFn;
|
|
154
|
+
const optionsRef = (0, react.useRef)(options);
|
|
155
|
+
optionsRef.current = options;
|
|
156
|
+
const mutateAsync = (0, react.useCallback)(async (variables) => {
|
|
157
|
+
setIsPending(true);
|
|
158
|
+
setError(null);
|
|
159
|
+
try {
|
|
160
|
+
const result = await mutationFnRef.current(variables);
|
|
161
|
+
setData(result);
|
|
162
|
+
invalidateNotificationsQueries(optionsRef.current?.queryKey ?? defaultInvalidateKey);
|
|
163
|
+
optionsRef.current?.onSuccess?.(result, variables);
|
|
164
|
+
return result;
|
|
165
|
+
} catch (err) {
|
|
166
|
+
const normalized = err instanceof Error ? err : new Error(String(err || "Unknown error"));
|
|
167
|
+
setError(normalized);
|
|
168
|
+
optionsRef.current?.onError?.(normalized, variables);
|
|
169
|
+
throw normalized;
|
|
170
|
+
} finally {
|
|
171
|
+
setIsPending(false);
|
|
172
|
+
}
|
|
173
|
+
}, [defaultInvalidateKey]);
|
|
174
|
+
return {
|
|
175
|
+
mutate: (0, react.useCallback)((variables, callOptions) => {
|
|
176
|
+
mutateAsync(variables).then((res) => {
|
|
177
|
+
callOptions?.onSuccess?.(res, variables);
|
|
178
|
+
}).catch((err) => {
|
|
179
|
+
callOptions?.onError?.(err, variables);
|
|
180
|
+
});
|
|
181
|
+
}, [mutateAsync]),
|
|
182
|
+
mutateAsync,
|
|
183
|
+
isPending,
|
|
184
|
+
error,
|
|
185
|
+
data,
|
|
186
|
+
reset: (0, react.useCallback)(() => {
|
|
187
|
+
setError(null);
|
|
188
|
+
setData(void 0);
|
|
189
|
+
setIsPending(false);
|
|
190
|
+
}, [])
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
// src/sdk/client.ts
|
|
194
|
+
function buildQueryString(params) {
|
|
195
|
+
if (!params) return "";
|
|
196
|
+
const search = new URLSearchParams();
|
|
197
|
+
for (const [key, value] of Object.entries(params)) {
|
|
198
|
+
if (value === void 0 || value === null || value === "") continue;
|
|
199
|
+
search.set(key, String(value));
|
|
200
|
+
}
|
|
201
|
+
const str = search.toString();
|
|
202
|
+
return str ? `?${str}` : "";
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Typed SDK client for `medusa-plugin-notifications` (MPN).
|
|
206
|
+
* Supports both `/admin` and `/store` routes with automatic JSON parsing
|
|
207
|
+
* and standard Medusa error extraction.
|
|
208
|
+
*/
|
|
209
|
+
var NotificationsApiClient = class {
|
|
210
|
+
baseUrl;
|
|
211
|
+
prefix;
|
|
212
|
+
options;
|
|
213
|
+
constructor(prefix = "/store", baseUrl = "", options = {}) {
|
|
214
|
+
this.prefix = prefix;
|
|
215
|
+
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
216
|
+
this.options = options;
|
|
217
|
+
}
|
|
218
|
+
resolveUrl(endpoint, params) {
|
|
219
|
+
const normalizedEndpoint = endpoint.startsWith("/") ? endpoint : `/${endpoint}`;
|
|
220
|
+
return `${this.baseUrl}${this.prefix}${normalizedEndpoint}${buildQueryString(params)}`;
|
|
221
|
+
}
|
|
222
|
+
buildHeaders(customHeaders, hasJsonBody = true) {
|
|
223
|
+
const headers = {
|
|
224
|
+
...hasJsonBody ? { "Content-Type": "application/json" } : {},
|
|
225
|
+
...this.options.headers
|
|
226
|
+
};
|
|
227
|
+
if (this.options.publishableApiKey) headers["x-publishable-api-key"] = this.options.publishableApiKey;
|
|
228
|
+
if (customHeaders) {
|
|
229
|
+
if (customHeaders instanceof Headers) customHeaders.forEach((v, k) => {
|
|
230
|
+
headers[k] = v;
|
|
231
|
+
});
|
|
232
|
+
else if (Array.isArray(customHeaders)) for (const [k, v] of customHeaders) headers[k] = v;
|
|
233
|
+
else Object.assign(headers, customHeaders);
|
|
234
|
+
}
|
|
235
|
+
return headers;
|
|
236
|
+
}
|
|
237
|
+
async fetch(endpoint, options, queryParams) {
|
|
238
|
+
const url = this.resolveUrl(endpoint, queryParams);
|
|
239
|
+
const fetchFn = this.options.fetchImpl ?? globalThis.fetch;
|
|
240
|
+
const hasJsonBody = options?.body !== void 0 && !(options.body instanceof FormData);
|
|
241
|
+
const response = await fetchFn(url, {
|
|
242
|
+
credentials: this.options.credentials ?? "include",
|
|
243
|
+
...options,
|
|
244
|
+
headers: this.buildHeaders(options?.headers, hasJsonBody)
|
|
245
|
+
});
|
|
246
|
+
if (response.status === 204) return {};
|
|
247
|
+
const data = await response.json().catch(() => ({}));
|
|
248
|
+
if (!response.ok) throw new _medusajs_framework_utils.MedusaError(_medusajs_framework_utils.MedusaError.Types.UNEXPECTED_STATE, data.message || data.detail || `Request failed with status ${response.status}`);
|
|
249
|
+
return data;
|
|
250
|
+
}
|
|
251
|
+
async listTemplates(params) {
|
|
252
|
+
return this.fetch("/mpn/templates", { method: "GET" }, params);
|
|
253
|
+
}
|
|
254
|
+
async getTemplate(id) {
|
|
255
|
+
return this.fetch(`/mpn/templates/${encodeURIComponent(id)}`, { method: "GET" });
|
|
256
|
+
}
|
|
257
|
+
async createOrCloneTemplate(payload) {
|
|
258
|
+
return this.fetch("/mpn/templates", {
|
|
259
|
+
method: "POST",
|
|
260
|
+
body: JSON.stringify(payload)
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
async updateTemplate(id, payload) {
|
|
264
|
+
return this.fetch(`/mpn/templates/${encodeURIComponent(id)}`, {
|
|
265
|
+
method: "POST",
|
|
266
|
+
body: JSON.stringify(payload)
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
async deleteTemplate(id) {
|
|
270
|
+
return this.fetch(`/mpn/templates/${encodeURIComponent(id)}`, { method: "DELETE" });
|
|
271
|
+
}
|
|
272
|
+
async renderTemplatePreview(payload) {
|
|
273
|
+
return this.fetch("/mpn/render-template", {
|
|
274
|
+
method: "POST",
|
|
275
|
+
body: JSON.stringify(payload)
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
async listMappings() {
|
|
279
|
+
return this.fetch("/mpn/mappings", { method: "GET" });
|
|
280
|
+
}
|
|
281
|
+
async createMapping(payload) {
|
|
282
|
+
return this.fetch("/mpn/mappings", {
|
|
283
|
+
method: "POST",
|
|
284
|
+
body: JSON.stringify(payload)
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
async updateMapping(id, payload) {
|
|
288
|
+
return this.fetch(`/mpn/mappings/${encodeURIComponent(id)}`, {
|
|
289
|
+
method: "POST",
|
|
290
|
+
body: JSON.stringify(payload)
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
async deleteMapping(id) {
|
|
294
|
+
return this.fetch(`/mpn/mappings/${encodeURIComponent(id)}`, { method: "DELETE" });
|
|
295
|
+
}
|
|
296
|
+
async listChannels() {
|
|
297
|
+
return this.fetch("/mpn/channels", { method: "GET" });
|
|
298
|
+
}
|
|
299
|
+
async saveOrVerifyChannel(payload) {
|
|
300
|
+
return this.fetch("/mpn/channels", {
|
|
301
|
+
method: "POST",
|
|
302
|
+
body: JSON.stringify(payload)
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
async listLogs(params) {
|
|
306
|
+
return this.fetch("/mpn/logs", { method: "GET" }, params);
|
|
307
|
+
}
|
|
308
|
+
async listBroadcasts() {
|
|
309
|
+
return this.fetch("/mpn/broadcasts", { method: "GET" });
|
|
310
|
+
}
|
|
311
|
+
async createBroadcast(payload) {
|
|
312
|
+
return this.fetch("/mpn/broadcasts", {
|
|
313
|
+
method: "POST",
|
|
314
|
+
body: JSON.stringify(payload)
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
async listSandboxMessages(params) {
|
|
318
|
+
return this.fetch("/mpn/sandbox", { method: "GET" }, params);
|
|
319
|
+
}
|
|
320
|
+
async clearSandboxMessages() {
|
|
321
|
+
return this.fetch("/mpn/sandbox", { method: "DELETE" });
|
|
322
|
+
}
|
|
323
|
+
async sendNotification(payload) {
|
|
324
|
+
return this.fetch("/mpn/send", {
|
|
325
|
+
method: "POST",
|
|
326
|
+
body: JSON.stringify(payload)
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
async updateConsent(payload) {
|
|
330
|
+
return this.fetch("/mpn/consent", {
|
|
331
|
+
method: "POST",
|
|
332
|
+
body: JSON.stringify(payload)
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
var notificationsAdminSdk = new NotificationsApiClient("/admin");
|
|
337
|
+
new NotificationsApiClient("/store");
|
|
338
|
+
// src/hooks/use-mpn-templates.ts
|
|
339
|
+
function useMpnTemplates(params, options) {
|
|
340
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
341
|
+
return useNotificationsQuery(options?.queryKey ?? notificationsQueryKeys.templates(params), () => client.listTemplates(params), options);
|
|
342
|
+
}
|
|
343
|
+
function useCreateOrCloneMpnTemplate(options) {
|
|
344
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
345
|
+
return useNotificationsMutation((payload) => client.createOrCloneTemplate(payload), options, notificationsQueryKeys.templatesAll());
|
|
346
|
+
}
|
|
347
|
+
function useUpdateMpnTemplate(options) {
|
|
348
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
349
|
+
return useNotificationsMutation(({ id, payload }) => client.updateTemplate(id, payload), options, notificationsQueryKeys.templatesAll());
|
|
350
|
+
}
|
|
351
|
+
function useRenderMpnTemplatePreview(options) {
|
|
352
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
353
|
+
return useNotificationsMutation((payload) => client.renderTemplatePreview(payload), options, notificationsQueryKeys.templatesAll());
|
|
354
|
+
}
|
|
355
|
+
// src/hooks/use-mpn-mappings.ts
|
|
356
|
+
function useMpnMappings(options) {
|
|
357
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
358
|
+
return useNotificationsQuery(options?.queryKey ?? notificationsQueryKeys.mappings(), () => client.listMappings(), options);
|
|
359
|
+
}
|
|
360
|
+
function useCreateMpnMapping(options) {
|
|
361
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
362
|
+
return useNotificationsMutation((payload) => client.createMapping(payload), options, notificationsQueryKeys.mappingsAll());
|
|
363
|
+
}
|
|
364
|
+
function useDeleteMpnMapping(options) {
|
|
365
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
366
|
+
return useNotificationsMutation(({ id }) => client.deleteMapping(id), options, notificationsQueryKeys.mappingsAll());
|
|
367
|
+
}
|
|
368
|
+
// src/hooks/use-mpn-channels.ts
|
|
369
|
+
function useMpnChannels(options) {
|
|
370
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
371
|
+
return useNotificationsQuery(options?.queryKey ?? notificationsQueryKeys.channels(), () => client.listChannels(), options);
|
|
372
|
+
}
|
|
373
|
+
function useSaveOrVerifyMpnChannel(options) {
|
|
374
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
375
|
+
return useNotificationsMutation((payload) => client.saveOrVerifyChannel(payload), options, notificationsQueryKeys.channels());
|
|
376
|
+
}
|
|
377
|
+
// src/hooks/use-mpn-dispatch.ts
|
|
378
|
+
function useMpnLogs(params, options) {
|
|
379
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
380
|
+
return useNotificationsQuery(options?.queryKey ?? notificationsQueryKeys.logs(params), () => client.listLogs(params), options);
|
|
381
|
+
}
|
|
382
|
+
function useMpnOrderLogs(orderId, options) {
|
|
383
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
384
|
+
return useNotificationsQuery(options?.queryKey ?? notificationsQueryKeys.orderLogs(orderId || ""), () => client.listLogs({
|
|
385
|
+
entity_id: orderId,
|
|
386
|
+
limit: 15
|
|
387
|
+
}), {
|
|
388
|
+
...options,
|
|
389
|
+
enabled: Boolean(orderId) && (options?.enabled ?? true)
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
function useMpnBroadcasts(options) {
|
|
393
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
394
|
+
return useNotificationsQuery(options?.queryKey ?? notificationsQueryKeys.broadcasts(), () => client.listBroadcasts(), options);
|
|
395
|
+
}
|
|
396
|
+
function useCreateMpnBroadcast(options) {
|
|
397
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
398
|
+
return useNotificationsMutation((payload) => client.createBroadcast(payload), options, notificationsQueryKeys.broadcasts());
|
|
399
|
+
}
|
|
400
|
+
function useMpnSandboxMessages(params, options) {
|
|
401
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
402
|
+
return useNotificationsQuery(options?.queryKey ?? notificationsQueryKeys.sandbox(params), () => client.listSandboxMessages(params), options);
|
|
403
|
+
}
|
|
404
|
+
function useClearMpnSandbox(options) {
|
|
405
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
406
|
+
return useNotificationsMutation(() => client.clearSandboxMessages(), options, notificationsQueryKeys.sandbox());
|
|
407
|
+
}
|
|
408
|
+
function useSendMpnNotification(options) {
|
|
409
|
+
const client = options?.client ?? notificationsAdminSdk;
|
|
410
|
+
return useNotificationsMutation((payload) => client.sendNotification(payload), options, notificationsQueryKeys.logsAll());
|
|
411
|
+
}
|
|
412
|
+
// src/hooks/use-order-notifications-widget-state.ts
|
|
413
|
+
function useOrderNotificationsWidgetState({ order, client = notificationsAdminSdk, t = (key) => key }) {
|
|
414
|
+
const orderId = order?.id;
|
|
415
|
+
const [selectedChannel, setSelectedChannel] = (0, react.useState)("email");
|
|
416
|
+
const [selectedTemplateId, setSelectedTemplateId] = (0, react.useState)("system_email_order_placed");
|
|
417
|
+
const [attachInvoicePdf, setAttachInvoicePdf] = (0, react.useState)(true);
|
|
418
|
+
const [statusMessage, setStatusMessage] = (0, react.useState)(null);
|
|
419
|
+
const orderLogsQueryKey = notificationsQueryKeys.orderLogs(orderId || "");
|
|
420
|
+
const { data: logsData, refetch: refetchOrderLogs } = useMpnOrderLogs(orderId, {
|
|
421
|
+
client,
|
|
422
|
+
queryKey: orderLogsQueryKey
|
|
423
|
+
});
|
|
424
|
+
const { data: templatesData } = useMpnTemplates(void 0, {
|
|
425
|
+
client,
|
|
426
|
+
enabled: Boolean(orderId)
|
|
427
|
+
});
|
|
428
|
+
const logs = logsData?.logs || [];
|
|
429
|
+
const templates = templatesData?.templates || [];
|
|
430
|
+
const sendMutation = useSendMpnNotification({
|
|
431
|
+
client,
|
|
432
|
+
queryKey: orderLogsQueryKey
|
|
433
|
+
});
|
|
434
|
+
const handleSendOrderNotification = (0, react.useCallback)(async () => {
|
|
435
|
+
if (!orderId) return;
|
|
436
|
+
setStatusMessage(null);
|
|
437
|
+
try {
|
|
438
|
+
const recipient = selectedChannel === "email" ? order?.email || "customer@example.com" : selectedChannel === "whatsapp" || selectedChannel === "sms" ? order?.shipping_address?.phone || order?.billing_address?.phone || "+14155552671" : order?.metadata?.telegram_chat_id || "-1001234567890";
|
|
439
|
+
await sendMutation.mutateAsync({
|
|
440
|
+
channel: selectedChannel,
|
|
441
|
+
recipient,
|
|
442
|
+
template_id: selectedTemplateId,
|
|
443
|
+
order_id: orderId,
|
|
444
|
+
context_type: "order",
|
|
445
|
+
data: order,
|
|
446
|
+
attach_invoice_pdf: attachInvoicePdf
|
|
447
|
+
});
|
|
448
|
+
setStatusMessage(t("widget.dispatchedSuccess", { channel: selectedChannel }));
|
|
449
|
+
} catch (err) {
|
|
450
|
+
setStatusMessage(err?.message || t("widget.dispatchFailed"));
|
|
451
|
+
}
|
|
452
|
+
}, [
|
|
453
|
+
orderId,
|
|
454
|
+
order,
|
|
455
|
+
selectedChannel,
|
|
456
|
+
selectedTemplateId,
|
|
457
|
+
attachInvoicePdf,
|
|
458
|
+
sendMutation,
|
|
459
|
+
t
|
|
460
|
+
]);
|
|
461
|
+
return {
|
|
462
|
+
orderId,
|
|
463
|
+
logs,
|
|
464
|
+
templates,
|
|
465
|
+
selectedChannel,
|
|
466
|
+
setSelectedChannel,
|
|
467
|
+
selectedTemplateId,
|
|
468
|
+
setSelectedTemplateId,
|
|
469
|
+
attachInvoicePdf,
|
|
470
|
+
setAttachInvoicePdf,
|
|
471
|
+
sending: sendMutation.isPending,
|
|
472
|
+
statusMessage,
|
|
473
|
+
setStatusMessage,
|
|
474
|
+
loadOrderActivity: refetchOrderLogs,
|
|
475
|
+
handleSendOrderNotification
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
// src/admin/widgets/order-notifications-widget.tsx
|
|
479
|
+
var OrderNotificationsActivityWidget = ({ data }) => {
|
|
480
|
+
const { t, i18n } = (0, react_i18next.useTranslation)();
|
|
481
|
+
const { orderId, logs, templates, selectedChannel, setSelectedChannel, selectedTemplateId, setSelectedTemplateId, attachInvoicePdf, setAttachInvoicePdf, sending, statusMessage, setStatusMessage, handleSendOrderNotification } = useOrderNotificationsWidgetState({
|
|
482
|
+
order: data,
|
|
483
|
+
t
|
|
484
|
+
});
|
|
485
|
+
(0, react.useEffect)(() => {
|
|
486
|
+
if (!statusMessage) return;
|
|
487
|
+
if (statusMessage.toLowerCase().includes(t("widget.dispatchFailed").toLowerCase())) _medusajs_ui.toast.error(statusMessage);
|
|
488
|
+
else _medusajs_ui.toast.success(statusMessage);
|
|
489
|
+
setStatusMessage(null);
|
|
490
|
+
}, [
|
|
491
|
+
statusMessage,
|
|
492
|
+
setStatusMessage,
|
|
493
|
+
t
|
|
494
|
+
]);
|
|
495
|
+
if (!orderId) return null;
|
|
496
|
+
const isRtl = (i18n.resolvedLanguage || i18n.language || "").startsWith("ar");
|
|
497
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Container, {
|
|
498
|
+
className: "divide-y p-0",
|
|
499
|
+
dir: isRtl ? "rtl" : "ltr",
|
|
500
|
+
children: [
|
|
501
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Toaster, {}),
|
|
502
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
503
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
504
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
505
|
+
level: "h2",
|
|
506
|
+
children: t("widget.title", { count: logs.length })
|
|
507
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Text, {
|
|
508
|
+
className: "text-ui-fg-subtle text-xs mt-1",
|
|
509
|
+
children: t("widget.subtitle")
|
|
510
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.StatusBadge, {
|
|
511
|
+
color: "green",
|
|
512
|
+
children: logs.length
|
|
513
|
+
})]
|
|
514
|
+
}),
|
|
515
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.SectionRow, {
|
|
516
|
+
title: t("widget.colChannel"),
|
|
517
|
+
value: selectedChannel
|
|
518
|
+
}),
|
|
519
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
520
|
+
className: "flex flex-wrap items-center gap-3 px-6 py-4",
|
|
521
|
+
children: [
|
|
522
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
523
|
+
className: "w-40",
|
|
524
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select, {
|
|
525
|
+
size: "small",
|
|
526
|
+
value: selectedChannel,
|
|
527
|
+
onValueChange: setSelectedChannel,
|
|
528
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Trigger, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Value, { placeholder: t("widget.channelPlaceholder") }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select.Content, { children: [
|
|
529
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
530
|
+
value: "email",
|
|
531
|
+
children: "EMAIL"
|
|
532
|
+
}),
|
|
533
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
534
|
+
value: "whatsapp",
|
|
535
|
+
children: "WHATSAPP / OPENWA"
|
|
536
|
+
}),
|
|
537
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
538
|
+
value: "telegram",
|
|
539
|
+
children: "TELEGRAM"
|
|
540
|
+
}),
|
|
541
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
542
|
+
value: "sms",
|
|
543
|
+
children: "SMS"
|
|
544
|
+
}),
|
|
545
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
546
|
+
value: "dummy",
|
|
547
|
+
children: "DUMMY SANDBOX"
|
|
548
|
+
})
|
|
549
|
+
] })]
|
|
550
|
+
})
|
|
551
|
+
}),
|
|
552
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
553
|
+
className: "w-64",
|
|
554
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select, {
|
|
555
|
+
size: "small",
|
|
556
|
+
value: selectedTemplateId,
|
|
557
|
+
onValueChange: setSelectedTemplateId,
|
|
558
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Trigger, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Value, { placeholder: t("widget.templatePlaceholder") }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Content, { children: templates.map((tpl) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select.Item, {
|
|
559
|
+
value: tpl.id,
|
|
560
|
+
children: [
|
|
561
|
+
"[",
|
|
562
|
+
tpl.channel.toUpperCase(),
|
|
563
|
+
"] ",
|
|
564
|
+
tpl.label
|
|
565
|
+
]
|
|
566
|
+
}, tpl.id)) })]
|
|
567
|
+
})
|
|
568
|
+
}),
|
|
569
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
570
|
+
className: "flex items-center gap-x-2",
|
|
571
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Switch, {
|
|
572
|
+
checked: attachInvoicePdf,
|
|
573
|
+
onCheckedChange: setAttachInvoicePdf
|
|
574
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Text, {
|
|
575
|
+
className: "text-xs",
|
|
576
|
+
children: t("widget.attachInvoiceLabel")
|
|
577
|
+
})]
|
|
578
|
+
}),
|
|
579
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Button, {
|
|
580
|
+
size: "small",
|
|
581
|
+
variant: "primary",
|
|
582
|
+
disabled: sending,
|
|
583
|
+
isLoading: sending,
|
|
584
|
+
onClick: () => void handleSendOrderNotification(),
|
|
585
|
+
children: sending ? t("widget.sending") : t("widget.sendResendButton")
|
|
586
|
+
})
|
|
587
|
+
]
|
|
588
|
+
}),
|
|
589
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Header, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table.Row, { children: [
|
|
590
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("widget.colChannel") }),
|
|
591
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("widget.colEventTemplate") }),
|
|
592
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("widget.colRecipient") }),
|
|
593
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("widget.colStatus") })
|
|
594
|
+
] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Body, { children: logs.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table.Row, { children: [
|
|
595
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
596
|
+
size: "2xsmall",
|
|
597
|
+
color: "blue",
|
|
598
|
+
children: row.channel
|
|
599
|
+
}) }),
|
|
600
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table.Cell, { children: [
|
|
601
|
+
row.event_name,
|
|
602
|
+
" (",
|
|
603
|
+
row.template_id || "—",
|
|
604
|
+
")"
|
|
605
|
+
] }),
|
|
606
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: row.recipient_masked }),
|
|
607
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.StatusBadge, {
|
|
608
|
+
color: row.status === "sent" || row.status === "delivered" ? "green" : "orange",
|
|
609
|
+
children: row.status
|
|
610
|
+
}) })
|
|
611
|
+
] }, row.id)) })] })
|
|
612
|
+
]
|
|
613
|
+
});
|
|
614
|
+
};
|
|
615
|
+
(0, _medusajs_admin_sdk.defineWidgetConfig)({ zone: "order.details.after" });
|
|
616
|
+
// src/admin/components/mpn/broadcast-consent-section.tsx
|
|
617
|
+
var BroadcastConsentSection = ({ consentSummary }) => {
|
|
618
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
619
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Container, {
|
|
620
|
+
className: "divide-y p-0",
|
|
621
|
+
children: [
|
|
622
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
623
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
624
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
625
|
+
level: "h2",
|
|
626
|
+
children: t("tabs.broadcasts")
|
|
627
|
+
})
|
|
628
|
+
}),
|
|
629
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.SectionRow, {
|
|
630
|
+
title: "SMS",
|
|
631
|
+
value: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.StatusBadge, {
|
|
632
|
+
color: "green",
|
|
633
|
+
children: t("broadcasts.smsOptedIn", { count: consentSummary?.opted_in_sms ?? 0 })
|
|
634
|
+
})
|
|
635
|
+
}),
|
|
636
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.SectionRow, {
|
|
637
|
+
title: "WhatsApp",
|
|
638
|
+
value: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.StatusBadge, {
|
|
639
|
+
color: "green",
|
|
640
|
+
children: t("broadcasts.whatsappOptedIn", { count: consentSummary?.opted_in_whatsapp ?? 0 })
|
|
641
|
+
})
|
|
642
|
+
}),
|
|
643
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.SectionRow, {
|
|
644
|
+
title: "Telegram",
|
|
645
|
+
value: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
646
|
+
size: "2xsmall",
|
|
647
|
+
color: "blue",
|
|
648
|
+
children: t("broadcasts.telegramLinked", { count: consentSummary?.opted_in_telegram ?? 0 })
|
|
649
|
+
})
|
|
650
|
+
}),
|
|
651
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.SectionRow, {
|
|
652
|
+
title: "STOP",
|
|
653
|
+
value: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.StatusBadge, {
|
|
654
|
+
color: "red",
|
|
655
|
+
children: t("broadcasts.optedOut", { count: consentSummary?.opted_out_total ?? 0 })
|
|
656
|
+
})
|
|
657
|
+
})
|
|
658
|
+
]
|
|
659
|
+
});
|
|
660
|
+
};
|
|
661
|
+
// src/admin/components/mpn/broadcasts-tab.tsx
|
|
662
|
+
var BroadcastsConsentTab = ({ broadcasts, consentSummary, templates, onRefresh, onStatus, section = "all" }) => {
|
|
663
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
664
|
+
const [broadcastName, setBroadcastName] = (0, react.useState)("");
|
|
665
|
+
const [broadcastChannel, setBroadcastChannel] = (0, react.useState)("sms");
|
|
666
|
+
const [broadcastTemplateId, setBroadcastTemplateId] = (0, react.useState)("system_sms_order_placed");
|
|
667
|
+
const form = (0, react_hook_form.useForm)({ defaultValues: {
|
|
668
|
+
name: "",
|
|
669
|
+
channel: "sms",
|
|
670
|
+
template_id: "system_sms_order_placed"
|
|
671
|
+
} });
|
|
672
|
+
const createBroadcastMutation = useCreateMpnBroadcast();
|
|
673
|
+
const handleSendBroadcast = async () => {
|
|
674
|
+
if (!broadcastName.trim()) return;
|
|
675
|
+
try {
|
|
676
|
+
await createBroadcastMutation.mutateAsync({
|
|
677
|
+
name: broadcastName,
|
|
678
|
+
channel: broadcastChannel,
|
|
679
|
+
template_id: broadcastTemplateId,
|
|
680
|
+
send_now: true
|
|
681
|
+
});
|
|
682
|
+
setBroadcastName("");
|
|
683
|
+
const msg = t("messages.broadcastSentSuccess");
|
|
684
|
+
_medusajs_ui.toast.success(msg);
|
|
685
|
+
onStatus?.({
|
|
686
|
+
type: "success",
|
|
687
|
+
text: msg
|
|
688
|
+
});
|
|
689
|
+
await onRefresh();
|
|
690
|
+
} catch (err) {
|
|
691
|
+
_medusajs_ui.toast.error(err?.message || t("messages.loadStudioError"));
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
const mainSection = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Container, {
|
|
695
|
+
className: "divide-y p-0",
|
|
696
|
+
children: [
|
|
697
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
698
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
699
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
700
|
+
level: "h2",
|
|
701
|
+
children: t("broadcasts.title")
|
|
702
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.StatusBadge, {
|
|
703
|
+
color: "green",
|
|
704
|
+
children: broadcasts.length
|
|
705
|
+
})]
|
|
706
|
+
}),
|
|
707
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.Form, {
|
|
708
|
+
...form,
|
|
709
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.KeyboundForm, {
|
|
710
|
+
onSubmit: (e) => {
|
|
711
|
+
e.preventDefault();
|
|
712
|
+
handleSendBroadcast();
|
|
713
|
+
},
|
|
714
|
+
className: "px-6 py-4",
|
|
715
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
716
|
+
className: "grid grid-cols-1 gap-4 md:grid-cols-4",
|
|
717
|
+
children: [
|
|
718
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
719
|
+
className: "flex flex-col gap-y-2",
|
|
720
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
721
|
+
size: "small",
|
|
722
|
+
children: t("broadcasts.campaignNameLabel")
|
|
723
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Input, {
|
|
724
|
+
size: "small",
|
|
725
|
+
placeholder: t("broadcasts.campaignNamePlaceholder"),
|
|
726
|
+
value: broadcastName,
|
|
727
|
+
onChange: (e) => setBroadcastName(e.target.value)
|
|
728
|
+
})]
|
|
729
|
+
}),
|
|
730
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
731
|
+
className: "flex flex-col gap-y-2",
|
|
732
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
733
|
+
size: "small",
|
|
734
|
+
children: t("broadcasts.channelLabel")
|
|
735
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select, {
|
|
736
|
+
size: "small",
|
|
737
|
+
value: broadcastChannel,
|
|
738
|
+
onValueChange: setBroadcastChannel,
|
|
739
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Trigger, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Value, {}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select.Content, { children: [
|
|
740
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
741
|
+
value: "sms",
|
|
742
|
+
children: "SMS"
|
|
743
|
+
}),
|
|
744
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
745
|
+
value: "whatsapp",
|
|
746
|
+
children: "WhatsApp"
|
|
747
|
+
}),
|
|
748
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
749
|
+
value: "telegram",
|
|
750
|
+
children: "Telegram"
|
|
751
|
+
})
|
|
752
|
+
] })]
|
|
753
|
+
})]
|
|
754
|
+
}),
|
|
755
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
756
|
+
className: "flex flex-col gap-y-2",
|
|
757
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
758
|
+
size: "small",
|
|
759
|
+
children: t("broadcasts.templateLabel")
|
|
760
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select, {
|
|
761
|
+
size: "small",
|
|
762
|
+
value: broadcastTemplateId,
|
|
763
|
+
onValueChange: setBroadcastTemplateId,
|
|
764
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Trigger, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Value, {}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Content, { children: templates.map((tpl) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select.Item, {
|
|
765
|
+
value: tpl.id,
|
|
766
|
+
children: [
|
|
767
|
+
"[",
|
|
768
|
+
tpl.channel,
|
|
769
|
+
"] ",
|
|
770
|
+
tpl.label
|
|
771
|
+
]
|
|
772
|
+
}, tpl.id)) })]
|
|
773
|
+
})]
|
|
774
|
+
}),
|
|
775
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
776
|
+
className: "flex items-end",
|
|
777
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Button, {
|
|
778
|
+
size: "small",
|
|
779
|
+
variant: "primary",
|
|
780
|
+
type: "submit",
|
|
781
|
+
isLoading: createBroadcastMutation.isPending,
|
|
782
|
+
children: t("broadcasts.sendNowButton")
|
|
783
|
+
})
|
|
784
|
+
})
|
|
785
|
+
]
|
|
786
|
+
})
|
|
787
|
+
})
|
|
788
|
+
}),
|
|
789
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Header, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table.Row, { children: [
|
|
790
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("broadcasts.colCampaign") }),
|
|
791
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("broadcasts.colChannel") }),
|
|
792
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("broadcasts.colStatus") }),
|
|
793
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("broadcasts.colSentTotal") })
|
|
794
|
+
] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Body, { children: broadcasts.map((b) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table.Row, { children: [
|
|
795
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: b.name }),
|
|
796
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
797
|
+
size: "2xsmall",
|
|
798
|
+
color: "blue",
|
|
799
|
+
children: b.channel
|
|
800
|
+
}) }),
|
|
801
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.StatusBadge, {
|
|
802
|
+
color: "green",
|
|
803
|
+
children: b.status
|
|
804
|
+
}) }),
|
|
805
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table.Cell, { children: [
|
|
806
|
+
b.sent_count,
|
|
807
|
+
" / ",
|
|
808
|
+
b.total_recipients
|
|
809
|
+
] })
|
|
810
|
+
] }, b.id)) })] })
|
|
811
|
+
]
|
|
812
|
+
});
|
|
813
|
+
const sideSection = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BroadcastConsentSection, { consentSummary });
|
|
814
|
+
if (section === "main") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Toaster, {}), mainSection] });
|
|
815
|
+
if (section === "side") return sideSection;
|
|
816
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
817
|
+
className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
|
|
818
|
+
children: [
|
|
819
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Toaster, {}),
|
|
820
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
821
|
+
className: "lg:col-span-2",
|
|
822
|
+
children: mainSection
|
|
823
|
+
}),
|
|
824
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: sideSection })
|
|
825
|
+
]
|
|
826
|
+
});
|
|
827
|
+
};
|
|
828
|
+
// src/admin/components/mpn/channels-main-section.tsx
|
|
829
|
+
var ChannelsMainSection = ({ whatsappDriverInput, openWaUrlInput, telegramChannelInput, tgVerified, verifyCooldown, isPending, onWhatsappDriverChange, onOpenWaUrlChange, onTelegramChannelChange, onSaveOrVerify }) => {
|
|
830
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
831
|
+
const form = (0, react_hook_form.useForm)({ defaultValues: {
|
|
832
|
+
whatsapp_driver: whatsappDriverInput,
|
|
833
|
+
gateway_url: openWaUrlInput,
|
|
834
|
+
merchant_channel_id: telegramChannelInput
|
|
835
|
+
} });
|
|
836
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
837
|
+
className: "flex flex-col gap-y-4",
|
|
838
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Container, {
|
|
839
|
+
className: "divide-y p-0",
|
|
840
|
+
children: [
|
|
841
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
842
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
843
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
844
|
+
level: "h2",
|
|
845
|
+
children: t("channels.whatsappTitle")
|
|
846
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Text, {
|
|
847
|
+
className: "text-ui-fg-subtle text-xs mt-1",
|
|
848
|
+
children: t("channels.whatsappSubtitle")
|
|
849
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
850
|
+
size: "2xsmall",
|
|
851
|
+
color: "blue",
|
|
852
|
+
children: whatsappDriverInput
|
|
853
|
+
})]
|
|
854
|
+
}),
|
|
855
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.SectionRow, {
|
|
856
|
+
title: t("channels.activeDriverLabel"),
|
|
857
|
+
value: whatsappDriverInput
|
|
858
|
+
}),
|
|
859
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.Form, {
|
|
860
|
+
...form,
|
|
861
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_dashboard_components.KeyboundForm, {
|
|
862
|
+
onSubmit: (e) => {
|
|
863
|
+
e.preventDefault();
|
|
864
|
+
onSaveOrVerify("whatsapp", whatsappDriverInput, { gateway_url: openWaUrlInput }, "save");
|
|
865
|
+
},
|
|
866
|
+
className: "flex flex-col gap-y-3 px-6 py-4",
|
|
867
|
+
children: [
|
|
868
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
869
|
+
className: "flex flex-col gap-y-2",
|
|
870
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
871
|
+
size: "small",
|
|
872
|
+
children: t("channels.activeDriverLabel")
|
|
873
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select, {
|
|
874
|
+
size: "small",
|
|
875
|
+
value: whatsappDriverInput,
|
|
876
|
+
onValueChange: onWhatsappDriverChange,
|
|
877
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Trigger, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Value, {}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select.Content, { children: [
|
|
878
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
879
|
+
value: "meta-cloud",
|
|
880
|
+
children: t("channels.driverMetaCloud")
|
|
881
|
+
}),
|
|
882
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
883
|
+
value: "openwa",
|
|
884
|
+
children: t("channels.driverOpenWa")
|
|
885
|
+
}),
|
|
886
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
887
|
+
value: "waha",
|
|
888
|
+
children: t("channels.driverWaha")
|
|
889
|
+
}),
|
|
890
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
891
|
+
value: "evolution",
|
|
892
|
+
children: t("channels.driverEvolution")
|
|
893
|
+
})
|
|
894
|
+
] })]
|
|
895
|
+
})]
|
|
896
|
+
}),
|
|
897
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
898
|
+
className: "flex flex-col gap-y-2",
|
|
899
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
900
|
+
size: "small",
|
|
901
|
+
children: t("channels.gatewayUrlLabel")
|
|
902
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Input, {
|
|
903
|
+
size: "small",
|
|
904
|
+
placeholder: "http://127.0.0.1:8082",
|
|
905
|
+
value: openWaUrlInput,
|
|
906
|
+
onChange: (e) => onOpenWaUrlChange(e.target.value)
|
|
907
|
+
})]
|
|
908
|
+
}),
|
|
909
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
910
|
+
className: "flex justify-end",
|
|
911
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Button, {
|
|
912
|
+
size: "small",
|
|
913
|
+
variant: "primary",
|
|
914
|
+
type: "submit",
|
|
915
|
+
isLoading: isPending,
|
|
916
|
+
children: t("channels.saveWhatsappButton")
|
|
917
|
+
})
|
|
918
|
+
})
|
|
919
|
+
]
|
|
920
|
+
})
|
|
921
|
+
})
|
|
922
|
+
]
|
|
923
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Container, {
|
|
924
|
+
className: "divide-y p-0",
|
|
925
|
+
children: [
|
|
926
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
927
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
928
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
929
|
+
level: "h2",
|
|
930
|
+
children: t("channels.telegramTitle")
|
|
931
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Text, {
|
|
932
|
+
className: "text-ui-fg-subtle text-xs mt-1",
|
|
933
|
+
children: t("channels.telegramSubtitle")
|
|
934
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.StatusBadge, {
|
|
935
|
+
color: tgVerified ? "green" : "orange",
|
|
936
|
+
children: tgVerified ? t("channels.verifiedBadge") : t("channels.unverifiedBadge")
|
|
937
|
+
})]
|
|
938
|
+
}),
|
|
939
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.SectionRow, {
|
|
940
|
+
title: t("channels.merchantChannelLabel"),
|
|
941
|
+
value: telegramChannelInput || "—"
|
|
942
|
+
}),
|
|
943
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
944
|
+
className: "flex flex-col gap-y-3 px-6 py-4",
|
|
945
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
946
|
+
className: "flex flex-col gap-y-2",
|
|
947
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
948
|
+
size: "small",
|
|
949
|
+
children: t("channels.merchantChannelLabel")
|
|
950
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Input, {
|
|
951
|
+
size: "small",
|
|
952
|
+
placeholder: t("channels.merchantChannelPlaceholder"),
|
|
953
|
+
value: telegramChannelInput,
|
|
954
|
+
onChange: (e) => onTelegramChannelChange(e.target.value)
|
|
955
|
+
})]
|
|
956
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
957
|
+
className: "flex justify-end gap-x-2",
|
|
958
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Button, {
|
|
959
|
+
size: "small",
|
|
960
|
+
variant: "secondary",
|
|
961
|
+
isLoading: isPending,
|
|
962
|
+
onClick: () => onSaveOrVerify("telegram", "telegram-bot", { merchant_channel_id: telegramChannelInput }, "save"),
|
|
963
|
+
children: t("channels.saveChannelIdButton")
|
|
964
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Button, {
|
|
965
|
+
size: "small",
|
|
966
|
+
variant: "primary",
|
|
967
|
+
disabled: verifyCooldown,
|
|
968
|
+
isLoading: isPending,
|
|
969
|
+
onClick: () => onSaveOrVerify("telegram", "telegram-bot", { merchant_channel_id: telegramChannelInput }, "verify"),
|
|
970
|
+
children: t("channels.sendTestButton")
|
|
971
|
+
})]
|
|
972
|
+
})]
|
|
973
|
+
})
|
|
974
|
+
]
|
|
975
|
+
})]
|
|
976
|
+
});
|
|
977
|
+
};
|
|
978
|
+
// src/admin/components/mpn/channels-side-section.tsx
|
|
979
|
+
var ChannelsSideSection = ({ smsDriverInput, isPending, onSmsDriverChange, onSaveSms }) => {
|
|
980
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
981
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Container, {
|
|
982
|
+
className: "divide-y p-0",
|
|
983
|
+
children: [
|
|
984
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
985
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
986
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
987
|
+
level: "h2",
|
|
988
|
+
children: t("channels.smsTitle")
|
|
989
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Text, {
|
|
990
|
+
className: "text-ui-fg-subtle text-xs mt-1",
|
|
991
|
+
children: t("channels.smsSubtitle")
|
|
992
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
993
|
+
size: "2xsmall",
|
|
994
|
+
color: "blue",
|
|
995
|
+
children: smsDriverInput
|
|
996
|
+
})]
|
|
997
|
+
}),
|
|
998
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.SectionRow, {
|
|
999
|
+
title: t("channels.smsDriverLabel"),
|
|
1000
|
+
value: smsDriverInput
|
|
1001
|
+
}),
|
|
1002
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1003
|
+
className: "flex flex-col gap-y-3 px-6 py-4",
|
|
1004
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1005
|
+
className: "flex flex-col gap-y-2",
|
|
1006
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
1007
|
+
size: "small",
|
|
1008
|
+
children: t("channels.smsDriverLabel")
|
|
1009
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select, {
|
|
1010
|
+
size: "small",
|
|
1011
|
+
value: smsDriverInput,
|
|
1012
|
+
onValueChange: onSmsDriverChange,
|
|
1013
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Trigger, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Value, {}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select.Content, { children: [
|
|
1014
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1015
|
+
value: "twilio",
|
|
1016
|
+
children: t("channels.driverTwilio")
|
|
1017
|
+
}),
|
|
1018
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1019
|
+
value: "signalhouse",
|
|
1020
|
+
children: t("channels.driverSignalHouse")
|
|
1021
|
+
}),
|
|
1022
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1023
|
+
value: "msg91",
|
|
1024
|
+
children: t("channels.driverMsg91")
|
|
1025
|
+
}),
|
|
1026
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1027
|
+
value: "smsapi",
|
|
1028
|
+
children: t("channels.driverSmsApi")
|
|
1029
|
+
}),
|
|
1030
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1031
|
+
value: "dummy",
|
|
1032
|
+
children: t("channels.driverDummy")
|
|
1033
|
+
})
|
|
1034
|
+
] })]
|
|
1035
|
+
})]
|
|
1036
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1037
|
+
className: "flex justify-end",
|
|
1038
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Button, {
|
|
1039
|
+
size: "small",
|
|
1040
|
+
variant: "primary",
|
|
1041
|
+
isLoading: isPending,
|
|
1042
|
+
onClick: onSaveSms,
|
|
1043
|
+
children: t("channels.saveSmsButton")
|
|
1044
|
+
})
|
|
1045
|
+
})]
|
|
1046
|
+
})
|
|
1047
|
+
]
|
|
1048
|
+
});
|
|
1049
|
+
};
|
|
1050
|
+
// src/admin/components/mpn/channels-tab.tsx
|
|
1051
|
+
var ChannelsConfigTab = ({ channelsConfig, onRefresh, onStatus, section = "all" }) => {
|
|
1052
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
1053
|
+
const [telegramChannelInput, setTelegramChannelInput] = (0, react.useState)("");
|
|
1054
|
+
const [openWaUrlInput, setOpenWaUrlInput] = (0, react.useState)("");
|
|
1055
|
+
const [whatsappDriverInput, setWhatsappDriverInput] = (0, react.useState)("meta-cloud");
|
|
1056
|
+
const [smsDriverInput, setSmsDriverInput] = (0, react.useState)("twilio");
|
|
1057
|
+
const [verifyCooldown, setVerifyCooldown] = (0, react.useState)(false);
|
|
1058
|
+
const saveOrVerifyMutation = useSaveOrVerifyMpnChannel();
|
|
1059
|
+
(0, react.useEffect)(() => {
|
|
1060
|
+
const tg = channelsConfig.find((c) => c.channel === "telegram");
|
|
1061
|
+
if (tg?.config_json?.merchant_channel_id) setTelegramChannelInput(String(tg.config_json.merchant_channel_id));
|
|
1062
|
+
const wa = channelsConfig.find((c) => c.channel === "whatsapp");
|
|
1063
|
+
if (wa?.driver) setWhatsappDriverInput(String(wa.driver));
|
|
1064
|
+
if (wa?.config_json?.gateway_url) setOpenWaUrlInput(String(wa.config_json.gateway_url));
|
|
1065
|
+
const sms = channelsConfig.find((c) => c.channel === "sms");
|
|
1066
|
+
if (sms?.driver) setSmsDriverInput(String(sms.driver));
|
|
1067
|
+
}, [channelsConfig]);
|
|
1068
|
+
const handleSaveOrVerifyChannel = async (channel, driver, configJson, action) => {
|
|
1069
|
+
if (action === "verify") {
|
|
1070
|
+
setVerifyCooldown(true);
|
|
1071
|
+
setTimeout(() => setVerifyCooldown(false), 3e3);
|
|
1072
|
+
}
|
|
1073
|
+
try {
|
|
1074
|
+
await saveOrVerifyMutation.mutateAsync({
|
|
1075
|
+
channel,
|
|
1076
|
+
driver,
|
|
1077
|
+
config_json: configJson,
|
|
1078
|
+
action
|
|
1079
|
+
});
|
|
1080
|
+
const msg = action === "verify" ? t("messages.verifiedChannelSuccess", { channel }) : t("messages.savedChannelSuccess", { channel });
|
|
1081
|
+
_medusajs_ui.toast.success(msg);
|
|
1082
|
+
onStatus?.({
|
|
1083
|
+
type: "success",
|
|
1084
|
+
text: msg
|
|
1085
|
+
});
|
|
1086
|
+
await onRefresh();
|
|
1087
|
+
} catch (err) {
|
|
1088
|
+
const msg = err?.message || t("messages.channelActionError", {
|
|
1089
|
+
action,
|
|
1090
|
+
channel
|
|
1091
|
+
});
|
|
1092
|
+
_medusajs_ui.toast.error(msg);
|
|
1093
|
+
onStatus?.({
|
|
1094
|
+
type: "error",
|
|
1095
|
+
text: msg
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
};
|
|
1099
|
+
const tgVerified = Boolean(channelsConfig.find((c) => c.channel === "telegram")?.is_verified);
|
|
1100
|
+
const mainCards = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChannelsMainSection, {
|
|
1101
|
+
whatsappDriverInput,
|
|
1102
|
+
openWaUrlInput,
|
|
1103
|
+
telegramChannelInput,
|
|
1104
|
+
tgVerified,
|
|
1105
|
+
verifyCooldown,
|
|
1106
|
+
isPending: saveOrVerifyMutation.isPending,
|
|
1107
|
+
onWhatsappDriverChange: setWhatsappDriverInput,
|
|
1108
|
+
onOpenWaUrlChange: setOpenWaUrlInput,
|
|
1109
|
+
onTelegramChannelChange: setTelegramChannelInput,
|
|
1110
|
+
onSaveOrVerify: (ch, drv, cfg, act) => void handleSaveOrVerifyChannel(ch, drv, cfg, act)
|
|
1111
|
+
});
|
|
1112
|
+
const sideCard = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChannelsSideSection, {
|
|
1113
|
+
smsDriverInput,
|
|
1114
|
+
isPending: saveOrVerifyMutation.isPending,
|
|
1115
|
+
onSmsDriverChange: setSmsDriverInput,
|
|
1116
|
+
onSaveSms: () => void handleSaveOrVerifyChannel("sms", smsDriverInput, {}, "save")
|
|
1117
|
+
});
|
|
1118
|
+
if (section === "main") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Toaster, {}), mainCards] });
|
|
1119
|
+
if (section === "side") return sideCard;
|
|
1120
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1121
|
+
className: "grid grid-cols-1 gap-4 lg:grid-cols-3",
|
|
1122
|
+
children: [
|
|
1123
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Toaster, {}),
|
|
1124
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1125
|
+
className: "lg:col-span-2",
|
|
1126
|
+
children: mainCards
|
|
1127
|
+
}),
|
|
1128
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: sideCard })
|
|
1129
|
+
]
|
|
1130
|
+
});
|
|
1131
|
+
};
|
|
1132
|
+
var CHANNELS = [
|
|
1133
|
+
"email",
|
|
1134
|
+
"whatsapp",
|
|
1135
|
+
"telegram",
|
|
1136
|
+
"sms",
|
|
1137
|
+
"slack",
|
|
1138
|
+
"dummy"
|
|
1139
|
+
];
|
|
1140
|
+
var BLOCK_TYPES = [
|
|
1141
|
+
"section",
|
|
1142
|
+
"heading",
|
|
1143
|
+
"text",
|
|
1144
|
+
"row",
|
|
1145
|
+
"separator",
|
|
1146
|
+
"group",
|
|
1147
|
+
"repeater",
|
|
1148
|
+
"product-item",
|
|
1149
|
+
"button",
|
|
1150
|
+
"actions",
|
|
1151
|
+
"divider",
|
|
1152
|
+
"attachment"
|
|
1153
|
+
];
|
|
1154
|
+
var SUPPORTED_LOCALES = [
|
|
1155
|
+
"en",
|
|
1156
|
+
"es",
|
|
1157
|
+
"pl",
|
|
1158
|
+
"de",
|
|
1159
|
+
"fr",
|
|
1160
|
+
"pt",
|
|
1161
|
+
"it",
|
|
1162
|
+
"nl",
|
|
1163
|
+
"tr",
|
|
1164
|
+
"ar"
|
|
1165
|
+
];
|
|
1166
|
+
var CONTEXT_TYPES = [
|
|
1167
|
+
"order",
|
|
1168
|
+
"shipment",
|
|
1169
|
+
"product",
|
|
1170
|
+
"inventory-level",
|
|
1171
|
+
"customer",
|
|
1172
|
+
"cart",
|
|
1173
|
+
"document",
|
|
1174
|
+
"otp",
|
|
1175
|
+
"custom"
|
|
1176
|
+
];
|
|
1177
|
+
// src/admin/components/mpn/delivery-logs-tab.tsx
|
|
1178
|
+
var DeliveryLogsTab = ({ logs }) => {
|
|
1179
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
1180
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Container, {
|
|
1181
|
+
className: "divide-y p-0",
|
|
1182
|
+
children: [
|
|
1183
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Toaster, {}),
|
|
1184
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1185
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
1186
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
1187
|
+
level: "h2",
|
|
1188
|
+
children: t("logs.title")
|
|
1189
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.StatusBadge, {
|
|
1190
|
+
color: "green",
|
|
1191
|
+
children: logs.length
|
|
1192
|
+
})]
|
|
1193
|
+
}),
|
|
1194
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.SectionRow, {
|
|
1195
|
+
title: t("logs.colStatus"),
|
|
1196
|
+
value: logs.length
|
|
1197
|
+
}),
|
|
1198
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Header, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table.Row, { children: [
|
|
1199
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("logs.colEvent") }),
|
|
1200
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("logs.colChannel") }),
|
|
1201
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("logs.colRecipient") }),
|
|
1202
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("logs.colStatus") }),
|
|
1203
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("logs.colExternalId") })
|
|
1204
|
+
] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Body, { children: logs.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table.Row, { children: [
|
|
1205
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: row.event_name }),
|
|
1206
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
1207
|
+
size: "2xsmall",
|
|
1208
|
+
color: "blue",
|
|
1209
|
+
children: row.channel
|
|
1210
|
+
}) }),
|
|
1211
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: row.recipient_masked }),
|
|
1212
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.StatusBadge, {
|
|
1213
|
+
color: row.status === "sent" || row.status === "delivered" ? "green" : row.status === "failed" ? "red" : "orange",
|
|
1214
|
+
children: row.status
|
|
1215
|
+
}) }),
|
|
1216
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: row.external_message_id || "—" })
|
|
1217
|
+
] }, row.id)) })] })
|
|
1218
|
+
]
|
|
1219
|
+
});
|
|
1220
|
+
};
|
|
1221
|
+
// src/admin/components/mpn/event-mapping-form.tsx
|
|
1222
|
+
var EventMappingForm = ({ supportedEvents, templates, newMappingEvent, newMappingChannel, newMappingTemplateId, newMappingRecipientRule, newMappingAttachInvoice, newMappingThreadId, isSubmitting = false, onEventChange, onChannelChange, onTemplateChange, onRecipientRuleChange, onAttachInvoiceChange, onThreadIdChange, onSubmit }) => {
|
|
1223
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
1224
|
+
const form = (0, react_hook_form.useForm)({ defaultValues: {
|
|
1225
|
+
event_name: newMappingEvent,
|
|
1226
|
+
channel: newMappingChannel,
|
|
1227
|
+
template_id: newMappingTemplateId,
|
|
1228
|
+
recipient_rule: newMappingRecipientRule,
|
|
1229
|
+
telegram_thread_id: newMappingThreadId,
|
|
1230
|
+
attach_invoice: newMappingAttachInvoice
|
|
1231
|
+
} });
|
|
1232
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.Form, {
|
|
1233
|
+
...form,
|
|
1234
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_dashboard_components.KeyboundForm, {
|
|
1235
|
+
onSubmit: (e) => {
|
|
1236
|
+
e.preventDefault();
|
|
1237
|
+
onSubmit();
|
|
1238
|
+
},
|
|
1239
|
+
className: "px-6 py-4",
|
|
1240
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1241
|
+
className: "grid grid-cols-1 gap-4 md:grid-cols-5",
|
|
1242
|
+
children: [
|
|
1243
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1244
|
+
className: "flex flex-col gap-y-2",
|
|
1245
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
1246
|
+
size: "small",
|
|
1247
|
+
children: t("mappings.eventLabel")
|
|
1248
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select, {
|
|
1249
|
+
size: "small",
|
|
1250
|
+
value: newMappingEvent,
|
|
1251
|
+
onValueChange: onEventChange,
|
|
1252
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Trigger, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Value, {}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Content, { children: supportedEvents.map((ev) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1253
|
+
value: ev,
|
|
1254
|
+
children: ev
|
|
1255
|
+
}, ev)) })]
|
|
1256
|
+
})]
|
|
1257
|
+
}),
|
|
1258
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1259
|
+
className: "flex flex-col gap-y-2",
|
|
1260
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
1261
|
+
size: "small",
|
|
1262
|
+
children: t("mappings.channelLabel")
|
|
1263
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select, {
|
|
1264
|
+
size: "small",
|
|
1265
|
+
value: newMappingChannel,
|
|
1266
|
+
onValueChange: onChannelChange,
|
|
1267
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Trigger, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Value, {}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Content, { children: CHANNELS.map((ch) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1268
|
+
value: ch,
|
|
1269
|
+
children: ch.toUpperCase()
|
|
1270
|
+
}, ch)) })]
|
|
1271
|
+
})]
|
|
1272
|
+
}),
|
|
1273
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1274
|
+
className: "flex flex-col gap-y-2",
|
|
1275
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
1276
|
+
size: "small",
|
|
1277
|
+
children: t("mappings.templateLabel")
|
|
1278
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select, {
|
|
1279
|
+
size: "small",
|
|
1280
|
+
value: newMappingTemplateId,
|
|
1281
|
+
onValueChange: onTemplateChange,
|
|
1282
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Trigger, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Value, {}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Content, { children: templates.map((tpl) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select.Item, {
|
|
1283
|
+
value: tpl.id,
|
|
1284
|
+
children: [
|
|
1285
|
+
"[",
|
|
1286
|
+
tpl.channel,
|
|
1287
|
+
"] ",
|
|
1288
|
+
tpl.label
|
|
1289
|
+
]
|
|
1290
|
+
}, tpl.id)) })]
|
|
1291
|
+
})]
|
|
1292
|
+
}),
|
|
1293
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1294
|
+
className: "flex flex-col gap-y-2",
|
|
1295
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
1296
|
+
size: "small",
|
|
1297
|
+
children: t("mappings.recipientRuleLabel")
|
|
1298
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select, {
|
|
1299
|
+
size: "small",
|
|
1300
|
+
value: newMappingRecipientRule,
|
|
1301
|
+
onValueChange: onRecipientRuleChange,
|
|
1302
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Trigger, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Value, {}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select.Content, { children: [
|
|
1303
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1304
|
+
value: "customer_auto",
|
|
1305
|
+
children: t("mappings.ruleCustomerAuto")
|
|
1306
|
+
}),
|
|
1307
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1308
|
+
value: "order_email",
|
|
1309
|
+
children: t("mappings.ruleOrderEmail")
|
|
1310
|
+
}),
|
|
1311
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1312
|
+
value: "order_phone",
|
|
1313
|
+
children: t("mappings.ruleOrderPhone")
|
|
1314
|
+
}),
|
|
1315
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1316
|
+
value: "customer_telegram",
|
|
1317
|
+
children: t("mappings.ruleCustomerTelegram")
|
|
1318
|
+
}),
|
|
1319
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1320
|
+
value: "merchant_channel",
|
|
1321
|
+
children: t("mappings.ruleMerchantChannel")
|
|
1322
|
+
}),
|
|
1323
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1324
|
+
value: "b2b_accounting_contact",
|
|
1325
|
+
children: t("mappings.ruleB2bAccounting")
|
|
1326
|
+
})
|
|
1327
|
+
] })]
|
|
1328
|
+
})]
|
|
1329
|
+
}),
|
|
1330
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1331
|
+
className: "flex flex-col gap-y-2",
|
|
1332
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
1333
|
+
size: "small",
|
|
1334
|
+
children: t("mappings.threadIdLabel")
|
|
1335
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Input, {
|
|
1336
|
+
size: "small",
|
|
1337
|
+
placeholder: t("mappings.threadIdPlaceholder"),
|
|
1338
|
+
value: newMappingThreadId,
|
|
1339
|
+
onChange: (e) => onThreadIdChange(e.target.value)
|
|
1340
|
+
})]
|
|
1341
|
+
})
|
|
1342
|
+
]
|
|
1343
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1344
|
+
className: "mt-4 flex items-center justify-between",
|
|
1345
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1346
|
+
className: "flex items-center gap-x-2",
|
|
1347
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Switch, {
|
|
1348
|
+
checked: newMappingAttachInvoice,
|
|
1349
|
+
onCheckedChange: onAttachInvoiceChange
|
|
1350
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
1351
|
+
size: "small",
|
|
1352
|
+
children: t("mappings.attachInvoiceLabel")
|
|
1353
|
+
})]
|
|
1354
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Button, {
|
|
1355
|
+
size: "small",
|
|
1356
|
+
variant: "primary",
|
|
1357
|
+
type: "submit",
|
|
1358
|
+
isLoading: isSubmitting,
|
|
1359
|
+
children: t("mappings.addMappingButton")
|
|
1360
|
+
})]
|
|
1361
|
+
})]
|
|
1362
|
+
})
|
|
1363
|
+
});
|
|
1364
|
+
};
|
|
1365
|
+
// src/admin/components/mpn/event-mappings-tab.tsx
|
|
1366
|
+
var EventMappingsTab = ({ mappings, supportedEvents, templates, onRefresh, onStatus }) => {
|
|
1367
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
1368
|
+
const [newMappingEvent, setNewMappingEvent] = (0, react.useState)("order.placed");
|
|
1369
|
+
const [newMappingChannel, setNewMappingChannel] = (0, react.useState)("email");
|
|
1370
|
+
const [newMappingTemplateId, setNewMappingTemplateId] = (0, react.useState)("system_email_order_placed");
|
|
1371
|
+
const [newMappingRecipientRule, setNewMappingRecipientRule] = (0, react.useState)("customer_auto");
|
|
1372
|
+
const [newMappingAttachInvoice, setNewMappingAttachInvoice] = (0, react.useState)(false);
|
|
1373
|
+
const [newMappingThreadId, setNewMappingThreadId] = (0, react.useState)("");
|
|
1374
|
+
const createMappingMutation = useCreateMpnMapping();
|
|
1375
|
+
const deleteMappingMutation = useDeleteMpnMapping();
|
|
1376
|
+
const handleCreateMapping = async () => {
|
|
1377
|
+
try {
|
|
1378
|
+
await createMappingMutation.mutateAsync({
|
|
1379
|
+
event_name: newMappingEvent,
|
|
1380
|
+
channel: newMappingChannel,
|
|
1381
|
+
template_id: newMappingTemplateId,
|
|
1382
|
+
recipient_rule: newMappingRecipientRule,
|
|
1383
|
+
telegram_thread_id: newMappingThreadId ? Number(newMappingThreadId) : null,
|
|
1384
|
+
attach_document_types: newMappingAttachInvoice ? ["invoice"] : null,
|
|
1385
|
+
is_active: true
|
|
1386
|
+
});
|
|
1387
|
+
const msg = t("messages.createdMappingSuccess", {
|
|
1388
|
+
event: newMappingEvent,
|
|
1389
|
+
channel: newMappingChannel
|
|
1390
|
+
});
|
|
1391
|
+
_medusajs_ui.toast.success(msg);
|
|
1392
|
+
onStatus?.({
|
|
1393
|
+
type: "success",
|
|
1394
|
+
text: msg
|
|
1395
|
+
});
|
|
1396
|
+
await onRefresh();
|
|
1397
|
+
} catch {
|
|
1398
|
+
const msg = t("messages.createMappingError");
|
|
1399
|
+
_medusajs_ui.toast.error(msg);
|
|
1400
|
+
onStatus?.({
|
|
1401
|
+
type: "error",
|
|
1402
|
+
text: msg
|
|
1403
|
+
});
|
|
1404
|
+
}
|
|
1405
|
+
};
|
|
1406
|
+
const handleDeleteMapping = async (mappingId) => {
|
|
1407
|
+
try {
|
|
1408
|
+
await deleteMappingMutation.mutateAsync({ id: mappingId });
|
|
1409
|
+
await onRefresh();
|
|
1410
|
+
} catch {}
|
|
1411
|
+
};
|
|
1412
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Container, {
|
|
1413
|
+
className: "divide-y p-0",
|
|
1414
|
+
children: [
|
|
1415
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Toaster, {}),
|
|
1416
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1417
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
1418
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
1419
|
+
level: "h2",
|
|
1420
|
+
children: t("mappings.title")
|
|
1421
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.StatusBadge, {
|
|
1422
|
+
color: "green",
|
|
1423
|
+
children: mappings.length
|
|
1424
|
+
})]
|
|
1425
|
+
}),
|
|
1426
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.SectionRow, {
|
|
1427
|
+
title: t("mappings.eventLabel"),
|
|
1428
|
+
value: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
1429
|
+
size: "2xsmall",
|
|
1430
|
+
color: "grey",
|
|
1431
|
+
children: supportedEvents.length
|
|
1432
|
+
})
|
|
1433
|
+
}),
|
|
1434
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(EventMappingForm, {
|
|
1435
|
+
supportedEvents,
|
|
1436
|
+
templates,
|
|
1437
|
+
newMappingEvent,
|
|
1438
|
+
newMappingChannel,
|
|
1439
|
+
newMappingTemplateId,
|
|
1440
|
+
newMappingRecipientRule,
|
|
1441
|
+
newMappingAttachInvoice,
|
|
1442
|
+
newMappingThreadId,
|
|
1443
|
+
isSubmitting: createMappingMutation.isPending,
|
|
1444
|
+
onEventChange: setNewMappingEvent,
|
|
1445
|
+
onChannelChange: setNewMappingChannel,
|
|
1446
|
+
onTemplateChange: setNewMappingTemplateId,
|
|
1447
|
+
onRecipientRuleChange: setNewMappingRecipientRule,
|
|
1448
|
+
onAttachInvoiceChange: setNewMappingAttachInvoice,
|
|
1449
|
+
onThreadIdChange: setNewMappingThreadId,
|
|
1450
|
+
onSubmit: () => void handleCreateMapping()
|
|
1451
|
+
}),
|
|
1452
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Header, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table.Row, { children: [
|
|
1453
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("mappings.colEvent") }),
|
|
1454
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("mappings.colChannel") }),
|
|
1455
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("mappings.colTemplate") }),
|
|
1456
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("mappings.colRecipientRule") }),
|
|
1457
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("mappings.colAttachments") }),
|
|
1458
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("mappings.colAction") })
|
|
1459
|
+
] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Body, { children: mappings.map((m) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table.Row, { children: [
|
|
1460
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: m.event_name }),
|
|
1461
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
1462
|
+
size: "2xsmall",
|
|
1463
|
+
color: "blue",
|
|
1464
|
+
children: m.channel
|
|
1465
|
+
}) }),
|
|
1466
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: m.template_id }),
|
|
1467
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: m.recipient_rule }),
|
|
1468
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: Array.isArray(m.attach_document_types) ? m.attach_document_types.join(", ") : "—" }),
|
|
1469
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Button, {
|
|
1470
|
+
size: "small",
|
|
1471
|
+
variant: "secondary",
|
|
1472
|
+
isLoading: deleteMappingMutation.isPending,
|
|
1473
|
+
onClick: () => void handleDeleteMapping(m.id),
|
|
1474
|
+
children: t("mappings.deleteButton")
|
|
1475
|
+
}) })
|
|
1476
|
+
] }, m.id)) })] })
|
|
1477
|
+
]
|
|
1478
|
+
});
|
|
1479
|
+
};
|
|
1480
|
+
// src/admin/components/mpn/overview-cards.tsx
|
|
1481
|
+
var StatCard = ({ title, value, icon, loading = false, onClick }) => {
|
|
1482
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Container, {
|
|
1483
|
+
className: (0, _medusajs_ui.clx)("p-0", onClick ? "cursor-pointer hover:bg-ui-bg-subtle-hover transition-colors" : ""),
|
|
1484
|
+
onClick,
|
|
1485
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1486
|
+
className: "p-5",
|
|
1487
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1488
|
+
className: "flex items-center justify-between",
|
|
1489
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Text, {
|
|
1490
|
+
className: "text-ui-fg-subtle",
|
|
1491
|
+
children: title
|
|
1492
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1493
|
+
className: "flex items-center justify-center w-8 h-8 rounded-md bg-ui-bg-subtle",
|
|
1494
|
+
children: icon
|
|
1495
|
+
})]
|
|
1496
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1497
|
+
className: "mt-3",
|
|
1498
|
+
children: loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Skeleton, { className: "h-8 w-16" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
1499
|
+
level: "h2",
|
|
1500
|
+
children: value
|
|
1501
|
+
})
|
|
1502
|
+
})]
|
|
1503
|
+
})
|
|
1504
|
+
});
|
|
1505
|
+
};
|
|
1506
|
+
var NavigationCard = ({ icon, title, description, onClick, position }) => {
|
|
1507
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Button, {
|
|
1508
|
+
type: "button",
|
|
1509
|
+
variant: "transparent",
|
|
1510
|
+
className: (0, _medusajs_ui.clx)("h-auto w-full justify-start text-left p-6 hover:bg-ui-bg-subtle-hover transition-colors rounded-none", !(position === "bottom-left" || position === "bottom-right") ? "border-b border-ui-border-base" : "", position === "top-left" || position === "middle-left" || position === "bottom-left" ? "md:border-r md:border-ui-border-base" : ""),
|
|
1511
|
+
onClick,
|
|
1512
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1513
|
+
className: "flex items-start gap-x-3",
|
|
1514
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1515
|
+
className: "flex items-center justify-center w-8 h-8 rounded-md bg-ui-bg-subtle shrink-0",
|
|
1516
|
+
children: icon
|
|
1517
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
1518
|
+
level: "h3",
|
|
1519
|
+
children: title
|
|
1520
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Text, {
|
|
1521
|
+
className: "text-ui-fg-subtle mt-1",
|
|
1522
|
+
children: description
|
|
1523
|
+
})] })]
|
|
1524
|
+
})
|
|
1525
|
+
});
|
|
1526
|
+
};
|
|
1527
|
+
// src/admin/components/mpn/sandbox-tab.tsx
|
|
1528
|
+
var DummySandboxTab = ({ sandboxMessages, onRefresh }) => {
|
|
1529
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
1530
|
+
const clearSandboxMutation = useClearMpnSandbox();
|
|
1531
|
+
const handleClearSandbox = async () => {
|
|
1532
|
+
try {
|
|
1533
|
+
await clearSandboxMutation.mutateAsync();
|
|
1534
|
+
_medusajs_ui.toast.success(t("sandbox.clearButton"));
|
|
1535
|
+
await onRefresh();
|
|
1536
|
+
} catch (err) {
|
|
1537
|
+
_medusajs_ui.toast.error(err?.message || t("messages.loadStudioError"));
|
|
1538
|
+
}
|
|
1539
|
+
};
|
|
1540
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Container, {
|
|
1541
|
+
className: "divide-y p-0",
|
|
1542
|
+
children: [
|
|
1543
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Toaster, {}),
|
|
1544
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1545
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
1546
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
1547
|
+
level: "h2",
|
|
1548
|
+
children: t("sandbox.title")
|
|
1549
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Text, {
|
|
1550
|
+
className: "text-ui-fg-subtle text-xs mt-1",
|
|
1551
|
+
children: t("sandbox.subtitle")
|
|
1552
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Button, {
|
|
1553
|
+
size: "small",
|
|
1554
|
+
variant: "secondary",
|
|
1555
|
+
isLoading: clearSandboxMutation.isPending,
|
|
1556
|
+
onClick: () => void handleClearSandbox(),
|
|
1557
|
+
children: t("sandbox.clearButton")
|
|
1558
|
+
})]
|
|
1559
|
+
}),
|
|
1560
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.SectionRow, {
|
|
1561
|
+
title: t("sandbox.colOtp"),
|
|
1562
|
+
value: sandboxMessages.length
|
|
1563
|
+
}),
|
|
1564
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Header, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table.Row, { children: [
|
|
1565
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("sandbox.colChannel") }),
|
|
1566
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("sandbox.colRecipient") }),
|
|
1567
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("sandbox.colOtp") }),
|
|
1568
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.HeaderCell, { children: t("sandbox.colBody") })
|
|
1569
|
+
] }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Body, { children: sandboxMessages.map((msg) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table.Row, { children: [
|
|
1570
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
1571
|
+
size: "2xsmall",
|
|
1572
|
+
color: "blue",
|
|
1573
|
+
children: msg.channel
|
|
1574
|
+
}) }),
|
|
1575
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: msg.recipient }),
|
|
1576
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, { children: msg.otp_code ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.StatusBadge, {
|
|
1577
|
+
color: "green",
|
|
1578
|
+
children: msg.otp_code
|
|
1579
|
+
}) : "—" }),
|
|
1580
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, {
|
|
1581
|
+
className: "max-w-md truncate",
|
|
1582
|
+
children: msg.body
|
|
1583
|
+
})
|
|
1584
|
+
] }, msg.id)) })] })
|
|
1585
|
+
]
|
|
1586
|
+
});
|
|
1587
|
+
};
|
|
1588
|
+
// src/admin/components/mpn/template-preview-section.tsx
|
|
1589
|
+
var TemplatePreviewSection = ({ previewContextType, previewLocale, previewResult, onContextChange, onLocaleChange }) => {
|
|
1590
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
1591
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1592
|
+
className: "px-6 py-4",
|
|
1593
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1594
|
+
className: "mb-3 flex flex-wrap items-center justify-between gap-2",
|
|
1595
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
1596
|
+
level: "h3",
|
|
1597
|
+
children: t("templates.previewTitle", { locale: previewLocale.toUpperCase() })
|
|
1598
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1599
|
+
className: "flex items-center gap-x-2",
|
|
1600
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select, {
|
|
1601
|
+
size: "small",
|
|
1602
|
+
value: previewContextType,
|
|
1603
|
+
onValueChange: onContextChange,
|
|
1604
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Trigger, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Value, { placeholder: t("templates.contextPlaceholder") }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Content, { children: CONTEXT_TYPES.map((ct) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1605
|
+
value: ct,
|
|
1606
|
+
children: ct
|
|
1607
|
+
}, ct)) })]
|
|
1608
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select, {
|
|
1609
|
+
size: "small",
|
|
1610
|
+
value: previewLocale,
|
|
1611
|
+
onValueChange: onLocaleChange,
|
|
1612
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Trigger, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Value, { placeholder: t("templates.localePlaceholder") }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Content, { children: SUPPORTED_LOCALES.map((loc) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1613
|
+
value: loc,
|
|
1614
|
+
children: loc.toUpperCase()
|
|
1615
|
+
}, loc)) })]
|
|
1616
|
+
})]
|
|
1617
|
+
})]
|
|
1618
|
+
}), previewResult && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1619
|
+
className: "rounded border border-ui-border-base bg-ui-bg-subtle p-4",
|
|
1620
|
+
children: [
|
|
1621
|
+
previewResult.subject && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Text, {
|
|
1622
|
+
className: "font-semibold mb-2",
|
|
1623
|
+
children: t("templates.subjectPrefix", { subject: previewResult.subject })
|
|
1624
|
+
}),
|
|
1625
|
+
previewResult.sms_options && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1626
|
+
className: "mb-2 flex items-center gap-x-2",
|
|
1627
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
1628
|
+
size: "2xsmall",
|
|
1629
|
+
color: "green",
|
|
1630
|
+
children: t("templates.encodingBadge", { encoding: previewResult.sms_options.encoding })
|
|
1631
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
1632
|
+
size: "2xsmall",
|
|
1633
|
+
color: "blue",
|
|
1634
|
+
children: t("templates.segmentsBadge", {
|
|
1635
|
+
segments: previewResult.sms_options.segments,
|
|
1636
|
+
chars: previewResult.sms_options.character_count
|
|
1637
|
+
})
|
|
1638
|
+
})]
|
|
1639
|
+
}),
|
|
1640
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
1641
|
+
className: "whitespace-pre-wrap text-xs font-mono",
|
|
1642
|
+
children: previewResult.text
|
|
1643
|
+
}),
|
|
1644
|
+
previewResult.whatsapp_options?.buttons?.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1645
|
+
className: "mt-3 flex gap-x-2",
|
|
1646
|
+
children: previewResult.whatsapp_options.buttons.map((btn) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
1647
|
+
size: "2xsmall",
|
|
1648
|
+
color: "green",
|
|
1649
|
+
children: t("templates.waButtonPrefix", { title: btn.title })
|
|
1650
|
+
}, btn.id))
|
|
1651
|
+
}),
|
|
1652
|
+
previewResult.telegram_options?.inline_keyboard?.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1653
|
+
className: "mt-3 flex gap-x-2",
|
|
1654
|
+
children: previewResult.telegram_options.inline_keyboard.flat().map((btn, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
1655
|
+
size: "2xsmall",
|
|
1656
|
+
color: "blue",
|
|
1657
|
+
children: t("templates.tgInlinePrefix", { text: btn.text })
|
|
1658
|
+
}, i))
|
|
1659
|
+
})
|
|
1660
|
+
]
|
|
1661
|
+
})]
|
|
1662
|
+
});
|
|
1663
|
+
};
|
|
1664
|
+
// src/admin/components/mpn/template-editor-section.tsx
|
|
1665
|
+
var TemplateEditorSection = ({ selectedTemplate, selectedBlocks, previewContextType, previewLocale, previewResult, isSaving = false, onTemplateChange, onAddBlock, onRemoveBlock, onSaveTemplate, onContextChange, onLocaleChange }) => {
|
|
1666
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
1667
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Container, {
|
|
1668
|
+
className: "divide-y p-0 lg:col-span-7",
|
|
1669
|
+
children: selectedTemplate ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
1670
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1671
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
1672
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
1673
|
+
level: "h2",
|
|
1674
|
+
children: selectedTemplate.label
|
|
1675
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Text, {
|
|
1676
|
+
className: "text-ui-fg-subtle text-xs mt-1",
|
|
1677
|
+
children: [
|
|
1678
|
+
"ID: ",
|
|
1679
|
+
selectedTemplate.id,
|
|
1680
|
+
" (",
|
|
1681
|
+
selectedTemplate.channel,
|
|
1682
|
+
" /",
|
|
1683
|
+
" ",
|
|
1684
|
+
selectedTemplate.mode,
|
|
1685
|
+
")"
|
|
1686
|
+
]
|
|
1687
|
+
})] }), selectedTemplate.source === "db" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Button, {
|
|
1688
|
+
size: "small",
|
|
1689
|
+
variant: "primary",
|
|
1690
|
+
isLoading: isSaving,
|
|
1691
|
+
onClick: onSaveTemplate,
|
|
1692
|
+
children: t("templates.saveButton")
|
|
1693
|
+
})]
|
|
1694
|
+
}),
|
|
1695
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.SectionRow, {
|
|
1696
|
+
title: t("mappings.channelLabel"),
|
|
1697
|
+
value: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
1698
|
+
size: "2xsmall",
|
|
1699
|
+
color: "blue",
|
|
1700
|
+
children: selectedTemplate.channel
|
|
1701
|
+
})
|
|
1702
|
+
}),
|
|
1703
|
+
selectedTemplate.source === "db" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1704
|
+
className: "grid grid-cols-1 gap-4 px-6 py-4 md:grid-cols-2",
|
|
1705
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1706
|
+
className: "flex flex-col gap-y-2",
|
|
1707
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
1708
|
+
size: "small",
|
|
1709
|
+
children: t("templates.subjectLabel")
|
|
1710
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Input, {
|
|
1711
|
+
size: "small",
|
|
1712
|
+
value: selectedTemplate.subject || "",
|
|
1713
|
+
onChange: (e) => onTemplateChange({
|
|
1714
|
+
...selectedTemplate,
|
|
1715
|
+
subject: e.target.value
|
|
1716
|
+
})
|
|
1717
|
+
})]
|
|
1718
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1719
|
+
className: "flex flex-col gap-y-2",
|
|
1720
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
1721
|
+
size: "small",
|
|
1722
|
+
children: t("templates.metaTemplateLabel")
|
|
1723
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Input, {
|
|
1724
|
+
size: "small",
|
|
1725
|
+
value: selectedTemplate.meta_template_name || "",
|
|
1726
|
+
onChange: (e) => onTemplateChange({
|
|
1727
|
+
...selectedTemplate,
|
|
1728
|
+
meta_template_name: e.target.value
|
|
1729
|
+
})
|
|
1730
|
+
})]
|
|
1731
|
+
})]
|
|
1732
|
+
}),
|
|
1733
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1734
|
+
className: "px-6 py-4",
|
|
1735
|
+
children: selectedTemplate.mode === "raw" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1736
|
+
className: "flex flex-col gap-y-2",
|
|
1737
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
1738
|
+
size: "small",
|
|
1739
|
+
children: t("templates.rawContentLabel")
|
|
1740
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Textarea, {
|
|
1741
|
+
rows: 5,
|
|
1742
|
+
value: selectedTemplate.raw_content || "",
|
|
1743
|
+
disabled: selectedTemplate.source === "system",
|
|
1744
|
+
onChange: (e) => onTemplateChange({
|
|
1745
|
+
...selectedTemplate,
|
|
1746
|
+
raw_content: e.target.value
|
|
1747
|
+
})
|
|
1748
|
+
})]
|
|
1749
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1750
|
+
className: "mb-3 flex flex-wrap items-center justify-between gap-2",
|
|
1751
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Label, {
|
|
1752
|
+
size: "small",
|
|
1753
|
+
children: t("templates.blockTreeLabel", { count: selectedBlocks.length })
|
|
1754
|
+
}), selectedTemplate.source === "db" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1755
|
+
className: "flex flex-wrap gap-1",
|
|
1756
|
+
children: BLOCK_TYPES.slice(0, 6).map((bType) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Button, {
|
|
1757
|
+
size: "small",
|
|
1758
|
+
variant: "secondary",
|
|
1759
|
+
onClick: () => onAddBlock(bType),
|
|
1760
|
+
children: ["+ ", bType]
|
|
1761
|
+
}, bType))
|
|
1762
|
+
})]
|
|
1763
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1764
|
+
className: "flex flex-col gap-y-2",
|
|
1765
|
+
children: selectedBlocks.map((blk, idx) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1766
|
+
className: "flex items-center justify-between rounded border border-ui-border-base p-2.5",
|
|
1767
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1768
|
+
className: "flex items-center gap-x-2",
|
|
1769
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
1770
|
+
size: "2xsmall",
|
|
1771
|
+
color: "purple",
|
|
1772
|
+
children: blk.type
|
|
1773
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Text, {
|
|
1774
|
+
className: "text-xs",
|
|
1775
|
+
children: blk.metadata?.text || blk.metadata?.label || blk.metadata?.arrayKey || blk.metadata?.variant || "—"
|
|
1776
|
+
})]
|
|
1777
|
+
}), selectedTemplate.source === "db" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Button, {
|
|
1778
|
+
size: "small",
|
|
1779
|
+
variant: "transparent",
|
|
1780
|
+
onClick: () => onRemoveBlock(idx),
|
|
1781
|
+
children: t("templates.removeBlock")
|
|
1782
|
+
})]
|
|
1783
|
+
}, blk.id || idx))
|
|
1784
|
+
})] })
|
|
1785
|
+
}),
|
|
1786
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TemplatePreviewSection, {
|
|
1787
|
+
templateId: selectedTemplate.id,
|
|
1788
|
+
previewContextType,
|
|
1789
|
+
previewLocale,
|
|
1790
|
+
previewResult,
|
|
1791
|
+
onContextChange,
|
|
1792
|
+
onLocaleChange
|
|
1793
|
+
})
|
|
1794
|
+
] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1795
|
+
className: "px-6 py-8",
|
|
1796
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Text, {
|
|
1797
|
+
className: "text-ui-fg-subtle",
|
|
1798
|
+
children: t("templates.emptySelection")
|
|
1799
|
+
})
|
|
1800
|
+
})
|
|
1801
|
+
});
|
|
1802
|
+
};
|
|
1803
|
+
// src/admin/components/mpn/templates-list-section.tsx
|
|
1804
|
+
var TemplatesListSection = ({ templates, channelFilter, onChannelFilterChange, onSelectTemplate, onClonePreset, isCloning = false }) => {
|
|
1805
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
1806
|
+
const filteredTemplates = templates.filter((tpl) => channelFilter === "all" ? true : tpl.channel === channelFilter);
|
|
1807
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Container, {
|
|
1808
|
+
className: "divide-y p-0 lg:col-span-5",
|
|
1809
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1810
|
+
className: "flex items-center justify-between px-6 py-4",
|
|
1811
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
1812
|
+
level: "h2",
|
|
1813
|
+
children: t("templates.title")
|
|
1814
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1815
|
+
className: "w-40",
|
|
1816
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select, {
|
|
1817
|
+
size: "small",
|
|
1818
|
+
value: channelFilter,
|
|
1819
|
+
onValueChange: onChannelFilterChange,
|
|
1820
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Trigger, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Value, { placeholder: t("templates.filterChannel") }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Select.Content, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1821
|
+
value: "all",
|
|
1822
|
+
children: t("templates.allChannels")
|
|
1823
|
+
}), CHANNELS.map((ch) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Select.Item, {
|
|
1824
|
+
value: ch,
|
|
1825
|
+
children: ch.toUpperCase()
|
|
1826
|
+
}, ch))] })]
|
|
1827
|
+
})
|
|
1828
|
+
})]
|
|
1829
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Body, { children: filteredTemplates.map((tpl) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table.Row, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Table.Cell, {
|
|
1830
|
+
className: "py-3",
|
|
1831
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1832
|
+
className: "flex items-center gap-x-2",
|
|
1833
|
+
children: [
|
|
1834
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Badge, {
|
|
1835
|
+
size: "2xsmall",
|
|
1836
|
+
color: "blue",
|
|
1837
|
+
children: tpl.channel
|
|
1838
|
+
}),
|
|
1839
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.StatusBadge, {
|
|
1840
|
+
color: tpl.source === "system" ? "grey" : "green",
|
|
1841
|
+
children: tpl.source
|
|
1842
|
+
}),
|
|
1843
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Text, {
|
|
1844
|
+
size: "small",
|
|
1845
|
+
weight: "plus",
|
|
1846
|
+
children: tpl.label
|
|
1847
|
+
})
|
|
1848
|
+
]
|
|
1849
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Text, {
|
|
1850
|
+
className: "text-ui-fg-subtle text-xs mt-1",
|
|
1851
|
+
children: [
|
|
1852
|
+
tpl.name,
|
|
1853
|
+
" ·",
|
|
1854
|
+
" ",
|
|
1855
|
+
t("templates.modeLabel", { mode: tpl.mode })
|
|
1856
|
+
]
|
|
1857
|
+
})]
|
|
1858
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Table.Cell, {
|
|
1859
|
+
className: "py-3 text-right",
|
|
1860
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1861
|
+
className: "flex items-center justify-end gap-x-2",
|
|
1862
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Button, {
|
|
1863
|
+
size: "small",
|
|
1864
|
+
variant: "secondary",
|
|
1865
|
+
onClick: () => onSelectTemplate(tpl.id),
|
|
1866
|
+
children: t("templates.inspectPreview")
|
|
1867
|
+
}), tpl.source === "system" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Button, {
|
|
1868
|
+
size: "small",
|
|
1869
|
+
variant: "primary",
|
|
1870
|
+
isLoading: isCloning,
|
|
1871
|
+
onClick: () => onClonePreset(tpl.id),
|
|
1872
|
+
children: t("templates.cloneToDb")
|
|
1873
|
+
})]
|
|
1874
|
+
})
|
|
1875
|
+
})] }, tpl.id)) }) })]
|
|
1876
|
+
});
|
|
1877
|
+
};
|
|
1878
|
+
// src/admin/components/mpn/templates-tab.tsx
|
|
1879
|
+
var TemplatesBuilderTab = ({ templates, onRefresh, onStatus }) => {
|
|
1880
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
1881
|
+
const [channelFilter, setChannelFilter] = (0, react.useState)("all");
|
|
1882
|
+
const [selectedTemplate, setSelectedTemplate] = (0, react.useState)(null);
|
|
1883
|
+
const [selectedBlocks, setSelectedBlocks] = (0, react.useState)([]);
|
|
1884
|
+
const [previewContextType, setPreviewContextType] = (0, react.useState)("order");
|
|
1885
|
+
const [previewLocale, setPreviewLocale] = (0, react.useState)("en");
|
|
1886
|
+
const [previewResult, setPreviewResult] = (0, react.useState)(null);
|
|
1887
|
+
const renderPreviewMutation = useRenderMpnTemplatePreview();
|
|
1888
|
+
const cloneTemplateMutation = useCreateOrCloneMpnTemplate();
|
|
1889
|
+
const updateTemplateMutation = useUpdateMpnTemplate();
|
|
1890
|
+
const handlePreviewTemplate = async (templateId, contextType, locale) => {
|
|
1891
|
+
try {
|
|
1892
|
+
const data = await renderPreviewMutation.mutateAsync({
|
|
1893
|
+
template_id: templateId,
|
|
1894
|
+
context_type: contextType,
|
|
1895
|
+
locale,
|
|
1896
|
+
append_sms_consent_footer: true
|
|
1897
|
+
});
|
|
1898
|
+
setPreviewResult(data.rendered || null);
|
|
1899
|
+
} catch {}
|
|
1900
|
+
};
|
|
1901
|
+
const handleSelectTemplate = async (templateId) => {
|
|
1902
|
+
try {
|
|
1903
|
+
const data = await notificationsAdminSdk.getTemplate(templateId);
|
|
1904
|
+
setSelectedTemplate(data.template || null);
|
|
1905
|
+
setSelectedBlocks(data.flat_blocks || []);
|
|
1906
|
+
await handlePreviewTemplate(templateId, previewContextType, previewLocale);
|
|
1907
|
+
} catch {}
|
|
1908
|
+
};
|
|
1909
|
+
const handleClonePresetToDb = async (presetId) => {
|
|
1910
|
+
try {
|
|
1911
|
+
const data = await cloneTemplateMutation.mutateAsync({ clone_from_preset_id: presetId });
|
|
1912
|
+
const msg = t("messages.clonedPresetSuccess", { label: data.template?.label || presetId });
|
|
1913
|
+
_medusajs_ui.toast.success(msg);
|
|
1914
|
+
onStatus?.({
|
|
1915
|
+
type: "success",
|
|
1916
|
+
text: msg
|
|
1917
|
+
});
|
|
1918
|
+
await onRefresh();
|
|
1919
|
+
if (data.template?.id) await handleSelectTemplate(data.template.id);
|
|
1920
|
+
} catch {
|
|
1921
|
+
const msg = t("messages.clonePresetError");
|
|
1922
|
+
_medusajs_ui.toast.error(msg);
|
|
1923
|
+
onStatus?.({
|
|
1924
|
+
type: "error",
|
|
1925
|
+
text: msg
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1928
|
+
};
|
|
1929
|
+
const handleSaveDbTemplate = async () => {
|
|
1930
|
+
if (!selectedTemplate || selectedTemplate.source === "system") return;
|
|
1931
|
+
try {
|
|
1932
|
+
await updateTemplateMutation.mutateAsync({
|
|
1933
|
+
id: selectedTemplate.id,
|
|
1934
|
+
payload: {
|
|
1935
|
+
label: selectedTemplate.label,
|
|
1936
|
+
subject: selectedTemplate.subject,
|
|
1937
|
+
mode: selectedTemplate.mode,
|
|
1938
|
+
raw_content: selectedTemplate.raw_content,
|
|
1939
|
+
meta_template_name: selectedTemplate.meta_template_name,
|
|
1940
|
+
blocks: selectedBlocks
|
|
1941
|
+
}
|
|
1942
|
+
});
|
|
1943
|
+
const msg = t("messages.savedTemplateSuccess");
|
|
1944
|
+
_medusajs_ui.toast.success(msg);
|
|
1945
|
+
onStatus?.({
|
|
1946
|
+
type: "success",
|
|
1947
|
+
text: msg
|
|
1948
|
+
});
|
|
1949
|
+
await handlePreviewTemplate(selectedTemplate.id, previewContextType, previewLocale);
|
|
1950
|
+
await onRefresh();
|
|
1951
|
+
} catch {
|
|
1952
|
+
const msg = t("messages.saveTemplateError");
|
|
1953
|
+
_medusajs_ui.toast.error(msg);
|
|
1954
|
+
onStatus?.({
|
|
1955
|
+
type: "error",
|
|
1956
|
+
text: msg
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
};
|
|
1960
|
+
const handleAddBlock = (type) => {
|
|
1961
|
+
const nextPos = selectedBlocks.length;
|
|
1962
|
+
setSelectedBlocks([...selectedBlocks, {
|
|
1963
|
+
id: `blk_${Date.now()}`,
|
|
1964
|
+
type,
|
|
1965
|
+
position: nextPos,
|
|
1966
|
+
parent_id: null,
|
|
1967
|
+
metadata: type === "row" ? {
|
|
1968
|
+
label: "Field",
|
|
1969
|
+
value: "{{data.total_formatted}}"
|
|
1970
|
+
} : type === "button" || type === "actions" ? {
|
|
1971
|
+
text: "View Order",
|
|
1972
|
+
url: "{{data.order_url}}"
|
|
1973
|
+
} : { text: "New content block ({{data.first_name}})" }
|
|
1974
|
+
}]);
|
|
1975
|
+
};
|
|
1976
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1977
|
+
className: "grid grid-cols-1 gap-4 lg:grid-cols-12",
|
|
1978
|
+
children: [
|
|
1979
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Toaster, {}),
|
|
1980
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TemplatesListSection, {
|
|
1981
|
+
templates,
|
|
1982
|
+
channelFilter,
|
|
1983
|
+
onChannelFilterChange: setChannelFilter,
|
|
1984
|
+
onSelectTemplate: (id) => void handleSelectTemplate(id),
|
|
1985
|
+
onClonePreset: (id) => void handleClonePresetToDb(id),
|
|
1986
|
+
isCloning: cloneTemplateMutation.isPending
|
|
1987
|
+
}),
|
|
1988
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TemplateEditorSection, {
|
|
1989
|
+
selectedTemplate,
|
|
1990
|
+
selectedBlocks,
|
|
1991
|
+
previewContextType,
|
|
1992
|
+
previewLocale,
|
|
1993
|
+
previewResult,
|
|
1994
|
+
isSaving: updateTemplateMutation.isPending,
|
|
1995
|
+
onTemplateChange: setSelectedTemplate,
|
|
1996
|
+
onAddBlock: handleAddBlock,
|
|
1997
|
+
onRemoveBlock: (idx) => setSelectedBlocks(selectedBlocks.filter((_, i) => i !== idx)),
|
|
1998
|
+
onSaveTemplate: () => void handleSaveDbTemplate(),
|
|
1999
|
+
onContextChange: (val) => {
|
|
2000
|
+
setPreviewContextType(val);
|
|
2001
|
+
if (selectedTemplate?.id) handlePreviewTemplate(selectedTemplate.id, val, previewLocale);
|
|
2002
|
+
},
|
|
2003
|
+
onLocaleChange: (loc) => {
|
|
2004
|
+
setPreviewLocale(loc);
|
|
2005
|
+
if (selectedTemplate?.id) handlePreviewTemplate(selectedTemplate.id, previewContextType, loc);
|
|
2006
|
+
}
|
|
2007
|
+
})
|
|
2008
|
+
]
|
|
2009
|
+
});
|
|
2010
|
+
};
|
|
2011
|
+
// src/admin/components/mpn/use-notification-studio.ts
|
|
2012
|
+
function useNotificationStudio() {
|
|
2013
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
2014
|
+
const handleLoadError = (0, react.useCallback)(() => {
|
|
2015
|
+
_medusajs_ui.toast.error(t("messages.loadStudioError"));
|
|
2016
|
+
}, [t]);
|
|
2017
|
+
const { data: tplData, isLoading: templatesLoading } = useMpnTemplates(void 0, { onError: handleLoadError });
|
|
2018
|
+
const { data: mapData, isLoading: mappingsLoading } = useMpnMappings({ onError: handleLoadError });
|
|
2019
|
+
const { data: chData, isLoading: channelsLoading } = useMpnChannels({ onError: handleLoadError });
|
|
2020
|
+
const { data: logData, isLoading: logsLoading } = useMpnLogs({ limit: 50 }, { onError: handleLoadError });
|
|
2021
|
+
const { data: brcData, isLoading: broadcastsLoading } = useMpnBroadcasts({ onError: handleLoadError });
|
|
2022
|
+
const { data: sbxData, isLoading: sandboxLoading } = useMpnSandboxMessages({ limit: 50 }, { onError: handleLoadError });
|
|
2023
|
+
const setStatusBanner = (0, react.useCallback)((status) => {
|
|
2024
|
+
if (!status) return;
|
|
2025
|
+
if (status.type === "success") _medusajs_ui.toast.success(status.text);
|
|
2026
|
+
else _medusajs_ui.toast.error(status.text);
|
|
2027
|
+
}, []);
|
|
2028
|
+
const loadAllStudioData = (0, react.useCallback)(async () => {
|
|
2029
|
+
invalidateNotificationsQueries(notificationsQueryKeys.all);
|
|
2030
|
+
}, []);
|
|
2031
|
+
return {
|
|
2032
|
+
isLoading: templatesLoading || mappingsLoading || channelsLoading || logsLoading || broadcastsLoading || sandboxLoading,
|
|
2033
|
+
statusBanner: null,
|
|
2034
|
+
setStatusBanner,
|
|
2035
|
+
templates: tplData?.templates || [],
|
|
2036
|
+
mappings: mapData?.mappings || [],
|
|
2037
|
+
supportedEvents: mapData?.supported_events || [],
|
|
2038
|
+
channelsConfig: chData?.channels || [],
|
|
2039
|
+
logs: logData?.logs || [],
|
|
2040
|
+
broadcasts: brcData?.broadcasts || [],
|
|
2041
|
+
consentSummary: brcData?.consent_summary || null,
|
|
2042
|
+
sandboxMessages: sbxData?.messages || [],
|
|
2043
|
+
loadAllStudioData
|
|
2044
|
+
};
|
|
2045
|
+
}
|
|
2046
|
+
// src/admin/components/rbac-guard.tsx
|
|
2047
|
+
var CACHE_TTL_MS = 3e4;
|
|
2048
|
+
var cachedResult = null;
|
|
2049
|
+
var inflightPromise = null;
|
|
2050
|
+
function matchRbacPermission(granted, required, isSuperAdmin = false) {
|
|
2051
|
+
if (isSuperAdmin || !required) return true;
|
|
2052
|
+
if (granted.includes("*") || granted.includes("*:*") || granted.includes(required)) return true;
|
|
2053
|
+
const sep = required.includes(".") ? "." : required.includes(":") ? ":" : null;
|
|
2054
|
+
if (sep) {
|
|
2055
|
+
const ns = required.split(sep)[0];
|
|
2056
|
+
if (granted.includes(`${ns}.*`) || granted.includes(`${ns}:*`)) return true;
|
|
2057
|
+
}
|
|
2058
|
+
return false;
|
|
2059
|
+
}
|
|
2060
|
+
async function fetchRbacMe() {
|
|
2061
|
+
if (cachedResult && Date.now() - cachedResult.fetchedAt < CACHE_TTL_MS) return cachedResult;
|
|
2062
|
+
if (inflightPromise) return inflightPromise;
|
|
2063
|
+
inflightPromise = (async () => {
|
|
2064
|
+
try {
|
|
2065
|
+
const res = await fetch("/admin/rbac/me", {
|
|
2066
|
+
credentials: "include",
|
|
2067
|
+
headers: { Accept: "application/json" }
|
|
2068
|
+
});
|
|
2069
|
+
if (res.status === 404) {
|
|
2070
|
+
cachedResult = {
|
|
2071
|
+
rbacActive: false,
|
|
2072
|
+
isSuperAdmin: false,
|
|
2073
|
+
permissions: [],
|
|
2074
|
+
fetchedAt: Date.now()
|
|
2075
|
+
};
|
|
2076
|
+
return cachedResult;
|
|
2077
|
+
}
|
|
2078
|
+
if (!res.ok) {
|
|
2079
|
+
cachedResult = {
|
|
2080
|
+
rbacActive: true,
|
|
2081
|
+
isSuperAdmin: false,
|
|
2082
|
+
permissions: [],
|
|
2083
|
+
fetchedAt: Date.now()
|
|
2084
|
+
};
|
|
2085
|
+
return cachedResult;
|
|
2086
|
+
}
|
|
2087
|
+
const data = await res.json();
|
|
2088
|
+
cachedResult = {
|
|
2089
|
+
rbacActive: true,
|
|
2090
|
+
isSuperAdmin: Boolean(data?.isSuperAdmin),
|
|
2091
|
+
permissions: Array.isArray(data?.permissions) ? data.permissions : [],
|
|
2092
|
+
fetchedAt: Date.now()
|
|
2093
|
+
};
|
|
2094
|
+
return cachedResult;
|
|
2095
|
+
} catch {
|
|
2096
|
+
cachedResult = {
|
|
2097
|
+
rbacActive: false,
|
|
2098
|
+
isSuperAdmin: false,
|
|
2099
|
+
permissions: [],
|
|
2100
|
+
fetchedAt: Date.now()
|
|
2101
|
+
};
|
|
2102
|
+
return cachedResult;
|
|
2103
|
+
} finally {
|
|
2104
|
+
inflightPromise = null;
|
|
2105
|
+
}
|
|
2106
|
+
})();
|
|
2107
|
+
return inflightPromise;
|
|
2108
|
+
}
|
|
2109
|
+
function useRbacAccess() {
|
|
2110
|
+
const [state, setState] = (0, react.useState)(() => cachedResult && Date.now() - cachedResult.fetchedAt < CACHE_TTL_MS ? cachedResult : null);
|
|
2111
|
+
(0, react.useEffect)(() => {
|
|
2112
|
+
let active = true;
|
|
2113
|
+
fetchRbacMe().then((res) => {
|
|
2114
|
+
if (active) setState(res);
|
|
2115
|
+
});
|
|
2116
|
+
return () => {
|
|
2117
|
+
active = false;
|
|
2118
|
+
};
|
|
2119
|
+
}, []);
|
|
2120
|
+
if (!state) return {
|
|
2121
|
+
isLoading: true,
|
|
2122
|
+
rbacActive: false,
|
|
2123
|
+
hasPermission: () => false
|
|
2124
|
+
};
|
|
2125
|
+
return {
|
|
2126
|
+
isLoading: false,
|
|
2127
|
+
rbacActive: state.rbacActive,
|
|
2128
|
+
hasPermission: (permission) => {
|
|
2129
|
+
if (!state.rbacActive || !permission) return true;
|
|
2130
|
+
return matchRbacPermission(state.permissions, permission, state.isSuperAdmin);
|
|
2131
|
+
}
|
|
2132
|
+
};
|
|
2133
|
+
}
|
|
2134
|
+
var RbacGuard = ({ permission, children, hideOnDenied = false }) => {
|
|
2135
|
+
const { isLoading, hasPermission } = useRbacAccess();
|
|
2136
|
+
if (isLoading) return null;
|
|
2137
|
+
if (!hasPermission(permission)) {
|
|
2138
|
+
if (hideOnDenied) return null;
|
|
2139
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Container, {
|
|
2140
|
+
className: "flex flex-col gap-y-2 p-6",
|
|
2141
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
2142
|
+
level: "h2",
|
|
2143
|
+
children: "Access denied"
|
|
2144
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Text, {
|
|
2145
|
+
size: "small",
|
|
2146
|
+
className: "text-ui-fg-subtle",
|
|
2147
|
+
children: [
|
|
2148
|
+
"You do not have permission to view this section. (",
|
|
2149
|
+
permission,
|
|
2150
|
+
")"
|
|
2151
|
+
]
|
|
2152
|
+
})]
|
|
2153
|
+
});
|
|
2154
|
+
}
|
|
2155
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children });
|
|
2156
|
+
};
|
|
2157
|
+
// src/admin/routes/mpn/page.tsx
|
|
2158
|
+
var NotificationStudioOverviewPage = () => {
|
|
2159
|
+
const { t, i18n } = (0, react_i18next.useTranslation)();
|
|
2160
|
+
const navigate = (0, react_router_dom.useNavigate)();
|
|
2161
|
+
const { isLoading, templates, mappings, logs, sandboxMessages, loadAllStudioData } = useNotificationStudio();
|
|
2162
|
+
const isRtl = (i18n.resolvedLanguage || i18n.language || "").startsWith("ar");
|
|
2163
|
+
const handleRefresh = async () => {
|
|
2164
|
+
try {
|
|
2165
|
+
await loadAllStudioData();
|
|
2166
|
+
_medusajs_ui.toast.success(t("header.refresh"));
|
|
2167
|
+
} catch {
|
|
2168
|
+
_medusajs_ui.toast.error(t("messages.loadStudioError"));
|
|
2169
|
+
}
|
|
2170
|
+
};
|
|
2171
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer, {
|
|
2172
|
+
widgetsZonePrefix: "mpn.overview",
|
|
2173
|
+
preferredLayoutId: _medusajs_admin_shared.CORE_LAYOUT_IDS.SINGLE_COLUMN,
|
|
2174
|
+
sections: { main: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer.Entry, {
|
|
2175
|
+
id: "MpnOverviewDashboard",
|
|
2176
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2177
|
+
className: "flex flex-col gap-y-4",
|
|
2178
|
+
dir: isRtl ? "rtl" : "ltr",
|
|
2179
|
+
children: [
|
|
2180
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Toaster, {}),
|
|
2181
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2182
|
+
className: "flex flex-wrap items-center justify-between gap-4",
|
|
2183
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
2184
|
+
className: "font-sans font-medium h1-core",
|
|
2185
|
+
children: t("header.title")
|
|
2186
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Text, {
|
|
2187
|
+
className: "text-ui-fg-subtle mt-1",
|
|
2188
|
+
children: t("header.subtitle")
|
|
2189
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Button, {
|
|
2190
|
+
size: "small",
|
|
2191
|
+
variant: "secondary",
|
|
2192
|
+
onClick: () => void handleRefresh(),
|
|
2193
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_icons.ArrowPath, {}), t("header.refresh")]
|
|
2194
|
+
})]
|
|
2195
|
+
}),
|
|
2196
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2197
|
+
className: "grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4",
|
|
2198
|
+
children: [
|
|
2199
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatCard, {
|
|
2200
|
+
title: t("templates.title"),
|
|
2201
|
+
value: templates.length,
|
|
2202
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_icons.DocumentText, {}),
|
|
2203
|
+
loading: isLoading,
|
|
2204
|
+
onClick: () => navigate("/mpn/templates")
|
|
2205
|
+
}),
|
|
2206
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatCard, {
|
|
2207
|
+
title: t("mappings.title"),
|
|
2208
|
+
value: mappings.length,
|
|
2209
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_icons.Tag, {}),
|
|
2210
|
+
loading: isLoading,
|
|
2211
|
+
onClick: () => navigate("/mpn/mappings")
|
|
2212
|
+
}),
|
|
2213
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatCard, {
|
|
2214
|
+
title: t("logs.title"),
|
|
2215
|
+
value: logs.length,
|
|
2216
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_icons.CheckCircle, {}),
|
|
2217
|
+
loading: isLoading,
|
|
2218
|
+
onClick: () => navigate("/mpn/logs")
|
|
2219
|
+
}),
|
|
2220
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatCard, {
|
|
2221
|
+
title: t("sandbox.title"),
|
|
2222
|
+
value: sandboxMessages.length,
|
|
2223
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_icons.EnvelopeSolid, {}),
|
|
2224
|
+
loading: isLoading,
|
|
2225
|
+
onClick: () => navigate("/mpn/sandbox")
|
|
2226
|
+
})
|
|
2227
|
+
]
|
|
2228
|
+
}),
|
|
2229
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_medusajs_ui.Container, {
|
|
2230
|
+
className: "p-0 overflow-hidden",
|
|
2231
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2232
|
+
className: "px-6 py-5 border-b border-ui-border-base",
|
|
2233
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Heading, {
|
|
2234
|
+
level: "h2",
|
|
2235
|
+
children: t("nav.label")
|
|
2236
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_ui.Text, {
|
|
2237
|
+
className: "text-ui-fg-subtle mt-1",
|
|
2238
|
+
children: t("header.subtitle")
|
|
2239
|
+
})]
|
|
2240
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2241
|
+
className: "grid grid-cols-1 md:grid-cols-2",
|
|
2242
|
+
children: [
|
|
2243
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavigationCard, {
|
|
2244
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_icons.DocumentText, {}),
|
|
2245
|
+
title: t("tabs.templates", { count: templates.length }),
|
|
2246
|
+
description: t("templates.emptySelection"),
|
|
2247
|
+
onClick: () => navigate("/mpn/templates"),
|
|
2248
|
+
position: "top-left"
|
|
2249
|
+
}),
|
|
2250
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavigationCard, {
|
|
2251
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_icons.Tag, {}),
|
|
2252
|
+
title: t("tabs.mappings", { count: mappings.length }),
|
|
2253
|
+
description: t("mappings.title"),
|
|
2254
|
+
onClick: () => navigate("/mpn/mappings"),
|
|
2255
|
+
position: "top-right"
|
|
2256
|
+
}),
|
|
2257
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavigationCard, {
|
|
2258
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_icons.CogSixTooth, {}),
|
|
2259
|
+
title: t("tabs.channels"),
|
|
2260
|
+
description: t("channels.whatsappSubtitle"),
|
|
2261
|
+
onClick: () => navigate("/mpn/channels"),
|
|
2262
|
+
position: "middle-left"
|
|
2263
|
+
}),
|
|
2264
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavigationCard, {
|
|
2265
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_icons.CheckCircle, {}),
|
|
2266
|
+
title: t("tabs.logs", { count: logs.length }),
|
|
2267
|
+
description: t("logs.title"),
|
|
2268
|
+
onClick: () => navigate("/mpn/logs"),
|
|
2269
|
+
position: "middle-right"
|
|
2270
|
+
}),
|
|
2271
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavigationCard, {
|
|
2272
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_icons.Megaphone, {}),
|
|
2273
|
+
title: t("tabs.broadcasts"),
|
|
2274
|
+
description: t("broadcasts.title"),
|
|
2275
|
+
onClick: () => navigate("/mpn/broadcasts"),
|
|
2276
|
+
position: "bottom-left"
|
|
2277
|
+
}),
|
|
2278
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(NavigationCard, {
|
|
2279
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_icons.EnvelopeSolid, {}),
|
|
2280
|
+
title: t("tabs.sandbox", { count: sandboxMessages.length }),
|
|
2281
|
+
description: t("sandbox.subtitle"),
|
|
2282
|
+
onClick: () => navigate("/mpn/sandbox"),
|
|
2283
|
+
position: "bottom-right"
|
|
2284
|
+
})
|
|
2285
|
+
]
|
|
2286
|
+
})]
|
|
2287
|
+
})
|
|
2288
|
+
]
|
|
2289
|
+
})
|
|
2290
|
+
}) }
|
|
2291
|
+
});
|
|
2292
|
+
};
|
|
2293
|
+
var Breadcrumb$6 = () => {
|
|
2294
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
2295
|
+
return t("nav.label");
|
|
2296
|
+
};
|
|
2297
|
+
var config$6 = (0, _medusajs_admin_sdk.defineRouteConfig)({
|
|
2298
|
+
label: "Notifications",
|
|
2299
|
+
translationNs: "mpn",
|
|
2300
|
+
icon: _medusajs_icons.ChatBubbleLeftRight
|
|
2301
|
+
});
|
|
2302
|
+
var handle$6 = { breadcrumb: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Breadcrumb$6, {}) };
|
|
2303
|
+
var GuardedNotificationStudioOverviewPage = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RbacGuard, {
|
|
2304
|
+
permission: "notifications.read",
|
|
2305
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NotificationStudioOverviewPage, {})
|
|
2306
|
+
});
|
|
2307
|
+
// src/admin/routes/mpn/broadcasts/page.tsx
|
|
2308
|
+
var MpnBroadcastsPage = () => {
|
|
2309
|
+
const { broadcasts, consentSummary, templates, loadAllStudioData, setStatusBanner } = useNotificationStudio();
|
|
2310
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer, {
|
|
2311
|
+
widgetsZonePrefix: "mpn.broadcasts",
|
|
2312
|
+
preferredLayoutId: _medusajs_admin_shared.CORE_LAYOUT_IDS.TWO_COLUMN,
|
|
2313
|
+
sections: {
|
|
2314
|
+
main: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer.Entry, {
|
|
2315
|
+
id: "MpnBroadcastsMainSection",
|
|
2316
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BroadcastsConsentTab, {
|
|
2317
|
+
broadcasts,
|
|
2318
|
+
consentSummary,
|
|
2319
|
+
templates,
|
|
2320
|
+
onRefresh: loadAllStudioData,
|
|
2321
|
+
onStatus: setStatusBanner,
|
|
2322
|
+
section: "main"
|
|
2323
|
+
})
|
|
2324
|
+
}),
|
|
2325
|
+
side: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer.Entry, {
|
|
2326
|
+
id: "MpnBroadcastsSideSection",
|
|
2327
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BroadcastsConsentTab, {
|
|
2328
|
+
broadcasts,
|
|
2329
|
+
consentSummary,
|
|
2330
|
+
templates,
|
|
2331
|
+
onRefresh: loadAllStudioData,
|
|
2332
|
+
onStatus: setStatusBanner,
|
|
2333
|
+
section: "side"
|
|
2334
|
+
})
|
|
2335
|
+
})
|
|
2336
|
+
}
|
|
2337
|
+
});
|
|
2338
|
+
};
|
|
2339
|
+
var Breadcrumb$5 = () => {
|
|
2340
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
2341
|
+
return t("tabs.broadcasts");
|
|
2342
|
+
};
|
|
2343
|
+
var config$5 = (0, _medusajs_admin_sdk.defineRouteConfig)({
|
|
2344
|
+
label: "Broadcasts",
|
|
2345
|
+
translationNs: "mpn",
|
|
2346
|
+
icon: _medusajs_icons.Megaphone
|
|
2347
|
+
});
|
|
2348
|
+
var handle$5 = { breadcrumb: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Breadcrumb$5, {}) };
|
|
2349
|
+
var GuardedMpnBroadcastsPage = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RbacGuard, {
|
|
2350
|
+
permission: "notifications.read",
|
|
2351
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MpnBroadcastsPage, {})
|
|
2352
|
+
});
|
|
2353
|
+
// src/admin/routes/mpn/channels/page.tsx
|
|
2354
|
+
var MpnChannelsPage = () => {
|
|
2355
|
+
const { channelsConfig, loadAllStudioData, setStatusBanner } = useNotificationStudio();
|
|
2356
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer, {
|
|
2357
|
+
widgetsZonePrefix: "mpn.channels",
|
|
2358
|
+
preferredLayoutId: _medusajs_admin_shared.CORE_LAYOUT_IDS.TWO_COLUMN,
|
|
2359
|
+
sections: {
|
|
2360
|
+
main: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer.Entry, {
|
|
2361
|
+
id: "MpnChannelsMainSection",
|
|
2362
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChannelsConfigTab, {
|
|
2363
|
+
channelsConfig,
|
|
2364
|
+
onRefresh: loadAllStudioData,
|
|
2365
|
+
onStatus: setStatusBanner,
|
|
2366
|
+
section: "main"
|
|
2367
|
+
})
|
|
2368
|
+
}),
|
|
2369
|
+
side: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer.Entry, {
|
|
2370
|
+
id: "MpnChannelsSideSection",
|
|
2371
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChannelsConfigTab, {
|
|
2372
|
+
channelsConfig,
|
|
2373
|
+
onRefresh: loadAllStudioData,
|
|
2374
|
+
onStatus: setStatusBanner,
|
|
2375
|
+
section: "side"
|
|
2376
|
+
})
|
|
2377
|
+
})
|
|
2378
|
+
}
|
|
2379
|
+
});
|
|
2380
|
+
};
|
|
2381
|
+
var Breadcrumb$4 = () => {
|
|
2382
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
2383
|
+
return t("tabs.channels");
|
|
2384
|
+
};
|
|
2385
|
+
var config$4 = (0, _medusajs_admin_sdk.defineRouteConfig)({
|
|
2386
|
+
label: "Channels",
|
|
2387
|
+
translationNs: "mpn",
|
|
2388
|
+
icon: _medusajs_icons.CogSixTooth
|
|
2389
|
+
});
|
|
2390
|
+
var handle$4 = { breadcrumb: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Breadcrumb$4, {}) };
|
|
2391
|
+
var GuardedMpnChannelsPage = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RbacGuard, {
|
|
2392
|
+
permission: "notifications.read",
|
|
2393
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MpnChannelsPage, {})
|
|
2394
|
+
});
|
|
2395
|
+
// src/admin/routes/mpn/logs/page.tsx
|
|
2396
|
+
var MpnLogsPage = () => {
|
|
2397
|
+
const { logs } = useNotificationStudio();
|
|
2398
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer, {
|
|
2399
|
+
widgetsZonePrefix: "mpn.logs",
|
|
2400
|
+
preferredLayoutId: _medusajs_admin_shared.CORE_LAYOUT_IDS.SINGLE_COLUMN,
|
|
2401
|
+
sections: { main: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer.Entry, {
|
|
2402
|
+
id: "MpnLogsSection",
|
|
2403
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DeliveryLogsTab, { logs })
|
|
2404
|
+
}) }
|
|
2405
|
+
});
|
|
2406
|
+
};
|
|
2407
|
+
var Breadcrumb$3 = () => {
|
|
2408
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
2409
|
+
return t("logs.title");
|
|
2410
|
+
};
|
|
2411
|
+
var config$3 = (0, _medusajs_admin_sdk.defineRouteConfig)({
|
|
2412
|
+
label: "Delivery Logs",
|
|
2413
|
+
translationNs: "mpn",
|
|
2414
|
+
icon: _medusajs_icons.CheckCircle
|
|
2415
|
+
});
|
|
2416
|
+
var handle$3 = { breadcrumb: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Breadcrumb$3, {}) };
|
|
2417
|
+
var GuardedMpnLogsPage = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RbacGuard, {
|
|
2418
|
+
permission: "notifications.read",
|
|
2419
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MpnLogsPage, {})
|
|
2420
|
+
});
|
|
2421
|
+
// src/admin/routes/mpn/mappings/page.tsx
|
|
2422
|
+
var MpnMappingsPage = () => {
|
|
2423
|
+
const { mappings, supportedEvents, templates, loadAllStudioData, setStatusBanner } = useNotificationStudio();
|
|
2424
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer, {
|
|
2425
|
+
widgetsZonePrefix: "mpn.mappings",
|
|
2426
|
+
preferredLayoutId: _medusajs_admin_shared.CORE_LAYOUT_IDS.SINGLE_COLUMN,
|
|
2427
|
+
sections: { main: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer.Entry, {
|
|
2428
|
+
id: "MpnMappingsSection",
|
|
2429
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EventMappingsTab, {
|
|
2430
|
+
mappings,
|
|
2431
|
+
supportedEvents,
|
|
2432
|
+
templates,
|
|
2433
|
+
onRefresh: loadAllStudioData,
|
|
2434
|
+
onStatus: setStatusBanner
|
|
2435
|
+
})
|
|
2436
|
+
}) }
|
|
2437
|
+
});
|
|
2438
|
+
};
|
|
2439
|
+
var Breadcrumb$2 = () => {
|
|
2440
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
2441
|
+
return t("mappings.title");
|
|
2442
|
+
};
|
|
2443
|
+
var config$2 = (0, _medusajs_admin_sdk.defineRouteConfig)({
|
|
2444
|
+
label: "Event Mappings",
|
|
2445
|
+
translationNs: "mpn",
|
|
2446
|
+
icon: _medusajs_icons.Tag
|
|
2447
|
+
});
|
|
2448
|
+
var handle$2 = { breadcrumb: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Breadcrumb$2, {}) };
|
|
2449
|
+
var GuardedMpnMappingsPage = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RbacGuard, {
|
|
2450
|
+
permission: "notifications.read",
|
|
2451
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MpnMappingsPage, {})
|
|
2452
|
+
});
|
|
2453
|
+
// src/admin/routes/mpn/sandbox/page.tsx
|
|
2454
|
+
var MpnSandboxPage = () => {
|
|
2455
|
+
const { sandboxMessages, loadAllStudioData } = useNotificationStudio();
|
|
2456
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer, {
|
|
2457
|
+
widgetsZonePrefix: "mpn.sandbox",
|
|
2458
|
+
preferredLayoutId: _medusajs_admin_shared.CORE_LAYOUT_IDS.SINGLE_COLUMN,
|
|
2459
|
+
sections: { main: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer.Entry, {
|
|
2460
|
+
id: "MpnSandboxSection",
|
|
2461
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DummySandboxTab, {
|
|
2462
|
+
sandboxMessages,
|
|
2463
|
+
onRefresh: loadAllStudioData
|
|
2464
|
+
})
|
|
2465
|
+
}) }
|
|
2466
|
+
});
|
|
2467
|
+
};
|
|
2468
|
+
var Breadcrumb$1 = () => {
|
|
2469
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
2470
|
+
return t("sandbox.title");
|
|
2471
|
+
};
|
|
2472
|
+
var config$1 = (0, _medusajs_admin_sdk.defineRouteConfig)({
|
|
2473
|
+
label: "OTP Sandbox",
|
|
2474
|
+
translationNs: "mpn",
|
|
2475
|
+
icon: _medusajs_icons.EnvelopeSolid
|
|
2476
|
+
});
|
|
2477
|
+
var handle$1 = { breadcrumb: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Breadcrumb$1, {}) };
|
|
2478
|
+
var GuardedMpnSandboxPage = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RbacGuard, {
|
|
2479
|
+
permission: "notifications.read",
|
|
2480
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MpnSandboxPage, {})
|
|
2481
|
+
});
|
|
2482
|
+
// src/admin/routes/mpn/templates/page.tsx
|
|
2483
|
+
var MpnTemplatesPage = () => {
|
|
2484
|
+
const { templates, loadAllStudioData, setStatusBanner } = useNotificationStudio();
|
|
2485
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer, {
|
|
2486
|
+
widgetsZonePrefix: "mpn.templates",
|
|
2487
|
+
preferredLayoutId: _medusajs_admin_shared.CORE_LAYOUT_IDS.SINGLE_COLUMN,
|
|
2488
|
+
sections: { main: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_medusajs_dashboard_components.LayoutComposer.Entry, {
|
|
2489
|
+
id: "MpnTemplatesSection",
|
|
2490
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TemplatesBuilderTab, {
|
|
2491
|
+
templates,
|
|
2492
|
+
onRefresh: loadAllStudioData,
|
|
2493
|
+
onStatus: setStatusBanner
|
|
2494
|
+
})
|
|
2495
|
+
}) }
|
|
2496
|
+
});
|
|
2497
|
+
};
|
|
2498
|
+
var Breadcrumb = () => {
|
|
2499
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
2500
|
+
return t("templates.title");
|
|
2501
|
+
};
|
|
2502
|
+
var config = (0, _medusajs_admin_sdk.defineRouteConfig)({
|
|
2503
|
+
label: "Templates",
|
|
2504
|
+
translationNs: "mpn",
|
|
2505
|
+
icon: _medusajs_icons.DocumentText
|
|
2506
|
+
});
|
|
2507
|
+
var handle = { breadcrumb: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Breadcrumb, {}) };
|
|
2508
|
+
var GuardedMpnTemplatesPage = () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RbacGuard, {
|
|
2509
|
+
permission: "notifications.read",
|
|
2510
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MpnTemplatesPage, {})
|
|
2511
|
+
});
|
|
2512
|
+
// src/admin/i18n/index.ts
|
|
2513
|
+
var i18n_default = {
|
|
2514
|
+
ar: { translation: {
|
|
2515
|
+
nav: { "label": "الإشعارات" },
|
|
2516
|
+
header: {
|
|
2517
|
+
"title": "استوديو الإشعارات متعدد القنوات (البريد، واتساب/OpenWA، تيليجرام، SMS، سلاك)",
|
|
2518
|
+
"subtitle": "منشئ القوالب والكتل المرئية، ربط أحداث المتجر، بوابات الإرسال المتعددة، سجل الموافقات، وبيئة اختبار رموز التحقق OTP.",
|
|
2519
|
+
"languageLabel": "اللغة",
|
|
2520
|
+
"refresh": "تحديث الاستوديو",
|
|
2521
|
+
"successBadge": "نجاح",
|
|
2522
|
+
"errorBadge": "خطأ"
|
|
2523
|
+
},
|
|
2524
|
+
tabs: {
|
|
2525
|
+
"templates": "القوالب والمنشئ المرئي ({{count}})",
|
|
2526
|
+
"mappings": "ربط الأحداث ({{count}})",
|
|
2527
|
+
"channels": "القنوات (OpenWA / تيليجرام / SMS)",
|
|
2528
|
+
"logs": "سجلات التسليم ({{count}})",
|
|
2529
|
+
"broadcasts": "الحملات وسجل الموافقات",
|
|
2530
|
+
"sandbox": "صندوق اختبار OTP ({{count}})"
|
|
2531
|
+
},
|
|
2532
|
+
templates: {
|
|
2533
|
+
"title": "القوالب",
|
|
2534
|
+
"filterChannel": "تصفية حسب القناة",
|
|
2535
|
+
"allChannels": "جميع القنوات",
|
|
2536
|
+
"modeLabel": "الوضع: {{mode}}",
|
|
2537
|
+
"inspectPreview": "فحص / معاينة",
|
|
2538
|
+
"cloneToDb": "نسخ لقاعدة البيانات",
|
|
2539
|
+
"saveButton": "حفظ القالب والكتل",
|
|
2540
|
+
"subjectLabel": "عنوان الرسالة (البريد / الموضوع)",
|
|
2541
|
+
"metaTemplateLabel": "اسم قالب Meta WABA (واتساب الرسمي)",
|
|
2542
|
+
"rawContentLabel": "محتوى القالب النصي (يدعم {{data.*}} و {{translations.*}} و {{ .var }})",
|
|
2543
|
+
"blockTreeLabel": "شجرة الكتل المرئية ({{count}} كتل)",
|
|
2544
|
+
"removeBlock": "حذف",
|
|
2545
|
+
"previewTitle": "معاينة مباشرة متعددة القنوات ({{locale}})",
|
|
2546
|
+
"contextPlaceholder": "السياق",
|
|
2547
|
+
"localePlaceholder": "اللغة",
|
|
2548
|
+
"subjectPrefix": "الموضوع: {{subject}}",
|
|
2549
|
+
"encodingBadge": "الترميز: {{encoding}}",
|
|
2550
|
+
"segmentsBadge": "المقاطع: {{segments}} ({{chars}} حرف)",
|
|
2551
|
+
"waButtonPrefix": "[زر واتساب] {{title}}",
|
|
2552
|
+
"tgInlinePrefix": "[زر تيليجرام] {{text}}",
|
|
2553
|
+
"emptySelection": "اختر قالباً من القائمة لاستعراض شجرة الكتل أو نسخ قالب نظام أو معاينة المخرجات بجميع اللغات."
|
|
2554
|
+
},
|
|
2555
|
+
mappings: {
|
|
2556
|
+
"title": "إنشاء ربط: حدث ← قناة ← قالب",
|
|
2557
|
+
"eventLabel": "حدث متجر Medusa",
|
|
2558
|
+
"channelLabel": "القناة",
|
|
2559
|
+
"templateLabel": "القالب",
|
|
2560
|
+
"recipientRuleLabel": "قاعدة المستلم",
|
|
2561
|
+
"ruleCustomerAuto": "العميل تلقائياً",
|
|
2562
|
+
"ruleOrderEmail": "بريد الطلب",
|
|
2563
|
+
"ruleOrderPhone": "هاتف الطلب (E.164)",
|
|
2564
|
+
"ruleCustomerTelegram": "تيليجرام العميل المباشر",
|
|
2565
|
+
"ruleMerchantChannel": "قناة / مجموعة المتجر",
|
|
2566
|
+
"ruleB2bAccounting": "مسؤول المحاسبة B2B",
|
|
2567
|
+
"threadIdLabel": "معرّف موضوع تيليجرام Thread ID (اختياري)",
|
|
2568
|
+
"threadIdPlaceholder": "مثال: 42",
|
|
2569
|
+
"attachInvoiceLabel": "إرفاق فاتورة PDF تلقائياً من medusa-documents-plugin (للبريد وواتساب/OpenWA وتيليجرام)",
|
|
2570
|
+
"addMappingButton": "إضافة ربط نشط",
|
|
2571
|
+
"colEvent": "الحدث",
|
|
2572
|
+
"colChannel": "القناة",
|
|
2573
|
+
"colTemplate": "القالب",
|
|
2574
|
+
"colRecipientRule": "قاعدة المستلم",
|
|
2575
|
+
"colAttachments": "المرفقات",
|
|
2576
|
+
"colAction": "إجراء",
|
|
2577
|
+
"deleteButton": "حذف"
|
|
2578
|
+
},
|
|
2579
|
+
channels: {
|
|
2580
|
+
"whatsappTitle": "بوابة واتساب و OpenWA",
|
|
2581
|
+
"whatsappSubtitle": "التبديل بين واجهة Meta Cloud الرسمية (قوالب WABA) أو البوابات المستضافة ذاتياً OpenWA / WAHA / Evolution API.",
|
|
2582
|
+
"activeDriverLabel": "المشغّل النشط",
|
|
2583
|
+
"driverMetaCloud": "Meta Cloud API (واتساب الرسمي)",
|
|
2584
|
+
"driverOpenWa": "OpenWA (@open-wa/wa-automate REST)",
|
|
2585
|
+
"driverWaha": "WAHA (WhatsApp HTTP API)",
|
|
2586
|
+
"driverEvolution": "Evolution API v2",
|
|
2587
|
+
"gatewayUrlLabel": "رابط بوابة OpenWA / WAHA / Evolution",
|
|
2588
|
+
"saveWhatsappButton": "حفظ مشغّل واتساب",
|
|
2589
|
+
"telegramTitle": "إشعارات تيليجرام",
|
|
2590
|
+
"verifiedBadge": "موثّق",
|
|
2591
|
+
"unverifiedBadge": "غير موثّق",
|
|
2592
|
+
"telegramSubtitle": "إعداد المجموعة الفائقة للمتجر (-100... أو @channel). تغيير المعرّف يعيد ضبط التوثيق حتى تنجح رسالة الاختبار.",
|
|
2593
|
+
"merchantChannelLabel": "معرّف قناة / مجموعة المتجر",
|
|
2594
|
+
"merchantChannelPlaceholder": "-1001234567890 أو @my_store_alerts",
|
|
2595
|
+
"saveChannelIdButton": "حفظ معرّف القناة",
|
|
2596
|
+
"sendTestButton": "إرسال رسالة تجريبية",
|
|
2597
|
+
"smsTitle": "مشغّل الرسائل النصية SMS",
|
|
2598
|
+
"smsSubtitle": "اختر Twilio SMS/MMS أو Signal House (10DLC) أو MSG91 Flow أو SMSAPI أو بيئة الاختبار.",
|
|
2599
|
+
"smsDriverLabel": "مشغّل SMS",
|
|
2600
|
+
"driverTwilio": "Twilio (SMS / MMS + خدمة الرسائل)",
|
|
2601
|
+
"driverSignalHouse": "Signal House (10DLC واستعادة السلة)",
|
|
2602
|
+
"driverMsg91": "MSG91 Flow API",
|
|
2603
|
+
"driverSmsApi": "SMSAPI",
|
|
2604
|
+
"driverDummy": "بيئة اختبار OTP محلية",
|
|
2605
|
+
"saveSmsButton": "حفظ مشغّل SMS"
|
|
2606
|
+
},
|
|
2607
|
+
logs: {
|
|
2608
|
+
"title": "سجل التسليم المحمي (إخفاء البيانات الشخصية ومنع التكرار)",
|
|
2609
|
+
"colEvent": "الحدث",
|
|
2610
|
+
"colChannel": "القناة",
|
|
2611
|
+
"colRecipient": "المستلم (مخفي جزئياً)",
|
|
2612
|
+
"colStatus": "الحالة",
|
|
2613
|
+
"colExternalId": "المعرّف الخارجي"
|
|
2614
|
+
},
|
|
2615
|
+
broadcasts: {
|
|
2616
|
+
"title": "ملخص الموافقات (TCPA / 10DLC) وحملات البث للعملاء",
|
|
2617
|
+
"smsOptedIn": "مشتركو SMS: {{count}}",
|
|
2618
|
+
"whatsappOptedIn": "مشتركو واتساب: {{count}}",
|
|
2619
|
+
"telegramLinked": "تيليجرام مرتبط: {{count}}",
|
|
2620
|
+
"optedOut": "ألغوا الاشتراك (STOP): {{count}}",
|
|
2621
|
+
"campaignNameLabel": "اسم الحملة",
|
|
2622
|
+
"campaignNamePlaceholder": "عروض نهاية الأسبوع",
|
|
2623
|
+
"channelLabel": "القناة",
|
|
2624
|
+
"templateLabel": "القالب",
|
|
2625
|
+
"sendNowButton": "إرسال الحملة الآن",
|
|
2626
|
+
"colCampaign": "الحملة",
|
|
2627
|
+
"colChannel": "القناة",
|
|
2628
|
+
"colStatus": "الحالة",
|
|
2629
|
+
"colSentTotal": "المرسل / الإجمالي"
|
|
2630
|
+
},
|
|
2631
|
+
sandbox: {
|
|
2632
|
+
"title": "بيئة الاختبار المحلية للرسائل ورموز التحقق OTP",
|
|
2633
|
+
"subtitle": "التقاط رموز التحقق OTP وإشعارات الاختبار محلياً دون إرسال رسائل فعلية عبر شركات الاتصالات.",
|
|
2634
|
+
"clearButton": "مسح الرسائل الملتقطة",
|
|
2635
|
+
"colChannel": "القناة",
|
|
2636
|
+
"colRecipient": "المستلم",
|
|
2637
|
+
"colOtp": "رمز OTP المستخرج",
|
|
2638
|
+
"colBody": "نص الرسالة"
|
|
2639
|
+
},
|
|
2640
|
+
widget: {
|
|
2641
|
+
"title": "إشعارات الطلب متعددة القنوات ({{count}})",
|
|
2642
|
+
"subtitle": "إرسال أو إعادة إرسال بريد إلكتروني أو واتساب/OpenWA أو تيليجرام أو SMS لهذا الطلب (مع إرفاق فاتورة PDF اختيارياً).",
|
|
2643
|
+
"channelPlaceholder": "القناة",
|
|
2644
|
+
"templatePlaceholder": "القالب",
|
|
2645
|
+
"attachInvoiceLabel": "إرفاق فاتورة PDF (إن وجدت)",
|
|
2646
|
+
"sending": "جارٍ الإرسال...",
|
|
2647
|
+
"sendResendButton": "إرسال / إعادة إرسال الإشعار",
|
|
2648
|
+
"dispatchedSuccess": "تم إرسال إشعار {{channel}} بنجاح",
|
|
2649
|
+
"dispatchFailed": "تعذر إرسال الإشعار",
|
|
2650
|
+
"colChannel": "القناة",
|
|
2651
|
+
"colEventTemplate": "الحدث / القالب",
|
|
2652
|
+
"colRecipient": "المستلم",
|
|
2653
|
+
"colStatus": "الحالة"
|
|
2654
|
+
},
|
|
2655
|
+
messages: {
|
|
2656
|
+
"loadStudioError": "تعذر تحميل بيانات استوديو الإشعارات.",
|
|
2657
|
+
"clonedPresetSuccess": "تم نسخ القالب الافتراضي إلى قالب قابل للتعديل '{{label}}'.",
|
|
2658
|
+
"clonePresetError": "تعذر نسخ القالب الافتراضي.",
|
|
2659
|
+
"savedTemplateSuccess": "تم حفظ القالب وشجرة الكتل بنجاح.",
|
|
2660
|
+
"saveTemplateError": "تعذر حفظ القالب.",
|
|
2661
|
+
"createdMappingSuccess": "تم إنشاء ربط نشط للحدث '{{event}}' ← '{{channel}}'.",
|
|
2662
|
+
"createMappingError": "تعذر إنشاء ربط الحدث.",
|
|
2663
|
+
"verifiedChannelSuccess": "تم توثيق قناة '{{channel}}' وإرسال رسالة تجريبية.",
|
|
2664
|
+
"savedChannelSuccess": "تم حفظ إعدادات قناة '{{channel}}'.",
|
|
2665
|
+
"channelActionError": "فشل إجراء {{action}} لقناة {{channel}}",
|
|
2666
|
+
"broadcastSentSuccess": "تم إطلاق حملة البث للمستلمين المشتركين."
|
|
2667
|
+
}
|
|
2668
|
+
} },
|
|
2669
|
+
de: { translation: {
|
|
2670
|
+
nav: { "label": "Benachrichtigungen" },
|
|
2671
|
+
header: {
|
|
2672
|
+
"title": "Multi-Channel-Benachrichtigungsstudio (E-Mail, WhatsApp/OpenWA, Telegram, SMS, Slack)",
|
|
2673
|
+
"subtitle": "Visueller Block- & Raw-Vorlagen-Editor, DB-Ereigniszuordnungen, Multi-Driver-Gateways, Einwilligungsregister und Dummy-OTP-Sandbox.",
|
|
2674
|
+
"languageLabel": "Sprache",
|
|
2675
|
+
"refresh": "Studio aktualisieren",
|
|
2676
|
+
"successBadge": "ERFOLG",
|
|
2677
|
+
"errorBadge": "FEHLER"
|
|
2678
|
+
},
|
|
2679
|
+
tabs: {
|
|
2680
|
+
"templates": "Vorlagen & Visueller Editor ({{count}})",
|
|
2681
|
+
"mappings": "Ereigniszuordnungen ({{count}})",
|
|
2682
|
+
"channels": "Kanäle (OpenWA / Telegram / SMS)",
|
|
2683
|
+
"logs": "Zustellprotokolle ({{count}})",
|
|
2684
|
+
"broadcasts": "Broadcasts & Einwilligungen",
|
|
2685
|
+
"sandbox": "Dummy-OTP-Sandbox ({{count}})"
|
|
2686
|
+
},
|
|
2687
|
+
templates: {
|
|
2688
|
+
"title": "Vorlagen",
|
|
2689
|
+
"filterChannel": "Kanal filtern",
|
|
2690
|
+
"allChannels": "Alle Kanäle",
|
|
2691
|
+
"modeLabel": "Modus: {{mode}}",
|
|
2692
|
+
"inspectPreview": "Prüfen / Vorschau",
|
|
2693
|
+
"cloneToDb": "In DB klonen",
|
|
2694
|
+
"saveButton": "Vorlage & Blöcke speichern",
|
|
2695
|
+
"subjectLabel": "Betreffzeile (E-Mail / Titel)",
|
|
2696
|
+
"metaTemplateLabel": "Meta WABA-Vorlagenname (WhatsApp Cloud)",
|
|
2697
|
+
"rawContentLabel": "Raw-Vorlageninhalt (unterstützt {{data.*}}, {{translations.*}} und {{ .var }})",
|
|
2698
|
+
"blockTreeLabel": "Visueller Blockbaum ({{count}} Blöcke)",
|
|
2699
|
+
"removeBlock": "Entfernen",
|
|
2700
|
+
"previewTitle": "Live-Multi-Channel-Vorschau ({{locale}})",
|
|
2701
|
+
"contextPlaceholder": "Kontext",
|
|
2702
|
+
"localePlaceholder": "Sprache",
|
|
2703
|
+
"subjectPrefix": "Betreff: {{subject}}",
|
|
2704
|
+
"encodingBadge": "Kodierung: {{encoding}}",
|
|
2705
|
+
"segmentsBadge": "Segmente: {{segments}} ({{chars}} Zeichen)",
|
|
2706
|
+
"waButtonPrefix": "[WA-Button] {{title}}",
|
|
2707
|
+
"tgInlinePrefix": "[TG-Inline] {{text}}",
|
|
2708
|
+
"emptySelection": "Wählen Sie links eine Vorlage aus, um den Blockbaum zu prüfen, eine Systemvorlage zu klonen oder die Vorschau anzuzeigen."
|
|
2709
|
+
},
|
|
2710
|
+
mappings: {
|
|
2711
|
+
"title": "Ereignis → Kanal → Vorlagen-Zuordnung erstellen",
|
|
2712
|
+
"eventLabel": "Medusa Store-Ereignis",
|
|
2713
|
+
"channelLabel": "Kanal",
|
|
2714
|
+
"templateLabel": "Vorlage",
|
|
2715
|
+
"recipientRuleLabel": "Empfängerregel",
|
|
2716
|
+
"ruleCustomerAuto": "Kunde Automatisch",
|
|
2717
|
+
"ruleOrderEmail": "Bestell-E-Mail",
|
|
2718
|
+
"ruleOrderPhone": "Bestelltelefon (E.164)",
|
|
2719
|
+
"ruleCustomerTelegram": "Kunden-Telegram-DM",
|
|
2720
|
+
"ruleMerchantChannel": "Händlerkanal / Gruppe",
|
|
2721
|
+
"ruleB2bAccounting": "B2B-Buchhaltungskontakt",
|
|
2722
|
+
"threadIdLabel": "Telegram-Thema Thread-ID (Optional)",
|
|
2723
|
+
"threadIdPlaceholder": "z. B. 42",
|
|
2724
|
+
"attachInvoiceLabel": "PDF-Rechnung aus medusa-documents-plugin automatisch anhängen (E-Mail, WhatsApp/OpenWA & Telegram)",
|
|
2725
|
+
"addMappingButton": "Aktive Zuordnung hinzufügen",
|
|
2726
|
+
"colEvent": "Ereignis",
|
|
2727
|
+
"colChannel": "Kanal",
|
|
2728
|
+
"colTemplate": "Vorlage",
|
|
2729
|
+
"colRecipientRule": "Empfängerregel",
|
|
2730
|
+
"colAttachments": "Anhänge",
|
|
2731
|
+
"colAction": "Aktion",
|
|
2732
|
+
"deleteButton": "Löschen"
|
|
2733
|
+
},
|
|
2734
|
+
channels: {
|
|
2735
|
+
"whatsappTitle": "WhatsApp & OpenWA Gateway",
|
|
2736
|
+
"whatsappSubtitle": "Wechseln Sie zwischen der offiziellen Meta Cloud API (WABA-Vorlagen) und selbst gehostetem OpenWA / WAHA / Evolution API.",
|
|
2737
|
+
"activeDriverLabel": "Aktiver Treiber",
|
|
2738
|
+
"driverMetaCloud": "Meta Cloud API (Offizielles WABA)",
|
|
2739
|
+
"driverOpenWa": "OpenWA (@open-wa/wa-automate REST)",
|
|
2740
|
+
"driverWaha": "WAHA (WhatsApp HTTP API)",
|
|
2741
|
+
"driverEvolution": "Evolution API v2",
|
|
2742
|
+
"gatewayUrlLabel": "OpenWA / WAHA / Evolution Gateway-URL",
|
|
2743
|
+
"saveWhatsappButton": "WhatsApp-Treiber speichern",
|
|
2744
|
+
"telegramTitle": "Telegram-Benachrichtigungen",
|
|
2745
|
+
"verifiedBadge": "Verifiziert",
|
|
2746
|
+
"unverifiedBadge": "Nicht verifiziert",
|
|
2747
|
+
"telegramSubtitle": "Konfigurieren Sie die Händler-Supergruppe (-100... oder @kanal). Das Ändern der ID setzt die Verifizierung zurück.",
|
|
2748
|
+
"merchantChannelLabel": "Händlerkanal / Supergruppen-ID",
|
|
2749
|
+
"merchantChannelPlaceholder": "-1001234567890 oder @my_store_alerts",
|
|
2750
|
+
"saveChannelIdButton": "Kanal-ID speichern",
|
|
2751
|
+
"sendTestButton": "Testnachricht senden",
|
|
2752
|
+
"smsTitle": "SMS-Anbietertreiber",
|
|
2753
|
+
"smsSubtitle": "Wählen Sie Twilio SMS/MMS, Signal House (10DLC), MSG91 Flow, SMSAPI oder Dummy-Sandbox.",
|
|
2754
|
+
"smsDriverLabel": "SMS-Treiber",
|
|
2755
|
+
"driverTwilio": "Twilio (SMS / MMS + Messaging Service)",
|
|
2756
|
+
"driverSignalHouse": "Signal House (10DLC & Warenkorbrettung)",
|
|
2757
|
+
"driverMsg91": "MSG91 Flow API",
|
|
2758
|
+
"driverSmsApi": "SMSAPI",
|
|
2759
|
+
"driverDummy": "Dummy-OTP-Sandbox (Test)",
|
|
2760
|
+
"saveSmsButton": "SMS-Treiber speichern"
|
|
2761
|
+
},
|
|
2762
|
+
logs: {
|
|
2763
|
+
"title": "Geschwärztes Zustellprotokoll (PII-maskiert & Idempotent)",
|
|
2764
|
+
"colEvent": "Ereignis",
|
|
2765
|
+
"colChannel": "Kanal",
|
|
2766
|
+
"colRecipient": "Empfänger (Maskiert)",
|
|
2767
|
+
"colStatus": "Status",
|
|
2768
|
+
"colExternalId": "Externe ID"
|
|
2769
|
+
},
|
|
2770
|
+
broadcasts: {
|
|
2771
|
+
"title": "TCPA / 10DLC Einwilligungsübersicht & Kundengruppen-Broadcasts",
|
|
2772
|
+
"smsOptedIn": "SMS Opt-In: {{count}}",
|
|
2773
|
+
"whatsappOptedIn": "WhatsApp Opt-In: {{count}}",
|
|
2774
|
+
"telegramLinked": "Telegram Verknüpft: {{count}}",
|
|
2775
|
+
"optedOut": "Abgemeldet (STOP): {{count}}",
|
|
2776
|
+
"campaignNameLabel": "Kampagnenname",
|
|
2777
|
+
"campaignNamePlaceholder": "Wochenend-Flash-Sale",
|
|
2778
|
+
"channelLabel": "Kanal",
|
|
2779
|
+
"templateLabel": "Vorlage",
|
|
2780
|
+
"sendNowButton": "Broadcast jetzt senden",
|
|
2781
|
+
"colCampaign": "Kampagne",
|
|
2782
|
+
"colChannel": "Kanal",
|
|
2783
|
+
"colStatus": "Status",
|
|
2784
|
+
"colSentTotal": "Gesendet / Gesamt"
|
|
2785
|
+
},
|
|
2786
|
+
sandbox: {
|
|
2787
|
+
"title": "Dummy-SMS / OTP & Multi-Channel-Sandbox",
|
|
2788
|
+
"subtitle": "Erfasst OTP-Verifizierungscodes und Testbenachrichtigungen lokal ohne echten Versand.",
|
|
2789
|
+
"clearButton": "Erfasste Nachrichten löschen",
|
|
2790
|
+
"colChannel": "Kanal",
|
|
2791
|
+
"colRecipient": "Empfänger",
|
|
2792
|
+
"colOtp": "Extrahierter OTP",
|
|
2793
|
+
"colBody": "Nachrichtentext"
|
|
2794
|
+
},
|
|
2795
|
+
widget: {
|
|
2796
|
+
"title": "Multi-Channel-Bestellbenachrichtigungen ({{count}})",
|
|
2797
|
+
"subtitle": "Senden oder wiederholen Sie E-Mail, WhatsApp/OpenWA, Telegram oder SMS für diese Bestellung (optional mit PDF-Rechnung).",
|
|
2798
|
+
"channelPlaceholder": "Kanal",
|
|
2799
|
+
"templatePlaceholder": "Vorlage",
|
|
2800
|
+
"attachInvoiceLabel": "PDF-Rechnung anhängen (falls vorhanden)",
|
|
2801
|
+
"sending": "Wird gesendet...",
|
|
2802
|
+
"sendResendButton": "Benachrichtigung senden / erneut senden",
|
|
2803
|
+
"dispatchedSuccess": "{{channel}}-Benachrichtigung gesendet",
|
|
2804
|
+
"dispatchFailed": "Benachrichtigung konnte nicht gesendet werden",
|
|
2805
|
+
"colChannel": "Kanal",
|
|
2806
|
+
"colEventTemplate": "Ereignis / Vorlage",
|
|
2807
|
+
"colRecipient": "Empfänger",
|
|
2808
|
+
"colStatus": "Status"
|
|
2809
|
+
},
|
|
2810
|
+
messages: {
|
|
2811
|
+
"loadStudioError": "Notification Studio-Daten konnten nicht geladen werden.",
|
|
2812
|
+
"clonedPresetSuccess": "Systemvorlage in bearbeitbare DB-Vorlage '{{label}}' geklont.",
|
|
2813
|
+
"clonePresetError": "Systemvorlage konnte nicht geklont werden.",
|
|
2814
|
+
"savedTemplateSuccess": "Vorlage & Blockbaum gespeichert.",
|
|
2815
|
+
"saveTemplateError": "Vorlage konnte nicht gespeichert werden.",
|
|
2816
|
+
"createdMappingSuccess": "Aktive Zuordnung für '{{event}}' -> '{{channel}}' erstellt.",
|
|
2817
|
+
"createMappingError": "Ereigniszuordnung konnte nicht erstellt werden.",
|
|
2818
|
+
"verifiedChannelSuccess": "Kanal '{{channel}}' verifiziert und Testnachricht gesendet.",
|
|
2819
|
+
"savedChannelSuccess": "Konfiguration für '{{channel}}' gespeichert.",
|
|
2820
|
+
"channelActionError": "Aktion {{action}} für {{channel}} fehlgeschlagen",
|
|
2821
|
+
"broadcastSentSuccess": "Broadcast-Kampagne an Opt-In-Empfänger gesendet."
|
|
2822
|
+
}
|
|
2823
|
+
} },
|
|
2824
|
+
en: { translation: {
|
|
2825
|
+
nav: { "label": "Notifications" },
|
|
2826
|
+
header: {
|
|
2827
|
+
"title": "Multi-Channel Notification Studio (Email, WhatsApp/OpenWA, Telegram, SMS, Slack)",
|
|
2828
|
+
"subtitle": "Visual Block & Raw Template Builder, DB Event Mappings, Multi-Driver Gateways, Consent Ledger, and Dummy OTP Sandbox.",
|
|
2829
|
+
"languageLabel": "Language",
|
|
2830
|
+
"refresh": "Refresh Studio",
|
|
2831
|
+
"successBadge": "SUCCESS",
|
|
2832
|
+
"errorBadge": "ERROR"
|
|
2833
|
+
},
|
|
2834
|
+
tabs: {
|
|
2835
|
+
"templates": "Templates & Visual Builder ({{count}})",
|
|
2836
|
+
"mappings": "Event Mappings ({{count}})",
|
|
2837
|
+
"channels": "Channels (OpenWA / Telegram / SMS)",
|
|
2838
|
+
"logs": "Delivery Logs ({{count}})",
|
|
2839
|
+
"broadcasts": "Broadcasts & Consent Ledger",
|
|
2840
|
+
"sandbox": "Dummy OTP Sandbox ({{count}})"
|
|
2841
|
+
},
|
|
2842
|
+
templates: {
|
|
2843
|
+
"title": "Templates",
|
|
2844
|
+
"filterChannel": "Filter Channel",
|
|
2845
|
+
"allChannels": "All Channels",
|
|
2846
|
+
"modeLabel": "Mode: {{mode}}",
|
|
2847
|
+
"inspectPreview": "Inspect / Preview",
|
|
2848
|
+
"cloneToDb": "Clone to DB",
|
|
2849
|
+
"saveButton": "Save Template & Blocks",
|
|
2850
|
+
"subjectLabel": "Subject Line (Email / Title)",
|
|
2851
|
+
"metaTemplateLabel": "Meta WABA Template Name (WhatsApp Cloud)",
|
|
2852
|
+
"rawContentLabel": "Raw Template Content (supports {{data.*}}, {{translations.*}}, and {{ .var }})",
|
|
2853
|
+
"blockTreeLabel": "Visual Block Tree ({{count}} blocks)",
|
|
2854
|
+
"removeBlock": "Remove",
|
|
2855
|
+
"previewTitle": "Live Multi-Channel Preview ({{locale}})",
|
|
2856
|
+
"contextPlaceholder": "Context",
|
|
2857
|
+
"localePlaceholder": "Locale",
|
|
2858
|
+
"subjectPrefix": "Subject: {{subject}}",
|
|
2859
|
+
"encodingBadge": "Encoding: {{encoding}}",
|
|
2860
|
+
"segmentsBadge": "Segments: {{segments}} ({{chars}} chars)",
|
|
2861
|
+
"waButtonPrefix": "[WA Button] {{title}}",
|
|
2862
|
+
"tgInlinePrefix": "[TG Inline] {{text}}",
|
|
2863
|
+
"emptySelection": "Select a template on the left to inspect its block tree, clone a system preset, or preview its rendered output across locales."
|
|
2864
|
+
},
|
|
2865
|
+
mappings: {
|
|
2866
|
+
"title": "Create Event → Channel → Template Mapping",
|
|
2867
|
+
"eventLabel": "Medusa Store Event",
|
|
2868
|
+
"channelLabel": "Channel",
|
|
2869
|
+
"templateLabel": "Template",
|
|
2870
|
+
"recipientRuleLabel": "Recipient Rule",
|
|
2871
|
+
"ruleCustomerAuto": "Customer Auto",
|
|
2872
|
+
"ruleOrderEmail": "Order Email",
|
|
2873
|
+
"ruleOrderPhone": "Order Phone (E.164)",
|
|
2874
|
+
"ruleCustomerTelegram": "Customer Telegram DM",
|
|
2875
|
+
"ruleMerchantChannel": "Merchant Channel / Group",
|
|
2876
|
+
"ruleB2bAccounting": "B2B Accounting Contact",
|
|
2877
|
+
"threadIdLabel": "Telegram Topic Thread ID (Optional)",
|
|
2878
|
+
"threadIdPlaceholder": "e.g. 42",
|
|
2879
|
+
"attachInvoiceLabel": "Auto-attach PDF Invoice from medusa-documents-plugin (Email, WhatsApp/OpenWA & Telegram)",
|
|
2880
|
+
"addMappingButton": "Add Active Mapping",
|
|
2881
|
+
"colEvent": "Event",
|
|
2882
|
+
"colChannel": "Channel",
|
|
2883
|
+
"colTemplate": "Template",
|
|
2884
|
+
"colRecipientRule": "Recipient Rule",
|
|
2885
|
+
"colAttachments": "Attachments",
|
|
2886
|
+
"colAction": "Action",
|
|
2887
|
+
"deleteButton": "Delete"
|
|
2888
|
+
},
|
|
2889
|
+
channels: {
|
|
2890
|
+
"whatsappTitle": "WhatsApp & OpenWA Gateway",
|
|
2891
|
+
"whatsappSubtitle": "Switch between Official Meta Cloud API (WABA Templates) and self-hosted OpenWA / WAHA / Evolution API.",
|
|
2892
|
+
"activeDriverLabel": "Active Driver",
|
|
2893
|
+
"driverMetaCloud": "Meta Cloud API (Official WABA)",
|
|
2894
|
+
"driverOpenWa": "OpenWA (@open-wa/wa-automate REST)",
|
|
2895
|
+
"driverWaha": "WAHA (WhatsApp HTTP API)",
|
|
2896
|
+
"driverEvolution": "Evolution API v2",
|
|
2897
|
+
"gatewayUrlLabel": "OpenWA / WAHA / Evolution Gateway URL",
|
|
2898
|
+
"saveWhatsappButton": "Save WhatsApp Driver",
|
|
2899
|
+
"telegramTitle": "Telegram Notifications",
|
|
2900
|
+
"verifiedBadge": "Verified",
|
|
2901
|
+
"unverifiedBadge": "Unverified",
|
|
2902
|
+
"telegramSubtitle": "Configure Merchant Supergroup (-100... or @channel). Changing the channel ID resets verification until a test message succeeds.",
|
|
2903
|
+
"merchantChannelLabel": "Merchant Channel / Supergroup ID",
|
|
2904
|
+
"merchantChannelPlaceholder": "-1001234567890 or @my_store_alerts",
|
|
2905
|
+
"saveChannelIdButton": "Save Channel ID",
|
|
2906
|
+
"sendTestButton": "Send Test Message",
|
|
2907
|
+
"smsTitle": "SMS Carrier Driver",
|
|
2908
|
+
"smsSubtitle": "Select Twilio SMS/MMS, Signal House (10DLC), MSG91 Flow, SMSAPI, or Dummy Sandbox.",
|
|
2909
|
+
"smsDriverLabel": "SMS Driver",
|
|
2910
|
+
"driverTwilio": "Twilio (SMS / MMS + Messaging Service)",
|
|
2911
|
+
"driverSignalHouse": "Signal House (10DLC & Cart Recovery)",
|
|
2912
|
+
"driverMsg91": "MSG91 Flow API",
|
|
2913
|
+
"driverSmsApi": "SMSAPI",
|
|
2914
|
+
"driverDummy": "Dummy OTP Sandbox (Testing)",
|
|
2915
|
+
"saveSmsButton": "Save SMS Driver"
|
|
2916
|
+
},
|
|
2917
|
+
logs: {
|
|
2918
|
+
"title": "Redacted Delivery Ledger (PII Masked & Idempotent)",
|
|
2919
|
+
"colEvent": "Event",
|
|
2920
|
+
"colChannel": "Channel",
|
|
2921
|
+
"colRecipient": "Recipient (Masked)",
|
|
2922
|
+
"colStatus": "Status",
|
|
2923
|
+
"colExternalId": "External ID"
|
|
2924
|
+
},
|
|
2925
|
+
broadcasts: {
|
|
2926
|
+
"title": "TCPA / 10DLC Consent Summary & Customer Group Broadcasts",
|
|
2927
|
+
"smsOptedIn": "SMS Opted-In: {{count}}",
|
|
2928
|
+
"whatsappOptedIn": "WhatsApp Opted-In: {{count}}",
|
|
2929
|
+
"telegramLinked": "Telegram Linked: {{count}}",
|
|
2930
|
+
"optedOut": "Opted-Out (STOP): {{count}}",
|
|
2931
|
+
"campaignNameLabel": "Campaign Name",
|
|
2932
|
+
"campaignNamePlaceholder": "Weekend Flash Sale",
|
|
2933
|
+
"channelLabel": "Channel",
|
|
2934
|
+
"templateLabel": "Template",
|
|
2935
|
+
"sendNowButton": "Send Broadcast Now",
|
|
2936
|
+
"colCampaign": "Campaign",
|
|
2937
|
+
"colChannel": "Channel",
|
|
2938
|
+
"colStatus": "Status",
|
|
2939
|
+
"colSentTotal": "Sent / Total"
|
|
2940
|
+
},
|
|
2941
|
+
sandbox: {
|
|
2942
|
+
"title": "Dummy SMS / OTP & Multi-Channel Sandbox",
|
|
2943
|
+
"subtitle": "Captures OTP verification codes and test notifications locally without sending real carrier messages.",
|
|
2944
|
+
"clearButton": "Clear Captured Messages",
|
|
2945
|
+
"colChannel": "Channel",
|
|
2946
|
+
"colRecipient": "Recipient",
|
|
2947
|
+
"colOtp": "Extracted OTP",
|
|
2948
|
+
"colBody": "Message Body"
|
|
2949
|
+
},
|
|
2950
|
+
widget: {
|
|
2951
|
+
"title": "Multi-Channel Order Notifications ({{count}})",
|
|
2952
|
+
"subtitle": "Send or resend Email, WhatsApp/OpenWA, Telegram, or SMS for this order (with optional PDF invoice attachment).",
|
|
2953
|
+
"channelPlaceholder": "Channel",
|
|
2954
|
+
"templatePlaceholder": "Template",
|
|
2955
|
+
"attachInvoiceLabel": "Attach Invoice PDF (if generated)",
|
|
2956
|
+
"sending": "Sending...",
|
|
2957
|
+
"sendResendButton": "Send / Resend Notification",
|
|
2958
|
+
"dispatchedSuccess": "Dispatched {{channel}} notification",
|
|
2959
|
+
"dispatchFailed": "Failed to dispatch notification",
|
|
2960
|
+
"colChannel": "Channel",
|
|
2961
|
+
"colEventTemplate": "Event / Template",
|
|
2962
|
+
"colRecipient": "Recipient",
|
|
2963
|
+
"colStatus": "Status"
|
|
2964
|
+
},
|
|
2965
|
+
messages: {
|
|
2966
|
+
"loadStudioError": "Failed to load Notification Studio data.",
|
|
2967
|
+
"clonedPresetSuccess": "Cloned preset into editable DB template '{{label}}'.",
|
|
2968
|
+
"clonePresetError": "Failed to clone system preset.",
|
|
2969
|
+
"savedTemplateSuccess": "Saved template & block tree.",
|
|
2970
|
+
"saveTemplateError": "Failed to save template.",
|
|
2971
|
+
"createdMappingSuccess": "Created active mapping for '{{event}}' -> '{{channel}}'.",
|
|
2972
|
+
"createMappingError": "Failed to create event mapping.",
|
|
2973
|
+
"verifiedChannelSuccess": "Verified '{{channel}}' channel and sent test message.",
|
|
2974
|
+
"savedChannelSuccess": "Saved '{{channel}}' configuration.",
|
|
2975
|
+
"channelActionError": "Failed to {{action}} {{channel}}",
|
|
2976
|
+
"broadcastSentSuccess": "Broadcast campaign dispatched to opted-in recipients."
|
|
2977
|
+
}
|
|
2978
|
+
} },
|
|
2979
|
+
es: { translation: {
|
|
2980
|
+
nav: { "label": "Notificaciones" },
|
|
2981
|
+
header: {
|
|
2982
|
+
"title": "Estudio de Notificaciones Multicanal (Email, WhatsApp/OpenWA, Telegram, SMS, Slack)",
|
|
2983
|
+
"subtitle": "Constructor visual de bloques y plantillas, mapeo de eventos en BD, pasarelas multi-driver, registro de consentimiento y sandbox OTP.",
|
|
2984
|
+
"languageLabel": "Idioma",
|
|
2985
|
+
"refresh": "Actualizar Estudio",
|
|
2986
|
+
"successBadge": "ÉXITO",
|
|
2987
|
+
"errorBadge": "ERROR"
|
|
2988
|
+
},
|
|
2989
|
+
tabs: {
|
|
2990
|
+
"templates": "Plantillas y Constructor Visual ({{count}})",
|
|
2991
|
+
"mappings": "Mapeo de Eventos ({{count}})",
|
|
2992
|
+
"channels": "Canales (OpenWA / Telegram / SMS)",
|
|
2993
|
+
"logs": "Registros de Envío ({{count}})",
|
|
2994
|
+
"broadcasts": "Campañas y Consentimiento",
|
|
2995
|
+
"sandbox": "Sandbox OTP de Prueba ({{count}})"
|
|
2996
|
+
},
|
|
2997
|
+
templates: {
|
|
2998
|
+
"title": "Plantillas",
|
|
2999
|
+
"filterChannel": "Filtrar Canal",
|
|
3000
|
+
"allChannels": "Todos los Canales",
|
|
3001
|
+
"modeLabel": "Modo: {{mode}}",
|
|
3002
|
+
"inspectPreview": "Inspeccionar / Vista Previa",
|
|
3003
|
+
"cloneToDb": "Clonar a BD",
|
|
3004
|
+
"saveButton": "Guardar Plantilla y Bloques",
|
|
3005
|
+
"subjectLabel": "Asunto (Email / Título)",
|
|
3006
|
+
"metaTemplateLabel": "Nombre de Plantilla Meta WABA (WhatsApp Cloud)",
|
|
3007
|
+
"rawContentLabel": "Contenido de Plantilla Raw (soporta {{data.*}}, {{translations.*}} y {{ .var }})",
|
|
3008
|
+
"blockTreeLabel": "Árbol Visual de Bloques ({{count}} bloques)",
|
|
3009
|
+
"removeBlock": "Eliminar",
|
|
3010
|
+
"previewTitle": "Vista Previa Multicanal en Vivo ({{locale}})",
|
|
3011
|
+
"contextPlaceholder": "Contexto",
|
|
3012
|
+
"localePlaceholder": "Idioma",
|
|
3013
|
+
"subjectPrefix": "Asunto: {{subject}}",
|
|
3014
|
+
"encodingBadge": "Codificación: {{encoding}}",
|
|
3015
|
+
"segmentsBadge": "Segmentos: {{segments}} ({{chars}} caracteres)",
|
|
3016
|
+
"waButtonPrefix": "[Botón WA] {{title}}",
|
|
3017
|
+
"tgInlinePrefix": "[Botón TG] {{text}}",
|
|
3018
|
+
"emptySelection": "Selecciona una plantilla a la izquierda para inspeccionar sus bloques, clonar un preset del sistema o previsualizarla."
|
|
3019
|
+
},
|
|
3020
|
+
mappings: {
|
|
3021
|
+
"title": "Crear Mapeo Evento → Canal → Plantilla",
|
|
3022
|
+
"eventLabel": "Evento de Tienda Medusa",
|
|
3023
|
+
"channelLabel": "Canal",
|
|
3024
|
+
"templateLabel": "Plantilla",
|
|
3025
|
+
"recipientRuleLabel": "Regla de Destinatario",
|
|
3026
|
+
"ruleCustomerAuto": "Cliente Automático",
|
|
3027
|
+
"ruleOrderEmail": "Email del Pedido",
|
|
3028
|
+
"ruleOrderPhone": "Teléfono del Pedido (E.164)",
|
|
3029
|
+
"ruleCustomerTelegram": "Telegram DM del Cliente",
|
|
3030
|
+
"ruleMerchantChannel": "Canal / Grupo del Comercio",
|
|
3031
|
+
"ruleB2bAccounting": "Contacto de Contabilidad B2B",
|
|
3032
|
+
"threadIdLabel": "ID de Tema / Hilo de Telegram (Opcional)",
|
|
3033
|
+
"threadIdPlaceholder": "ej. 42",
|
|
3034
|
+
"attachInvoiceLabel": "Adjuntar Factura PDF automáticamente desde medusa-documents-plugin (Email, WhatsApp/OpenWA y Telegram)",
|
|
3035
|
+
"addMappingButton": "Añadir Mapeo Activo",
|
|
3036
|
+
"colEvent": "Evento",
|
|
3037
|
+
"colChannel": "Canal",
|
|
3038
|
+
"colTemplate": "Plantilla",
|
|
3039
|
+
"colRecipientRule": "Regla de Destinatario",
|
|
3040
|
+
"colAttachments": "Adjuntos",
|
|
3041
|
+
"colAction": "Acción",
|
|
3042
|
+
"deleteButton": "Eliminar"
|
|
3043
|
+
},
|
|
3044
|
+
channels: {
|
|
3045
|
+
"whatsappTitle": "Pasarela WhatsApp y OpenWA",
|
|
3046
|
+
"whatsappSubtitle": "Alterna entre Meta Cloud API Oficial (Plantillas WABA) y servidores propios OpenWA / WAHA / Evolution API.",
|
|
3047
|
+
"activeDriverLabel": "Driver Activo",
|
|
3048
|
+
"driverMetaCloud": "Meta Cloud API (WABA Oficial)",
|
|
3049
|
+
"driverOpenWa": "OpenWA (@open-wa/wa-automate REST)",
|
|
3050
|
+
"driverWaha": "WAHA (WhatsApp HTTP API)",
|
|
3051
|
+
"driverEvolution": "Evolution API v2",
|
|
3052
|
+
"gatewayUrlLabel": "URL de Pasarela OpenWA / WAHA / Evolution",
|
|
3053
|
+
"saveWhatsappButton": "Guardar Driver WhatsApp",
|
|
3054
|
+
"telegramTitle": "Notificaciones de Telegram",
|
|
3055
|
+
"verifiedBadge": "Verificado",
|
|
3056
|
+
"unverifiedBadge": "Sin Verificar",
|
|
3057
|
+
"telegramSubtitle": "Configura el supergrupo del comercio (-100... o @canal). Cambiar el ID reinicia la verificación hasta enviar un mensaje de prueba.",
|
|
3058
|
+
"merchantChannelLabel": "ID de Canal / Supergrupo del Comercio",
|
|
3059
|
+
"merchantChannelPlaceholder": "-1001234567890 o @mis_alertas",
|
|
3060
|
+
"saveChannelIdButton": "Guardar ID de Canal",
|
|
3061
|
+
"sendTestButton": "Enviar Mensaje de Prueba",
|
|
3062
|
+
"smsTitle": "Driver de Operador SMS",
|
|
3063
|
+
"smsSubtitle": "Selecciona Twilio SMS/MMS, Signal House (10DLC), MSG91 Flow, SMSAPI o Sandbox OTP.",
|
|
3064
|
+
"smsDriverLabel": "Driver SMS",
|
|
3065
|
+
"driverTwilio": "Twilio (SMS / MMS + Messaging Service)",
|
|
3066
|
+
"driverSignalHouse": "Signal House (10DLC y Recuperación de Carrito)",
|
|
3067
|
+
"driverMsg91": "MSG91 Flow API",
|
|
3068
|
+
"driverSmsApi": "SMSAPI",
|
|
3069
|
+
"driverDummy": "Sandbox OTP Dummy (Pruebas)",
|
|
3070
|
+
"saveSmsButton": "Guardar Driver SMS"
|
|
3071
|
+
},
|
|
3072
|
+
logs: {
|
|
3073
|
+
"title": "Registro de Entregas Redactado (PII Enmascarado e Idempotente)",
|
|
3074
|
+
"colEvent": "Evento",
|
|
3075
|
+
"colChannel": "Canal",
|
|
3076
|
+
"colRecipient": "Destinatario (Enmascarado)",
|
|
3077
|
+
"colStatus": "Estado",
|
|
3078
|
+
"colExternalId": "ID Externo"
|
|
3079
|
+
},
|
|
3080
|
+
broadcasts: {
|
|
3081
|
+
"title": "Resumen de Consentimiento TCPA / 10DLC y Difusiones a Clientes",
|
|
3082
|
+
"smsOptedIn": "SMS Suscritos: {{count}}",
|
|
3083
|
+
"whatsappOptedIn": "WhatsApp Suscritos: {{count}}",
|
|
3084
|
+
"telegramLinked": "Telegram Vinculados: {{count}}",
|
|
3085
|
+
"optedOut": "Bajas (STOP): {{count}}",
|
|
3086
|
+
"campaignNameLabel": "Nombre de Campaña",
|
|
3087
|
+
"campaignNamePlaceholder": "Oferta Relámpago de Fin de Semana",
|
|
3088
|
+
"channelLabel": "Canal",
|
|
3089
|
+
"templateLabel": "Plantilla",
|
|
3090
|
+
"sendNowButton": "Enviar Difusión Ahora",
|
|
3091
|
+
"colCampaign": "Campaña",
|
|
3092
|
+
"colChannel": "Canal",
|
|
3093
|
+
"colStatus": "Estado",
|
|
3094
|
+
"colSentTotal": "Enviados / Total"
|
|
3095
|
+
},
|
|
3096
|
+
sandbox: {
|
|
3097
|
+
"title": "Sandbox Local de SMS / OTP y Multicanal",
|
|
3098
|
+
"subtitle": "Captura códigos OTP de verificación y notificaciones de prueba localmente sin enviar mensajes reales.",
|
|
3099
|
+
"clearButton": "Limpiar Mensajes Capturados",
|
|
3100
|
+
"colChannel": "Canal",
|
|
3101
|
+
"colRecipient": "Destinatario",
|
|
3102
|
+
"colOtp": "OTP Extraído",
|
|
3103
|
+
"colBody": "Cuerpo del Mensaje"
|
|
3104
|
+
},
|
|
3105
|
+
widget: {
|
|
3106
|
+
"title": "Notificaciones Multicanal del Pedido ({{count}})",
|
|
3107
|
+
"subtitle": "Envía o reenvía Email, WhatsApp/OpenWA, Telegram o SMS para este pedido (con factura PDF opcional).",
|
|
3108
|
+
"channelPlaceholder": "Canal",
|
|
3109
|
+
"templatePlaceholder": "Plantilla",
|
|
3110
|
+
"attachInvoiceLabel": "Adjuntar Factura PDF (si fue generada)",
|
|
3111
|
+
"sending": "Enviando...",
|
|
3112
|
+
"sendResendButton": "Enviar / Reenviar Notificación",
|
|
3113
|
+
"dispatchedSuccess": "Notificación enviada por {{channel}}",
|
|
3114
|
+
"dispatchFailed": "Error al enviar la notificación",
|
|
3115
|
+
"colChannel": "Canal",
|
|
3116
|
+
"colEventTemplate": "Evento / Plantilla",
|
|
3117
|
+
"colRecipient": "Destinatario",
|
|
3118
|
+
"colStatus": "Estado"
|
|
3119
|
+
},
|
|
3120
|
+
messages: {
|
|
3121
|
+
"loadStudioError": "Error al cargar los datos del Estudio de Notificaciones.",
|
|
3122
|
+
"clonedPresetSuccess": "Preset clonado en plantilla editable '{{label}}'.",
|
|
3123
|
+
"clonePresetError": "Error al clonar el preset del sistema.",
|
|
3124
|
+
"savedTemplateSuccess": "Plantilla y árbol de bloques guardados.",
|
|
3125
|
+
"saveTemplateError": "Error al guardar la plantilla.",
|
|
3126
|
+
"createdMappingSuccess": "Mapeo activo creado para '{{event}}' -> '{{channel}}'.",
|
|
3127
|
+
"createMappingError": "Error al crear el mapeo de eventos.",
|
|
3128
|
+
"verifiedChannelSuccess": "Canal '{{channel}}' verificado y mensaje de prueba enviado.",
|
|
3129
|
+
"savedChannelSuccess": "Configuración de '{{channel}}' guardada.",
|
|
3130
|
+
"channelActionError": "Error al ejecutar {{action}} en {{channel}}",
|
|
3131
|
+
"broadcastSentSuccess": "Campaña de difusión enviada a los destinatarios suscritos."
|
|
3132
|
+
}
|
|
3133
|
+
} },
|
|
3134
|
+
fr: { translation: {
|
|
3135
|
+
nav: { "label": "Notifications" },
|
|
3136
|
+
header: {
|
|
3137
|
+
"title": "Studio de Notifications Multicanal (E-mail, WhatsApp/OpenWA, Telegram, SMS, Slack)",
|
|
3138
|
+
"subtitle": "Éditeur visuel de blocs et modèles bruts, routage d'événements BD, passerelles multi-pilotes, registre de consentement et sandbox OTP.",
|
|
3139
|
+
"languageLabel": "Langue",
|
|
3140
|
+
"refresh": "Actualiser le Studio",
|
|
3141
|
+
"successBadge": "SUCCÈS",
|
|
3142
|
+
"errorBadge": "ERREUR"
|
|
3143
|
+
},
|
|
3144
|
+
tabs: {
|
|
3145
|
+
"templates": "Modèles & Éditeur Visuel ({{count}})",
|
|
3146
|
+
"mappings": "Routage d'Événements ({{count}})",
|
|
3147
|
+
"channels": "Canaux (OpenWA / Telegram / SMS)",
|
|
3148
|
+
"logs": "Journaux d'Envoi ({{count}})",
|
|
3149
|
+
"broadcasts": "Diffusions & Consentement",
|
|
3150
|
+
"sandbox": "Sandbox OTP ({{count}})"
|
|
3151
|
+
},
|
|
3152
|
+
templates: {
|
|
3153
|
+
"title": "Modèles",
|
|
3154
|
+
"filterChannel": "Filtrer par Canal",
|
|
3155
|
+
"allChannels": "Tous les Canaux",
|
|
3156
|
+
"modeLabel": "Mode : {{mode}}",
|
|
3157
|
+
"inspectPreview": "Inspecter / Aperçu",
|
|
3158
|
+
"cloneToDb": "Cloner en BD",
|
|
3159
|
+
"saveButton": "Enregistrer Modèle & Blocs",
|
|
3160
|
+
"subjectLabel": "Objet (E-mail / Titre)",
|
|
3161
|
+
"metaTemplateLabel": "Nom du Modèle Meta WABA (WhatsApp Cloud)",
|
|
3162
|
+
"rawContentLabel": "Contenu Brut (supporte {{data.*}}, {{translations.*}} et {{ .var }})",
|
|
3163
|
+
"blockTreeLabel": "Arbre Visuel de Blocs ({{count}} blocs)",
|
|
3164
|
+
"removeBlock": "Supprimer",
|
|
3165
|
+
"previewTitle": "Aperçu Multicanal en Direct ({{locale}})",
|
|
3166
|
+
"contextPlaceholder": "Contexte",
|
|
3167
|
+
"localePlaceholder": "Langue",
|
|
3168
|
+
"subjectPrefix": "Objet : {{subject}}",
|
|
3169
|
+
"encodingBadge": "Encodage : {{encoding}}",
|
|
3170
|
+
"segmentsBadge": "Segments : {{segments}} ({{chars}} caractères)",
|
|
3171
|
+
"waButtonPrefix": "[Bouton WA] {{title}}",
|
|
3172
|
+
"tgInlinePrefix": "[Bouton TG] {{text}}",
|
|
3173
|
+
"emptySelection": "Sélectionnez un modèle à gauche pour inspecter ses blocs, cloner un préréglage système ou prévisualiser le rendu."
|
|
3174
|
+
},
|
|
3175
|
+
mappings: {
|
|
3176
|
+
"title": "Créer une Règle Événement → Canal → Modèle",
|
|
3177
|
+
"eventLabel": "Événement Medusa",
|
|
3178
|
+
"channelLabel": "Canal",
|
|
3179
|
+
"templateLabel": "Modèle",
|
|
3180
|
+
"recipientRuleLabel": "Règle de Destinataire",
|
|
3181
|
+
"ruleCustomerAuto": "Client Auto",
|
|
3182
|
+
"ruleOrderEmail": "E-mail de Commande",
|
|
3183
|
+
"ruleOrderPhone": "Téléphone de Commande (E.164)",
|
|
3184
|
+
"ruleCustomerTelegram": "Telegram DM Client",
|
|
3185
|
+
"ruleMerchantChannel": "Canal / Groupe Marchand",
|
|
3186
|
+
"ruleB2bAccounting": "Contact Comptabilité B2B",
|
|
3187
|
+
"threadIdLabel": "ID de Sujet / Thread Telegram (Optionnel)",
|
|
3188
|
+
"threadIdPlaceholder": "ex. 42",
|
|
3189
|
+
"attachInvoiceLabel": "Joindre automatiquement la facture PDF depuis medusa-documents-plugin (E-mail, WhatsApp/OpenWA & Telegram)",
|
|
3190
|
+
"addMappingButton": "Ajouter la Règle",
|
|
3191
|
+
"colEvent": "Événement",
|
|
3192
|
+
"colChannel": "Canal",
|
|
3193
|
+
"colTemplate": "Modèle",
|
|
3194
|
+
"colRecipientRule": "Destinataire",
|
|
3195
|
+
"colAttachments": "Pièces jointes",
|
|
3196
|
+
"colAction": "Action",
|
|
3197
|
+
"deleteButton": "Supprimer"
|
|
3198
|
+
},
|
|
3199
|
+
channels: {
|
|
3200
|
+
"whatsappTitle": "Passerelle WhatsApp & OpenWA",
|
|
3201
|
+
"whatsappSubtitle": "Basculez entre l'API officielle Meta Cloud (modèles WABA) et OpenWA / WAHA / Evolution API auto-hébergés.",
|
|
3202
|
+
"activeDriverLabel": "Pilote Actif",
|
|
3203
|
+
"driverMetaCloud": "Meta Cloud API (WABA Officiel)",
|
|
3204
|
+
"driverOpenWa": "OpenWA (@open-wa/wa-automate REST)",
|
|
3205
|
+
"driverWaha": "WAHA (WhatsApp HTTP API)",
|
|
3206
|
+
"driverEvolution": "Evolution API v2",
|
|
3207
|
+
"gatewayUrlLabel": "URL de Passerelle OpenWA / WAHA / Evolution",
|
|
3208
|
+
"saveWhatsappButton": "Enregistrer le Pilote WhatsApp",
|
|
3209
|
+
"telegramTitle": "Notifications Telegram",
|
|
3210
|
+
"verifiedBadge": "Vérifié",
|
|
3211
|
+
"unverifiedBadge": "Non vérifié",
|
|
3212
|
+
"telegramSubtitle": "Configurez le supergroupe marchand (-100... ou @canal). Modifier l'ID réinitialise la vérification.",
|
|
3213
|
+
"merchantChannelLabel": "ID du Canal / Supergroupe Marchand",
|
|
3214
|
+
"merchantChannelPlaceholder": "-1001234567890 ou @mes_alertes",
|
|
3215
|
+
"saveChannelIdButton": "Enregistrer l'ID",
|
|
3216
|
+
"sendTestButton": "Envoyer un Message Test",
|
|
3217
|
+
"smsTitle": "Pilote Opérateur SMS",
|
|
3218
|
+
"smsSubtitle": "Sélectionnez Twilio SMS/MMS, Signal House (10DLC), MSG91 Flow, SMSAPI ou Sandbox OTP.",
|
|
3219
|
+
"smsDriverLabel": "Pilote SMS",
|
|
3220
|
+
"driverTwilio": "Twilio (SMS / MMS + Messaging Service)",
|
|
3221
|
+
"driverSignalHouse": "Signal House (10DLC & Panier Abandonné)",
|
|
3222
|
+
"driverMsg91": "MSG91 Flow API",
|
|
3223
|
+
"driverSmsApi": "SMSAPI",
|
|
3224
|
+
"driverDummy": "Sandbox OTP (Test)",
|
|
3225
|
+
"saveSmsButton": "Enregistrer le Pilote SMS"
|
|
3226
|
+
},
|
|
3227
|
+
logs: {
|
|
3228
|
+
"title": "Journal des Envois Anonymisé (PII Masqué & Idempotent)",
|
|
3229
|
+
"colEvent": "Événement",
|
|
3230
|
+
"colChannel": "Canal",
|
|
3231
|
+
"colRecipient": "Destinataire (Masqué)",
|
|
3232
|
+
"colStatus": "Statut",
|
|
3233
|
+
"colExternalId": "ID Externe"
|
|
3234
|
+
},
|
|
3235
|
+
broadcasts: {
|
|
3236
|
+
"title": "Résumé du Consentement TCPA / 10DLC & Campagnes de Diffusion",
|
|
3237
|
+
"smsOptedIn": "SMS Inscrits : {{count}}",
|
|
3238
|
+
"whatsappOptedIn": "WhatsApp Inscrits : {{count}}",
|
|
3239
|
+
"telegramLinked": "Telegram Liés : {{count}}",
|
|
3240
|
+
"optedOut": "Désinscrits (STOP) : {{count}}",
|
|
3241
|
+
"campaignNameLabel": "Nom de la Campagne",
|
|
3242
|
+
"campaignNamePlaceholder": "Vente Flash Week-end",
|
|
3243
|
+
"channelLabel": "Canal",
|
|
3244
|
+
"templateLabel": "Modèle",
|
|
3245
|
+
"sendNowButton": "Envoyer la Diffusion",
|
|
3246
|
+
"colCampaign": "Campagne",
|
|
3247
|
+
"colChannel": "Canal",
|
|
3248
|
+
"colStatus": "Statut",
|
|
3249
|
+
"colSentTotal": "Envoyés / Total"
|
|
3250
|
+
},
|
|
3251
|
+
sandbox: {
|
|
3252
|
+
"title": "Sandbox Locale SMS / OTP & Multicanal",
|
|
3253
|
+
"subtitle": "Capture localement les codes OTP et notifications de test sans envoi opérateur réel.",
|
|
3254
|
+
"clearButton": "Effacer les Messages Capturés",
|
|
3255
|
+
"colChannel": "Canal",
|
|
3256
|
+
"colRecipient": "Destinataire",
|
|
3257
|
+
"colOtp": "OTP Extrait",
|
|
3258
|
+
"colBody": "Message"
|
|
3259
|
+
},
|
|
3260
|
+
widget: {
|
|
3261
|
+
"title": "Notifications Multicanal de la Commande ({{count}})",
|
|
3262
|
+
"subtitle": "Envoyer ou renvoyer un E-mail, WhatsApp/OpenWA, Telegram ou SMS pour cette commande (avec facture PDF en option).",
|
|
3263
|
+
"channelPlaceholder": "Canal",
|
|
3264
|
+
"templatePlaceholder": "Modèle",
|
|
3265
|
+
"attachInvoiceLabel": "Joindre la facture PDF (si générée)",
|
|
3266
|
+
"sending": "Envoi...",
|
|
3267
|
+
"sendResendButton": "Envoyer / Renvoyer la Notification",
|
|
3268
|
+
"dispatchedSuccess": "Notification {{channel}} envoyée",
|
|
3269
|
+
"dispatchFailed": "Échec de l'envoi de la notification",
|
|
3270
|
+
"colChannel": "Canal",
|
|
3271
|
+
"colEventTemplate": "Événement / Modèle",
|
|
3272
|
+
"colRecipient": "Destinataire",
|
|
3273
|
+
"colStatus": "Statut"
|
|
3274
|
+
},
|
|
3275
|
+
messages: {
|
|
3276
|
+
"loadStudioError": "Impossible de charger les données du Studio de Notifications.",
|
|
3277
|
+
"clonedPresetSuccess": "Préréglage cloné en modèle modifiable '{{label}}'.",
|
|
3278
|
+
"clonePresetError": "Échec du clonage du préréglage.",
|
|
3279
|
+
"savedTemplateSuccess": "Modèle et arbre de blocs enregistrés.",
|
|
3280
|
+
"saveTemplateError": "Échec de l'enregistrement du modèle.",
|
|
3281
|
+
"createdMappingSuccess": "Règle active créée pour '{{event}}' -> '{{channel}}'.",
|
|
3282
|
+
"createMappingError": "Échec de la création de la règle.",
|
|
3283
|
+
"verifiedChannelSuccess": "Canal '{{channel}}' vérifié et message test envoyé.",
|
|
3284
|
+
"savedChannelSuccess": "Configuration '{{channel}}' enregistrée.",
|
|
3285
|
+
"channelActionError": "Échec de l'action {{action}} sur {{channel}}",
|
|
3286
|
+
"broadcastSentSuccess": "Campagne de diffusion envoyée aux destinataires inscrits."
|
|
3287
|
+
}
|
|
3288
|
+
} },
|
|
3289
|
+
it: { translation: {
|
|
3290
|
+
nav: { "label": "Notifiche" },
|
|
3291
|
+
header: {
|
|
3292
|
+
"title": "Studio Notifiche Multicanale (Email, WhatsApp/OpenWA, Telegram, SMS, Slack)",
|
|
3293
|
+
"subtitle": "Costruttore visivo di blocchi e modelli raw, mappatura eventi DB, gateway multi-driver, registro consensi e sandbox OTP.",
|
|
3294
|
+
"languageLabel": "Lingua",
|
|
3295
|
+
"refresh": "Aggiorna Studio",
|
|
3296
|
+
"successBadge": "SUCCESSO",
|
|
3297
|
+
"errorBadge": "ERRORE"
|
|
3298
|
+
},
|
|
3299
|
+
tabs: {
|
|
3300
|
+
"templates": "Modelli e Builder Visivo ({{count}})",
|
|
3301
|
+
"mappings": "Mappatura Eventi ({{count}})",
|
|
3302
|
+
"channels": "Canali (OpenWA / Telegram / SMS)",
|
|
3303
|
+
"logs": "Log di Consegna ({{count}})",
|
|
3304
|
+
"broadcasts": "Broadcast e Consensi",
|
|
3305
|
+
"sandbox": "Sandbox OTP ({{count}})"
|
|
3306
|
+
},
|
|
3307
|
+
templates: {
|
|
3308
|
+
"title": "Modelli",
|
|
3309
|
+
"filterChannel": "Filtra Canale",
|
|
3310
|
+
"allChannels": "Tutti i Canali",
|
|
3311
|
+
"modeLabel": "Modalità: {{mode}}",
|
|
3312
|
+
"inspectPreview": "Ispeziona / Anteprima",
|
|
3313
|
+
"cloneToDb": "Clona su DB",
|
|
3314
|
+
"saveButton": "Salva Modello e Blocchi",
|
|
3315
|
+
"subjectLabel": "Oggetto (Email / Titolo)",
|
|
3316
|
+
"metaTemplateLabel": "Nome Modello Meta WABA (WhatsApp Cloud)",
|
|
3317
|
+
"rawContentLabel": "Contenuto Modello Raw (supporta {{data.*}}, {{translations.*}} e {{ .var }})",
|
|
3318
|
+
"blockTreeLabel": "Albero Visivo dei Blocchi ({{count}} blocchi)",
|
|
3319
|
+
"removeBlock": "Rimuovi",
|
|
3320
|
+
"previewTitle": "Anteprima Multicanale Live ({{locale}})",
|
|
3321
|
+
"contextPlaceholder": "Contesto",
|
|
3322
|
+
"localePlaceholder": "Lingua",
|
|
3323
|
+
"subjectPrefix": "Oggetto: {{subject}}",
|
|
3324
|
+
"encodingBadge": "Codifica: {{encoding}}",
|
|
3325
|
+
"segmentsBadge": "Segmenti: {{segments}} ({{chars}} caratteri)",
|
|
3326
|
+
"waButtonPrefix": "[Pulsante WA] {{title}}",
|
|
3327
|
+
"tgInlinePrefix": "[Pulsante TG] {{text}}",
|
|
3328
|
+
"emptySelection": "Seleziona un modello a sinistra per ispezionare i blocchi, clonare un preset di sistema o visualizzare l'anteprima."
|
|
3329
|
+
},
|
|
3330
|
+
mappings: {
|
|
3331
|
+
"title": "Crea Mappatura Evento → Canale → Modello",
|
|
3332
|
+
"eventLabel": "Evento Store Medusa",
|
|
3333
|
+
"channelLabel": "Canale",
|
|
3334
|
+
"templateLabel": "Modello",
|
|
3335
|
+
"recipientRuleLabel": "Regola Destinatario",
|
|
3336
|
+
"ruleCustomerAuto": "Cliente Automatico",
|
|
3337
|
+
"ruleOrderEmail": "Email Ordine",
|
|
3338
|
+
"ruleOrderPhone": "Telefono Ordine (E.164)",
|
|
3339
|
+
"ruleCustomerTelegram": "Telegram DM Cliente",
|
|
3340
|
+
"ruleMerchantChannel": "Canale / Gruppo Commerciante",
|
|
3341
|
+
"ruleB2bAccounting": "Contatto Contabilità B2B",
|
|
3342
|
+
"threadIdLabel": "ID Topic Telegram (Opzionale)",
|
|
3343
|
+
"threadIdPlaceholder": "es. 42",
|
|
3344
|
+
"attachInvoiceLabel": "Allega automaticamente fattura PDF da medusa-documents-plugin (Email, WhatsApp/OpenWA e Telegram)",
|
|
3345
|
+
"addMappingButton": "Aggiungi Mappatura Attiva",
|
|
3346
|
+
"colEvent": "Evento",
|
|
3347
|
+
"colChannel": "Canale",
|
|
3348
|
+
"colTemplate": "Modello",
|
|
3349
|
+
"colRecipientRule": "Regola Destinatario",
|
|
3350
|
+
"colAttachments": "Allegati",
|
|
3351
|
+
"colAction": "Azione",
|
|
3352
|
+
"deleteButton": "Elimina"
|
|
3353
|
+
},
|
|
3354
|
+
channels: {
|
|
3355
|
+
"whatsappTitle": "Gateway WhatsApp e OpenWA",
|
|
3356
|
+
"whatsappSubtitle": "Passa tra l'API ufficiale Meta Cloud (Modelli WABA) e OpenWA / WAHA / Evolution API self-hosted.",
|
|
3357
|
+
"activeDriverLabel": "Driver Attivo",
|
|
3358
|
+
"driverMetaCloud": "Meta Cloud API (WABA Ufficiale)",
|
|
3359
|
+
"driverOpenWa": "OpenWA (@open-wa/wa-automate REST)",
|
|
3360
|
+
"driverWaha": "WAHA (WhatsApp HTTP API)",
|
|
3361
|
+
"driverEvolution": "Evolution API v2",
|
|
3362
|
+
"gatewayUrlLabel": "URL Gateway OpenWA / WAHA / Evolution",
|
|
3363
|
+
"saveWhatsappButton": "Salva Driver WhatsApp",
|
|
3364
|
+
"telegramTitle": "Notifiche Telegram",
|
|
3365
|
+
"verifiedBadge": "Verificato",
|
|
3366
|
+
"unverifiedBadge": "Non Verificato",
|
|
3367
|
+
"telegramSubtitle": "Configura il supergruppo del negozio (-100... o @canale). La modifica dell'ID azzera la verifica fino al messaggio di test.",
|
|
3368
|
+
"merchantChannelLabel": "ID Canale / Supergruppo Commerciante",
|
|
3369
|
+
"merchantChannelPlaceholder": "-1001234567890 o @avvisi_negozio",
|
|
3370
|
+
"saveChannelIdButton": "Salva ID Canale",
|
|
3371
|
+
"sendTestButton": "Invia Messaggio di Test",
|
|
3372
|
+
"smsTitle": "Driver Operatore SMS",
|
|
3373
|
+
"smsSubtitle": "Seleziona Twilio SMS/MMS, Signal House (10DLC), MSG91 Flow, SMSAPI o Sandbox OTP.",
|
|
3374
|
+
"smsDriverLabel": "Driver SMS",
|
|
3375
|
+
"driverTwilio": "Twilio (SMS / MMS + Messaging Service)",
|
|
3376
|
+
"driverSignalHouse": "Signal House (10DLC e Recupero Carrello)",
|
|
3377
|
+
"driverMsg91": "MSG91 Flow API",
|
|
3378
|
+
"driverSmsApi": "SMSAPI",
|
|
3379
|
+
"driverDummy": "Sandbox OTP (Test)",
|
|
3380
|
+
"saveSmsButton": "Salva Driver SMS"
|
|
3381
|
+
},
|
|
3382
|
+
logs: {
|
|
3383
|
+
"title": "Registro Consegne Oscurato (PII Mascherato e Idempotente)",
|
|
3384
|
+
"colEvent": "Evento",
|
|
3385
|
+
"colChannel": "Canale",
|
|
3386
|
+
"colRecipient": "Destinatario (Mascherato)",
|
|
3387
|
+
"colStatus": "Stato",
|
|
3388
|
+
"colExternalId": "ID Esterno"
|
|
3389
|
+
},
|
|
3390
|
+
broadcasts: {
|
|
3391
|
+
"title": "Riepilogo Consensi TCPA / 10DLC e Campagne Broadcast",
|
|
3392
|
+
"smsOptedIn": "SMS Iscritti: {{count}}",
|
|
3393
|
+
"whatsappOptedIn": "WhatsApp Iscritti: {{count}}",
|
|
3394
|
+
"telegramLinked": "Telegram Collegati: {{count}}",
|
|
3395
|
+
"optedOut": "Disiscritti (STOP): {{count}}",
|
|
3396
|
+
"campaignNameLabel": "Nome Campagna",
|
|
3397
|
+
"campaignNamePlaceholder": "Flash Sale del Weekend",
|
|
3398
|
+
"channelLabel": "Canale",
|
|
3399
|
+
"templateLabel": "Modello",
|
|
3400
|
+
"sendNowButton": "Invia Broadcast Ora",
|
|
3401
|
+
"colCampaign": "Campagna",
|
|
3402
|
+
"colChannel": "Canale",
|
|
3403
|
+
"colStatus": "Stato",
|
|
3404
|
+
"colSentTotal": "Inviati / Totale"
|
|
3405
|
+
},
|
|
3406
|
+
sandbox: {
|
|
3407
|
+
"title": "Sandbox Locale SMS / OTP e Multicanale",
|
|
3408
|
+
"subtitle": "Cattura codici OTP e notifiche di test localmente senza invii reali.",
|
|
3409
|
+
"clearButton": "Cancella Messaggi Catturati",
|
|
3410
|
+
"colChannel": "Canale",
|
|
3411
|
+
"colRecipient": "Destinatario",
|
|
3412
|
+
"colOtp": "OTP Estratto",
|
|
3413
|
+
"colBody": "Testo del Messaggio"
|
|
3414
|
+
},
|
|
3415
|
+
widget: {
|
|
3416
|
+
"title": "Notifiche Ordine Multicanale ({{count}})",
|
|
3417
|
+
"subtitle": "Invia o reinvia Email, WhatsApp/OpenWA, Telegram o SMS per questo ordine (con fattura PDF opzionale).",
|
|
3418
|
+
"channelPlaceholder": "Canale",
|
|
3419
|
+
"templatePlaceholder": "Modello",
|
|
3420
|
+
"attachInvoiceLabel": "Allega Fattura PDF (se generata)",
|
|
3421
|
+
"sending": "Invio in corso...",
|
|
3422
|
+
"sendResendButton": "Invia / Reinvia Notifica",
|
|
3423
|
+
"dispatchedSuccess": "Notifica {{channel}} inviata",
|
|
3424
|
+
"dispatchFailed": "Impossibile inviare la notifica",
|
|
3425
|
+
"colChannel": "Canale",
|
|
3426
|
+
"colEventTemplate": "Evento / Modello",
|
|
3427
|
+
"colRecipient": "Destinatario",
|
|
3428
|
+
"colStatus": "Stato"
|
|
3429
|
+
},
|
|
3430
|
+
messages: {
|
|
3431
|
+
"loadStudioError": "Impossibile caricare i dati dello Studio Notifiche.",
|
|
3432
|
+
"clonedPresetSuccess": "Preset clonato nel modello modificabile '{{label}}'.",
|
|
3433
|
+
"clonePresetError": "Impossibile clonare il preset di sistema.",
|
|
3434
|
+
"savedTemplateSuccess": "Modello e albero dei blocchi salvati.",
|
|
3435
|
+
"saveTemplateError": "Impossibile salvare il modello.",
|
|
3436
|
+
"createdMappingSuccess": "Mappatura attiva creata per '{{event}}' -> '{{channel}}'.",
|
|
3437
|
+
"createMappingError": "Impossibile creare la mappatura eventi.",
|
|
3438
|
+
"verifiedChannelSuccess": "Canale '{{channel}}' verificato e messaggio di test inviato.",
|
|
3439
|
+
"savedChannelSuccess": "Configurazione '{{channel}}' salvata.",
|
|
3440
|
+
"channelActionError": "Azione {{action}} fallita su {{channel}}",
|
|
3441
|
+
"broadcastSentSuccess": "Campagna broadcast inviata ai destinatari iscritti."
|
|
3442
|
+
}
|
|
3443
|
+
} },
|
|
3444
|
+
nl: { translation: {
|
|
3445
|
+
nav: { "label": "Meldingen" },
|
|
3446
|
+
header: {
|
|
3447
|
+
"title": "Multi-Channel Notificatiestudio (E-mail, WhatsApp/OpenWA, Telegram, SMS, Slack)",
|
|
3448
|
+
"subtitle": "Visuele blok- en sjabloonbouwer, DB-gebeurteniskoppelingen, multi-driver gateways, toestemmingsregister en OTP-sandbox.",
|
|
3449
|
+
"languageLabel": "Taal",
|
|
3450
|
+
"refresh": "Studio Vernieuwen",
|
|
3451
|
+
"successBadge": "SUCCES",
|
|
3452
|
+
"errorBadge": "FOUT"
|
|
3453
|
+
},
|
|
3454
|
+
tabs: {
|
|
3455
|
+
"templates": "Sjablonen & Visuele Bouwer ({{count}})",
|
|
3456
|
+
"mappings": "Gebeurteniskoppelingen ({{count}})",
|
|
3457
|
+
"channels": "Kanalen (OpenWA / Telegram / SMS)",
|
|
3458
|
+
"logs": "Verzendlogboeken ({{count}})",
|
|
3459
|
+
"broadcasts": "Broadcasts & Toestemming",
|
|
3460
|
+
"sandbox": "Dummy OTP Sandbox ({{count}})"
|
|
3461
|
+
},
|
|
3462
|
+
templates: {
|
|
3463
|
+
"title": "Sjablonen",
|
|
3464
|
+
"filterChannel": "Kanaal Filteren",
|
|
3465
|
+
"allChannels": "Alle Kanalen",
|
|
3466
|
+
"modeLabel": "Modus: {{mode}}",
|
|
3467
|
+
"inspectPreview": "Inspecteren / Voorbeeld",
|
|
3468
|
+
"cloneToDb": "Klonen naar DB",
|
|
3469
|
+
"saveButton": "Sjabloon & Blokken Opslaan",
|
|
3470
|
+
"subjectLabel": "Onderwerpregel (E-mail / Titel)",
|
|
3471
|
+
"metaTemplateLabel": "Meta WABA-sjabloonnaam (WhatsApp Cloud)",
|
|
3472
|
+
"rawContentLabel": "Raw Sjablooninhoud (ondersteunt {{data.*}}, {{translations.*}} en {{ .var }})",
|
|
3473
|
+
"blockTreeLabel": "Visuele Blokstructuur ({{count}} blokken)",
|
|
3474
|
+
"removeBlock": "Verwijderen",
|
|
3475
|
+
"previewTitle": "Live Multi-Channel Voorbeeld ({{locale}})",
|
|
3476
|
+
"contextPlaceholder": "Context",
|
|
3477
|
+
"localePlaceholder": "Taal",
|
|
3478
|
+
"subjectPrefix": "Onderwerp: {{subject}}",
|
|
3479
|
+
"encodingBadge": "Codering: {{encoding}}",
|
|
3480
|
+
"segmentsBadge": "Segmenten: {{segments}} ({{chars}} tekens)",
|
|
3481
|
+
"waButtonPrefix": "[WA-knop] {{title}}",
|
|
3482
|
+
"tgInlinePrefix": "[TG-knop] {{text}}",
|
|
3483
|
+
"emptySelection": "Selecteer links een sjabloon om de blokstructuur te bekijken, een systeempreset te klonen of een voorbeeld weer te geven."
|
|
3484
|
+
},
|
|
3485
|
+
mappings: {
|
|
3486
|
+
"title": "Koppeling Gebeurtenis → Kanaal → Sjabloon Maken",
|
|
3487
|
+
"eventLabel": "Medusa Winkelgebeurtenis",
|
|
3488
|
+
"channelLabel": "Kanaal",
|
|
3489
|
+
"templateLabel": "Sjabloon",
|
|
3490
|
+
"recipientRuleLabel": "Ontvangersregel",
|
|
3491
|
+
"ruleCustomerAuto": "Klant Automatisch",
|
|
3492
|
+
"ruleOrderEmail": "Bestel-e-mail",
|
|
3493
|
+
"ruleOrderPhone": "Besteltelefoon (E.164)",
|
|
3494
|
+
"ruleCustomerTelegram": "Klant Telegram DM",
|
|
3495
|
+
"ruleMerchantChannel": "Winkelkanaal / Groep",
|
|
3496
|
+
"ruleB2bAccounting": "B2B Administratiecontact",
|
|
3497
|
+
"threadIdLabel": "Telegram Topic Thread-ID (Optioneel)",
|
|
3498
|
+
"threadIdPlaceholder": "bijv. 42",
|
|
3499
|
+
"attachInvoiceLabel": "PDF-factuur vanuit medusa-documents-plugin automatisch bijvoegen (E-mail, WhatsApp/OpenWA & Telegram)",
|
|
3500
|
+
"addMappingButton": "Actieve Koppeling Toevoegen",
|
|
3501
|
+
"colEvent": "Gebeurtenis",
|
|
3502
|
+
"colChannel": "Kanaal",
|
|
3503
|
+
"colTemplate": "Sjabloon",
|
|
3504
|
+
"colRecipientRule": "Ontvangersregel",
|
|
3505
|
+
"colAttachments": "Bijlagen",
|
|
3506
|
+
"colAction": "Actie",
|
|
3507
|
+
"deleteButton": "Verwijderen"
|
|
3508
|
+
},
|
|
3509
|
+
channels: {
|
|
3510
|
+
"whatsappTitle": "WhatsApp & OpenWA Gateway",
|
|
3511
|
+
"whatsappSubtitle": "Schakel tussen de officiële Meta Cloud API (WABA-sjablonen) en zelf-gehoste OpenWA / WAHA / Evolution API.",
|
|
3512
|
+
"activeDriverLabel": "Actieve Driver",
|
|
3513
|
+
"driverMetaCloud": "Meta Cloud API (Officieel WABA)",
|
|
3514
|
+
"driverOpenWa": "OpenWA (@open-wa/wa-automate REST)",
|
|
3515
|
+
"driverWaha": "WAHA (WhatsApp HTTP API)",
|
|
3516
|
+
"driverEvolution": "Evolution API v2",
|
|
3517
|
+
"gatewayUrlLabel": "OpenWA / WAHA / Evolution Gateway-URL",
|
|
3518
|
+
"saveWhatsappButton": "WhatsApp-driver Opslaan",
|
|
3519
|
+
"telegramTitle": "Telegram-meldingen",
|
|
3520
|
+
"verifiedBadge": "Geverifieerd",
|
|
3521
|
+
"unverifiedBadge": "Niet geverifieerd",
|
|
3522
|
+
"telegramSubtitle": "Configureer de winkelsupergroep (-100... of @kanaal). Wijziging van het ID reset de verificatie totdat een testbericht slaagt.",
|
|
3523
|
+
"merchantChannelLabel": "Winkelkanaal / Supergroep-ID",
|
|
3524
|
+
"merchantChannelPlaceholder": "-1001234567890 of @winkel_meldingen",
|
|
3525
|
+
"saveChannelIdButton": "Kanaal-ID Opslaan",
|
|
3526
|
+
"sendTestButton": "Testbericht Verzenden",
|
|
3527
|
+
"smsTitle": "SMS-provider Driver",
|
|
3528
|
+
"smsSubtitle": "Selecteer Twilio SMS/MMS, Signal House (10DLC), MSG91 Flow, SMSAPI of Dummy Sandbox.",
|
|
3529
|
+
"smsDriverLabel": "SMS-driver",
|
|
3530
|
+
"driverTwilio": "Twilio (SMS / MMS + Messaging Service)",
|
|
3531
|
+
"driverSignalHouse": "Signal House (10DLC & Winkelwagenherstel)",
|
|
3532
|
+
"driverMsg91": "MSG91 Flow API",
|
|
3533
|
+
"driverSmsApi": "SMSAPI",
|
|
3534
|
+
"driverDummy": "Dummy OTP Sandbox (Test)",
|
|
3535
|
+
"saveSmsButton": "SMS-driver Opslaan"
|
|
3536
|
+
},
|
|
3537
|
+
logs: {
|
|
3538
|
+
"title": "Geanonimiseerd Verzendlogboek (PII Gemaskeerd & Idempotent)",
|
|
3539
|
+
"colEvent": "Gebeurtenis",
|
|
3540
|
+
"colChannel": "Kanaal",
|
|
3541
|
+
"colRecipient": "Ontvanger (Gemaskeerd)",
|
|
3542
|
+
"colStatus": "Status",
|
|
3543
|
+
"colExternalId": "Externe ID"
|
|
3544
|
+
},
|
|
3545
|
+
broadcasts: {
|
|
3546
|
+
"title": "TCPA / 10DLC Toestemmingsoverzicht & Klantgroep Broadcasts",
|
|
3547
|
+
"smsOptedIn": "SMS Opt-in: {{count}}",
|
|
3548
|
+
"whatsappOptedIn": "WhatsApp Opt-in: {{count}}",
|
|
3549
|
+
"telegramLinked": "Telegram Gekoppeld: {{count}}",
|
|
3550
|
+
"optedOut": "Uitgeschreven (STOP): {{count}}",
|
|
3551
|
+
"campaignNameLabel": "Campagnenaam",
|
|
3552
|
+
"campaignNamePlaceholder": "Weekend Flash Sale",
|
|
3553
|
+
"channelLabel": "Kanaal",
|
|
3554
|
+
"templateLabel": "Sjabloon",
|
|
3555
|
+
"sendNowButton": "Broadcast Nu Verzenden",
|
|
3556
|
+
"colCampaign": "Campagne",
|
|
3557
|
+
"colChannel": "Kanaal",
|
|
3558
|
+
"colStatus": "Status",
|
|
3559
|
+
"colSentTotal": "Verzonden / Totaal"
|
|
3560
|
+
},
|
|
3561
|
+
sandbox: {
|
|
3562
|
+
"title": "Lokale SMS / OTP & Multi-Channel Sandbox",
|
|
3563
|
+
"subtitle": "Vangt OTP-verificatiecodes en testmeldingen lokaal op zonder echte berichten te versturen.",
|
|
3564
|
+
"clearButton": "Opgevangen Berichten Wissen",
|
|
3565
|
+
"colChannel": "Kanaal",
|
|
3566
|
+
"colRecipient": "Ontvanger",
|
|
3567
|
+
"colOtp": "Geëxtraheerde OTP",
|
|
3568
|
+
"colBody": "Berichtinhoud"
|
|
3569
|
+
},
|
|
3570
|
+
widget: {
|
|
3571
|
+
"title": "Multi-Channel Bestelmeldingen ({{count}})",
|
|
3572
|
+
"subtitle": "Verstuur of herverstuur E-mail, WhatsApp/OpenWA, Telegram of SMS voor deze bestelling (met optionele PDF-factuur).",
|
|
3573
|
+
"channelPlaceholder": "Kanaal",
|
|
3574
|
+
"templatePlaceholder": "Sjabloon",
|
|
3575
|
+
"attachInvoiceLabel": "PDF-factuur bijvoegen (indien gegenereerd)",
|
|
3576
|
+
"sending": "Verzenden...",
|
|
3577
|
+
"sendResendButton": "Melding Verzenden / Opnieuw Verzenden",
|
|
3578
|
+
"dispatchedSuccess": "{{channel}}-melding verzonden",
|
|
3579
|
+
"dispatchFailed": "Melding verzenden mislukt",
|
|
3580
|
+
"colChannel": "Kanaal",
|
|
3581
|
+
"colEventTemplate": "Gebeurtenis / Sjabloon",
|
|
3582
|
+
"colRecipient": "Ontvanger",
|
|
3583
|
+
"colStatus": "Status"
|
|
3584
|
+
},
|
|
3585
|
+
messages: {
|
|
3586
|
+
"loadStudioError": "Kan gegevens van Notificatiestudio niet laden.",
|
|
3587
|
+
"clonedPresetSuccess": "Preset gekloond naar bewerkbaar DB-sjabloon '{{label}}'.",
|
|
3588
|
+
"clonePresetError": "Systeempreset klonen mislukt.",
|
|
3589
|
+
"savedTemplateSuccess": "Sjabloon & blokstructuur opgeslagen.",
|
|
3590
|
+
"saveTemplateError": "Sjabloon opslaan mislukt.",
|
|
3591
|
+
"createdMappingSuccess": "Actieve koppeling gemaakt voor '{{event}}' -> '{{channel}}'.",
|
|
3592
|
+
"createMappingError": "Gebeurteniskoppeling maken mislukt.",
|
|
3593
|
+
"verifiedChannelSuccess": "Kanaal '{{channel}}' geverifieerd en testbericht verzonden.",
|
|
3594
|
+
"savedChannelSuccess": "Configuratie '{{channel}}' opgeslagen.",
|
|
3595
|
+
"channelActionError": "Actie {{action}} voor {{channel}} mislukt",
|
|
3596
|
+
"broadcastSentSuccess": "Broadcastcampagne verzonden naar opt-in ontvangers."
|
|
3597
|
+
}
|
|
3598
|
+
} },
|
|
3599
|
+
pl: { translation: {
|
|
3600
|
+
nav: { "label": "Powiadomienia" },
|
|
3601
|
+
header: {
|
|
3602
|
+
"title": "Wielokanałowe Studio Powiadomień (E-mail, WhatsApp/OpenWA, Telegram, SMS, Slack)",
|
|
3603
|
+
"subtitle": "Wizualny kreator bloków i szablonów, mapowanie zdarzeń w bazie, bramki wielosterownikowe, rejestr zgód i piaskownica OTP.",
|
|
3604
|
+
"languageLabel": "Język",
|
|
3605
|
+
"refresh": "Odśwież Studio",
|
|
3606
|
+
"successBadge": "SUKCES",
|
|
3607
|
+
"errorBadge": "BŁĄD"
|
|
3608
|
+
},
|
|
3609
|
+
tabs: {
|
|
3610
|
+
"templates": "Szablony i Kreator Wizualny ({{count}})",
|
|
3611
|
+
"mappings": "Mapowanie Zdarzeń ({{count}})",
|
|
3612
|
+
"channels": "Kanały (OpenWA / Telegram / SMS)",
|
|
3613
|
+
"logs": "Dziennik Dostarczeń ({{count}})",
|
|
3614
|
+
"broadcasts": "Kampanie i Rejestr Zgód",
|
|
3615
|
+
"sandbox": "Piaskownica OTP ({{count}})"
|
|
3616
|
+
},
|
|
3617
|
+
templates: {
|
|
3618
|
+
"title": "Szablony",
|
|
3619
|
+
"filterChannel": "Filtruj Kanał",
|
|
3620
|
+
"allChannels": "Wszystkie Kanały",
|
|
3621
|
+
"modeLabel": "Tryb: {{mode}}",
|
|
3622
|
+
"inspectPreview": "Sprawdź / Podgląd",
|
|
3623
|
+
"cloneToDb": "Klonuj do Bazy",
|
|
3624
|
+
"saveButton": "Zapisz Szablon i Bloki",
|
|
3625
|
+
"subjectLabel": "Temat wiadomości (E-mail / Tytuł)",
|
|
3626
|
+
"metaTemplateLabel": "Nazwa Szablonu Meta WABA (WhatsApp Cloud)",
|
|
3627
|
+
"rawContentLabel": "Treść szablonu Raw (obsługuje {{data.*}}, {{translations.*}} oraz {{ .var }})",
|
|
3628
|
+
"blockTreeLabel": "Wizualne Drzewo Bloków ({{count}} bloków)",
|
|
3629
|
+
"removeBlock": "Usuń",
|
|
3630
|
+
"previewTitle": "Podgląd Wielokanałowy na Żywo ({{locale}})",
|
|
3631
|
+
"contextPlaceholder": "Kontekst",
|
|
3632
|
+
"localePlaceholder": "Język",
|
|
3633
|
+
"subjectPrefix": "Temat: {{subject}}",
|
|
3634
|
+
"encodingBadge": "Kodowanie: {{encoding}}",
|
|
3635
|
+
"segmentsBadge": "Segmenty: {{segments}} ({{chars}} znaków)",
|
|
3636
|
+
"waButtonPrefix": "[Przycisk WA] {{title}}",
|
|
3637
|
+
"tgInlinePrefix": "[Przycisk TG] {{text}}",
|
|
3638
|
+
"emptySelection": "Wybierz szablon po lewej stronie, aby sprawdzić drzewo bloków, sklonować szablon systemowy lub wyświetlić podgląd."
|
|
3639
|
+
},
|
|
3640
|
+
mappings: {
|
|
3641
|
+
"title": "Utwórz Mapowanie Zdarzenie → Kanał → Szablon",
|
|
3642
|
+
"eventLabel": "Zdarzenie Sklepu Medusa",
|
|
3643
|
+
"channelLabel": "Kanał",
|
|
3644
|
+
"templateLabel": "Szablon",
|
|
3645
|
+
"recipientRuleLabel": "Reguła Odbiorcy",
|
|
3646
|
+
"ruleCustomerAuto": "Klient Automatycznie",
|
|
3647
|
+
"ruleOrderEmail": "E-mail Zamówienia",
|
|
3648
|
+
"ruleOrderPhone": "Telefon Zamówienia (E.164)",
|
|
3649
|
+
"ruleCustomerTelegram": "Telegram DM Klienta",
|
|
3650
|
+
"ruleMerchantChannel": "Kanał / Grupa Sklepu",
|
|
3651
|
+
"ruleB2bAccounting": "Kontakt Księgowości B2B",
|
|
3652
|
+
"threadIdLabel": "ID Wątku / Tematu Telegram (Opcjonalnie)",
|
|
3653
|
+
"threadIdPlaceholder": "np. 42",
|
|
3654
|
+
"attachInvoiceLabel": "Automatycznie dołącz fakturę PDF z medusa-documents-plugin (E-mail, WhatsApp/OpenWA i Telegram)",
|
|
3655
|
+
"addMappingButton": "Dodaj Aktywne Mapowanie",
|
|
3656
|
+
"colEvent": "Zdarzenie",
|
|
3657
|
+
"colChannel": "Kanał",
|
|
3658
|
+
"colTemplate": "Szablon",
|
|
3659
|
+
"colRecipientRule": "Reguła Odbiorcy",
|
|
3660
|
+
"colAttachments": "Załączniki",
|
|
3661
|
+
"colAction": "Akcja",
|
|
3662
|
+
"deleteButton": "Usuń"
|
|
3663
|
+
},
|
|
3664
|
+
channels: {
|
|
3665
|
+
"whatsappTitle": "Bramka WhatsApp i OpenWA",
|
|
3666
|
+
"whatsappSubtitle": "Przełączaj między oficjalnym Meta Cloud API (Szablony WABA) a własnym serwerem OpenWA / WAHA / Evolution API.",
|
|
3667
|
+
"activeDriverLabel": "Aktywny Sterownik",
|
|
3668
|
+
"driverMetaCloud": "Meta Cloud API (Oficjalne WABA)",
|
|
3669
|
+
"driverOpenWa": "OpenWA (@open-wa/wa-automate REST)",
|
|
3670
|
+
"driverWaha": "WAHA (WhatsApp HTTP API)",
|
|
3671
|
+
"driverEvolution": "Evolution API v2",
|
|
3672
|
+
"gatewayUrlLabel": "URL Bramki OpenWA / WAHA / Evolution",
|
|
3673
|
+
"saveWhatsappButton": "Zapisz Sterownik WhatsApp",
|
|
3674
|
+
"telegramTitle": "Powiadomienia Telegram",
|
|
3675
|
+
"verifiedBadge": "Zweryfikowano",
|
|
3676
|
+
"unverifiedBadge": "Niezweryfikowano",
|
|
3677
|
+
"telegramSubtitle": "Skonfiguruj supergrupę sklepu (-100... lub @kanał). Zmiana ID resetuje weryfikację do czasu wysłania wiadomości testowej.",
|
|
3678
|
+
"merchantChannelLabel": "ID Kanału / Supergrupy Sklepu",
|
|
3679
|
+
"merchantChannelPlaceholder": "-1001234567890 lub @alerty_sklepu",
|
|
3680
|
+
"saveChannelIdButton": "Zapisz ID Kanału",
|
|
3681
|
+
"sendTestButton": "Wyślij Wiadomość Testową",
|
|
3682
|
+
"smsTitle": "Sterownik Operatora SMS",
|
|
3683
|
+
"smsSubtitle": "Wybierz Twilio SMS/MMS, Signal House (10DLC), MSG91 Flow, SMSAPI lub Piaskownicę OTP.",
|
|
3684
|
+
"smsDriverLabel": "Sterownik SMS",
|
|
3685
|
+
"driverTwilio": "Twilio (SMS / MMS + Messaging Service)",
|
|
3686
|
+
"driverSignalHouse": "Signal House (10DLC i Porzucone Koszyki)",
|
|
3687
|
+
"driverMsg91": "MSG91 Flow API",
|
|
3688
|
+
"driverSmsApi": "SMSAPI",
|
|
3689
|
+
"driverDummy": "Piaskownica OTP (Testy)",
|
|
3690
|
+
"saveSmsButton": "Zapisz Sterownik SMS"
|
|
3691
|
+
},
|
|
3692
|
+
logs: {
|
|
3693
|
+
"title": "Zanonimizowany Rejestr Dostarczeń (Ukryte PII i Idempotentność)",
|
|
3694
|
+
"colEvent": "Zdarzenie",
|
|
3695
|
+
"colChannel": "Kanał",
|
|
3696
|
+
"colRecipient": "Odbiorca (Zamaskowany)",
|
|
3697
|
+
"colStatus": "Status",
|
|
3698
|
+
"colExternalId": "Zewnętrzne ID"
|
|
3699
|
+
},
|
|
3700
|
+
broadcasts: {
|
|
3701
|
+
"title": "Podsumowanie Zgód TCPA / 10DLC i Wysyłki Masowe",
|
|
3702
|
+
"smsOptedIn": "Zgody SMS: {{count}}",
|
|
3703
|
+
"whatsappOptedIn": "Zgody WhatsApp: {{count}}",
|
|
3704
|
+
"telegramLinked": "Połączeni Telegram: {{count}}",
|
|
3705
|
+
"optedOut": "Wypisani (STOP): {{count}}",
|
|
3706
|
+
"campaignNameLabel": "Nazwa Kampanii",
|
|
3707
|
+
"campaignNamePlaceholder": "Weekendowa Wyprzedaż Błyskawiczna",
|
|
3708
|
+
"channelLabel": "Kanał",
|
|
3709
|
+
"templateLabel": "Szablon",
|
|
3710
|
+
"sendNowButton": "Wyślij Kampanię Teraz",
|
|
3711
|
+
"colCampaign": "Kampania",
|
|
3712
|
+
"colChannel": "Kanał",
|
|
3713
|
+
"colStatus": "Status",
|
|
3714
|
+
"colSentTotal": "Wysłane / Razem"
|
|
3715
|
+
},
|
|
3716
|
+
sandbox: {
|
|
3717
|
+
"title": "Lokalna Piaskownica SMS / OTP i Wielokanałowa",
|
|
3718
|
+
"subtitle": "Przechwytuje kody weryfikacyjne OTP i powiadomienia testowe lokalnie bez wysyłania prawdziwych wiadomości.",
|
|
3719
|
+
"clearButton": "Wyczyść Przechwycone Wiadomości",
|
|
3720
|
+
"colChannel": "Kanał",
|
|
3721
|
+
"colRecipient": "Odbiorca",
|
|
3722
|
+
"colOtp": "Kod OTP",
|
|
3723
|
+
"colBody": "Treść Wiadomości"
|
|
3724
|
+
},
|
|
3725
|
+
widget: {
|
|
3726
|
+
"title": "Wielokanałowe Powiadomienia Zamówienia ({{count}})",
|
|
3727
|
+
"subtitle": "Wyślij lub ponów E-mail, WhatsApp/OpenWA, Telegram lub SMS dla tego zamówienia (opcjonalnie z fakturą PDF).",
|
|
3728
|
+
"channelPlaceholder": "Kanał",
|
|
3729
|
+
"templatePlaceholder": "Szablon",
|
|
3730
|
+
"attachInvoiceLabel": "Dołącz fakturę PDF (jeśli wygenerowano)",
|
|
3731
|
+
"sending": "Wysyłanie...",
|
|
3732
|
+
"sendResendButton": "Wyślij / Ponów Powiadomienie",
|
|
3733
|
+
"dispatchedSuccess": "Wysłano powiadomienie ({{channel}})",
|
|
3734
|
+
"dispatchFailed": "Nie udało się wysłać powiadomienia",
|
|
3735
|
+
"colChannel": "Kanał",
|
|
3736
|
+
"colEventTemplate": "Zdarzenie / Szablon",
|
|
3737
|
+
"colRecipient": "Odbiorca",
|
|
3738
|
+
"colStatus": "Status"
|
|
3739
|
+
},
|
|
3740
|
+
messages: {
|
|
3741
|
+
"loadStudioError": "Nie udało się załadować danych Studia Powiadomień.",
|
|
3742
|
+
"clonedPresetSuccess": "Sklonowano szablon systemowy do edytowalnego szablonu '{{label}}'.",
|
|
3743
|
+
"clonePresetError": "Nie udało się sklonować szablonu systemowego.",
|
|
3744
|
+
"savedTemplateSuccess": "Zapisano szablon i drzewo bloków.",
|
|
3745
|
+
"saveTemplateError": "Nie udało się zapisać szablonu.",
|
|
3746
|
+
"createdMappingSuccess": "Utworzono aktywne mapowanie dla '{{event}}' -> '{{channel}}'.",
|
|
3747
|
+
"createMappingError": "Nie udało się utworzyć mapowania zdarzenia.",
|
|
3748
|
+
"verifiedChannelSuccess": "Zweryfikowano kanał '{{channel}}' i wysłano wiadomość testową.",
|
|
3749
|
+
"savedChannelSuccess": "Zapisano konfigurację kanału '{{channel}}'.",
|
|
3750
|
+
"channelActionError": "Błąd akcji {{action}} dla kanału {{channel}}",
|
|
3751
|
+
"broadcastSentSuccess": "Kampania masowa została wysłana do subskrybentów."
|
|
3752
|
+
}
|
|
3753
|
+
} },
|
|
3754
|
+
pt: { translation: {
|
|
3755
|
+
nav: { "label": "Notificações" },
|
|
3756
|
+
header: {
|
|
3757
|
+
"title": "Estúdio de Notificações Multicanal (E-mail, WhatsApp/OpenWA, Telegram, SMS, Slack)",
|
|
3758
|
+
"subtitle": "Construtor Visual de Blocos e Modelos, Mapeamento de Eventos em BD, Gateways Multi-Driver, Consentimento e Sandbox OTP.",
|
|
3759
|
+
"languageLabel": "Idioma",
|
|
3760
|
+
"refresh": "Atualizar Estúdio",
|
|
3761
|
+
"successBadge": "SUCESSO",
|
|
3762
|
+
"errorBadge": "ERRO"
|
|
3763
|
+
},
|
|
3764
|
+
tabs: {
|
|
3765
|
+
"templates": "Modelos e Construtor Visual ({{count}})",
|
|
3766
|
+
"mappings": "Mapeamento de Eventos ({{count}})",
|
|
3767
|
+
"channels": "Canais (OpenWA / Telegram / SMS)",
|
|
3768
|
+
"logs": "Registos de Envio ({{count}})",
|
|
3769
|
+
"broadcasts": "Campanhas e Consentimento",
|
|
3770
|
+
"sandbox": "Sandbox OTP ({{count}})"
|
|
3771
|
+
},
|
|
3772
|
+
templates: {
|
|
3773
|
+
"title": "Modelos",
|
|
3774
|
+
"filterChannel": "Filtrar Canal",
|
|
3775
|
+
"allChannels": "Todos os Canais",
|
|
3776
|
+
"modeLabel": "Modo: {{mode}}",
|
|
3777
|
+
"inspectPreview": "Inspecionar / Pré-visualizar",
|
|
3778
|
+
"cloneToDb": "Clonar para BD",
|
|
3779
|
+
"saveButton": "Guardar Modelo e Blocos",
|
|
3780
|
+
"subjectLabel": "Assunto (E-mail / Título)",
|
|
3781
|
+
"metaTemplateLabel": "Nome do Modelo Meta WABA (WhatsApp Cloud)",
|
|
3782
|
+
"rawContentLabel": "Conteúdo Raw (suporta {{data.*}}, {{translations.*}} e {{ .var }})",
|
|
3783
|
+
"blockTreeLabel": "Árvore Visual de Blocos ({{count}} blocos)",
|
|
3784
|
+
"removeBlock": "Remover",
|
|
3785
|
+
"previewTitle": "Pré-visualização Multicanal ao Vivo ({{locale}})",
|
|
3786
|
+
"contextPlaceholder": "Contexto",
|
|
3787
|
+
"localePlaceholder": "Idioma",
|
|
3788
|
+
"subjectPrefix": "Assunto: {{subject}}",
|
|
3789
|
+
"encodingBadge": "Codificação: {{encoding}}",
|
|
3790
|
+
"segmentsBadge": "Segmentos: {{segments}} ({{chars}} caracteres)",
|
|
3791
|
+
"waButtonPrefix": "[Botão WA] {{title}}",
|
|
3792
|
+
"tgInlinePrefix": "[Botão TG] {{text}}",
|
|
3793
|
+
"emptySelection": "Selecione um modelo à esquerda para inspecionar os blocos, clonar uma predefinição ou pré-visualizar."
|
|
3794
|
+
},
|
|
3795
|
+
mappings: {
|
|
3796
|
+
"title": "Criar Mapeamento Evento → Canal → Modelo",
|
|
3797
|
+
"eventLabel": "Evento da Loja Medusa",
|
|
3798
|
+
"channelLabel": "Canal",
|
|
3799
|
+
"templateLabel": "Modelo",
|
|
3800
|
+
"recipientRuleLabel": "Regra de Destinatário",
|
|
3801
|
+
"ruleCustomerAuto": "Cliente Automático",
|
|
3802
|
+
"ruleOrderEmail": "E-mail do Pedido",
|
|
3803
|
+
"ruleOrderPhone": "Telefone do Pedido (E.164)",
|
|
3804
|
+
"ruleCustomerTelegram": "Telegram DM do Cliente",
|
|
3805
|
+
"ruleMerchantChannel": "Canal / Grupo do Lojista",
|
|
3806
|
+
"ruleB2bAccounting": "Contacto Financeiro B2B",
|
|
3807
|
+
"threadIdLabel": "ID do Tópico Telegram (Opcional)",
|
|
3808
|
+
"threadIdPlaceholder": "ex. 42",
|
|
3809
|
+
"attachInvoiceLabel": "Anexar Fatura PDF automaticamente via medusa-documents-plugin (E-mail, WhatsApp/OpenWA e Telegram)",
|
|
3810
|
+
"addMappingButton": "Adicionar Mapeamento Ativo",
|
|
3811
|
+
"colEvent": "Evento",
|
|
3812
|
+
"colChannel": "Canal",
|
|
3813
|
+
"colTemplate": "Modelo",
|
|
3814
|
+
"colRecipientRule": "Destinatário",
|
|
3815
|
+
"colAttachments": "Anexos",
|
|
3816
|
+
"colAction": "Ação",
|
|
3817
|
+
"deleteButton": "Eliminar"
|
|
3818
|
+
},
|
|
3819
|
+
channels: {
|
|
3820
|
+
"whatsappTitle": "Gateway WhatsApp e OpenWA",
|
|
3821
|
+
"whatsappSubtitle": "Alterne entre a API Oficial Meta Cloud (Modelos WABA) e OpenWA / WAHA / Evolution API auto-hospedados.",
|
|
3822
|
+
"activeDriverLabel": "Driver Ativo",
|
|
3823
|
+
"driverMetaCloud": "Meta Cloud API (WABA Oficial)",
|
|
3824
|
+
"driverOpenWa": "OpenWA (@open-wa/wa-automate REST)",
|
|
3825
|
+
"driverWaha": "WAHA (WhatsApp HTTP API)",
|
|
3826
|
+
"driverEvolution": "Evolution API v2",
|
|
3827
|
+
"gatewayUrlLabel": "URL do Gateway OpenWA / WAHA / Evolution",
|
|
3828
|
+
"saveWhatsappButton": "Guardar Driver WhatsApp",
|
|
3829
|
+
"telegramTitle": "Notificações Telegram",
|
|
3830
|
+
"verifiedBadge": "Verificado",
|
|
3831
|
+
"unverifiedBadge": "Não Verificado",
|
|
3832
|
+
"telegramSubtitle": "Configure o supergrupo da loja (-100... ou @canal). Alterar o ID reinicia a verificação até enviar um teste.",
|
|
3833
|
+
"merchantChannelLabel": "ID do Canal / Supergrupo da Loja",
|
|
3834
|
+
"merchantChannelPlaceholder": "-1001234567890 ou @alertas_loja",
|
|
3835
|
+
"saveChannelIdButton": "Guardar ID do Canal",
|
|
3836
|
+
"sendTestButton": "Enviar Mensagem de Teste",
|
|
3837
|
+
"smsTitle": "Driver de Operadora SMS",
|
|
3838
|
+
"smsSubtitle": "Selecione Twilio SMS/MMS, Signal House (10DLC), MSG91 Flow, SMSAPI ou Sandbox OTP.",
|
|
3839
|
+
"smsDriverLabel": "Driver SMS",
|
|
3840
|
+
"driverTwilio": "Twilio (SMS / MMS + Messaging Service)",
|
|
3841
|
+
"driverSignalHouse": "Signal House (10DLC e Recuperação de Carrinho)",
|
|
3842
|
+
"driverMsg91": "MSG91 Flow API",
|
|
3843
|
+
"driverSmsApi": "SMSAPI",
|
|
3844
|
+
"driverDummy": "Sandbox OTP (Teste)",
|
|
3845
|
+
"saveSmsButton": "Guardar Driver SMS"
|
|
3846
|
+
},
|
|
3847
|
+
logs: {
|
|
3848
|
+
"title": "Registo de Entregas Protegido (PII Mascarado e Idempotente)",
|
|
3849
|
+
"colEvent": "Evento",
|
|
3850
|
+
"colChannel": "Canal",
|
|
3851
|
+
"colRecipient": "Destinatário (Mascarado)",
|
|
3852
|
+
"colStatus": "Estado",
|
|
3853
|
+
"colExternalId": "ID Externo"
|
|
3854
|
+
},
|
|
3855
|
+
broadcasts: {
|
|
3856
|
+
"title": "Resumo de Consentimento TCPA / 10DLC e Campanhas para Clientes",
|
|
3857
|
+
"smsOptedIn": "SMS Subscritos: {{count}}",
|
|
3858
|
+
"whatsappOptedIn": "WhatsApp Subscritos: {{count}}",
|
|
3859
|
+
"telegramLinked": "Telegram Associados: {{count}}",
|
|
3860
|
+
"optedOut": "Cancelados (STOP): {{count}}",
|
|
3861
|
+
"campaignNameLabel": "Nome da Campanha",
|
|
3862
|
+
"campaignNamePlaceholder": "Promoção Relâmpago de Fim de Semana",
|
|
3863
|
+
"channelLabel": "Canal",
|
|
3864
|
+
"templateLabel": "Modelo",
|
|
3865
|
+
"sendNowButton": "Enviar Campanha Agora",
|
|
3866
|
+
"colCampaign": "Campanha",
|
|
3867
|
+
"colChannel": "Canal",
|
|
3868
|
+
"colStatus": "Estado",
|
|
3869
|
+
"colSentTotal": "Enviados / Total"
|
|
3870
|
+
},
|
|
3871
|
+
sandbox: {
|
|
3872
|
+
"title": "Sandbox Local SMS / OTP e Multicanal",
|
|
3873
|
+
"subtitle": "Captura códigos OTP e notificações de teste localmente sem enviar mensagens reais.",
|
|
3874
|
+
"clearButton": "Limpar Mensagens Capturadas",
|
|
3875
|
+
"colChannel": "Canal",
|
|
3876
|
+
"colRecipient": "Destinatário",
|
|
3877
|
+
"colOtp": "OTP Extraído",
|
|
3878
|
+
"colBody": "Mensagem"
|
|
3879
|
+
},
|
|
3880
|
+
widget: {
|
|
3881
|
+
"title": "Notificações Multicanal do Pedido ({{count}})",
|
|
3882
|
+
"subtitle": "Envie ou reenvie E-mail, WhatsApp/OpenWA, Telegram ou SMS para este pedido (com fatura PDF opcional).",
|
|
3883
|
+
"channelPlaceholder": "Canal",
|
|
3884
|
+
"templatePlaceholder": "Modelo",
|
|
3885
|
+
"attachInvoiceLabel": "Anexar Fatura PDF (se gerada)",
|
|
3886
|
+
"sending": "A enviar...",
|
|
3887
|
+
"sendResendButton": "Enviar / Reenviar Notificação",
|
|
3888
|
+
"dispatchedSuccess": "Notificação {{channel}} enviada",
|
|
3889
|
+
"dispatchFailed": "Falha ao enviar notificação",
|
|
3890
|
+
"colChannel": "Canal",
|
|
3891
|
+
"colEventTemplate": "Evento / Modelo",
|
|
3892
|
+
"colRecipient": "Destinatário",
|
|
3893
|
+
"colStatus": "Estado"
|
|
3894
|
+
},
|
|
3895
|
+
messages: {
|
|
3896
|
+
"loadStudioError": "Falha ao carregar dados do Estúdio de Notificações.",
|
|
3897
|
+
"clonedPresetSuccess": "Predefinição clonada para o modelo editável '{{label}}'.",
|
|
3898
|
+
"clonePresetError": "Falha ao clonar predefinição do sistema.",
|
|
3899
|
+
"savedTemplateSuccess": "Modelo e árvore de blocos guardados.",
|
|
3900
|
+
"saveTemplateError": "Falha ao guardar o modelo.",
|
|
3901
|
+
"createdMappingSuccess": "Mapeamento ativo criado para '{{event}}' -> '{{channel}}'.",
|
|
3902
|
+
"createMappingError": "Falha ao criar mapeamento de evento.",
|
|
3903
|
+
"verifiedChannelSuccess": "Canal '{{channel}}' verificado e mensagem de teste enviada.",
|
|
3904
|
+
"savedChannelSuccess": "Configuração '{{channel}}' guardada.",
|
|
3905
|
+
"channelActionError": "Falha ao executar {{action}} em {{channel}}",
|
|
3906
|
+
"broadcastSentSuccess": "Campanha enviada para os destinatários subscritos."
|
|
3907
|
+
}
|
|
3908
|
+
} },
|
|
3909
|
+
tr: { translation: {
|
|
3910
|
+
nav: { "label": "Bildirimler" },
|
|
3911
|
+
header: {
|
|
3912
|
+
"title": "Çok Kanallı Bildirim Stüdyosu (E-posta, WhatsApp/OpenWA, Telegram, SMS, Slack)",
|
|
3913
|
+
"subtitle": "Görsel Blok ve Ham Şablon Oluşturucu, Veritabanı Olay Eşlemeleri, Çoklu Sürücü Ağ Geçitleri, İzin Kaydı ve Dummy OTP Sandbox.",
|
|
3914
|
+
"languageLabel": "Dil",
|
|
3915
|
+
"refresh": "Stüdyoyu Yenile",
|
|
3916
|
+
"successBadge": "BAŞARILI",
|
|
3917
|
+
"errorBadge": "HATA"
|
|
3918
|
+
},
|
|
3919
|
+
tabs: {
|
|
3920
|
+
"templates": "Şablonlar ve Görsel Oluşturucu ({{count}})",
|
|
3921
|
+
"mappings": "Olay Eşlemeleri ({{count}})",
|
|
3922
|
+
"channels": "Kanallar (OpenWA / Telegram / SMS)",
|
|
3923
|
+
"logs": "Teslimat Kayıtları ({{count}})",
|
|
3924
|
+
"broadcasts": "Toplu Gönderim ve İzin Defteri",
|
|
3925
|
+
"sandbox": "Dummy OTP Sandbox ({{count}})"
|
|
3926
|
+
},
|
|
3927
|
+
templates: {
|
|
3928
|
+
"title": "Şablonlar",
|
|
3929
|
+
"filterChannel": "Kanal Filtrele",
|
|
3930
|
+
"allChannels": "Tüm Kanallar",
|
|
3931
|
+
"modeLabel": "Mod: {{mode}}",
|
|
3932
|
+
"inspectPreview": "İncele / Önizle",
|
|
3933
|
+
"cloneToDb": "VT'ye Kopyala",
|
|
3934
|
+
"saveButton": "Şablonu ve Blokları Kaydet",
|
|
3935
|
+
"subjectLabel": "Konu Satırı (E-posta / Başlık)",
|
|
3936
|
+
"metaTemplateLabel": "Meta WABA Şablon Adı (WhatsApp Cloud)",
|
|
3937
|
+
"rawContentLabel": "Ham Şablon İçeriği ({{data.*}}, {{translations.*}} ve {{ .var }} destekler)",
|
|
3938
|
+
"blockTreeLabel": "Görsel Blok Ağacı ({{count}} blok)",
|
|
3939
|
+
"removeBlock": "Kaldır",
|
|
3940
|
+
"previewTitle": "Canlı Çok Kanallı Önizleme ({{locale}})",
|
|
3941
|
+
"contextPlaceholder": "Bağlam",
|
|
3942
|
+
"localePlaceholder": "Dil",
|
|
3943
|
+
"subjectPrefix": "Konu: {{subject}}",
|
|
3944
|
+
"encodingBadge": "Kodlama: {{encoding}}",
|
|
3945
|
+
"segmentsBadge": "Segment: {{segments}} ({{chars}} karakter)",
|
|
3946
|
+
"waButtonPrefix": "[WA Butonu] {{title}}",
|
|
3947
|
+
"tgInlinePrefix": "[TG Butonu] {{text}}",
|
|
3948
|
+
"emptySelection": "Blok ağacını incelemek, sistem şablonunu kopyalamak veya farklı dillerde önizlemek için soldan bir şablon seçin."
|
|
3949
|
+
},
|
|
3950
|
+
mappings: {
|
|
3951
|
+
"title": "Olay → Kanal → Şablon Eşlemesi Oluştur",
|
|
3952
|
+
"eventLabel": "Medusa Mağaza Olayı",
|
|
3953
|
+
"channelLabel": "Kanal",
|
|
3954
|
+
"templateLabel": "Şablon",
|
|
3955
|
+
"recipientRuleLabel": "Alıcı Kuralı",
|
|
3956
|
+
"ruleCustomerAuto": "Müşteri Otomatik",
|
|
3957
|
+
"ruleOrderEmail": "Sipariş E-postası",
|
|
3958
|
+
"ruleOrderPhone": "Sipariş Telefonu (E.164)",
|
|
3959
|
+
"ruleCustomerTelegram": "Müşteri Telegram DM",
|
|
3960
|
+
"ruleMerchantChannel": "Mağaza Kanalı / Grubu",
|
|
3961
|
+
"ruleB2bAccounting": "B2B Muhasebe Yetkilisi",
|
|
3962
|
+
"threadIdLabel": "Telegram Konu (Thread) ID (İsteğe Bağlı)",
|
|
3963
|
+
"threadIdPlaceholder": "örn. 42",
|
|
3964
|
+
"attachInvoiceLabel": "medusa-documents-plugin üzerinden PDF Faturayı otomatik ekle (E-posta, WhatsApp/OpenWA ve Telegram)",
|
|
3965
|
+
"addMappingButton": "Aktif Eşleme Ekle",
|
|
3966
|
+
"colEvent": "Olay",
|
|
3967
|
+
"colChannel": "Kanal",
|
|
3968
|
+
"colTemplate": "Şablon",
|
|
3969
|
+
"colRecipientRule": "Alıcı Kuralı",
|
|
3970
|
+
"colAttachments": "Ekler",
|
|
3971
|
+
"colAction": "İşlem",
|
|
3972
|
+
"deleteButton": "Sil"
|
|
3973
|
+
},
|
|
3974
|
+
channels: {
|
|
3975
|
+
"whatsappTitle": "WhatsApp ve OpenWA Ağ Geçidi",
|
|
3976
|
+
"whatsappSubtitle": "Resmi Meta Cloud API (WABA Şablonları) ile kendi barındırdığınız OpenWA / WAHA / Evolution API arasında geçiş yapın.",
|
|
3977
|
+
"activeDriverLabel": "Aktif Sürücü",
|
|
3978
|
+
"driverMetaCloud": "Meta Cloud API (Resmi WABA)",
|
|
3979
|
+
"driverOpenWa": "OpenWA (@open-wa/wa-automate REST)",
|
|
3980
|
+
"driverWaha": "WAHA (WhatsApp HTTP API)",
|
|
3981
|
+
"driverEvolution": "Evolution API v2",
|
|
3982
|
+
"gatewayUrlLabel": "OpenWA / WAHA / Evolution Ağ Geçidi URL'si",
|
|
3983
|
+
"saveWhatsappButton": "WhatsApp Sürücüsünü Kaydet",
|
|
3984
|
+
"telegramTitle": "Telegram Bildirimleri",
|
|
3985
|
+
"verifiedBadge": "Doğrulandı",
|
|
3986
|
+
"unverifiedBadge": "Doğrulanmadı",
|
|
3987
|
+
"telegramSubtitle": "Mağaza Süper Grubunu (-100... veya @kanal) yapılandırın. Kanal ID'sini değiştirmek, test mesajı başarılı olana kadar doğrulamayı sıfırlar.",
|
|
3988
|
+
"merchantChannelLabel": "Mağaza Kanal / Süper Grup ID",
|
|
3989
|
+
"merchantChannelPlaceholder": "-1001234567890 veya @magaza_uyarilari",
|
|
3990
|
+
"saveChannelIdButton": "Kanal ID Kaydet",
|
|
3991
|
+
"sendTestButton": "Test Mesajı Gönder",
|
|
3992
|
+
"smsTitle": "SMS Operatör Sürücüsü",
|
|
3993
|
+
"smsSubtitle": "Twilio SMS/MMS, Signal House (10DLC), MSG91 Flow, SMSAPI veya Dummy Sandbox seçin.",
|
|
3994
|
+
"smsDriverLabel": "SMS Sürücüsü",
|
|
3995
|
+
"driverTwilio": "Twilio (SMS / MMS + Mesajlaşma Servisi)",
|
|
3996
|
+
"driverSignalHouse": "Signal House (10DLC ve Sepet Kurtarma)",
|
|
3997
|
+
"driverMsg91": "MSG91 Flow API",
|
|
3998
|
+
"driverSmsApi": "SMSAPI",
|
|
3999
|
+
"driverDummy": "Dummy OTP Sandbox (Test)",
|
|
4000
|
+
"saveSmsButton": "SMS Sürücüsünü Kaydet"
|
|
4001
|
+
},
|
|
4002
|
+
logs: {
|
|
4003
|
+
"title": "Maskelenmiş Teslimat Kayıtları (KVKK/PII Korumalı ve İdempotent)",
|
|
4004
|
+
"colEvent": "Olay",
|
|
4005
|
+
"colChannel": "Kanal",
|
|
4006
|
+
"colRecipient": "Alıcı (Maskelenmiş)",
|
|
4007
|
+
"colStatus": "Durum",
|
|
4008
|
+
"colExternalId": "Harici ID"
|
|
4009
|
+
},
|
|
4010
|
+
broadcasts: {
|
|
4011
|
+
"title": "TCPA / 10DLC İzin Özeti ve Müşteri Grubu Duyuruları",
|
|
4012
|
+
"smsOptedIn": "SMS Onaylı: {{count}}",
|
|
4013
|
+
"whatsappOptedIn": "WhatsApp Onaylı: {{count}}",
|
|
4014
|
+
"telegramLinked": "Telegram Bağlı: {{count}}",
|
|
4015
|
+
"optedOut": "İptal Edenler (STOP): {{count}}",
|
|
4016
|
+
"campaignNameLabel": "Kampanya Adı",
|
|
4017
|
+
"campaignNamePlaceholder": "Hafta Sonu Flaş İndirimi",
|
|
4018
|
+
"channelLabel": "Kanal",
|
|
4019
|
+
"templateLabel": "Şablon",
|
|
4020
|
+
"sendNowButton": "Duyuruyu Şimdi Gönder",
|
|
4021
|
+
"colCampaign": "Kampanya",
|
|
4022
|
+
"colChannel": "Kanal",
|
|
4023
|
+
"colStatus": "Durum",
|
|
4024
|
+
"colSentTotal": "Gönderilen / Toplam"
|
|
4025
|
+
},
|
|
4026
|
+
sandbox: {
|
|
4027
|
+
"title": "Dummy SMS / OTP ve Çok Kanallı Sandbox",
|
|
4028
|
+
"subtitle": "Gerçek operatör mesajı göndermeden OTP doğrulama kodlarını ve test bildirimlerini yerel olarak yakalar.",
|
|
4029
|
+
"clearButton": "Yakalanan Mesajları Temizle",
|
|
4030
|
+
"colChannel": "Kanal",
|
|
4031
|
+
"colRecipient": "Alıcı",
|
|
4032
|
+
"colOtp": "Çıkarılan OTP",
|
|
4033
|
+
"colBody": "Mesaj İçeriği"
|
|
4034
|
+
},
|
|
4035
|
+
widget: {
|
|
4036
|
+
"title": "Çok Kanallı Sipariş Bildirimleri ({{count}})",
|
|
4037
|
+
"subtitle": "Bu sipariş için E-posta, WhatsApp/OpenWA, Telegram veya SMS gönderin / yeniden gönderin (isteğe bağlı PDF fatura ekiyle).",
|
|
4038
|
+
"channelPlaceholder": "Kanal",
|
|
4039
|
+
"templatePlaceholder": "Şablon",
|
|
4040
|
+
"attachInvoiceLabel": "PDF Faturayı Ekle (oluşturulduysa)",
|
|
4041
|
+
"sending": "Gönderiliyor...",
|
|
4042
|
+
"sendResendButton": "Bildirim Gönder / Yeniden Gönder",
|
|
4043
|
+
"dispatchedSuccess": "{{channel}} bildirimi gönderildi",
|
|
4044
|
+
"dispatchFailed": "Bildirim gönderilemedi",
|
|
4045
|
+
"colChannel": "Kanal",
|
|
4046
|
+
"colEventTemplate": "Olay / Şablon",
|
|
4047
|
+
"colRecipient": "Alıcı",
|
|
4048
|
+
"colStatus": "Durum"
|
|
4049
|
+
},
|
|
4050
|
+
messages: {
|
|
4051
|
+
"loadStudioError": "Bildirim Stüdyosu verileri yüklenemedi.",
|
|
4052
|
+
"clonedPresetSuccess": "Sistem şablonu düzenlenebilir '{{label}}' şablonuna kopyalandı.",
|
|
4053
|
+
"clonePresetError": "Sistem şablonu kopyalanamadı.",
|
|
4054
|
+
"savedTemplateSuccess": "Şablon ve blok ağacı kaydedildi.",
|
|
4055
|
+
"saveTemplateError": "Şablon kaydedilemedi.",
|
|
4056
|
+
"createdMappingSuccess": "'{{event}}' -> '{{channel}}' için aktif eşleme oluşturuldu.",
|
|
4057
|
+
"createMappingError": "Olay eşlemesi oluşturulamadı.",
|
|
4058
|
+
"verifiedChannelSuccess": "'{{channel}}' kanalı doğrulandı ve test mesajı gönderildi.",
|
|
4059
|
+
"savedChannelSuccess": "'{{channel}}' yapılandırması kaydedildi.",
|
|
4060
|
+
"channelActionError": "{{channel}} için {{action}} işlemi başarısız oldu",
|
|
4061
|
+
"broadcastSentSuccess": "Toplu bildirim kampanyası onaylı alıcılara gönderildi."
|
|
4062
|
+
}
|
|
4063
|
+
} }
|
|
4064
|
+
};
|
|
4065
|
+
var plugin = {
|
|
4066
|
+
widgetModule: { widgets: [{
|
|
4067
|
+
Component: OrderNotificationsActivityWidget,
|
|
4068
|
+
zone: ["order.details.after"],
|
|
4069
|
+
widgetId: "Widget-7197"
|
|
4070
|
+
}] },
|
|
4071
|
+
routeModule: { routes: [
|
|
4072
|
+
{
|
|
4073
|
+
Component: GuardedNotificationStudioOverviewPage,
|
|
4074
|
+
path: "/mpn",
|
|
4075
|
+
handle: {
|
|
4076
|
+
label: config$6.label,
|
|
4077
|
+
translationNs: config$6.translationNs,
|
|
4078
|
+
permissions: config$6.permissions,
|
|
4079
|
+
...handle$6
|
|
4080
|
+
}
|
|
4081
|
+
},
|
|
4082
|
+
{
|
|
4083
|
+
Component: GuardedMpnBroadcastsPage,
|
|
4084
|
+
path: "/mpn/broadcasts",
|
|
4085
|
+
handle: {
|
|
4086
|
+
label: config$5.label,
|
|
4087
|
+
translationNs: config$5.translationNs,
|
|
4088
|
+
permissions: config$5.permissions,
|
|
4089
|
+
...handle$5
|
|
4090
|
+
}
|
|
4091
|
+
},
|
|
4092
|
+
{
|
|
4093
|
+
Component: GuardedMpnChannelsPage,
|
|
4094
|
+
path: "/mpn/channels",
|
|
4095
|
+
handle: {
|
|
4096
|
+
label: config$4.label,
|
|
4097
|
+
translationNs: config$4.translationNs,
|
|
4098
|
+
permissions: config$4.permissions,
|
|
4099
|
+
...handle$4
|
|
4100
|
+
}
|
|
4101
|
+
},
|
|
4102
|
+
{
|
|
4103
|
+
Component: GuardedMpnLogsPage,
|
|
4104
|
+
path: "/mpn/logs",
|
|
4105
|
+
handle: {
|
|
4106
|
+
label: config$3.label,
|
|
4107
|
+
translationNs: config$3.translationNs,
|
|
4108
|
+
permissions: config$3.permissions,
|
|
4109
|
+
...handle$3
|
|
4110
|
+
}
|
|
4111
|
+
},
|
|
4112
|
+
{
|
|
4113
|
+
Component: GuardedMpnMappingsPage,
|
|
4114
|
+
path: "/mpn/mappings",
|
|
4115
|
+
handle: {
|
|
4116
|
+
label: config$2.label,
|
|
4117
|
+
translationNs: config$2.translationNs,
|
|
4118
|
+
permissions: config$2.permissions,
|
|
4119
|
+
...handle$2
|
|
4120
|
+
}
|
|
4121
|
+
},
|
|
4122
|
+
{
|
|
4123
|
+
Component: GuardedMpnSandboxPage,
|
|
4124
|
+
path: "/mpn/sandbox",
|
|
4125
|
+
handle: {
|
|
4126
|
+
label: config$1.label,
|
|
4127
|
+
translationNs: config$1.translationNs,
|
|
4128
|
+
permissions: config$1.permissions,
|
|
4129
|
+
...handle$1
|
|
4130
|
+
}
|
|
4131
|
+
},
|
|
4132
|
+
{
|
|
4133
|
+
Component: GuardedMpnTemplatesPage,
|
|
4134
|
+
path: "/mpn/templates",
|
|
4135
|
+
handle: {
|
|
4136
|
+
label: config.label,
|
|
4137
|
+
translationNs: config.translationNs,
|
|
4138
|
+
permissions: config.permissions,
|
|
4139
|
+
...handle
|
|
4140
|
+
}
|
|
4141
|
+
}
|
|
4142
|
+
] },
|
|
4143
|
+
menuItemModule: { menuItems: [
|
|
4144
|
+
{
|
|
4145
|
+
label: config$6.label,
|
|
4146
|
+
icon: config$6.icon,
|
|
4147
|
+
path: "/mpn",
|
|
4148
|
+
nested: void 0,
|
|
4149
|
+
rank: void 0,
|
|
4150
|
+
translationNs: config$6.translationNs,
|
|
4151
|
+
permissions: void 0
|
|
4152
|
+
},
|
|
4153
|
+
{
|
|
4154
|
+
label: config$5.label,
|
|
4155
|
+
icon: config$5.icon,
|
|
4156
|
+
path: "/mpn/broadcasts",
|
|
4157
|
+
nested: void 0,
|
|
4158
|
+
rank: void 0,
|
|
4159
|
+
translationNs: config$5.translationNs,
|
|
4160
|
+
permissions: void 0
|
|
4161
|
+
},
|
|
4162
|
+
{
|
|
4163
|
+
label: config$4.label,
|
|
4164
|
+
icon: config$4.icon,
|
|
4165
|
+
path: "/mpn/channels",
|
|
4166
|
+
nested: void 0,
|
|
4167
|
+
rank: void 0,
|
|
4168
|
+
translationNs: config$4.translationNs,
|
|
4169
|
+
permissions: void 0
|
|
4170
|
+
},
|
|
4171
|
+
{
|
|
4172
|
+
label: config$3.label,
|
|
4173
|
+
icon: config$3.icon,
|
|
4174
|
+
path: "/mpn/logs",
|
|
4175
|
+
nested: void 0,
|
|
4176
|
+
rank: void 0,
|
|
4177
|
+
translationNs: config$3.translationNs,
|
|
4178
|
+
permissions: void 0
|
|
4179
|
+
},
|
|
4180
|
+
{
|
|
4181
|
+
label: config$2.label,
|
|
4182
|
+
icon: config$2.icon,
|
|
4183
|
+
path: "/mpn/mappings",
|
|
4184
|
+
nested: void 0,
|
|
4185
|
+
rank: void 0,
|
|
4186
|
+
translationNs: config$2.translationNs,
|
|
4187
|
+
permissions: void 0
|
|
4188
|
+
},
|
|
4189
|
+
{
|
|
4190
|
+
label: config$1.label,
|
|
4191
|
+
icon: config$1.icon,
|
|
4192
|
+
path: "/mpn/sandbox",
|
|
4193
|
+
nested: void 0,
|
|
4194
|
+
rank: void 0,
|
|
4195
|
+
translationNs: config$1.translationNs,
|
|
4196
|
+
permissions: void 0
|
|
4197
|
+
},
|
|
4198
|
+
{
|
|
4199
|
+
label: config.label,
|
|
4200
|
+
icon: config.icon,
|
|
4201
|
+
path: "/mpn/templates",
|
|
4202
|
+
nested: void 0,
|
|
4203
|
+
rank: void 0,
|
|
4204
|
+
translationNs: config.translationNs,
|
|
4205
|
+
permissions: void 0
|
|
4206
|
+
}
|
|
4207
|
+
] },
|
|
4208
|
+
formModule: { customFields: {} },
|
|
4209
|
+
displayModule: { displays: {} },
|
|
4210
|
+
i18nModule: { resources: i18n_default },
|
|
4211
|
+
cellRendererModule: {},
|
|
4212
|
+
layoutModule: { layouts: [] },
|
|
4213
|
+
searchEntityModule: {}
|
|
4214
|
+
};
|
|
4215
|
+
module.exports = plugin;
|