@primershop/strapi-plugin-product-actions 0.0.1
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 +38 -0
- package/dist/admin/components/Initializer/index.js +17 -0
- package/dist/admin/components/Initializer/index.js.map +1 -0
- package/dist/admin/components/Initializer/index.mjs +15 -0
- package/dist/admin/components/Initializer/index.mjs.map +1 -0
- package/dist/admin/components/SeriesProductActions/index.js +229 -0
- package/dist/admin/components/SeriesProductActions/index.js.map +1 -0
- package/dist/admin/components/SeriesProductActions/index.mjs +227 -0
- package/dist/admin/components/SeriesProductActions/index.mjs.map +1 -0
- package/dist/admin/index.js +28 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/index.mjs +26 -0
- package/dist/admin/index.mjs.map +1 -0
- package/dist/admin/pluginId.js +6 -0
- package/dist/admin/pluginId.js.map +1 -0
- package/dist/admin/pluginId.mjs +4 -0
- package/dist/admin/pluginId.mjs.map +1 -0
- package/dist/admin/src/components/Initializer/index.js +13 -0
- package/dist/admin/src/components/SeriesProductActions/index.js +84 -0
- package/dist/admin/src/index.js +22 -0
- package/dist/admin/src/pluginId.js +1 -0
- package/dist/admin/src/translations/en.js +21 -0
- package/dist/admin/src/translations/index.js +1 -0
- package/dist/admin/translations/en.js +25 -0
- package/dist/admin/translations/en.js.map +1 -0
- package/dist/admin/translations/en.mjs +23 -0
- package/dist/admin/translations/en.mjs.map +1 -0
- package/dist/server/bootstrap.js +15 -0
- package/dist/server/bootstrap.js.map +1 -0
- package/dist/server/bootstrap.mjs +13 -0
- package/dist/server/bootstrap.mjs.map +1 -0
- package/dist/server/controllers/index.js +10 -0
- package/dist/server/controllers/index.js.map +1 -0
- package/dist/server/controllers/index.mjs +8 -0
- package/dist/server/controllers/index.mjs.map +1 -0
- package/dist/server/controllers/product-series.js +29 -0
- package/dist/server/controllers/product-series.js.map +1 -0
- package/dist/server/controllers/product-series.mjs +27 -0
- package/dist/server/controllers/product-series.mjs.map +1 -0
- package/dist/server/index.js +24 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/index.mjs +19 -0
- package/dist/server/index.mjs.map +1 -0
- package/dist/server/permissions.js +46 -0
- package/dist/server/permissions.js.map +1 -0
- package/dist/server/permissions.mjs +44 -0
- package/dist/server/permissions.mjs.map +1 -0
- package/dist/server/pluginId.js +6 -0
- package/dist/server/pluginId.js.map +1 -0
- package/dist/server/pluginId.mjs +4 -0
- package/dist/server/pluginId.mjs.map +1 -0
- package/dist/server/register.js +16 -0
- package/dist/server/register.js.map +1 -0
- package/dist/server/register.mjs +14 -0
- package/dist/server/register.mjs.map +1 -0
- package/dist/server/routes/admin.js +44 -0
- package/dist/server/routes/admin.js.map +1 -0
- package/dist/server/routes/admin.mjs +42 -0
- package/dist/server/routes/admin.mjs.map +1 -0
- package/dist/server/routes/index.js +10 -0
- package/dist/server/routes/index.js.map +1 -0
- package/dist/server/routes/index.mjs +8 -0
- package/dist/server/routes/index.mjs.map +1 -0
- package/dist/server/services/index.js +10 -0
- package/dist/server/services/index.js.map +1 -0
- package/dist/server/services/index.mjs +8 -0
- package/dist/server/services/index.mjs.map +1 -0
- package/dist/server/services/product-series.js +113 -0
- package/dist/server/services/product-series.js.map +1 -0
- package/dist/server/services/product-series.mjs +111 -0
- package/dist/server/services/product-series.mjs.map +1 -0
- package/dist/server/src/bootstrap.js +16 -0
- package/dist/server/src/controllers/index.js +10 -0
- package/dist/server/src/controllers/product-series.js +31 -0
- package/dist/server/src/index.js +20 -0
- package/dist/server/src/permissions.js +42 -0
- package/dist/server/src/pluginId.js +4 -0
- package/dist/server/src/register.js +14 -0
- package/dist/server/src/routes/admin.js +37 -0
- package/dist/server/src/routes/index.js +9 -0
- package/dist/server/src/services/index.js +7 -0
- package/dist/server/src/services/product-series.js +116 -0
- package/package.json +100 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Initializer } from './components/Initializer/index.mjs';
|
|
2
|
+
import { SeriesProductActions } from './components/SeriesProductActions/index.mjs';
|
|
3
|
+
import { PLUGIN_ID } from './pluginId.mjs';
|
|
4
|
+
|
|
5
|
+
const plugin = {
|
|
6
|
+
register (app) {
|
|
7
|
+
app.registerPlugin({
|
|
8
|
+
id: PLUGIN_ID,
|
|
9
|
+
initializer: Initializer,
|
|
10
|
+
isReady: false,
|
|
11
|
+
name: PLUGIN_ID
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
bootstrap (app) {
|
|
15
|
+
console.log("🚀 ~ bootstrap ~ app:", app);
|
|
16
|
+
app.getPlugin("content-manager").apis.addEditViewSidePanel((panels)=>{
|
|
17
|
+
return [
|
|
18
|
+
...panels,
|
|
19
|
+
SeriesProductActions
|
|
20
|
+
];
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { plugin as default };
|
|
26
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../admin/src/index.ts"],"sourcesContent":["import { Initializer } from \"./components/Initializer\";\r\nimport { SeriesProductActions } from \"./components/SeriesProductActions\";\r\nimport { PLUGIN_ID } from \"./pluginId\";\r\n\r\nimport type { PanelComponent } from \"@strapi/content-manager/strapi-admin\";\r\n\r\nconst plugin = {\r\n register(app: any) {\r\n app.registerPlugin({\r\n id: PLUGIN_ID,\r\n initializer: Initializer,\r\n isReady: false,\r\n name: PLUGIN_ID,\r\n });\r\n },\r\n\r\n bootstrap(app: any) {\r\n console.log(\"🚀 ~ bootstrap ~ app:\", app);\r\n app\r\n .getPlugin(\"content-manager\")\r\n .apis.addEditViewSidePanel((panels: any): PanelComponent[] => {\r\n return [...panels, SeriesProductActions];\r\n });\r\n },\r\n};\r\n\r\nexport default plugin;\r\n"],"names":["plugin","register","app","registerPlugin","id","PLUGIN_ID","initializer","Initializer","isReady","name","bootstrap","console","log","getPlugin","apis","addEditViewSidePanel","panels","SeriesProductActions"],"mappings":";;;;AAMA,MAAMA,MAAAA,GAAS;AACbC,IAAAA,QAAAA,CAAAA,CAASC,GAAQ,EAAA;AACfA,QAAAA,GAAAA,CAAIC,cAAc,CAAC;YACjBC,EAAAA,EAAIC,SAAAA;YACJC,WAAAA,EAAaC,WAAAA;YACbC,OAAAA,EAAS,KAAA;YACTC,IAAAA,EAAMJ;AACR,SAAA,CAAA;AACF,IAAA,CAAA;AAEAK,IAAAA,SAAAA,CAAAA,CAAUR,GAAQ,EAAA;QAChBS,OAAAA,CAAQC,GAAG,CAAC,uBAAA,EAAyBV,GAAAA,CAAAA;AACrCA,QAAAA,GAAAA,CACGW,SAAS,CAAC,iBAAA,CAAA,CACVC,IAAI,CAACC,oBAAoB,CAAC,CAACC,MAAAA,GAAAA;YAC1B,OAAO;AAAIA,gBAAAA,GAAAA,MAAAA;AAAQC,gBAAAA;AAAqB,aAAA;AAC1C,QAAA,CAAA,CAAA;AACJ,IAAA;AACF;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginId.js","sources":["../../admin/src/pluginId.ts"],"sourcesContent":["export const PLUGIN_ID = \"primershop-product-actions\";\r\n"],"names":["PLUGIN_ID"],"mappings":";;AAAO,MAAMA,YAAY;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginId.mjs","sources":["../../admin/src/pluginId.ts"],"sourcesContent":["export const PLUGIN_ID = \"primershop-product-actions\";\r\n"],"names":["PLUGIN_ID"],"mappings":"AAAO,MAAMA,YAAY;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import { PLUGIN_ID } from "../../pluginId";
|
|
3
|
+
/**
|
|
4
|
+
* @type {import('react').FC<{ setPlugin: (id: string) => void }>}
|
|
5
|
+
*/
|
|
6
|
+
const Initializer = ({ setPlugin }) => {
|
|
7
|
+
const ref = useRef(setPlugin);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
ref.current(PLUGIN_ID);
|
|
10
|
+
}, []);
|
|
11
|
+
return null;
|
|
12
|
+
};
|
|
13
|
+
export { Initializer };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Box, Button, Typography, Dialog, NumberInput, Flex, MultiSelect, MultiSelectOption, } from "@strapi/design-system";
|
|
4
|
+
import { useFetchClient, unstable_useContentManagerContext as useContentManagerContext, } from "@strapi/strapi/admin";
|
|
5
|
+
import { en } from "../../translations";
|
|
6
|
+
const formatMessage = (arg) => {
|
|
7
|
+
return en[arg.id];
|
|
8
|
+
};
|
|
9
|
+
const valuesToUpdate = [
|
|
10
|
+
"description",
|
|
11
|
+
"shortDescription",
|
|
12
|
+
"media",
|
|
13
|
+
"coverImage",
|
|
14
|
+
"seo",
|
|
15
|
+
"totalCost",
|
|
16
|
+
"wholesalePrice",
|
|
17
|
+
"retailPrice",
|
|
18
|
+
"category",
|
|
19
|
+
"creator",
|
|
20
|
+
];
|
|
21
|
+
const SeriesProductActions = ({ document }) => {
|
|
22
|
+
const { model } = useContentManagerContext();
|
|
23
|
+
const documentId = document?.documentId;
|
|
24
|
+
const [productCount, setProductCount] = useState(1);
|
|
25
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
26
|
+
const [fieldsToUpdate, setFieldsToUpdate] = useState([]);
|
|
27
|
+
const { post, put } = useFetchClient();
|
|
28
|
+
if (model !== "api::product-series.product-series")
|
|
29
|
+
return null;
|
|
30
|
+
const handleCreateProducts = async () => {
|
|
31
|
+
try {
|
|
32
|
+
setIsLoading(true);
|
|
33
|
+
const response = await post(`primer-product-actions/create-products`, {
|
|
34
|
+
count: productCount,
|
|
35
|
+
id: documentId,
|
|
36
|
+
});
|
|
37
|
+
if (!response.data) {
|
|
38
|
+
throw new Error("Failed to create products");
|
|
39
|
+
}
|
|
40
|
+
setProductCount(1);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.error("Error creating products:", error);
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
setIsLoading(false);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const handleUpdateProducts = async () => {
|
|
50
|
+
try {
|
|
51
|
+
setIsLoading(true);
|
|
52
|
+
const response = await put(`/primer-product-actions/update-products`, {
|
|
53
|
+
seriesId: documentId,
|
|
54
|
+
fieldsToUpdate,
|
|
55
|
+
});
|
|
56
|
+
if (!response.data) {
|
|
57
|
+
throw new Error("Failed to update products");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
console.error("Error updating products:", error);
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
setIsLoading(false);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return {
|
|
68
|
+
title: "Series Product Actions",
|
|
69
|
+
content: (_jsx(Box, { children: _jsxs(Box, { children: [_jsx(Typography, { variant: "delta", fontWeight: "bold", children: formatMessage({ id: "product-series.actions.label" }) }), _jsxs(Flex, { wrap: "wrap", children: [!documentId && (_jsx(Typography, { display: "block", marginTop: 2, marginBottom: 2, width: "100%", color: "red", children: formatMessage({ id: "product-series.actions.noDocumentId" }) })), _jsxs(Dialog.Root, { children: [_jsx(Dialog.Trigger, { children: _jsx(Button, { variant: "secondary", disabled: isLoading || !documentId, children: formatMessage({
|
|
70
|
+
id: "product-series.actions.createProducts",
|
|
71
|
+
}) }) }), _jsxs(Dialog.Content, { children: [_jsx(Dialog.Body, { children: _jsxs(Box, { children: [_jsx(Typography, { children: formatMessage({
|
|
72
|
+
id: "product-series.actions.createDialogTitle",
|
|
73
|
+
}) }), _jsx(NumberInput, { value: productCount, onValueChange: (value) => setProductCount(value || 1), min: 1, max: 100 })] }) }), _jsxs(Dialog.Footer, { children: [_jsx(Dialog.Cancel, { children: _jsx(Button, { fullWidth: true, variant: "tertiary", children: "Cancel" }) }), _jsx(Dialog.Action, { children: _jsx(Button, { onClick: handleCreateProducts, variant: "default", loading: isLoading, children: formatMessage({ id: "product-series.actions.create" }) }) })] })] })] }), _jsxs(Dialog.Root, { children: [_jsx(Dialog.Trigger, { children: _jsx(Button, { marginLeft: 2, variant: "secondary", disabled: isLoading || !documentId, children: formatMessage({
|
|
74
|
+
id: "product-series.actions.updateProducts",
|
|
75
|
+
}) }) }), _jsxs(Dialog.Content, { children: [_jsxs(Dialog.Body, { display: "flex", direction: "column", gap: 2, justifyContent: "center", alignItems: "center", width: "100%", children: [_jsx(Typography, { variant: "delta", fontWeight: "bold", children: formatMessage({
|
|
76
|
+
id: "product-series.actions.updateDialogTitle",
|
|
77
|
+
}) }), _jsx(Typography, { children: formatMessage({
|
|
78
|
+
id: "product-series.actions.updateDialogDescription",
|
|
79
|
+
}) }), _jsx(MultiSelect, { withTags: true, value: fieldsToUpdate, onClear: () => setFieldsToUpdate([]), onChange: (value) => setFieldsToUpdate(value), required: true, placeholder: formatMessage({
|
|
80
|
+
id: "product-series.actions.selectFields",
|
|
81
|
+
}), children: valuesToUpdate.map((field) => (_jsx(MultiSelectOption, { value: field, children: field }, field))) })] }), _jsxs(Dialog.Footer, { children: [_jsx(Dialog.Cancel, { children: _jsx(Button, { fullWidth: true, variant: "tertiary", children: "Cancel" }) }), _jsx(Dialog.Action, { children: _jsx(Button, { onClick: handleUpdateProducts, variant: "default", loading: isLoading, children: formatMessage({ id: "product-series.actions.update" }) }) })] })] })] })] })] }) })),
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
export { SeriesProductActions };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Initializer } from "./components/Initializer";
|
|
2
|
+
import { SeriesProductActions } from "./components/SeriesProductActions";
|
|
3
|
+
import { PLUGIN_ID } from "./pluginId";
|
|
4
|
+
const plugin = {
|
|
5
|
+
register(app) {
|
|
6
|
+
app.registerPlugin({
|
|
7
|
+
id: PLUGIN_ID,
|
|
8
|
+
initializer: Initializer,
|
|
9
|
+
isReady: false,
|
|
10
|
+
name: PLUGIN_ID,
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
bootstrap(app) {
|
|
14
|
+
console.log("🚀 ~ bootstrap ~ app:", app);
|
|
15
|
+
app
|
|
16
|
+
.getPlugin("content-manager")
|
|
17
|
+
.apis.addEditViewSidePanel((panels) => {
|
|
18
|
+
return [...panels, SeriesProductActions];
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export default plugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const PLUGIN_ID = "primer-product-actions";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const en = {
|
|
2
|
+
"plugin.name": "Product Series",
|
|
3
|
+
"plugin.description": "Manage product series and their products",
|
|
4
|
+
"product-series.actions.label": "Product Actions",
|
|
5
|
+
"product-series.actions.createProducts": "Create Products",
|
|
6
|
+
"product-series.actions.updateProducts": "Update Products",
|
|
7
|
+
"product-series.actions.createDialogTitle": "Create Products from Series",
|
|
8
|
+
"product-series.actions.updateDialogTitle": "Update All Products in Series",
|
|
9
|
+
"product-series.actions.updateDialogDescription": "This will update all products in the series with the selected fields. Make sure to save the series first before updating the products.",
|
|
10
|
+
"product-series.actions.productCount": "Number of Products",
|
|
11
|
+
"product-series.actions.create": "Create",
|
|
12
|
+
"product-series.actions.update": "Update",
|
|
13
|
+
"product-series.actions.cancel": "Cancel",
|
|
14
|
+
"product-series.actions.createSuccess": "Products created successfully",
|
|
15
|
+
"product-series.actions.createError": "Failed to create products",
|
|
16
|
+
"product-series.actions.updateSuccess": "Products updated successfully",
|
|
17
|
+
"product-series.actions.updateError": "Failed to update products",
|
|
18
|
+
"product-series.actions.selectFields": "Select fields to update",
|
|
19
|
+
"product-series.actions.noDocumentId": "Save the series first before creating products",
|
|
20
|
+
};
|
|
21
|
+
export { en };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./en";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const en = {
|
|
4
|
+
"plugin.name": "Product Series",
|
|
5
|
+
"plugin.description": "Manage product series and their products",
|
|
6
|
+
"product-series.actions.label": "Product Actions",
|
|
7
|
+
"product-series.actions.createProducts": "Create Products",
|
|
8
|
+
"product-series.actions.updateProducts": "Update Products",
|
|
9
|
+
"product-series.actions.createDialogTitle": "Create Products from Series",
|
|
10
|
+
"product-series.actions.updateDialogTitle": "Update All Products in Series",
|
|
11
|
+
"product-series.actions.updateDialogDescription": "This will update all products in the series with the selected fields. Make sure to save the series first before updating the products.",
|
|
12
|
+
"product-series.actions.productCount": "Number of Products",
|
|
13
|
+
"product-series.actions.create": "Create",
|
|
14
|
+
"product-series.actions.update": "Update",
|
|
15
|
+
"product-series.actions.cancel": "Cancel",
|
|
16
|
+
"product-series.actions.createSuccess": "Products created successfully",
|
|
17
|
+
"product-series.actions.createError": "Failed to create products",
|
|
18
|
+
"product-series.actions.updateSuccess": "Products updated successfully",
|
|
19
|
+
"product-series.actions.updateError": "Failed to update products",
|
|
20
|
+
"product-series.actions.selectFields": "Select fields to update",
|
|
21
|
+
"product-series.actions.noDocumentId": "Save the series first before creating products"
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.en = en;
|
|
25
|
+
//# sourceMappingURL=en.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.js","sources":["../../../admin/src/translations/en.ts"],"sourcesContent":["const en: Record<string, string> = {\r\n \"plugin.name\": \"Product Series\",\r\n \"plugin.description\": \"Manage product series and their products\",\r\n \"product-series.actions.label\": \"Product Actions\",\r\n \"product-series.actions.createProducts\": \"Create Products\",\r\n \"product-series.actions.updateProducts\": \"Update Products\",\r\n \"product-series.actions.createDialogTitle\": \"Create Products from Series\",\r\n \"product-series.actions.updateDialogTitle\": \"Update All Products in Series\",\r\n \"product-series.actions.updateDialogDescription\":\r\n \"This will update all products in the series with the selected fields. Make sure to save the series first before updating the products.\",\r\n \"product-series.actions.productCount\": \"Number of Products\",\r\n \"product-series.actions.create\": \"Create\",\r\n \"product-series.actions.update\": \"Update\",\r\n \"product-series.actions.cancel\": \"Cancel\",\r\n \"product-series.actions.createSuccess\": \"Products created successfully\",\r\n \"product-series.actions.createError\": \"Failed to create products\",\r\n \"product-series.actions.updateSuccess\": \"Products updated successfully\",\r\n \"product-series.actions.updateError\": \"Failed to update products\",\r\n \"product-series.actions.selectFields\": \"Select fields to update\",\r\n \"product-series.actions.noDocumentId\":\r\n \"Save the series first before creating products\",\r\n};\r\n\r\nexport { en };\r\n"],"names":["en"],"mappings":";;AAAA,MAAMA,EAAAA,GAA6B;IACjC,aAAA,EAAe,gBAAA;IACf,oBAAA,EAAsB,0CAAA;IACtB,8BAAA,EAAgC,iBAAA;IAChC,uCAAA,EAAyC,iBAAA;IACzC,uCAAA,EAAyC,iBAAA;IACzC,0CAAA,EAA4C,6BAAA;IAC5C,0CAAA,EAA4C,+BAAA;IAC5C,gDAAA,EACE,wIAAA;IACF,qCAAA,EAAuC,oBAAA;IACvC,+BAAA,EAAiC,QAAA;IACjC,+BAAA,EAAiC,QAAA;IACjC,+BAAA,EAAiC,QAAA;IACjC,sCAAA,EAAwC,+BAAA;IACxC,oCAAA,EAAsC,2BAAA;IACtC,sCAAA,EAAwC,+BAAA;IACxC,oCAAA,EAAsC,2BAAA;IACtC,qCAAA,EAAuC,yBAAA;IACvC,qCAAA,EACE;AACJ;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const en = {
|
|
2
|
+
"plugin.name": "Product Series",
|
|
3
|
+
"plugin.description": "Manage product series and their products",
|
|
4
|
+
"product-series.actions.label": "Product Actions",
|
|
5
|
+
"product-series.actions.createProducts": "Create Products",
|
|
6
|
+
"product-series.actions.updateProducts": "Update Products",
|
|
7
|
+
"product-series.actions.createDialogTitle": "Create Products from Series",
|
|
8
|
+
"product-series.actions.updateDialogTitle": "Update All Products in Series",
|
|
9
|
+
"product-series.actions.updateDialogDescription": "This will update all products in the series with the selected fields. Make sure to save the series first before updating the products.",
|
|
10
|
+
"product-series.actions.productCount": "Number of Products",
|
|
11
|
+
"product-series.actions.create": "Create",
|
|
12
|
+
"product-series.actions.update": "Update",
|
|
13
|
+
"product-series.actions.cancel": "Cancel",
|
|
14
|
+
"product-series.actions.createSuccess": "Products created successfully",
|
|
15
|
+
"product-series.actions.createError": "Failed to create products",
|
|
16
|
+
"product-series.actions.updateSuccess": "Products updated successfully",
|
|
17
|
+
"product-series.actions.updateError": "Failed to update products",
|
|
18
|
+
"product-series.actions.selectFields": "Select fields to update",
|
|
19
|
+
"product-series.actions.noDocumentId": "Save the series first before creating products"
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { en };
|
|
23
|
+
//# sourceMappingURL=en.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.mjs","sources":["../../../admin/src/translations/en.ts"],"sourcesContent":["const en: Record<string, string> = {\r\n \"plugin.name\": \"Product Series\",\r\n \"plugin.description\": \"Manage product series and their products\",\r\n \"product-series.actions.label\": \"Product Actions\",\r\n \"product-series.actions.createProducts\": \"Create Products\",\r\n \"product-series.actions.updateProducts\": \"Update Products\",\r\n \"product-series.actions.createDialogTitle\": \"Create Products from Series\",\r\n \"product-series.actions.updateDialogTitle\": \"Update All Products in Series\",\r\n \"product-series.actions.updateDialogDescription\":\r\n \"This will update all products in the series with the selected fields. Make sure to save the series first before updating the products.\",\r\n \"product-series.actions.productCount\": \"Number of Products\",\r\n \"product-series.actions.create\": \"Create\",\r\n \"product-series.actions.update\": \"Update\",\r\n \"product-series.actions.cancel\": \"Cancel\",\r\n \"product-series.actions.createSuccess\": \"Products created successfully\",\r\n \"product-series.actions.createError\": \"Failed to create products\",\r\n \"product-series.actions.updateSuccess\": \"Products updated successfully\",\r\n \"product-series.actions.updateError\": \"Failed to update products\",\r\n \"product-series.actions.selectFields\": \"Select fields to update\",\r\n \"product-series.actions.noDocumentId\":\r\n \"Save the series first before creating products\",\r\n};\r\n\r\nexport { en };\r\n"],"names":["en"],"mappings":"AAAA,MAAMA,EAAAA,GAA6B;IACjC,aAAA,EAAe,gBAAA;IACf,oBAAA,EAAsB,0CAAA;IACtB,8BAAA,EAAgC,iBAAA;IAChC,uCAAA,EAAyC,iBAAA;IACzC,uCAAA,EAAyC,iBAAA;IACzC,0CAAA,EAA4C,6BAAA;IAC5C,0CAAA,EAA4C,+BAAA;IAC5C,gDAAA,EACE,wIAAA;IACF,qCAAA,EAAuC,oBAAA;IACvC,+BAAA,EAAiC,QAAA;IACjC,+BAAA,EAAiC,QAAA;IACjC,+BAAA,EAAiC,QAAA;IACjC,sCAAA,EAAwC,+BAAA;IACxC,oCAAA,EAAsC,2BAAA;IACtC,sCAAA,EAAwC,+BAAA;IACxC,oCAAA,EAAsC,2BAAA;IACtC,qCAAA,EAAuC,yBAAA;IACvC,qCAAA,EACE;AACJ;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var permissions = require('./permissions.js');
|
|
4
|
+
|
|
5
|
+
const bootstrap = async ({ strapi })=>{
|
|
6
|
+
// Register permissions for the plugin
|
|
7
|
+
try {
|
|
8
|
+
await strapi.service("admin::permission").actionProvider.registerMany(permissions.permissions.actions);
|
|
9
|
+
} catch (error) {
|
|
10
|
+
// Handle error silently or log to proper logging service
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.bootstrap = bootstrap;
|
|
15
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sources":["../../server/src/bootstrap.ts"],"sourcesContent":["import { permissions } from \"./permissions\";\r\n\r\ninterface StrapiInstance {\r\n db?: unknown;\r\n contentTypes?: Record<string, unknown>;\r\n service: (name: string) => {\r\n actionProvider: { registerMany: (actions: unknown) => Promise<void> };\r\n };\r\n}\r\n\r\nexport const bootstrap = async ({ strapi }: { strapi: StrapiInstance }) => {\r\n // Register permissions for the plugin\r\n try {\r\n await strapi\r\n .service(\"admin::permission\")\r\n .actionProvider.registerMany(permissions.actions);\r\n } catch (error) {\r\n // Handle error silently or log to proper logging service\r\n }\r\n};\r\n"],"names":["bootstrap","strapi","service","actionProvider","registerMany","permissions","actions","error"],"mappings":";;;;AAUO,MAAMA,SAAAA,GAAY,OAAO,EAAEC,MAAM,EAA8B,GAAA;;IAEpE,IAAI;QACF,MAAMA,MAAAA,CACHC,OAAO,CAAC,mBAAA,CAAA,CACRC,cAAc,CAACC,YAAY,CAACC,uBAAAA,CAAYC,OAAO,CAAA;AACpD,IAAA,CAAA,CAAE,OAAOC,KAAAA,EAAO;;AAEhB,IAAA;AACF;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { permissions } from './permissions.mjs';
|
|
2
|
+
|
|
3
|
+
const bootstrap = async ({ strapi })=>{
|
|
4
|
+
// Register permissions for the plugin
|
|
5
|
+
try {
|
|
6
|
+
await strapi.service("admin::permission").actionProvider.registerMany(permissions.actions);
|
|
7
|
+
} catch (error) {
|
|
8
|
+
// Handle error silently or log to proper logging service
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { bootstrap };
|
|
13
|
+
//# sourceMappingURL=bootstrap.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.mjs","sources":["../../server/src/bootstrap.ts"],"sourcesContent":["import { permissions } from \"./permissions\";\r\n\r\ninterface StrapiInstance {\r\n db?: unknown;\r\n contentTypes?: Record<string, unknown>;\r\n service: (name: string) => {\r\n actionProvider: { registerMany: (actions: unknown) => Promise<void> };\r\n };\r\n}\r\n\r\nexport const bootstrap = async ({ strapi }: { strapi: StrapiInstance }) => {\r\n // Register permissions for the plugin\r\n try {\r\n await strapi\r\n .service(\"admin::permission\")\r\n .actionProvider.registerMany(permissions.actions);\r\n } catch (error) {\r\n // Handle error silently or log to proper logging service\r\n }\r\n};\r\n"],"names":["bootstrap","strapi","service","actionProvider","registerMany","permissions","actions","error"],"mappings":";;AAUO,MAAMA,SAAAA,GAAY,OAAO,EAAEC,MAAM,EAA8B,GAAA;;IAEpE,IAAI;QACF,MAAMA,MAAAA,CACHC,OAAO,CAAC,mBAAA,CAAA,CACRC,cAAc,CAACC,YAAY,CAACC,WAAAA,CAAYC,OAAO,CAAA;AACpD,IAAA,CAAA,CAAE,OAAOC,KAAAA,EAAO;;AAEhB,IAAA;AACF;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../server/src/controllers/index.ts"],"sourcesContent":["import productSeries from \"./product-series\";\r\n\r\nexport const controllers = {\r\n productSeries,\r\n};\r\n"],"names":["controllers","productSeries"],"mappings":";;;;MAEaA,WAAAA,GAAc;AACzBC,IAAAA;AACF;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../server/src/controllers/index.ts"],"sourcesContent":["import productSeries from \"./product-series\";\r\n\r\nexport const controllers = {\r\n productSeries,\r\n};\r\n"],"names":["controllers","productSeries"],"mappings":";;MAEaA,WAAAA,GAAc;AACzBC,IAAAA;AACF;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const productSeries = ({ strapi })=>({
|
|
4
|
+
async createProducts (ctx) {
|
|
5
|
+
try {
|
|
6
|
+
const { id, count = 1 } = ctx.request.body;
|
|
7
|
+
const products = await strapi.plugin("primershop-product-actions").service("productSeries").createProductsFromSeries(id, count);
|
|
8
|
+
return {
|
|
9
|
+
data: products
|
|
10
|
+
};
|
|
11
|
+
} catch (error) {
|
|
12
|
+
ctx.throw(500, error);
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
async updateProducts (ctx) {
|
|
16
|
+
try {
|
|
17
|
+
const { seriesId, fieldsToUpdate } = ctx.request.body;
|
|
18
|
+
await strapi.plugin("primershop-product-actions").service("productSeries").updateSeriesProducts(seriesId, fieldsToUpdate);
|
|
19
|
+
return {
|
|
20
|
+
success: true
|
|
21
|
+
};
|
|
22
|
+
} catch (error) {
|
|
23
|
+
ctx.throw(500, error);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
module.exports = productSeries;
|
|
29
|
+
//# sourceMappingURL=product-series.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-series.js","sources":["../../../server/src/controllers/product-series.ts"],"sourcesContent":["import type { Core } from \"@strapi/strapi\";\r\nimport type { Context } from \"koa\";\r\n\r\nconst productSeries = ({\r\n strapi,\r\n}: {\r\n strapi: Core.Strapi;\r\n}): Core.Controller => ({\r\n async createProducts(ctx: Context) {\r\n try {\r\n const { id, count = 1 } = ctx.request.body;\r\n\r\n const products = await strapi\r\n .plugin(\"primershop-product-actions\")\r\n .service(\"productSeries\")\r\n .createProductsFromSeries(id, count);\r\n\r\n return { data: products };\r\n } catch (error) {\r\n ctx.throw(500, error);\r\n }\r\n },\r\n\r\n async updateProducts(ctx: Context) {\r\n try {\r\n const { seriesId, fieldsToUpdate } = ctx.request.body;\r\n\r\n await strapi\r\n .plugin(\"primershop-product-actions\")\r\n .service(\"productSeries\")\r\n .updateSeriesProducts(seriesId, fieldsToUpdate);\r\n\r\n return { success: true };\r\n } catch (error) {\r\n ctx.throw(500, error);\r\n }\r\n },\r\n});\r\nexport default productSeries;\r\n"],"names":["productSeries","strapi","createProducts","ctx","id","count","request","body","products","plugin","service","createProductsFromSeries","data","error","throw","updateProducts","seriesId","fieldsToUpdate","updateSeriesProducts","success"],"mappings":";;AAGA,MAAMA,gBAAgB,CAAC,EACrBC,MAAM,EAGP,IAAuB;AACtB,QAAA,MAAMC,gBAAeC,GAAY,EAAA;YAC/B,IAAI;gBACF,MAAM,EAAEC,EAAE,EAAEC,KAAAA,GAAQ,CAAC,EAAE,GAAGF,GAAAA,CAAIG,OAAO,CAACC,IAAI;gBAE1C,MAAMC,QAAAA,GAAW,MAAMP,MAAAA,CACpBQ,MAAM,CAAC,4BAAA,CAAA,CACPC,OAAO,CAAC,eAAA,CAAA,CACRC,wBAAwB,CAACP,EAAAA,EAAIC,KAAAA,CAAAA;gBAEhC,OAAO;oBAAEO,IAAAA,EAAMJ;AAAS,iBAAA;AAC1B,YAAA,CAAA,CAAE,OAAOK,KAAAA,EAAO;gBACdV,GAAAA,CAAIW,KAAK,CAAC,GAAA,EAAKD,KAAAA,CAAAA;AACjB,YAAA;AACF,QAAA,CAAA;AAEA,QAAA,MAAME,gBAAeZ,GAAY,EAAA;YAC/B,IAAI;gBACF,MAAM,EAAEa,QAAQ,EAAEC,cAAc,EAAE,GAAGd,GAAAA,CAAIG,OAAO,CAACC,IAAI;gBAErD,MAAMN,MAAAA,CACHQ,MAAM,CAAC,4BAAA,CAAA,CACPC,OAAO,CAAC,eAAA,CAAA,CACRQ,oBAAoB,CAACF,QAAAA,EAAUC,cAAAA,CAAAA;gBAElC,OAAO;oBAAEE,OAAAA,EAAS;AAAK,iBAAA;AACzB,YAAA,CAAA,CAAE,OAAON,KAAAA,EAAO;gBACdV,GAAAA,CAAIW,KAAK,CAAC,GAAA,EAAKD,KAAAA,CAAAA;AACjB,YAAA;AACF,QAAA;KACF;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const productSeries = ({ strapi })=>({
|
|
2
|
+
async createProducts (ctx) {
|
|
3
|
+
try {
|
|
4
|
+
const { id, count = 1 } = ctx.request.body;
|
|
5
|
+
const products = await strapi.plugin("primershop-product-actions").service("productSeries").createProductsFromSeries(id, count);
|
|
6
|
+
return {
|
|
7
|
+
data: products
|
|
8
|
+
};
|
|
9
|
+
} catch (error) {
|
|
10
|
+
ctx.throw(500, error);
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
async updateProducts (ctx) {
|
|
14
|
+
try {
|
|
15
|
+
const { seriesId, fieldsToUpdate } = ctx.request.body;
|
|
16
|
+
await strapi.plugin("primershop-product-actions").service("productSeries").updateSeriesProducts(seriesId, fieldsToUpdate);
|
|
17
|
+
return {
|
|
18
|
+
success: true
|
|
19
|
+
};
|
|
20
|
+
} catch (error) {
|
|
21
|
+
ctx.throw(500, error);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { productSeries as default };
|
|
27
|
+
//# sourceMappingURL=product-series.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-series.mjs","sources":["../../../server/src/controllers/product-series.ts"],"sourcesContent":["import type { Core } from \"@strapi/strapi\";\r\nimport type { Context } from \"koa\";\r\n\r\nconst productSeries = ({\r\n strapi,\r\n}: {\r\n strapi: Core.Strapi;\r\n}): Core.Controller => ({\r\n async createProducts(ctx: Context) {\r\n try {\r\n const { id, count = 1 } = ctx.request.body;\r\n\r\n const products = await strapi\r\n .plugin(\"primershop-product-actions\")\r\n .service(\"productSeries\")\r\n .createProductsFromSeries(id, count);\r\n\r\n return { data: products };\r\n } catch (error) {\r\n ctx.throw(500, error);\r\n }\r\n },\r\n\r\n async updateProducts(ctx: Context) {\r\n try {\r\n const { seriesId, fieldsToUpdate } = ctx.request.body;\r\n\r\n await strapi\r\n .plugin(\"primershop-product-actions\")\r\n .service(\"productSeries\")\r\n .updateSeriesProducts(seriesId, fieldsToUpdate);\r\n\r\n return { success: true };\r\n } catch (error) {\r\n ctx.throw(500, error);\r\n }\r\n },\r\n});\r\nexport default productSeries;\r\n"],"names":["productSeries","strapi","createProducts","ctx","id","count","request","body","products","plugin","service","createProductsFromSeries","data","error","throw","updateProducts","seriesId","fieldsToUpdate","updateSeriesProducts","success"],"mappings":"AAGA,MAAMA,gBAAgB,CAAC,EACrBC,MAAM,EAGP,IAAuB;AACtB,QAAA,MAAMC,gBAAeC,GAAY,EAAA;YAC/B,IAAI;gBACF,MAAM,EAAEC,EAAE,EAAEC,KAAAA,GAAQ,CAAC,EAAE,GAAGF,GAAAA,CAAIG,OAAO,CAACC,IAAI;gBAE1C,MAAMC,QAAAA,GAAW,MAAMP,MAAAA,CACpBQ,MAAM,CAAC,4BAAA,CAAA,CACPC,OAAO,CAAC,eAAA,CAAA,CACRC,wBAAwB,CAACP,EAAAA,EAAIC,KAAAA,CAAAA;gBAEhC,OAAO;oBAAEO,IAAAA,EAAMJ;AAAS,iBAAA;AAC1B,YAAA,CAAA,CAAE,OAAOK,KAAAA,EAAO;gBACdV,GAAAA,CAAIW,KAAK,CAAC,GAAA,EAAKD,KAAAA,CAAAA;AACjB,YAAA;AACF,QAAA,CAAA;AAEA,QAAA,MAAME,gBAAeZ,GAAY,EAAA;YAC/B,IAAI;gBACF,MAAM,EAAEa,QAAQ,EAAEC,cAAc,EAAE,GAAGd,GAAAA,CAAIG,OAAO,CAACC,IAAI;gBAErD,MAAMN,MAAAA,CACHQ,MAAM,CAAC,4BAAA,CAAA,CACPC,OAAO,CAAC,eAAA,CAAA,CACRQ,oBAAoB,CAACF,QAAAA,EAAUC,cAAAA,CAAAA;gBAElC,OAAO;oBAAEE,OAAAA,EAAS;AAAK,iBAAA;AACzB,YAAA,CAAA,CAAE,OAAON,KAAAA,EAAO;gBACdV,GAAAA,CAAIW,KAAK,CAAC,GAAA,EAAKD,KAAAA,CAAAA;AACjB,YAAA;AACF,QAAA;KACF;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var index$2 = require('./controllers/index.js');
|
|
6
|
+
var index$1 = require('./routes/index.js');
|
|
7
|
+
var index = require('./services/index.js');
|
|
8
|
+
var register = require('./register.js');
|
|
9
|
+
var bootstrap = require('./bootstrap.js');
|
|
10
|
+
|
|
11
|
+
const plugin = ()=>{
|
|
12
|
+
return {
|
|
13
|
+
register: register.register,
|
|
14
|
+
controllers: index$2.controllers,
|
|
15
|
+
routes: index$1.routes,
|
|
16
|
+
services: index.services,
|
|
17
|
+
middlewares: {},
|
|
18
|
+
bootstrap: bootstrap.bootstrap
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.default = plugin;
|
|
23
|
+
exports.plugin = plugin;
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../server/src/index.ts"],"sourcesContent":["import { controllers } from \"./controllers\";\r\nimport { routes } from \"./routes\";\r\nimport { services } from \"./services\";\r\nimport { register } from \"./register\";\r\nimport { bootstrap } from \"./bootstrap\";\r\n\r\nexport const plugin = () => {\r\n return {\r\n register,\r\n\r\n controllers,\r\n routes,\r\n services,\r\n middlewares: {},\r\n bootstrap,\r\n };\r\n};\r\n\r\nexport default plugin;\r\n"],"names":["plugin","register","controllers","routes","services","middlewares","bootstrap"],"mappings":";;;;;;;;;;MAMaA,MAAAA,GAAS,IAAA;IACpB,OAAO;AACLC,kBAAAA,iBAAAA;AAEAC,qBAAAA,mBAAAA;AACAC,gBAAAA,cAAAA;AACAC,kBAAAA,cAAAA;AACAC,QAAAA,WAAAA,EAAa,EAAC;AACdC,mBAAAA;AACF,KAAA;AACF;;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { controllers } from './controllers/index.mjs';
|
|
2
|
+
import { routes } from './routes/index.mjs';
|
|
3
|
+
import { services } from './services/index.mjs';
|
|
4
|
+
import { register } from './register.mjs';
|
|
5
|
+
import { bootstrap } from './bootstrap.mjs';
|
|
6
|
+
|
|
7
|
+
const plugin = ()=>{
|
|
8
|
+
return {
|
|
9
|
+
register,
|
|
10
|
+
controllers,
|
|
11
|
+
routes,
|
|
12
|
+
services,
|
|
13
|
+
middlewares: {},
|
|
14
|
+
bootstrap
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { plugin as default, plugin };
|
|
19
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../server/src/index.ts"],"sourcesContent":["import { controllers } from \"./controllers\";\r\nimport { routes } from \"./routes\";\r\nimport { services } from \"./services\";\r\nimport { register } from \"./register\";\r\nimport { bootstrap } from \"./bootstrap\";\r\n\r\nexport const plugin = () => {\r\n return {\r\n register,\r\n\r\n controllers,\r\n routes,\r\n services,\r\n middlewares: {},\r\n bootstrap,\r\n };\r\n};\r\n\r\nexport default plugin;\r\n"],"names":["plugin","register","controllers","routes","services","middlewares","bootstrap"],"mappings":";;;;;;MAMaA,MAAAA,GAAS,IAAA;IACpB,OAAO;AACLC,QAAAA,QAAAA;AAEAC,QAAAA,WAAAA;AACAC,QAAAA,MAAAA;AACAC,QAAAA,QAAAA;AACAC,QAAAA,WAAAA,EAAa,EAAC;AACdC,QAAAA;AACF,KAAA;AACF;;;;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const permissions = {
|
|
4
|
+
actions: [
|
|
5
|
+
{
|
|
6
|
+
// Roles
|
|
7
|
+
section: "plugins",
|
|
8
|
+
displayName: "Create",
|
|
9
|
+
uid: "product-series.create",
|
|
10
|
+
subCategory: "product-series",
|
|
11
|
+
pluginName: "primershop-product-actions"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
section: "plugins",
|
|
15
|
+
displayName: "Read",
|
|
16
|
+
uid: "product-series.read",
|
|
17
|
+
subCategory: "product-series",
|
|
18
|
+
pluginName: "primershop-product-actions",
|
|
19
|
+
aliases: [
|
|
20
|
+
{
|
|
21
|
+
actionId: "plugin::content-manager.explorer.read",
|
|
22
|
+
subjects: [
|
|
23
|
+
"api::product-series.product-series"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
section: "plugins",
|
|
30
|
+
displayName: "Update",
|
|
31
|
+
uid: "product-series.update",
|
|
32
|
+
subCategory: "product-series",
|
|
33
|
+
pluginName: "primershop-product-actions"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
section: "plugins",
|
|
37
|
+
displayName: "Delete",
|
|
38
|
+
uid: "product-series.delete",
|
|
39
|
+
subCategory: "product-series",
|
|
40
|
+
pluginName: "primershop-product-actions"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
exports.permissions = permissions;
|
|
46
|
+
//# sourceMappingURL=permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.js","sources":["../../server/src/permissions.ts"],"sourcesContent":["export const permissions = {\r\n actions: [\r\n {\r\n // Roles\r\n section: \"plugins\",\r\n displayName: \"Create\",\r\n uid: \"product-series.create\",\r\n subCategory: \"product-series\",\r\n pluginName: \"primershop-product-actions\",\r\n },\r\n {\r\n section: \"plugins\",\r\n displayName: \"Read\",\r\n uid: \"product-series.read\",\r\n subCategory: \"product-series\",\r\n pluginName: \"primershop-product-actions\",\r\n aliases: [\r\n {\r\n actionId: \"plugin::content-manager.explorer.read\",\r\n subjects: [\"api::product-series.product-series\"],\r\n },\r\n ],\r\n },\r\n {\r\n section: \"plugins\",\r\n displayName: \"Update\",\r\n uid: \"product-series.update\",\r\n subCategory: \"product-series\",\r\n pluginName: \"primershop-product-actions\",\r\n },\r\n {\r\n section: \"plugins\",\r\n displayName: \"Delete\",\r\n uid: \"product-series.delete\",\r\n subCategory: \"product-series\",\r\n pluginName: \"primershop-product-actions\",\r\n },\r\n ],\r\n};\r\n"],"names":["permissions","actions","section","displayName","uid","subCategory","pluginName","aliases","actionId","subjects"],"mappings":";;MAAaA,WAAAA,GAAc;IACzBC,OAAAA,EAAS;AACP,QAAA;;YAEEC,OAAAA,EAAS,SAAA;YACTC,WAAAA,EAAa,QAAA;YACbC,GAAAA,EAAK,uBAAA;YACLC,WAAAA,EAAa,gBAAA;YACbC,UAAAA,EAAY;AACd,SAAA;AACA,QAAA;YACEJ,OAAAA,EAAS,SAAA;YACTC,WAAAA,EAAa,MAAA;YACbC,GAAAA,EAAK,qBAAA;YACLC,WAAAA,EAAa,gBAAA;YACbC,UAAAA,EAAY,4BAAA;YACZC,OAAAA,EAAS;AACP,gBAAA;oBACEC,QAAAA,EAAU,uCAAA;oBACVC,QAAAA,EAAU;AAAC,wBAAA;AAAqC;AAClD;AACD;AACH,SAAA;AACA,QAAA;YACEP,OAAAA,EAAS,SAAA;YACTC,WAAAA,EAAa,QAAA;YACbC,GAAAA,EAAK,uBAAA;YACLC,WAAAA,EAAa,gBAAA;YACbC,UAAAA,EAAY;AACd,SAAA;AACA,QAAA;YACEJ,OAAAA,EAAS,SAAA;YACTC,WAAAA,EAAa,QAAA;YACbC,GAAAA,EAAK,uBAAA;YACLC,WAAAA,EAAa,gBAAA;YACbC,UAAAA,EAAY;AACd;AACD;AACH;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const permissions = {
|
|
2
|
+
actions: [
|
|
3
|
+
{
|
|
4
|
+
// Roles
|
|
5
|
+
section: "plugins",
|
|
6
|
+
displayName: "Create",
|
|
7
|
+
uid: "product-series.create",
|
|
8
|
+
subCategory: "product-series",
|
|
9
|
+
pluginName: "primershop-product-actions"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
section: "plugins",
|
|
13
|
+
displayName: "Read",
|
|
14
|
+
uid: "product-series.read",
|
|
15
|
+
subCategory: "product-series",
|
|
16
|
+
pluginName: "primershop-product-actions",
|
|
17
|
+
aliases: [
|
|
18
|
+
{
|
|
19
|
+
actionId: "plugin::content-manager.explorer.read",
|
|
20
|
+
subjects: [
|
|
21
|
+
"api::product-series.product-series"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
section: "plugins",
|
|
28
|
+
displayName: "Update",
|
|
29
|
+
uid: "product-series.update",
|
|
30
|
+
subCategory: "product-series",
|
|
31
|
+
pluginName: "primershop-product-actions"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
section: "plugins",
|
|
35
|
+
displayName: "Delete",
|
|
36
|
+
uid: "product-series.delete",
|
|
37
|
+
subCategory: "product-series",
|
|
38
|
+
pluginName: "primershop-product-actions"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { permissions };
|
|
44
|
+
//# sourceMappingURL=permissions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.mjs","sources":["../../server/src/permissions.ts"],"sourcesContent":["export const permissions = {\r\n actions: [\r\n {\r\n // Roles\r\n section: \"plugins\",\r\n displayName: \"Create\",\r\n uid: \"product-series.create\",\r\n subCategory: \"product-series\",\r\n pluginName: \"primershop-product-actions\",\r\n },\r\n {\r\n section: \"plugins\",\r\n displayName: \"Read\",\r\n uid: \"product-series.read\",\r\n subCategory: \"product-series\",\r\n pluginName: \"primershop-product-actions\",\r\n aliases: [\r\n {\r\n actionId: \"plugin::content-manager.explorer.read\",\r\n subjects: [\"api::product-series.product-series\"],\r\n },\r\n ],\r\n },\r\n {\r\n section: \"plugins\",\r\n displayName: \"Update\",\r\n uid: \"product-series.update\",\r\n subCategory: \"product-series\",\r\n pluginName: \"primershop-product-actions\",\r\n },\r\n {\r\n section: \"plugins\",\r\n displayName: \"Delete\",\r\n uid: \"product-series.delete\",\r\n subCategory: \"product-series\",\r\n pluginName: \"primershop-product-actions\",\r\n },\r\n ],\r\n};\r\n"],"names":["permissions","actions","section","displayName","uid","subCategory","pluginName","aliases","actionId","subjects"],"mappings":"MAAaA,WAAAA,GAAc;IACzBC,OAAAA,EAAS;AACP,QAAA;;YAEEC,OAAAA,EAAS,SAAA;YACTC,WAAAA,EAAa,QAAA;YACbC,GAAAA,EAAK,uBAAA;YACLC,WAAAA,EAAa,gBAAA;YACbC,UAAAA,EAAY;AACd,SAAA;AACA,QAAA;YACEJ,OAAAA,EAAS,SAAA;YACTC,WAAAA,EAAa,MAAA;YACbC,GAAAA,EAAK,qBAAA;YACLC,WAAAA,EAAa,gBAAA;YACbC,UAAAA,EAAY,4BAAA;YACZC,OAAAA,EAAS;AACP,gBAAA;oBACEC,QAAAA,EAAU,uCAAA;oBACVC,QAAAA,EAAU;AAAC,wBAAA;AAAqC;AAClD;AACD;AACH,SAAA;AACA,QAAA;YACEP,OAAAA,EAAS,SAAA;YACTC,WAAAA,EAAa,QAAA;YACbC,GAAAA,EAAK,uBAAA;YACLC,WAAAA,EAAa,gBAAA;YACbC,UAAAA,EAAY;AACd,SAAA;AACA,QAAA;YACEJ,OAAAA,EAAS,SAAA;YACTC,WAAAA,EAAa,QAAA;YACbC,GAAAA,EAAK,uBAAA;YACLC,WAAAA,EAAa,gBAAA;YACbC,UAAAA,EAAY;AACd;AACD;AACH;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginId.js","sources":["../../server/src/pluginId.ts"],"sourcesContent":["export const PLUGIN_ID = \"primershop-product-actions\";\r\n"],"names":["PLUGIN_ID"],"mappings":";;AAAO,MAAMA,YAAY;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginId.mjs","sources":["../../server/src/pluginId.ts"],"sourcesContent":["export const PLUGIN_ID = \"primershop-product-actions\";\r\n"],"names":["PLUGIN_ID"],"mappings":"AAAO,MAAMA,YAAY;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var pluginId = require('./pluginId.js');
|
|
4
|
+
|
|
5
|
+
const register = ({ strapi })=>{
|
|
6
|
+
// Register permissions
|
|
7
|
+
strapi.admin.services.permission.actionProvider.register({
|
|
8
|
+
section: "plugins",
|
|
9
|
+
displayName: "Product Actions",
|
|
10
|
+
uid: pluginId.PLUGIN_ID,
|
|
11
|
+
pluginName: pluginId.PLUGIN_ID
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
exports.register = register;
|
|
16
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sources":["../../server/src/register.ts"],"sourcesContent":["import { PLUGIN_ID } from \"./pluginId\";\r\nimport type { Core } from \"@strapi/strapi\";\r\n\r\nexport const register = ({ strapi }: { strapi: Core.Strapi }): void => {\r\n // Register permissions\r\n strapi.admin.services.permission.actionProvider.register({\r\n section: \"plugins\",\r\n displayName: \"Product Actions\",\r\n uid: PLUGIN_ID,\r\n pluginName: PLUGIN_ID,\r\n });\r\n};\r\n"],"names":["register","strapi","admin","services","permission","actionProvider","section","displayName","uid","PLUGIN_ID","pluginName"],"mappings":";;;;AAGO,MAAMA,QAAAA,GAAW,CAAC,EAAEC,MAAM,EAA2B,GAAA;;IAE1DA,MAAAA,CAAOC,KAAK,CAACC,QAAQ,CAACC,UAAU,CAACC,cAAc,CAACL,QAAQ,CAAC;QACvDM,OAAAA,EAAS,SAAA;QACTC,WAAAA,EAAa,iBAAA;QACbC,GAAAA,EAAKC,kBAAAA;QACLC,UAAAA,EAAYD;AACd,KAAA,CAAA;AACF;;;;"}
|