content-serialization 0.0.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/README.md +1 -0
- package/dist/_chunks/App-B8wd-5ZH.mjs +186 -0
- package/dist/_chunks/App-CF2xHAoO.js +186 -0
- package/dist/_chunks/en-B4KWt_jN.js +4 -0
- package/dist/_chunks/en-Byx4XI2L.mjs +4 -0
- package/dist/_chunks/index-B04ym5Xr.js +65 -0
- package/dist/_chunks/index-DgFuP8NI.mjs +66 -0
- package/dist/admin/index.js +3 -0
- package/dist/admin/index.mjs +4 -0
- package/dist/server/index.js +379 -0
- package/dist/server/index.mjs +375 -0
- package/package.json +71 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# content-serialization
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useFetchClient, useNotification, Page } from "@strapi/strapi/admin";
|
|
3
|
+
import { Routes, Route } from "react-router-dom";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { Main, Box, Flex, Typography, Grid, Card, CardBody, Button } from "@strapi/design-system";
|
|
6
|
+
import { Rocket, ArrowDown, ArrowUp, Code, ArrowClockwise, CheckCircle } from "@strapi/icons";
|
|
7
|
+
import { P as PLUGIN_ID } from "./index-DgFuP8NI.mjs";
|
|
8
|
+
const HomePage = () => {
|
|
9
|
+
const { post } = useFetchClient();
|
|
10
|
+
const { toggleNotification } = useNotification();
|
|
11
|
+
const [isPulling, setIsPulling] = useState(false);
|
|
12
|
+
const [isPushing, setIsPushing] = useState(false);
|
|
13
|
+
const [logs, setLogs] = useState([]);
|
|
14
|
+
const [lastAction, setLastAction] = useState(null);
|
|
15
|
+
const handlePull = async () => {
|
|
16
|
+
setIsPulling(true);
|
|
17
|
+
setLastAction("pull");
|
|
18
|
+
setLogs(["Starting Pull operation..."]);
|
|
19
|
+
try {
|
|
20
|
+
const { data } = await post(`/${PLUGIN_ID}/perform-pull`);
|
|
21
|
+
if (data.logs) setLogs(data.logs);
|
|
22
|
+
toggleNotification({
|
|
23
|
+
type: "success",
|
|
24
|
+
message: `Content successfully pulled!`
|
|
25
|
+
});
|
|
26
|
+
} catch (e) {
|
|
27
|
+
if (e.response?.data?.logs) setLogs(e.response.data.logs);
|
|
28
|
+
toggleNotification({
|
|
29
|
+
type: "warning",
|
|
30
|
+
message: `Pull failed: ${e.response?.data?.error?.message || e.message}`
|
|
31
|
+
});
|
|
32
|
+
} finally {
|
|
33
|
+
setIsPulling(false);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const handlePush = async () => {
|
|
37
|
+
setIsPushing(true);
|
|
38
|
+
setLastAction("push");
|
|
39
|
+
setLogs(["Starting Push operation..."]);
|
|
40
|
+
try {
|
|
41
|
+
const { data } = await post(`/${PLUGIN_ID}/perform-push`);
|
|
42
|
+
if (data.logs) setLogs(data.logs);
|
|
43
|
+
toggleNotification({
|
|
44
|
+
type: "success",
|
|
45
|
+
message: `Content successfully pushed!`
|
|
46
|
+
});
|
|
47
|
+
} catch (e) {
|
|
48
|
+
if (e.response?.data?.logs) setLogs(e.response.data.logs);
|
|
49
|
+
toggleNotification({
|
|
50
|
+
type: "warning",
|
|
51
|
+
message: `Push failed: ${e.response?.data?.error?.message || e.message}`
|
|
52
|
+
});
|
|
53
|
+
} finally {
|
|
54
|
+
setIsPushing(false);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
return /* @__PURE__ */ jsxs(Main, { children: [
|
|
58
|
+
/* @__PURE__ */ jsx(Box, { background: "neutral0", shadow: "filterShadow", children: /* @__PURE__ */ jsx(Box, { padding: 8, background: "primary100", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", gap: 4, children: [
|
|
59
|
+
/* @__PURE__ */ jsx(
|
|
60
|
+
Box,
|
|
61
|
+
{
|
|
62
|
+
padding: 3,
|
|
63
|
+
background: "primary200",
|
|
64
|
+
hasRadius: true,
|
|
65
|
+
borderColor: "primary500",
|
|
66
|
+
borderStyle: "solid",
|
|
67
|
+
borderWidth: "1px",
|
|
68
|
+
children: /* @__PURE__ */ jsx(Rocket, { width: "3rem", height: "3rem", fill: "primary600" })
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ jsx(Typography, { variant: "alpha", as: "h1", textColor: "primary700", children: "Content Serialization CLI" }),
|
|
72
|
+
/* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "primary600", style: { maxWidth: "600px", textAlign: "center" }, children: "Synchronize your content between environments seamlessly. Pull changes to version control or push updates to your production environment." })
|
|
73
|
+
] }) }) }),
|
|
74
|
+
/* @__PURE__ */ jsx(Box, { padding: 8, background: "neutral100", children: /* @__PURE__ */ jsxs(Grid.Root, { gap: 6, children: [
|
|
75
|
+
/* @__PURE__ */ jsx(Grid.Item, { col: 3, s: 12, children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(Box, { padding: 6, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", gap: 4, children: [
|
|
76
|
+
/* @__PURE__ */ jsx(Box, { padding: 4, background: "secondary100", hasRadius: "100%", children: /* @__PURE__ */ jsx(ArrowDown, { width: "2rem", height: "2rem", fill: "secondary600" }) }),
|
|
77
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", gap: 2, children: [
|
|
78
|
+
/* @__PURE__ */ jsx(Typography, { variant: "beta", textColor: "neutral800", children: "Pull Content" }),
|
|
79
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", style: { textAlign: "center" }, children: "Download content from Strapi to YAML files." })
|
|
80
|
+
] }),
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
Button,
|
|
83
|
+
{
|
|
84
|
+
onClick: handlePull,
|
|
85
|
+
loading: isPulling,
|
|
86
|
+
startIcon: /* @__PURE__ */ jsx(ArrowDown, {}),
|
|
87
|
+
variant: "default",
|
|
88
|
+
fullWidth: true,
|
|
89
|
+
size: "L",
|
|
90
|
+
children: "Execute Pull"
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
] }) }) }) }) }),
|
|
94
|
+
/* @__PURE__ */ jsx(Grid.Item, { col: 3, s: 12, children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(Box, { padding: 6, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", gap: 4, children: [
|
|
95
|
+
/* @__PURE__ */ jsx(Box, { padding: 4, background: "success100", hasRadius: "100%", children: /* @__PURE__ */ jsx(ArrowUp, { width: "2rem", height: "2rem", fill: "success600" }) }),
|
|
96
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", gap: 2, children: [
|
|
97
|
+
/* @__PURE__ */ jsx(Typography, { variant: "beta", textColor: "neutral800", children: "Push Content" }),
|
|
98
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", style: { textAlign: "center" }, children: "Upload YAML files to Strapi database." })
|
|
99
|
+
] }),
|
|
100
|
+
/* @__PURE__ */ jsx(
|
|
101
|
+
Button,
|
|
102
|
+
{
|
|
103
|
+
onClick: handlePush,
|
|
104
|
+
loading: isPushing,
|
|
105
|
+
startIcon: /* @__PURE__ */ jsx(ArrowUp, {}),
|
|
106
|
+
variant: "success",
|
|
107
|
+
fullWidth: true,
|
|
108
|
+
size: "L",
|
|
109
|
+
children: "Execute Push"
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
] }) }) }) }) }),
|
|
113
|
+
/* @__PURE__ */ jsx(Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(Box, { padding: 6, children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "center", gap: 4, children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", gap: 2, children: [
|
|
114
|
+
/* @__PURE__ */ jsx(Typography, { variant: "beta", textColor: "neutral800", children: "Created By" }),
|
|
115
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", style: { textAlign: "center" }, children: "Jaydeep Kotak Addact Technology" })
|
|
116
|
+
] }) }) }) }) }) }),
|
|
117
|
+
/* @__PURE__ */ jsx(Grid.Item, { col: 12, s: 12, children: /* @__PURE__ */ jsxs(Box, { hasRadius: true, shadow: "tableShadow", background: "neutral0", width: "100%", children: [
|
|
118
|
+
/* @__PURE__ */ jsx(Box, { padding: 4, background: "neutral100", style: { borderBottom: "1px solid #dcdce4" }, children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", children: [
|
|
119
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
120
|
+
/* @__PURE__ */ jsx(Code, { fill: "neutral500" }),
|
|
121
|
+
/* @__PURE__ */ jsx(Typography, { variant: "delta", textColor: "neutral700", children: "Execution Log" })
|
|
122
|
+
] }),
|
|
123
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
124
|
+
/* @__PURE__ */ jsx(Box, { background: "danger600", width: "10px", height: "10px", hasRadius: "100%" }),
|
|
125
|
+
/* @__PURE__ */ jsx(Box, { background: "warning600", width: "10px", height: "10px", hasRadius: "100%" }),
|
|
126
|
+
/* @__PURE__ */ jsx(Box, { background: "success600", width: "10px", height: "10px", hasRadius: "100%" })
|
|
127
|
+
] })
|
|
128
|
+
] }) }),
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
Box,
|
|
131
|
+
{
|
|
132
|
+
background: "neutral900",
|
|
133
|
+
padding: 6,
|
|
134
|
+
height: "500px",
|
|
135
|
+
width: "100%",
|
|
136
|
+
style: { overflowY: "auto", fontFamily: "'Fira Code', monospace" },
|
|
137
|
+
children: logs.length === 0 ? /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", justifyContent: "center", height: "100%", gap: 4, children: [
|
|
138
|
+
/* @__PURE__ */ jsx(ArrowClockwise, { width: "3rem", height: "3rem", fill: "neutral600" }),
|
|
139
|
+
/* @__PURE__ */ jsx(Typography, { variant: "delta", textColor: "neutral600", children: "Waiting for action..." })
|
|
140
|
+
] }) : logs.map((log, i) => /* @__PURE__ */ jsx(Box, { paddingBottom: 1, children: /* @__PURE__ */ jsx(
|
|
141
|
+
Typography,
|
|
142
|
+
{
|
|
143
|
+
variant: "omega",
|
|
144
|
+
textColor: log.includes("[ERROR]") ? "danger200" : log.includes("[SUCCESS]") || log.includes("SUMMARY") ? "success200" : log.includes("[SKIPPED]") ? "neutral500" : "neutral200",
|
|
145
|
+
style: { fontSize: "13px", lineHeight: "1.5" },
|
|
146
|
+
children: log
|
|
147
|
+
}
|
|
148
|
+
) }, i))
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
] }) }),
|
|
152
|
+
/* @__PURE__ */ jsx(Grid.Item, { col: 12, s: 12, children: /* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsxs(Grid.Root, { gap: 4, children: [
|
|
153
|
+
/* @__PURE__ */ jsx(Grid.Item, { col: 4, s: 12, children: /* @__PURE__ */ jsxs(Flex, { gap: 3, alignItems: "flex-start", children: [
|
|
154
|
+
/* @__PURE__ */ jsx(Box, { background: "secondary100", padding: 2, hasRadius: true, children: /* @__PURE__ */ jsx(CheckCircle, { fill: "secondary600" }) }),
|
|
155
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
156
|
+
/* @__PURE__ */ jsx(Typography, { variant: "delta", textColor: "neutral800", children: "Smart Checksums" }),
|
|
157
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", display: "block", paddingTop: 1, children: "Only changed files are processed to save time." })
|
|
158
|
+
] })
|
|
159
|
+
] }) }),
|
|
160
|
+
/* @__PURE__ */ jsx(Grid.Item, { col: 4, s: 12, children: /* @__PURE__ */ jsxs(Flex, { gap: 3, alignItems: "flex-start", children: [
|
|
161
|
+
/* @__PURE__ */ jsx(Box, { background: "primary100", padding: 2, hasRadius: true, children: /* @__PURE__ */ jsx(CheckCircle, { fill: "primary600" }) }),
|
|
162
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
163
|
+
/* @__PURE__ */ jsx(Typography, { variant: "delta", textColor: "neutral800", children: "Schema Aware" }),
|
|
164
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", display: "block", paddingTop: 1, children: "Automatically adapts to your Content Types." })
|
|
165
|
+
] })
|
|
166
|
+
] }) }),
|
|
167
|
+
/* @__PURE__ */ jsx(Grid.Item, { col: 4, s: 12, children: /* @__PURE__ */ jsxs(Flex, { gap: 3, alignItems: "flex-start", children: [
|
|
168
|
+
/* @__PURE__ */ jsx(Box, { background: "success100", padding: 2, hasRadius: true, children: /* @__PURE__ */ jsx(CheckCircle, { fill: "success600" }) }),
|
|
169
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
170
|
+
/* @__PURE__ */ jsx(Typography, { variant: "delta", textColor: "neutral800", children: "Secure Sync" }),
|
|
171
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", display: "block", paddingTop: 1, children: "Sensitive data is sanitized before export." })
|
|
172
|
+
] })
|
|
173
|
+
] }) })
|
|
174
|
+
] }) }) })
|
|
175
|
+
] }) })
|
|
176
|
+
] });
|
|
177
|
+
};
|
|
178
|
+
const App = () => {
|
|
179
|
+
return /* @__PURE__ */ jsxs(Routes, { children: [
|
|
180
|
+
/* @__PURE__ */ jsx(Route, { index: true, element: /* @__PURE__ */ jsx(HomePage, {}) }),
|
|
181
|
+
/* @__PURE__ */ jsx(Route, { path: "*", element: /* @__PURE__ */ jsx(Page.Error, {}) })
|
|
182
|
+
] });
|
|
183
|
+
};
|
|
184
|
+
export {
|
|
185
|
+
App
|
|
186
|
+
};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const admin = require("@strapi/strapi/admin");
|
|
5
|
+
const reactRouterDom = require("react-router-dom");
|
|
6
|
+
const react = require("react");
|
|
7
|
+
const designSystem = require("@strapi/design-system");
|
|
8
|
+
const icons = require("@strapi/icons");
|
|
9
|
+
const index = require("./index-B04ym5Xr.js");
|
|
10
|
+
const HomePage = () => {
|
|
11
|
+
const { post } = admin.useFetchClient();
|
|
12
|
+
const { toggleNotification } = admin.useNotification();
|
|
13
|
+
const [isPulling, setIsPulling] = react.useState(false);
|
|
14
|
+
const [isPushing, setIsPushing] = react.useState(false);
|
|
15
|
+
const [logs, setLogs] = react.useState([]);
|
|
16
|
+
const [lastAction, setLastAction] = react.useState(null);
|
|
17
|
+
const handlePull = async () => {
|
|
18
|
+
setIsPulling(true);
|
|
19
|
+
setLastAction("pull");
|
|
20
|
+
setLogs(["Starting Pull operation..."]);
|
|
21
|
+
try {
|
|
22
|
+
const { data } = await post(`/${index.PLUGIN_ID}/perform-pull`);
|
|
23
|
+
if (data.logs) setLogs(data.logs);
|
|
24
|
+
toggleNotification({
|
|
25
|
+
type: "success",
|
|
26
|
+
message: `Content successfully pulled!`
|
|
27
|
+
});
|
|
28
|
+
} catch (e) {
|
|
29
|
+
if (e.response?.data?.logs) setLogs(e.response.data.logs);
|
|
30
|
+
toggleNotification({
|
|
31
|
+
type: "warning",
|
|
32
|
+
message: `Pull failed: ${e.response?.data?.error?.message || e.message}`
|
|
33
|
+
});
|
|
34
|
+
} finally {
|
|
35
|
+
setIsPulling(false);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const handlePush = async () => {
|
|
39
|
+
setIsPushing(true);
|
|
40
|
+
setLastAction("push");
|
|
41
|
+
setLogs(["Starting Push operation..."]);
|
|
42
|
+
try {
|
|
43
|
+
const { data } = await post(`/${index.PLUGIN_ID}/perform-push`);
|
|
44
|
+
if (data.logs) setLogs(data.logs);
|
|
45
|
+
toggleNotification({
|
|
46
|
+
type: "success",
|
|
47
|
+
message: `Content successfully pushed!`
|
|
48
|
+
});
|
|
49
|
+
} catch (e) {
|
|
50
|
+
if (e.response?.data?.logs) setLogs(e.response.data.logs);
|
|
51
|
+
toggleNotification({
|
|
52
|
+
type: "warning",
|
|
53
|
+
message: `Push failed: ${e.response?.data?.error?.message || e.message}`
|
|
54
|
+
});
|
|
55
|
+
} finally {
|
|
56
|
+
setIsPushing(false);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { children: [
|
|
60
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "neutral0", shadow: "filterShadow", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 8, background: "primary100", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "center", gap: 4, children: [
|
|
61
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
62
|
+
designSystem.Box,
|
|
63
|
+
{
|
|
64
|
+
padding: 3,
|
|
65
|
+
background: "primary200",
|
|
66
|
+
hasRadius: true,
|
|
67
|
+
borderColor: "primary500",
|
|
68
|
+
borderStyle: "solid",
|
|
69
|
+
borderWidth: "1px",
|
|
70
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.Rocket, { width: "3rem", height: "3rem", fill: "primary600" })
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", as: "h1", textColor: "primary700", children: "Content Serialization CLI" }),
|
|
74
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "primary600", style: { maxWidth: "600px", textAlign: "center" }, children: "Synchronize your content between environments seamlessly. Pull changes to version control or push updates to your production environment." })
|
|
75
|
+
] }) }) }),
|
|
76
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 8, background: "neutral100", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 6, children: [
|
|
77
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Card, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.CardBody, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 6, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "center", gap: 4, children: [
|
|
78
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 4, background: "secondary100", hasRadius: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowDown, { width: "2rem", height: "2rem", fill: "secondary600" }) }),
|
|
79
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "center", gap: 2, children: [
|
|
80
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", textColor: "neutral800", children: "Pull Content" }),
|
|
81
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { textAlign: "center" }, children: "Download content from Strapi to YAML files." })
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
84
|
+
designSystem.Button,
|
|
85
|
+
{
|
|
86
|
+
onClick: handlePull,
|
|
87
|
+
loading: isPulling,
|
|
88
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowDown, {}),
|
|
89
|
+
variant: "default",
|
|
90
|
+
fullWidth: true,
|
|
91
|
+
size: "L",
|
|
92
|
+
children: "Execute Pull"
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
] }) }) }) }) }),
|
|
96
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Card, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.CardBody, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 6, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "center", gap: 4, children: [
|
|
97
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 4, background: "success100", hasRadius: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowUp, { width: "2rem", height: "2rem", fill: "success600" }) }),
|
|
98
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "center", gap: 2, children: [
|
|
99
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", textColor: "neutral800", children: "Push Content" }),
|
|
100
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { textAlign: "center" }, children: "Upload YAML files to Strapi database." })
|
|
101
|
+
] }),
|
|
102
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
103
|
+
designSystem.Button,
|
|
104
|
+
{
|
|
105
|
+
onClick: handlePush,
|
|
106
|
+
loading: isPushing,
|
|
107
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowUp, {}),
|
|
108
|
+
variant: "success",
|
|
109
|
+
fullWidth: true,
|
|
110
|
+
size: "L",
|
|
111
|
+
children: "Execute Push"
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
] }) }) }) }) }),
|
|
115
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Card, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.CardBody, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "center", gap: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "center", gap: 2, children: [
|
|
116
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", textColor: "neutral800", children: "Created By" }),
|
|
117
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { textAlign: "center" }, children: "Jaydeep Kotak Addact Technology" })
|
|
118
|
+
] }) }) }) }) }) }),
|
|
119
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { hasRadius: true, shadow: "tableShadow", background: "neutral0", width: "100%", children: [
|
|
120
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 4, background: "neutral100", style: { borderBottom: "1px solid #dcdce4" }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", children: [
|
|
121
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
122
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.Code, { fill: "neutral500" }),
|
|
123
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", textColor: "neutral700", children: "Execution Log" })
|
|
124
|
+
] }),
|
|
125
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
126
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "danger600", width: "10px", height: "10px", hasRadius: "100%" }),
|
|
127
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "warning600", width: "10px", height: "10px", hasRadius: "100%" }),
|
|
128
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "success600", width: "10px", height: "10px", hasRadius: "100%" })
|
|
129
|
+
] })
|
|
130
|
+
] }) }),
|
|
131
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
132
|
+
designSystem.Box,
|
|
133
|
+
{
|
|
134
|
+
background: "neutral900",
|
|
135
|
+
padding: 6,
|
|
136
|
+
height: "500px",
|
|
137
|
+
width: "100%",
|
|
138
|
+
style: { overflowY: "auto", fontFamily: "'Fira Code', monospace" },
|
|
139
|
+
children: logs.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "center", justifyContent: "center", height: "100%", gap: 4, children: [
|
|
140
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.ArrowClockwise, { width: "3rem", height: "3rem", fill: "neutral600" }),
|
|
141
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", textColor: "neutral600", children: "Waiting for action..." })
|
|
142
|
+
] }) : logs.map((log, i) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 1, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
143
|
+
designSystem.Typography,
|
|
144
|
+
{
|
|
145
|
+
variant: "omega",
|
|
146
|
+
textColor: log.includes("[ERROR]") ? "danger200" : log.includes("[SUCCESS]") || log.includes("SUMMARY") ? "success200" : log.includes("[SKIPPED]") ? "neutral500" : "neutral200",
|
|
147
|
+
style: { fontSize: "13px", lineHeight: "1.5" },
|
|
148
|
+
children: log
|
|
149
|
+
}
|
|
150
|
+
) }, i))
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
] }) }),
|
|
154
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 4, children: [
|
|
155
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "flex-start", children: [
|
|
156
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "secondary100", padding: 2, hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "secondary600" }) }),
|
|
157
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
158
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", textColor: "neutral800", children: "Smart Checksums" }),
|
|
159
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", display: "block", paddingTop: 1, children: "Only changed files are processed to save time." })
|
|
160
|
+
] })
|
|
161
|
+
] }) }),
|
|
162
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "flex-start", children: [
|
|
163
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "primary100", padding: 2, hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "primary600" }) }),
|
|
164
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
165
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", textColor: "neutral800", children: "Schema Aware" }),
|
|
166
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", display: "block", paddingTop: 1, children: "Automatically adapts to your Content Types." })
|
|
167
|
+
] })
|
|
168
|
+
] }) }),
|
|
169
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "flex-start", children: [
|
|
170
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "success100", padding: 2, hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }) }),
|
|
171
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
|
172
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", textColor: "neutral800", children: "Secure Sync" }),
|
|
173
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", display: "block", paddingTop: 1, children: "Sensitive data is sanitized before export." })
|
|
174
|
+
] })
|
|
175
|
+
] }) })
|
|
176
|
+
] }) }) })
|
|
177
|
+
] }) })
|
|
178
|
+
] });
|
|
179
|
+
};
|
|
180
|
+
const App = () => {
|
|
181
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Routes, { children: [
|
|
182
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: /* @__PURE__ */ jsxRuntime.jsx(HomePage, {}) }),
|
|
183
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: "*", element: /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Error, {}) })
|
|
184
|
+
] });
|
|
185
|
+
};
|
|
186
|
+
exports.App = App;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const react = require("react");
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const icons = require("@strapi/icons");
|
|
5
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
|
6
|
+
const v = glob[path];
|
|
7
|
+
if (v) {
|
|
8
|
+
return typeof v === "function" ? v() : Promise.resolve(v);
|
|
9
|
+
}
|
|
10
|
+
return new Promise((_, reject) => {
|
|
11
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
|
12
|
+
reject.bind(
|
|
13
|
+
null,
|
|
14
|
+
new Error(
|
|
15
|
+
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
|
16
|
+
)
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
const PLUGIN_ID = "content-serialization";
|
|
22
|
+
const Initializer = ({ setPlugin }) => {
|
|
23
|
+
const ref = react.useRef(setPlugin);
|
|
24
|
+
react.useEffect(() => {
|
|
25
|
+
ref.current(PLUGIN_ID);
|
|
26
|
+
}, []);
|
|
27
|
+
return null;
|
|
28
|
+
};
|
|
29
|
+
const PluginIcon = () => /* @__PURE__ */ jsxRuntime.jsx(icons.PuzzlePiece, {});
|
|
30
|
+
const index = {
|
|
31
|
+
register(app) {
|
|
32
|
+
app.addMenuLink({
|
|
33
|
+
to: `plugins/${PLUGIN_ID}`,
|
|
34
|
+
icon: PluginIcon,
|
|
35
|
+
intlLabel: {
|
|
36
|
+
id: `${PLUGIN_ID}.plugin.name`,
|
|
37
|
+
defaultMessage: PLUGIN_ID
|
|
38
|
+
},
|
|
39
|
+
Component: async () => {
|
|
40
|
+
const { App } = await Promise.resolve().then(() => require("./App-CF2xHAoO.js"));
|
|
41
|
+
return App;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
app.registerPlugin({
|
|
45
|
+
id: PLUGIN_ID,
|
|
46
|
+
initializer: Initializer,
|
|
47
|
+
isReady: false,
|
|
48
|
+
name: PLUGIN_ID
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
async registerTrads({ locales }) {
|
|
52
|
+
return Promise.all(
|
|
53
|
+
locales.map(async (locale) => {
|
|
54
|
+
try {
|
|
55
|
+
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-B4KWt_jN.js")) }), `./translations/${locale}.json`, 3);
|
|
56
|
+
return { data, locale };
|
|
57
|
+
} catch {
|
|
58
|
+
return { data: {}, locale };
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
exports.PLUGIN_ID = PLUGIN_ID;
|
|
65
|
+
exports.index = index;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useRef, useEffect } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { PuzzlePiece } from "@strapi/icons";
|
|
4
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
|
5
|
+
const v = glob[path];
|
|
6
|
+
if (v) {
|
|
7
|
+
return typeof v === "function" ? v() : Promise.resolve(v);
|
|
8
|
+
}
|
|
9
|
+
return new Promise((_, reject) => {
|
|
10
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
|
11
|
+
reject.bind(
|
|
12
|
+
null,
|
|
13
|
+
new Error(
|
|
14
|
+
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
|
15
|
+
)
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
const PLUGIN_ID = "content-serialization";
|
|
21
|
+
const Initializer = ({ setPlugin }) => {
|
|
22
|
+
const ref = useRef(setPlugin);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
ref.current(PLUGIN_ID);
|
|
25
|
+
}, []);
|
|
26
|
+
return null;
|
|
27
|
+
};
|
|
28
|
+
const PluginIcon = () => /* @__PURE__ */ jsx(PuzzlePiece, {});
|
|
29
|
+
const index = {
|
|
30
|
+
register(app) {
|
|
31
|
+
app.addMenuLink({
|
|
32
|
+
to: `plugins/${PLUGIN_ID}`,
|
|
33
|
+
icon: PluginIcon,
|
|
34
|
+
intlLabel: {
|
|
35
|
+
id: `${PLUGIN_ID}.plugin.name`,
|
|
36
|
+
defaultMessage: PLUGIN_ID
|
|
37
|
+
},
|
|
38
|
+
Component: async () => {
|
|
39
|
+
const { App } = await import("./App-B8wd-5ZH.mjs");
|
|
40
|
+
return App;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
app.registerPlugin({
|
|
44
|
+
id: PLUGIN_ID,
|
|
45
|
+
initializer: Initializer,
|
|
46
|
+
isReady: false,
|
|
47
|
+
name: PLUGIN_ID
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
async registerTrads({ locales }) {
|
|
51
|
+
return Promise.all(
|
|
52
|
+
locales.map(async (locale) => {
|
|
53
|
+
try {
|
|
54
|
+
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-Byx4XI2L.mjs") }), `./translations/${locale}.json`, 3);
|
|
55
|
+
return { data, locale };
|
|
56
|
+
} catch {
|
|
57
|
+
return { data: {}, locale };
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
PLUGIN_ID as P,
|
|
65
|
+
index as i
|
|
66
|
+
};
|