strapi-content-sync-pro 1.0.1 → 1.0.3
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/README.md +84 -25
- package/admin/src/components/ConfigTab.jsx +29 -6
- package/admin/src/components/HelpTab.jsx +131 -32
- package/admin/src/components/MediaTab.jsx +7 -0
- package/admin/src/components/StatsTab.jsx +470 -0
- package/admin/src/components/SyncProfilesTab.jsx +63 -5
- package/admin/src/components/SyncTab.jsx +51 -7
- package/admin/src/pages/App/index.jsx +3 -0
- package/docs/Screenshot 2026-04-20 160506.png +0 -0
- package/docs/Screenshot 2026-04-20 160558.png +0 -0
- package/docs/Screenshot 2026-04-20 175903.png +0 -0
- package/docs/Screenshot 2026-04-20 175931.png +0 -0
- package/docs/Screenshot 2026-04-20 180001.png +0 -0
- package/docs/Screenshot 2026-04-20 180041.png +0 -0
- package/docs/Screenshot 2026-04-20 180116.png +0 -0
- package/docs/Screenshot 2026-04-20 180135.png +0 -0
- package/docs/Screenshot 2026-04-20 180202.png +0 -0
- package/docs/Screenshot 2026-04-20 180228.png +0 -0
- package/docs/Screenshot 2026-04-20 180251.png +0 -0
- package/docs/Screenshot 2026-04-20 180301.png +0 -0
- package/docs/clipchamp-screen-recording-script.md +0 -0
- package/docs/logo-horizontal.svg +33 -0
- package/docs/logo-mark.svg +38 -0
- package/docs/logo-square.svg +27 -0
- package/docs/production-readiness-status.md +34 -0
- package/docs/production-readiness-test-matrix.md +151 -0
- package/docs/test-environments-setup-legacy.txt +60 -0
- package/package.json +2 -1
- package/server/src/content-types/index.js +2 -0
- package/server/src/content-types/sync-run-report/schema.json +26 -0
- package/server/src/controllers/config.js +48 -5
- package/server/src/controllers/index.js +2 -0
- package/server/src/controllers/sync-log.js +6 -0
- package/server/src/controllers/sync-media.js +19 -0
- package/server/src/controllers/sync-stats.js +51 -0
- package/server/src/controllers/sync.js +9 -3
- package/server/src/routes/index.js +13 -0
- package/server/src/services/config.js +18 -2
- package/server/src/services/index.js +2 -0
- package/server/src/services/sync-execution.js +102 -5
- package/server/src/services/sync-log.js +36 -0
- package/server/src/services/sync-media.js +224 -1
- package/server/src/services/sync-profiles.js +92 -4
- package/server/src/services/sync-stats.js +353 -0
- package/server/src/services/sync.js +324 -97
- package/server/src/utils/applier.js +120 -13
- package/server/src/utils/comparator.js +22 -6
- package/server/src/utils/fetcher.js +11 -2
|
@@ -53,6 +53,7 @@ const SyncTab = () => {
|
|
|
53
53
|
const [executionStatus, setExecutionStatus] = useState([]);
|
|
54
54
|
const [globalSettings, setGlobalSettings] = useState({});
|
|
55
55
|
const [loading, setLoading] = useState(true);
|
|
56
|
+
const [syncMode, setSyncMode] = useState('paired');
|
|
56
57
|
|
|
57
58
|
// Filter and ordering
|
|
58
59
|
const [profileFilter, setProfileFilter] = useState('all');
|
|
@@ -84,17 +85,19 @@ const SyncTab = () => {
|
|
|
84
85
|
|
|
85
86
|
const loadData = async () => {
|
|
86
87
|
try {
|
|
87
|
-
const [profilesRes, statusRes, globalRes, depsRes] = await Promise.all([
|
|
88
|
+
const [profilesRes, statusRes, globalRes, depsRes, configRes] = await Promise.all([
|
|
88
89
|
get(`/${PLUGIN_ID}/sync-profiles`),
|
|
89
90
|
get(`/${PLUGIN_ID}/sync-execution/status`),
|
|
90
91
|
get(`/${PLUGIN_ID}/sync-execution/global-settings`),
|
|
91
92
|
get(`/${PLUGIN_ID}/dependencies/all`).catch(() => ({ data: { data: {} } })),
|
|
93
|
+
get(`/${PLUGIN_ID}/config`),
|
|
92
94
|
]);
|
|
93
95
|
const loadedProfiles = profilesRes.data.data || [];
|
|
94
96
|
setProfiles(loadedProfiles);
|
|
95
97
|
setExecutionStatus(statusRes.data.data || []);
|
|
96
98
|
setGlobalSettings(globalRes.data.data || {});
|
|
97
99
|
setDependencies(depsRes.data.data || {});
|
|
100
|
+
setSyncMode(configRes?.data?.data?.syncMode || 'paired');
|
|
98
101
|
|
|
99
102
|
// Load saved execution order or calculate from dependencies
|
|
100
103
|
const savedOrder = globalRes.data.data?.executionOrder || {};
|
|
@@ -325,7 +328,7 @@ const SyncTab = () => {
|
|
|
325
328
|
const openSettingsModal = async (profileId) => {
|
|
326
329
|
try {
|
|
327
330
|
const res = await get(`/${PLUGIN_ID}/sync-execution/settings/${profileId}`);
|
|
328
|
-
|
|
331
|
+
const settings = res.data.data || {
|
|
329
332
|
executionMode: 'on_demand',
|
|
330
333
|
scheduleType: 'interval',
|
|
331
334
|
scheduleInterval: 60,
|
|
@@ -333,7 +336,15 @@ const SyncTab = () => {
|
|
|
333
336
|
enabled: false,
|
|
334
337
|
syncDependencies: false,
|
|
335
338
|
dependencyDepth: 1,
|
|
336
|
-
}
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
const profile = profiles.find((p) => p.id === profileId);
|
|
342
|
+
if (profile && profile.syncDeletions && settings.executionMode === 'live') {
|
|
343
|
+
settings.executionMode = 'on_demand';
|
|
344
|
+
settings.enabled = false;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
setExecutionSettings(settings);
|
|
337
348
|
setSelectedProfile(profileId);
|
|
338
349
|
setSettingsModalOpen(true);
|
|
339
350
|
} catch (err) {
|
|
@@ -343,7 +354,19 @@ const SyncTab = () => {
|
|
|
343
354
|
|
|
344
355
|
const handleSaveExecutionSettings = async () => {
|
|
345
356
|
try {
|
|
346
|
-
|
|
357
|
+
const payload = { ...executionSettings };
|
|
358
|
+
if (syncMode === 'single_side' && payload.executionMode === 'live') {
|
|
359
|
+
payload.executionMode = 'on_demand';
|
|
360
|
+
payload.enabled = false;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
const selected = profiles.find((p) => p.id === selectedProfile);
|
|
364
|
+
if (selected?.syncDeletions && payload.executionMode === 'live') {
|
|
365
|
+
payload.executionMode = 'on_demand';
|
|
366
|
+
payload.enabled = false;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
await put(`/${PLUGIN_ID}/sync-execution/settings/${selectedProfile}`, payload);
|
|
347
370
|
setMessage({ type: 'success', text: 'Execution settings saved' });
|
|
348
371
|
setSettingsModalOpen(false);
|
|
349
372
|
loadData();
|
|
@@ -441,6 +464,22 @@ const SyncTab = () => {
|
|
|
441
464
|
</Flex>
|
|
442
465
|
</Flex>
|
|
443
466
|
|
|
467
|
+
{syncMode === 'single_side' && (
|
|
468
|
+
<Box paddingTop={4}>
|
|
469
|
+
<Alert variant="info" title="Single-side mode restrictions">
|
|
470
|
+
Live execution is disabled in single-side mode. Use on-demand or scheduled execution with pull-only profiles.
|
|
471
|
+
</Alert>
|
|
472
|
+
</Box>
|
|
473
|
+
)}
|
|
474
|
+
|
|
475
|
+
{profiles.some((p) => p.syncDeletions) && (
|
|
476
|
+
<Box paddingTop={4}>
|
|
477
|
+
<Alert variant="info" title="Deletion sync profile rules">
|
|
478
|
+
Profiles with deletion sync enabled run as explicit one-way operations. Avoid live mode for these profiles.
|
|
479
|
+
</Alert>
|
|
480
|
+
</Box>
|
|
481
|
+
)}
|
|
482
|
+
|
|
444
483
|
{message && (
|
|
445
484
|
<Box paddingTop={4}>
|
|
446
485
|
<Alert variant={message.type} closeLabel="Close" onClose={() => setMessage(null)}>
|
|
@@ -474,7 +513,7 @@ const SyncTab = () => {
|
|
|
474
513
|
value={profileFilter}
|
|
475
514
|
onChange={setProfileFilter}
|
|
476
515
|
size="S"
|
|
477
|
-
style={{ width:
|
|
516
|
+
style={{ width: 180 }}
|
|
478
517
|
>
|
|
479
518
|
{FILTER_OPTIONS.map(opt => (
|
|
480
519
|
<SingleSelectOption key={opt.value} value={opt.value}>
|
|
@@ -570,7 +609,7 @@ const SyncTab = () => {
|
|
|
570
609
|
<ArrowDown />
|
|
571
610
|
</IconButton>
|
|
572
611
|
</Flex>
|
|
573
|
-
<TextInput
|
|
612
|
+
<TextInput
|
|
574
613
|
value={order}
|
|
575
614
|
onChange={(e) => handleOrderChange(profile.id, e.target.value)}
|
|
576
615
|
style={{ width: 50, textAlign: 'center' }}
|
|
@@ -849,7 +888,11 @@ const SyncTab = () => {
|
|
|
849
888
|
onChange={(value) => setExecutionSettings((p) => ({ ...p, executionMode: value }))}
|
|
850
889
|
>
|
|
851
890
|
{EXECUTION_MODE_OPTIONS.map((opt) => (
|
|
852
|
-
<SingleSelectOption
|
|
891
|
+
<SingleSelectOption
|
|
892
|
+
key={opt.value}
|
|
893
|
+
value={opt.value}
|
|
894
|
+
disabled={syncMode === 'single_side' && opt.value === 'live'}
|
|
895
|
+
>
|
|
853
896
|
{opt.label}
|
|
854
897
|
</SingleSelectOption>
|
|
855
898
|
))}
|
|
@@ -858,6 +901,7 @@ const SyncTab = () => {
|
|
|
858
901
|
{executionSettings.executionMode === 'on_demand' && 'Sync only when manually triggered'}
|
|
859
902
|
{executionSettings.executionMode === 'scheduled' && 'Sync automatically at regular intervals'}
|
|
860
903
|
{executionSettings.executionMode === 'live' && 'Sync immediately when changes occur'}
|
|
904
|
+
{syncMode === 'single_side' && executionSettings.executionMode === 'live' && ' (not supported in single-side mode)'}
|
|
861
905
|
</Field.Hint>
|
|
862
906
|
</Field.Root>
|
|
863
907
|
</Box>
|
|
@@ -6,6 +6,7 @@ import { ConfigTab } from '../../components/ConfigTab';
|
|
|
6
6
|
import { ContentTypesTab } from '../../components/ContentTypesTab';
|
|
7
7
|
import { SyncTab } from '../../components/SyncTab';
|
|
8
8
|
import { LogsTab } from '../../components/LogsTab';
|
|
9
|
+
import { StatsTab } from '../../components/StatsTab';
|
|
9
10
|
import { HelpTab } from '../../components/HelpTab';
|
|
10
11
|
import { SyncProfilesTab } from '../../components/SyncProfilesTab';
|
|
11
12
|
import { MediaTab } from '../../components/MediaTab';
|
|
@@ -16,6 +17,7 @@ const TABS = [
|
|
|
16
17
|
{ key: 'sync-profiles', label: 'Sync Profiles' },
|
|
17
18
|
{ key: 'sync', label: 'Sync' },
|
|
18
19
|
{ key: 'media', label: 'Media' },
|
|
20
|
+
{ key: 'stats', label: 'Stats' },
|
|
19
21
|
{ key: 'logs', label: 'Logs' },
|
|
20
22
|
{ key: 'help', label: 'Help' },
|
|
21
23
|
];
|
|
@@ -50,6 +52,7 @@ const HomePage = () => {
|
|
|
50
52
|
{activeTab === 'sync-profiles' && <SyncProfilesTab />}
|
|
51
53
|
{activeTab === 'sync' && <SyncTab />}
|
|
52
54
|
{activeTab === 'media' && <MediaTab />}
|
|
55
|
+
{activeTab === 'stats' && <StatsTab />}
|
|
53
56
|
{activeTab === 'logs' && <LogsTab />}
|
|
54
57
|
{activeTab === 'help' && <HelpTab />}
|
|
55
58
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="320" viewBox="0 0 1200 320" role="img" aria-label="Content Sync Pro logo">
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="csp-g" x1="40" y1="40" x2="240" y2="240" gradientUnits="userSpaceOnUse">
|
|
5
|
+
<stop offset="0" stop-color="#6C63FF"/>
|
|
6
|
+
<stop offset="1" stop-color="#4945FF"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
</defs>
|
|
9
|
+
|
|
10
|
+
<!-- mark -->
|
|
11
|
+
<g transform="translate(24,24)">
|
|
12
|
+
<rect x="0" y="0" width="272" height="272" rx="64" fill="url(#csp-g)"/>
|
|
13
|
+
<circle cx="92" cy="120" r="22" fill="#FFFFFF" opacity="0.92"/>
|
|
14
|
+
<circle cx="180" cy="120" r="22" fill="#FFFFFF" opacity="0.92"/>
|
|
15
|
+
<g fill="none" stroke="#FFFFFF" stroke-width="12" stroke-linecap="round" stroke-linejoin="round" opacity="0.95">
|
|
16
|
+
<path d="M110 104 H172"/>
|
|
17
|
+
<path d="M172 104 L160 92"/>
|
|
18
|
+
<path d="M172 104 L160 116"/>
|
|
19
|
+
<path d="M164 136 H102"/>
|
|
20
|
+
<path d="M102 136 L114 124"/>
|
|
21
|
+
<path d="M102 136 L114 148"/>
|
|
22
|
+
</g>
|
|
23
|
+
<path d="M136 158 C156 158 172 150 182 143 V176 C182 202 164 222 136 232 C108 222 90 202 90 176 V143 C100 150 116 158 136 158 Z" fill="#FFFFFF" opacity="0.92"/>
|
|
24
|
+
<path d="M118 186 L130 198 L156 172" fill="none" stroke="#4945FF" stroke-width="12" stroke-linecap="round" stroke-linejoin="round"/>
|
|
25
|
+
</g>
|
|
26
|
+
|
|
27
|
+
<!-- wordmark -->
|
|
28
|
+
<g transform="translate(340,88)">
|
|
29
|
+
<text x="0" y="0" font-size="54" font-weight="700" font-family="Inter, Segoe UI, Arial, sans-serif" fill="#111827">Content Sync</text>
|
|
30
|
+
<text x="0" y="70" font-size="54" font-weight="700" font-family="Inter, Segoe UI, Arial, sans-serif" fill="#4945FF">Pro</text>
|
|
31
|
+
<text x="140" y="70" font-size="22" font-weight="500" font-family="Inter, Segoe UI, Arial, sans-serif" fill="#6B7280">Strapi v5 plugin</text>
|
|
32
|
+
</g>
|
|
33
|
+
</svg>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512" role="img" aria-label="Content Sync Pro logo mark">
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="csp-g" x1="96" y1="96" x2="416" y2="416" gradientUnits="userSpaceOnUse">
|
|
5
|
+
<stop offset="0" stop-color="#6C63FF"/>
|
|
6
|
+
<stop offset="1" stop-color="#4945FF"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<filter id="csp-shadow" x="-20%" y="-20%" width="140%" height="140%" color-interpolation-filters="sRGB">
|
|
9
|
+
<feDropShadow dx="0" dy="8" stdDeviation="10" flood-color="#000" flood-opacity="0.18"/>
|
|
10
|
+
</filter>
|
|
11
|
+
</defs>
|
|
12
|
+
|
|
13
|
+
<!-- background badge -->
|
|
14
|
+
<rect x="56" y="56" width="400" height="400" rx="92" fill="url(#csp-g)" filter="url(#csp-shadow)"/>
|
|
15
|
+
|
|
16
|
+
<!-- sync nodes -->
|
|
17
|
+
<circle cx="182" cy="236" r="34" fill="#FFFFFF" opacity="0.92"/>
|
|
18
|
+
<circle cx="330" cy="236" r="34" fill="#FFFFFF" opacity="0.92"/>
|
|
19
|
+
|
|
20
|
+
<!-- bi-directional arrows -->
|
|
21
|
+
<g fill="none" stroke="#FFFFFF" stroke-width="18" stroke-linecap="round" stroke-linejoin="round" opacity="0.95">
|
|
22
|
+
<!-- top arrow: left -> right -->
|
|
23
|
+
<path d="M208 210 H320"/>
|
|
24
|
+
<path d="M320 210 L302 192"/>
|
|
25
|
+
<path d="M320 210 L302 228"/>
|
|
26
|
+
|
|
27
|
+
<!-- bottom arrow: right -> left -->
|
|
28
|
+
<path d="M304 262 H192"/>
|
|
29
|
+
<path d="M192 262 L210 244"/>
|
|
30
|
+
<path d="M192 262 L210 280"/>
|
|
31
|
+
</g>
|
|
32
|
+
|
|
33
|
+
<!-- safety shield + check ("pro" / enforcement) -->
|
|
34
|
+
<g transform="translate(0,2)">
|
|
35
|
+
<path d="M256 310 C290 310 316 296 332 284 V338 C332 380 302 412 256 430 C210 412 180 380 180 338 V284 C196 296 222 310 256 310 Z" fill="#FFFFFF" opacity="0.92"/>
|
|
36
|
+
<path d="M226 356 L246 376 L292 330" fill="none" stroke="#4945FF" stroke-width="18" stroke-linecap="round" stroke-linejoin="round"/>
|
|
37
|
+
</g>
|
|
38
|
+
</svg>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024" role="img" aria-label="Content Sync Pro square logo">
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="csp-g" x1="160" y1="160" x2="864" y2="864" gradientUnits="userSpaceOnUse">
|
|
5
|
+
<stop offset="0" stop-color="#6C63FF"/>
|
|
6
|
+
<stop offset="1" stop-color="#4945FF"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
</defs>
|
|
9
|
+
|
|
10
|
+
<rect x="112" y="112" width="800" height="800" rx="180" fill="url(#csp-g)"/>
|
|
11
|
+
|
|
12
|
+
<circle cx="364" cy="470" r="68" fill="#FFFFFF" opacity="0.92"/>
|
|
13
|
+
<circle cx="660" cy="470" r="68" fill="#FFFFFF" opacity="0.92"/>
|
|
14
|
+
|
|
15
|
+
<g fill="none" stroke="#FFFFFF" stroke-width="36" stroke-linecap="round" stroke-linejoin="round" opacity="0.95">
|
|
16
|
+
<path d="M416 418 H640"/>
|
|
17
|
+
<path d="M640 418 L604 382"/>
|
|
18
|
+
<path d="M640 418 L604 454"/>
|
|
19
|
+
|
|
20
|
+
<path d="M608 522 H384"/>
|
|
21
|
+
<path d="M384 522 L420 486"/>
|
|
22
|
+
<path d="M384 522 L420 558"/>
|
|
23
|
+
</g>
|
|
24
|
+
|
|
25
|
+
<path d="M512 620 C580 620 632 592 664 568 V676 C664 760 604 824 512 860 C420 824 360 760 360 676 V568 C392 592 444 620 512 620 Z" fill="#FFFFFF" opacity="0.92"/>
|
|
26
|
+
<path d="M452 712 L492 752 L588 656" fill="none" stroke="#4945FF" stroke-width="36" stroke-linecap="round" stroke-linejoin="round"/>
|
|
27
|
+
</svg>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Production Readiness Status — Content Sync Pro
|
|
2
|
+
|
|
3
|
+
## Current Verdict
|
|
4
|
+
**NO-GO (not yet fully production-ready)**
|
|
5
|
+
|
|
6
|
+
## Completed
|
|
7
|
+
- Implemented paired/single-side mode behavior and enforcement.
|
|
8
|
+
- Implemented Stats tab + before/after run reports.
|
|
9
|
+
- Implemented manual clear + retention limits for logs/reports.
|
|
10
|
+
- Added production-readiness test matrix:
|
|
11
|
+
- `docs/production-readiness-test-matrix.md`
|
|
12
|
+
- Added legacy environment notes copy:
|
|
13
|
+
- `docs/test-environments-setup-legacy.txt`
|
|
14
|
+
|
|
15
|
+
## Smoke Checks Passed
|
|
16
|
+
- `GET http://localhost:40101/api/strapi-content-sync-pro/ping` => 200
|
|
17
|
+
- `GET http://localhost:4010/api/strapi-content-sync-pro/ping` => 200
|
|
18
|
+
- Package test script passes (`npm run test`) — placeholder only.
|
|
19
|
+
|
|
20
|
+
## Blocking Items Before GO
|
|
21
|
+
1. Execute full P0 and P1 matrix scenarios in `docs/production-readiness-test-matrix.md`.
|
|
22
|
+
2. Capture evidence for each case (request/response, DB/file verification, screenshots).
|
|
23
|
+
3. Verify restart/recovery after plugin copy in target runtime path.
|
|
24
|
+
4. Validate single-side mode with remote plugin disabled.
|
|
25
|
+
5. Validate media restore scenarios after partial deletions.
|
|
26
|
+
6. Confirm retention pruning under load (high log/report volume).
|
|
27
|
+
|
|
28
|
+
## Required Release Gate
|
|
29
|
+
- P0 cases: 100% pass
|
|
30
|
+
- P1 cases: pass or accepted risk signed off
|
|
31
|
+
- No open critical defects
|
|
32
|
+
|
|
33
|
+
## Recommended Next Action
|
|
34
|
+
Run matrix execution in order: P0 -> P1 -> P2, then update this file with final **GO/NO-GO** sign-off.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Content Sync Pro — Production Readiness Test Matrix
|
|
2
|
+
|
|
3
|
+
This guide converts the environment notes from `test-enviroments-setup.txt` into a structured, repeatable validation matrix for release readiness.
|
|
4
|
+
|
|
5
|
+
## 1) Test Environments
|
|
6
|
+
|
|
7
|
+
### Remote Server
|
|
8
|
+
- Start:
|
|
9
|
+
- `D:\Rutba\ERP> npm run dev:strapi`
|
|
10
|
+
- URL: `http://localhost:4010`
|
|
11
|
+
- DB: MySQL (`pos_db`)
|
|
12
|
+
- Upload dir: `D:\Rutba\data\rutba-pos-files\uploads`
|
|
13
|
+
|
|
14
|
+
### Local Server
|
|
15
|
+
- Start:
|
|
16
|
+
- `D:\Rutba\ERP\pos-strapi> npm run dev`
|
|
17
|
+
- URL: `http://localhost:40101`
|
|
18
|
+
- DB: MySQL (`rutba_pos`)
|
|
19
|
+
- Upload dir: `D:\Rutba\data\rutba-pos-files\tmp\uploads`
|
|
20
|
+
|
|
21
|
+
### Shared Notes
|
|
22
|
+
- Same Strapi codebase, different `.env` values.
|
|
23
|
+
- Admin credentials (both):
|
|
24
|
+
- Email: `eharain@yahoo.com`
|
|
25
|
+
- Password: `At56ZNTxXf6JSTq`
|
|
26
|
+
- Plugin deploy target to test runtime updates:
|
|
27
|
+
- `D:\Rutba\ERP\pos-strapi\src\plugins\strapi-content-sync-pro`
|
|
28
|
+
- Restart may be required after plugin copy/update.
|
|
29
|
+
|
|
30
|
+
## 2) Scope of Validation
|
|
31
|
+
|
|
32
|
+
- Paired mode (plugin installed both sides)
|
|
33
|
+
- Single-side mode (plugin active on local only)
|
|
34
|
+
- Profiles (simple + advanced), dependency depth, execution modes
|
|
35
|
+
- Entity sync (CMS content, products, orders)
|
|
36
|
+
- Media sync + entity-linked media
|
|
37
|
+
- Stats tab snapshots and before/after reports
|
|
38
|
+
- Log/report retention and cleanup controls
|
|
39
|
+
- Failure/recovery behavior
|
|
40
|
+
|
|
41
|
+
## 3) Pass/Fail Exit Criteria
|
|
42
|
+
|
|
43
|
+
A build is **production-ready** only if all are true:
|
|
44
|
+
- Critical test cases pass (P0/P1 below)
|
|
45
|
+
- No data corruption in local/remote DBs
|
|
46
|
+
- No orphaned media references after sync runs
|
|
47
|
+
- Stats/report data is generated and retention controls work
|
|
48
|
+
- Plugin starts cleanly after restart in tested configurations
|
|
49
|
+
|
|
50
|
+
## 4) Test Matrix
|
|
51
|
+
|
|
52
|
+
| ID | Priority | Area | Scenario | Setup | Steps | Expected Result | Status | Evidence |
|
|
53
|
+
|---|---|---|---|---|---|---|---|---|
|
|
54
|
+
| P0-01 | P0 | Health | Plugin ping reachable both servers (paired) | Both running with plugin enabled | Call `/api/strapi-content-sync-pro/ping` on :40101 and :4010 | HTTP 200 + `{ "status": "ok" }` | TODO | |
|
|
55
|
+
| P0-02 | P0 | Connection | Connection test in paired mode | Local configured to remote | Run **Test Connection** in Configuration tab | Success, plugin endpoint validated | TODO | |
|
|
56
|
+
| P0-03 | P0 | Single-side | Connection test in single-side mode | Disable remote plugin load via env | Set local mode `single_side`, run Test Connection | Success without requiring remote plugin routes | TODO | |
|
|
57
|
+
| P0-04 | P0 | Profiles | Pull-only enforcement in single-side | Local mode `single_side` | Try creating push/bidirectional profile | UI/API enforce pull-only | TODO | |
|
|
58
|
+
| P0-05 | P0 | Execution | Live mode blocked in single-side | Local mode `single_side` | Try saving execution mode `live` | Rejected or normalized to non-live | TODO | |
|
|
59
|
+
| P0-06 | P0 | Data | Orders remote → local sync | Create new orders on remote | Run local pull/sync | Orders and order details appear local | TODO | |
|
|
60
|
+
| P0-07 | P0 | Data | CMS/offers local → remote sync (paired) | Create CMS/offers local | Run push/bidirectional | Entries appear remote correctly | TODO | |
|
|
61
|
+
| P0-08 | P0 | Media | Entity-linked media sync | Attach media to products/CMS | Run sync profile + media sync | Files + DB refs consistent on target | TODO | |
|
|
62
|
+
| P0-09 | P0 | Stats | Pre/post run report generation | Any enabled content types | Trigger sync run | Stats report contains before/after snapshots | TODO | |
|
|
63
|
+
| P0-10 | P0 | Retention | Manual clear logs/reports | Existing logs/reports | Use clear actions in Stats tab | Data removed, UI refreshed | TODO | |
|
|
64
|
+
| P1-01 | P1 | Dependencies | Min depth profile run | Profile depth=1 | Run profile | Only first-level dependencies handled | TODO | |
|
|
65
|
+
| P1-02 | P1 | Dependencies | Max depth profile run | Profile depth=5 | Run profile | Deep dependencies handled; no crash | TODO | |
|
|
66
|
+
| P1-03 | P1 | Media Recovery | Recreate deleted local media from remote | Delete selected local media rows/files | Run downward sync | Missing media restored | TODO | |
|
|
67
|
+
| P1-04 | P1 | Conflict | Latest/local/remote strategy behavior | Divergent edits both sides | Run with each strategy | Winner follows selected policy | TODO | |
|
|
68
|
+
| P1-05 | P1 | Restart | Restart resilience | Update plugin files + restart | Restart both servers | Plugin loads without route/service errors | TODO | |
|
|
69
|
+
| P1-06 | P1 | Retention Auto | Pruning by max entries | Set low limits | Trigger retention run | Old logs/reports pruned to limit | TODO | |
|
|
70
|
+
| P2-01 | P2 | Performance | Large dataset pagination behavior | Seed high row count | Run sync with page-size variations | Completes with bounded memory/errors | TODO | |
|
|
71
|
+
| P2-02 | P2 | UX | Stats readability | Run several syncs | Review report history | Clear before/after trend visibility | TODO | |
|
|
72
|
+
|
|
73
|
+
## 5) Detailed Execution Checklist
|
|
74
|
+
|
|
75
|
+
### A. Baseline + Connectivity
|
|
76
|
+
1. Confirm both servers are running.
|
|
77
|
+
2. Verify paired mode ping endpoints.
|
|
78
|
+
3. Configure local plugin connection settings.
|
|
79
|
+
4. Validate **Test Connection** in paired mode.
|
|
80
|
+
|
|
81
|
+
### B. Single-side Mode
|
|
82
|
+
1. Disable plugin loading on remote using env flag.
|
|
83
|
+
2. Keep local plugin enabled.
|
|
84
|
+
3. Set local `syncMode = single_side`.
|
|
85
|
+
4. Run connection test and verify success without remote plugin route dependency.
|
|
86
|
+
5. Verify profile direction and execution mode restrictions.
|
|
87
|
+
|
|
88
|
+
### C. Data Sync Scenarios
|
|
89
|
+
1. Create products with variations on source side; sync and verify target.
|
|
90
|
+
2. Create orders on remote; pull to local and verify details.
|
|
91
|
+
3. Create CMS content/offers local; push to remote and verify.
|
|
92
|
+
4. Run scenarios with different conflict strategies.
|
|
93
|
+
|
|
94
|
+
### D. Media Scenarios
|
|
95
|
+
1. Upload media and attach to products/CMS entities.
|
|
96
|
+
2. Sync and verify both file presence and DB links.
|
|
97
|
+
3. Delete a subset of local media rows/files.
|
|
98
|
+
4. Re-run downward sync; confirm restoration.
|
|
99
|
+
|
|
100
|
+
### E. Stats + Retention
|
|
101
|
+
1. Trigger sync; confirm report with before/after snapshots appears.
|
|
102
|
+
2. Verify columns: local/remote count, newest timestamps, newest side.
|
|
103
|
+
3. Use manual clear for logs and reports.
|
|
104
|
+
4. Configure low retention limits and run retention; verify pruning.
|
|
105
|
+
|
|
106
|
+
### F. Restart/Recovery
|
|
107
|
+
1. Copy plugin changes into Strapi plugin destination.
|
|
108
|
+
2. Restart both instances.
|
|
109
|
+
3. Re-check critical routes and one sync run.
|
|
110
|
+
|
|
111
|
+
## 6) Evidence Template
|
|
112
|
+
|
|
113
|
+
For each executed case, capture:
|
|
114
|
+
- Timestamp
|
|
115
|
+
- Server mode (paired/single-side)
|
|
116
|
+
- Profile ID/name and execution mode
|
|
117
|
+
- Request/response snippets (or screenshots)
|
|
118
|
+
- DB/file verification notes
|
|
119
|
+
- Result: Pass/Fail + defect link
|
|
120
|
+
|
|
121
|
+
Example note:
|
|
122
|
+
- `P0-09` | `2026-04-21 10:20` | `Pass`
|
|
123
|
+
- Report ID: `...`
|
|
124
|
+
- Before: products local=120 remote=115 newest=local
|
|
125
|
+
- After: products local=120 remote=120 newest=equal
|
|
126
|
+
|
|
127
|
+
## 7) Defect Severity Guidance
|
|
128
|
+
|
|
129
|
+
- **Critical**: Data loss/corruption, wrong direction writes, plugin cannot start
|
|
130
|
+
- **High**: Core sync path broken for common scenario
|
|
131
|
+
- **Medium**: Stats/reporting incorrect but sync still reliable
|
|
132
|
+
- **Low**: UI copy/formatting issues
|
|
133
|
+
|
|
134
|
+
## 8) Go/No-Go Summary
|
|
135
|
+
|
|
136
|
+
- Total cases executed:
|
|
137
|
+
- Passed:
|
|
138
|
+
- Failed:
|
|
139
|
+
- Blocked:
|
|
140
|
+
- Critical open defects:
|
|
141
|
+
- Decision: **GO / NO-GO**
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Current Session Smoke Result
|
|
146
|
+
|
|
147
|
+
- Ping local (`:40101`) = PASS
|
|
148
|
+
- Ping remote (`:4010`) = PASS
|
|
149
|
+
- Package test script (`npm run test`) = PASS (`No tests yet` placeholder)
|
|
150
|
+
|
|
151
|
+
A full production readiness sign-off requires completion of the matrix above.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
|
|
2
|
+
Remote server :
|
|
3
|
+
D:\>cd d:\Rutba\ERP
|
|
4
|
+
D:\Rutba\ERP>npm run dev:strapi
|
|
5
|
+
|
|
6
|
+
Database = mysql
|
|
7
|
+
Database name = pos_db
|
|
8
|
+
URL= http://localhost:4010
|
|
9
|
+
Upload dir =D:\Rutba\data\rutba-pos-files\uploads
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
Local Server:
|
|
15
|
+
D:\Rutba\ERP>cd pos-strapi
|
|
16
|
+
D:\Rutba\ERP\pos-strapi>npm run dev
|
|
17
|
+
http://localhost:40101
|
|
18
|
+
|
|
19
|
+
Database = mysql │
|
|
20
|
+
Database name = rutba_pos
|
|
21
|
+
Upload Dir = D:\Rutba\data\rutba-pos-files\tmp\uploads
|
|
22
|
+
|
|
23
|
+
these two servers have same code base of strapi but are running using different .env settings
|
|
24
|
+
|
|
25
|
+
you can truncate or partially delete any of their database tables or enteries as well as files.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
Please note that when the files are copied over the instance try to reboot but any of these can fail to start so you will have to restart. the restart takes about a minutes each time.
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
Both the servers admin user : eharain@yahoo.com and password : At56ZNTxXf6JSTq
|
|
33
|
+
|
|
34
|
+
kindly test different settings and different variations and ensure that the plugin works as desired.
|
|
35
|
+
|
|
36
|
+
the current servers are running in command prompt and you can stop them by pressing ctrl+c and start them again using the above commands. you can run these servers in you own power shels if you want.
|
|
37
|
+
the servers will not restrt unloss you copy the code changes in destination drrectory of the plugin that is :D:\Rutba\ERP\pos-strapi\src\plugins\strapi-content-sync-pro
|
|
38
|
+
|
|
39
|
+
to understand the entites read the contents of any server or in src directory of the strapi.
|
|
40
|
+
|
|
41
|
+
to test single-side mode disable the plugin loading by a special enviromment variable so that specific spin of strapi will not load the plugin and then you can test the sync in one direction.
|
|
42
|
+
|
|
43
|
+
Tests:
|
|
44
|
+
kindly create different sync profiles with least and max dependiceis and depth and try executing them.
|
|
45
|
+
|
|
46
|
+
kindly few media files and then sync also upload connect to entites and then sync and check if the media files are also synced properly with the entities.
|
|
47
|
+
|
|
48
|
+
Please also test the sync with different data in the tables and check if the sync is working as expected.
|
|
49
|
+
|
|
50
|
+
insert test data specially cms entites and then sync and check if the data is synced properly in the destination server.
|
|
51
|
+
|
|
52
|
+
create products and test the sync with different variations of products and check if the products are synced properly in the destination server.
|
|
53
|
+
|
|
54
|
+
create orders and test the sync with different variations of orders and check if the orders are synced properly in the destination server.
|
|
55
|
+
|
|
56
|
+
the orders will be created on remote server and should be synced to local server and then you can check the orders in local server and also check the order details and the products in the order and the media files connected to the products in the order.
|
|
57
|
+
|
|
58
|
+
the cms contenst and offers are created on local servers and set to remote server and then you can check the cms content and offers in remote server and also check the media files connected to the cms content and offers.
|
|
59
|
+
|
|
60
|
+
complete remove media enteries and few files on local server and then sync downward and check if these are created again. simmilar create new media each side and sync across.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strapi-content-sync-pro",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Strapi v5 plugin to copy, migrate, and live-sync content, media, and data between multiple Strapi environments with bi-directional sync, field-level policies, scheduling, and alerts.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"files": [
|
|
60
60
|
"admin/",
|
|
61
61
|
"server/",
|
|
62
|
+
"docs/",
|
|
62
63
|
"README.md",
|
|
63
64
|
"LICENSE"
|
|
64
65
|
],
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const syncLogSchema = require('./sync-log/schema.json');
|
|
4
|
+
const syncRunReportSchema = require('./sync-run-report/schema.json');
|
|
4
5
|
|
|
5
6
|
module.exports = {
|
|
6
7
|
'sync-log': { schema: syncLogSchema },
|
|
8
|
+
'sync-run-report': { schema: syncRunReportSchema },
|
|
7
9
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kind": "collectionType",
|
|
3
|
+
"collectionName": "sync_run_reports",
|
|
4
|
+
"info": {
|
|
5
|
+
"singularName": "sync-run-report",
|
|
6
|
+
"pluralName": "sync-run-reports",
|
|
7
|
+
"displayName": "Sync Run Report"
|
|
8
|
+
},
|
|
9
|
+
"options": {},
|
|
10
|
+
"pluginOptions": {
|
|
11
|
+
"content-manager": { "visible": false },
|
|
12
|
+
"content-type-builder": { "visible": false }
|
|
13
|
+
},
|
|
14
|
+
"attributes": {
|
|
15
|
+
"runType": { "type": "string" },
|
|
16
|
+
"trigger": { "type": "string" },
|
|
17
|
+
"status": { "type": "string" },
|
|
18
|
+
"startedAt": { "type": "datetime" },
|
|
19
|
+
"completedAt": { "type": "datetime" },
|
|
20
|
+
"contentTypes": { "type": "json" },
|
|
21
|
+
"beforeStats": { "type": "json" },
|
|
22
|
+
"afterStats": { "type": "json" },
|
|
23
|
+
"summary": { "type": "json" },
|
|
24
|
+
"error": { "type": "text" }
|
|
25
|
+
}
|
|
26
|
+
}
|