@localazy/strapi-plugin 1.0.4 → 1.0.9
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/dist/_chunks/FetchIdentity-4kkW9N7Y.js +981 -0
- package/dist/_chunks/FetchIdentity-BWSQAXt-.mjs +983 -0
- package/dist/_chunks/{LanguagesSelector-CeB7tVcb.mjs → LanguagesSelector-DwAGgpcR.mjs} +4 -2
- package/dist/_chunks/{LanguagesSelector-Bd8VFHib.js → LanguagesSelector-yWC_Yb_S.js} +12 -10
- package/dist/_chunks/{App-NRmSxuW3.js → LocalazyApp-DnaA768k.js} +136 -117
- package/dist/_chunks/{App-CtS6CrNn.mjs → LocalazyApp-zySanVTu.mjs} +32 -13
- package/dist/_chunks/{ContentTransferSetup-CeKXlzw_.mjs → LocalazyContentTransferSetup-C7qVIeix.mjs} +49 -456
- package/dist/_chunks/{ContentTransferSetup-DGs8MZPj.js → LocalazyContentTransferSetup-CeOM6bYA.js} +113 -520
- package/dist/_chunks/{GlobalSettings-rOwd0Y0E.mjs → LocalazyGlobalSettings-QvuLdsLe.mjs} +17 -8
- package/dist/_chunks/{GlobalSettings-CRMPRA3Y.js → LocalazyGlobalSettings-ewETL3oG.js} +61 -52
- package/dist/_chunks/LocalazyPanel-BXVLvFgD.js +83 -0
- package/dist/_chunks/LocalazyPanel-BotUsX-y.mjs +83 -0
- package/dist/_chunks/LocalazyStatusColumn-C81HewMg.mjs +51 -0
- package/dist/_chunks/LocalazyStatusColumn-Dt96YcGQ.js +51 -0
- package/dist/_chunks/{isEqual-CC-cEPwY.mjs → RequireLocalazyAuth-CDuyGCrT.mjs} +22 -1
- package/dist/_chunks/{isEqual-0M0aSdTT.js → RequireLocalazyAuth-CWBWETzC.js} +50 -29
- package/dist/_chunks/_commonjsHelpers-Bc2YnDe1.js +7 -0
- package/dist/_chunks/_commonjsHelpers-DWwsNxpa.mjs +8 -0
- package/dist/_chunks/en-CMWcM0nM.js +10 -0
- package/dist/_chunks/en-RX915msK.mjs +10 -0
- package/dist/_chunks/entry-exclusion-service-BVPICve2.mjs +60 -0
- package/dist/_chunks/entry-exclusion-service-CGV6iOkB.js +60 -0
- package/dist/_chunks/{has-model-changed-gNSOSMBa.js → has-model-changed-DVYRxVhM.js} +33 -32
- package/dist/_chunks/{has-model-changed-DViUIQHk.mjs → has-model-changed-DZL36gWh.mjs} +3 -2
- package/dist/_chunks/i18n-0dV2P-Hm.js +2378 -0
- package/dist/_chunks/i18n-RoETLXdU.mjs +2378 -0
- package/dist/_chunks/index-1he9s_bs.js +430 -0
- package/dist/_chunks/index-BIbKC7-V.mjs +432 -0
- package/dist/_chunks/index-CCxXsn7Z.js +254 -0
- package/dist/_chunks/{set-Cbi1yYuW.js → index-CaY3BYnQ.js} +878 -4379
- package/dist/_chunks/{set-Dnhh_SyE.mjs → index-CgI_aKe_.mjs} +906 -4408
- package/dist/_chunks/index-DsrYI6aB.mjs +231 -0
- package/dist/_chunks/initReactI18next-B0H8_DlW.js +60 -0
- package/dist/_chunks/initReactI18next-MHHxeg_9.mjs +61 -0
- package/dist/_chunks/{index-Dj68Ixl2.mjs → strapi-api-base-BE8VMlaA.js} +7 -234
- package/dist/_chunks/{index-Bbwk3kp3.js → strapi-api-base-DjeKGUw7.mjs} +15 -242
- package/dist/_chunks/useTranslation-BdIl-aLe.js +188 -0
- package/dist/_chunks/useTranslation-CZQ4lU1m.mjs +189 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/LocalazyPanel.d.ts +4 -0
- package/dist/admin/src/components/LocalazyStatusColumn.d.ts +3 -0
- package/dist/admin/src/components/RequireLocalazyAuth.d.ts +6 -0
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/admin/src/modules/entry-exclusion/services/entry-exclusion-service.d.ts +18 -0
- package/dist/admin/src/modules/plugin-settings/locale/en.d.ts +8 -0
- package/dist/admin/src/pages/LocalazyApp.d.ts +2 -0
- package/dist/admin/src/pages/LocalazyContentTransferSetup.d.ts +2 -0
- package/dist/admin/src/pages/LocalazyGlobalSettings.d.ts +2 -0
- package/dist/server/index.js +202 -35
- package/dist/server/index.mjs +202 -35
- package/dist/server/src/controllers/entry-exclusion-controller.d.ts +21 -0
- package/dist/server/src/controllers/index.d.ts +7 -0
- package/dist/server/src/core/index.d.ts +6 -0
- package/dist/server/src/index.d.ts +15 -0
- package/dist/server/src/routes/entry-exclusion-routes.d.ts +9 -0
- package/dist/server/src/services/entry-exclusion-service.d.ts +23 -0
- package/dist/server/src/services/index.d.ts +8 -0
- package/package.json +2 -2
- package/dist/_chunks/en-BTf8goGM.mjs +0 -8
- package/dist/_chunks/en-CRtsEFtl.js +0 -8
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
2
|
+
const FetchIdentity = require("./FetchIdentity-4kkW9N7Y.js");
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const index$1 = require("./index-CCxXsn7Z.js");
|
|
5
|
+
const index = require("./index-CaY3BYnQ.js");
|
|
6
|
+
const admin = require("@strapi/strapi/admin");
|
|
7
|
+
require("./i18n-0dV2P-Hm.js");
|
|
8
|
+
const useTranslation = require("./useTranslation-BdIl-aLe.js");
|
|
3
9
|
function arraySome(array, predicate) {
|
|
4
|
-
var
|
|
5
|
-
while (++
|
|
6
|
-
if (predicate(array[
|
|
10
|
+
var index2 = -1, length = array == null ? 0 : array.length;
|
|
11
|
+
while (++index2 < length) {
|
|
12
|
+
if (predicate(array[index2], index2, array)) {
|
|
7
13
|
return true;
|
|
8
14
|
}
|
|
9
15
|
}
|
|
@@ -20,13 +26,13 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
|
20
26
|
if (arrStacked && othStacked) {
|
|
21
27
|
return arrStacked == other && othStacked == array;
|
|
22
28
|
}
|
|
23
|
-
var
|
|
29
|
+
var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$1 ? new FetchIdentity.SetCache() : void 0;
|
|
24
30
|
stack.set(array, other);
|
|
25
31
|
stack.set(other, array);
|
|
26
|
-
while (++
|
|
27
|
-
var arrValue = array[
|
|
32
|
+
while (++index2 < arrLength) {
|
|
33
|
+
var arrValue = array[index2], othValue = other[index2];
|
|
28
34
|
if (customizer) {
|
|
29
|
-
var compared = isPartial ? customizer(othValue, arrValue,
|
|
35
|
+
var compared = isPartial ? customizer(othValue, arrValue, index2, other, array, stack) : customizer(arrValue, othValue, index2, array, other, stack);
|
|
30
36
|
}
|
|
31
37
|
if (compared !== void 0) {
|
|
32
38
|
if (compared) {
|
|
@@ -37,7 +43,7 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
|
37
43
|
}
|
|
38
44
|
if (seen) {
|
|
39
45
|
if (!arraySome(other, function(othValue2, othIndex) {
|
|
40
|
-
if (!
|
|
46
|
+
if (!FetchIdentity.cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
|
|
41
47
|
return seen.push(othIndex);
|
|
42
48
|
}
|
|
43
49
|
})) {
|
|
@@ -54,16 +60,16 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
|
54
60
|
return result;
|
|
55
61
|
}
|
|
56
62
|
function mapToArray(map) {
|
|
57
|
-
var
|
|
63
|
+
var index2 = -1, result = Array(map.size);
|
|
58
64
|
map.forEach(function(value, key) {
|
|
59
|
-
result[++
|
|
65
|
+
result[++index2] = [key, value];
|
|
60
66
|
});
|
|
61
67
|
return result;
|
|
62
68
|
}
|
|
63
69
|
var COMPARE_PARTIAL_FLAG$2 = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
64
70
|
var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
|
|
65
71
|
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
|
|
66
|
-
var symbolProto =
|
|
72
|
+
var symbolProto = FetchIdentity.Symbol ? FetchIdentity.Symbol.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
67
73
|
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
68
74
|
switch (tag) {
|
|
69
75
|
case dataViewTag:
|
|
@@ -73,14 +79,14 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
|
73
79
|
object = object.buffer;
|
|
74
80
|
other = other.buffer;
|
|
75
81
|
case arrayBufferTag:
|
|
76
|
-
if (object.byteLength != other.byteLength || !equalFunc(new
|
|
82
|
+
if (object.byteLength != other.byteLength || !equalFunc(new FetchIdentity.Uint8Array(object), new FetchIdentity.Uint8Array(other))) {
|
|
77
83
|
return false;
|
|
78
84
|
}
|
|
79
85
|
return true;
|
|
80
86
|
case boolTag:
|
|
81
87
|
case dateTag:
|
|
82
88
|
case numberTag:
|
|
83
|
-
return
|
|
89
|
+
return FetchIdentity.eq(+object, +other);
|
|
84
90
|
case errorTag:
|
|
85
91
|
return object.name == other.name && object.message == other.message;
|
|
86
92
|
case regexpTag:
|
|
@@ -90,7 +96,7 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
|
90
96
|
var convert = mapToArray;
|
|
91
97
|
case setTag:
|
|
92
98
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
|
|
93
|
-
convert || (convert =
|
|
99
|
+
convert || (convert = FetchIdentity.setToArray);
|
|
94
100
|
if (object.size != other.size && !isPartial) {
|
|
95
101
|
return false;
|
|
96
102
|
}
|
|
@@ -114,13 +120,13 @@ var COMPARE_PARTIAL_FLAG$1 = 1;
|
|
|
114
120
|
var objectProto$1 = Object.prototype;
|
|
115
121
|
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
116
122
|
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
117
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1, objProps =
|
|
123
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1, objProps = FetchIdentity.getAllKeys(object), objLength = objProps.length, othProps = FetchIdentity.getAllKeys(other), othLength = othProps.length;
|
|
118
124
|
if (objLength != othLength && !isPartial) {
|
|
119
125
|
return false;
|
|
120
126
|
}
|
|
121
|
-
var
|
|
122
|
-
while (
|
|
123
|
-
var key = objProps[
|
|
127
|
+
var index2 = objLength;
|
|
128
|
+
while (index2--) {
|
|
129
|
+
var key = objProps[index2];
|
|
124
130
|
if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
|
|
125
131
|
return false;
|
|
126
132
|
}
|
|
@@ -134,8 +140,8 @@ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
|
134
140
|
stack.set(object, other);
|
|
135
141
|
stack.set(other, object);
|
|
136
142
|
var skipCtor = isPartial;
|
|
137
|
-
while (++
|
|
138
|
-
key = objProps[
|
|
143
|
+
while (++index2 < objLength) {
|
|
144
|
+
key = objProps[index2];
|
|
139
145
|
var objValue = object[key], othValue = other[key];
|
|
140
146
|
if (customizer) {
|
|
141
147
|
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
|
|
@@ -161,40 +167,40 @@ var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[o
|
|
|
161
167
|
var objectProto = Object.prototype;
|
|
162
168
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
163
169
|
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
164
|
-
var objIsArr =
|
|
170
|
+
var objIsArr = FetchIdentity.isArray(object), othIsArr = FetchIdentity.isArray(other), objTag = objIsArr ? arrayTag : FetchIdentity.getTag(object), othTag = othIsArr ? arrayTag : FetchIdentity.getTag(other);
|
|
165
171
|
objTag = objTag == argsTag ? objectTag : objTag;
|
|
166
172
|
othTag = othTag == argsTag ? objectTag : othTag;
|
|
167
173
|
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
168
|
-
if (isSameTag &&
|
|
169
|
-
if (!
|
|
174
|
+
if (isSameTag && FetchIdentity.isBuffer(object)) {
|
|
175
|
+
if (!FetchIdentity.isBuffer(other)) {
|
|
170
176
|
return false;
|
|
171
177
|
}
|
|
172
178
|
objIsArr = true;
|
|
173
179
|
objIsObj = false;
|
|
174
180
|
}
|
|
175
181
|
if (isSameTag && !objIsObj) {
|
|
176
|
-
stack || (stack = new
|
|
177
|
-
return objIsArr ||
|
|
182
|
+
stack || (stack = new FetchIdentity.Stack());
|
|
183
|
+
return objIsArr || FetchIdentity.isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
178
184
|
}
|
|
179
185
|
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
180
186
|
var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
|
|
181
187
|
if (objIsWrapped || othIsWrapped) {
|
|
182
188
|
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
183
|
-
stack || (stack = new
|
|
189
|
+
stack || (stack = new FetchIdentity.Stack());
|
|
184
190
|
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
185
191
|
}
|
|
186
192
|
}
|
|
187
193
|
if (!isSameTag) {
|
|
188
194
|
return false;
|
|
189
195
|
}
|
|
190
|
-
stack || (stack = new
|
|
196
|
+
stack || (stack = new FetchIdentity.Stack());
|
|
191
197
|
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
192
198
|
}
|
|
193
199
|
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
194
200
|
if (value === other) {
|
|
195
201
|
return true;
|
|
196
202
|
}
|
|
197
|
-
if (value == null || other == null || !
|
|
203
|
+
if (value == null || other == null || !FetchIdentity.isObjectLike(value) && !FetchIdentity.isObjectLike(other)) {
|
|
198
204
|
return value !== value && other !== other;
|
|
199
205
|
}
|
|
200
206
|
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
@@ -202,4 +208,19 @@ function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
|
202
208
|
function isEqual(value, other) {
|
|
203
209
|
return baseIsEqual(value, other);
|
|
204
210
|
}
|
|
211
|
+
const RequireLocalazyAuth = ({ children }) => {
|
|
212
|
+
const { isLoggedIn, isFetchingIdentity } = FetchIdentity.useLocalazyIdentity();
|
|
213
|
+
const { t } = useTranslation.useTranslation();
|
|
214
|
+
if (!isFetchingIdentity && !isLoggedIn) {
|
|
215
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
216
|
+
/* @__PURE__ */ jsxRuntime.jsx(admin.Layouts.Header, { title: t("common.localazy_plugin"), subtitle: t("common.localazy_plugin_description"), as: "h2" }),
|
|
217
|
+
/* @__PURE__ */ jsxRuntime.jsxs(index.Box, { marginLeft: 10, marginRight: 10, background: "neutral0", padding: 7, hasRadius: true, shadow: "tableShadow", children: [
|
|
218
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Typography, { variant: "epsilon", textColor: "neutral600", children: t("login.you_have_to_own_account_for_the_plugin_to_work_properly") }),
|
|
219
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Box, { paddingTop: 4, children: /* @__PURE__ */ jsxRuntime.jsx(index.Typography, { variant: "omega", children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: `/admin/plugins/${index$1.PLUGIN_ID}/`, children: t("login.login_with_localazy") }) }) })
|
|
220
|
+
] })
|
|
221
|
+
] });
|
|
222
|
+
}
|
|
223
|
+
return children;
|
|
224
|
+
};
|
|
225
|
+
exports.RequireLocalazyAuth = RequireLocalazyAuth;
|
|
205
226
|
exports.isEqual = isEqual;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
3
|
+
function getDefaultExportFromCjs(x) {
|
|
4
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
5
|
+
}
|
|
6
|
+
exports.commonjsGlobal = commonjsGlobal;
|
|
7
|
+
exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
2
|
+
function getDefaultExportFromCjs(x) {
|
|
3
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
commonjsGlobal as c,
|
|
7
|
+
getDefaultExportFromCjs as g
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const en = {
|
|
4
|
+
"localazy.name": "Localazy",
|
|
5
|
+
"localazy.localazy_settings": "Localazy Settings",
|
|
6
|
+
"localazy.content_transfer_setup": "Content Transfer Setup",
|
|
7
|
+
"localazy.exclude_from_translation": "Exclude from translation",
|
|
8
|
+
"localazy.include_to_translation": "Include to translation"
|
|
9
|
+
};
|
|
10
|
+
exports.default = en;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const en = {
|
|
2
|
+
"localazy.name": "Localazy",
|
|
3
|
+
"localazy.localazy_settings": "Localazy Settings",
|
|
4
|
+
"localazy.content_transfer_setup": "Content Transfer Setup",
|
|
5
|
+
"localazy.exclude_from_translation": "Exclude from translation",
|
|
6
|
+
"localazy.include_to_translation": "Include to translation"
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
en as default
|
|
10
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-DjeKGUw7.mjs";
|
|
2
|
+
const BASE_PATH = "/entry-exclusion";
|
|
3
|
+
const axiosInstance = createStrapiApiAxiosInstance();
|
|
4
|
+
class EntryExclusionService {
|
|
5
|
+
/**
|
|
6
|
+
* Get entry exclusion state for a specific entry
|
|
7
|
+
*/
|
|
8
|
+
static async getEntryExclusion(contentType, documentId) {
|
|
9
|
+
try {
|
|
10
|
+
const result = await axiosInstance.get(`${BASE_PATH}/${contentType}/${documentId}`);
|
|
11
|
+
return result.data.isExcluded;
|
|
12
|
+
} catch (error) {
|
|
13
|
+
console.error("Error getting entry exclusion:", error);
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Set entry exclusion state for a specific entry
|
|
19
|
+
*/
|
|
20
|
+
static async setEntryExclusion(contentType, documentId, isExcluded) {
|
|
21
|
+
try {
|
|
22
|
+
const result = await axiosInstance.put(`${BASE_PATH}/${contentType}/${documentId}`, {
|
|
23
|
+
isExcluded
|
|
24
|
+
});
|
|
25
|
+
return result.data.isExcluded;
|
|
26
|
+
} catch (error) {
|
|
27
|
+
console.error("Error setting entry exclusion:", error);
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Set exclusion state for multiple entries
|
|
33
|
+
*/
|
|
34
|
+
static async setMultipleEntriesExclusion(contentType, documentIds, isExcluded) {
|
|
35
|
+
try {
|
|
36
|
+
for (let i = 0; i < documentIds.length; i++) {
|
|
37
|
+
const docId = documentIds[i];
|
|
38
|
+
await this.setEntryExclusion(contentType, docId, isExcluded);
|
|
39
|
+
}
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.error("Error setting multiple entries exclusion:", error);
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get all excluded entries for a content type
|
|
47
|
+
*/
|
|
48
|
+
static async getContentTypeExclusions(contentType) {
|
|
49
|
+
try {
|
|
50
|
+
const result = await axiosInstance.get(`${BASE_PATH}/${contentType}`);
|
|
51
|
+
return result.data.excludedIds;
|
|
52
|
+
} catch (error) {
|
|
53
|
+
console.error("Error getting content type exclusions:", error);
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
EntryExclusionService as default
|
|
60
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const strapiApiBase = require("./strapi-api-base-BE8VMlaA.js");
|
|
4
|
+
const BASE_PATH = "/entry-exclusion";
|
|
5
|
+
const axiosInstance = strapiApiBase.createStrapiApiAxiosInstance();
|
|
6
|
+
class EntryExclusionService {
|
|
7
|
+
/**
|
|
8
|
+
* Get entry exclusion state for a specific entry
|
|
9
|
+
*/
|
|
10
|
+
static async getEntryExclusion(contentType, documentId) {
|
|
11
|
+
try {
|
|
12
|
+
const result = await axiosInstance.get(`${BASE_PATH}/${contentType}/${documentId}`);
|
|
13
|
+
return result.data.isExcluded;
|
|
14
|
+
} catch (error) {
|
|
15
|
+
console.error("Error getting entry exclusion:", error);
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Set entry exclusion state for a specific entry
|
|
21
|
+
*/
|
|
22
|
+
static async setEntryExclusion(contentType, documentId, isExcluded) {
|
|
23
|
+
try {
|
|
24
|
+
const result = await axiosInstance.put(`${BASE_PATH}/${contentType}/${documentId}`, {
|
|
25
|
+
isExcluded
|
|
26
|
+
});
|
|
27
|
+
return result.data.isExcluded;
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.error("Error setting entry exclusion:", error);
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Set exclusion state for multiple entries
|
|
35
|
+
*/
|
|
36
|
+
static async setMultipleEntriesExclusion(contentType, documentIds, isExcluded) {
|
|
37
|
+
try {
|
|
38
|
+
for (let i = 0; i < documentIds.length; i++) {
|
|
39
|
+
const docId = documentIds[i];
|
|
40
|
+
await this.setEntryExclusion(contentType, docId, isExcluded);
|
|
41
|
+
}
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.error("Error setting multiple entries exclusion:", error);
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get all excluded entries for a content type
|
|
49
|
+
*/
|
|
50
|
+
static async getContentTypeExclusions(contentType) {
|
|
51
|
+
try {
|
|
52
|
+
const result = await axiosInstance.get(`${BASE_PATH}/${contentType}`);
|
|
53
|
+
return result.data.excludedIds;
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.error("Error getting content type exclusions:", error);
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.default = EntryExclusionService;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
const
|
|
2
|
+
const FetchIdentity = require("./FetchIdentity-4kkW9N7Y.js");
|
|
3
|
+
const strapiApiBase = require("./strapi-api-base-BE8VMlaA.js");
|
|
4
|
+
const _commonjsHelpers = require("./_commonjsHelpers-Bc2YnDe1.js");
|
|
4
5
|
function baseGet(object, path) {
|
|
5
|
-
path =
|
|
6
|
-
var
|
|
7
|
-
while (object != null &&
|
|
8
|
-
object = object[
|
|
6
|
+
path = FetchIdentity.castPath(path, object);
|
|
7
|
+
var index = 0, length = path.length;
|
|
8
|
+
while (object != null && index < length) {
|
|
9
|
+
object = object[FetchIdentity.toKey(path[index++])];
|
|
9
10
|
}
|
|
10
|
-
return
|
|
11
|
+
return index && index == length ? object : void 0;
|
|
11
12
|
}
|
|
12
13
|
function get(object, path, defaultValue) {
|
|
13
14
|
var result = object == null ? void 0 : baseGet(object, path);
|
|
14
15
|
return result === void 0 ? defaultValue : result;
|
|
15
16
|
}
|
|
16
17
|
const BASE_PATH = "/strapi";
|
|
17
|
-
const strapiApiAxiosInstance =
|
|
18
|
+
const strapiApiAxiosInstance = strapiApiBase.createStrapiApiAxiosInstance();
|
|
18
19
|
class StrapiModelService {
|
|
19
20
|
static async getModels() {
|
|
20
21
|
try {
|
|
@@ -113,10 +114,10 @@ const findModelValueByKey = (allModelsTree, key) => {
|
|
|
113
114
|
return get(objectivizedModelsTree, key);
|
|
114
115
|
};
|
|
115
116
|
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
116
|
-
var length = array.length,
|
|
117
|
-
while (++
|
|
118
|
-
if (predicate(array[
|
|
119
|
-
return
|
|
117
|
+
var length = array.length, index = fromIndex + -1;
|
|
118
|
+
while (++index < length) {
|
|
119
|
+
if (predicate(array[index], index, array)) {
|
|
120
|
+
return index;
|
|
120
121
|
}
|
|
121
122
|
}
|
|
122
123
|
return -1;
|
|
@@ -125,10 +126,10 @@ function baseIsNaN(value) {
|
|
|
125
126
|
return value !== value;
|
|
126
127
|
}
|
|
127
128
|
function strictIndexOf(array, value, fromIndex) {
|
|
128
|
-
var
|
|
129
|
-
while (++
|
|
130
|
-
if (array[
|
|
131
|
-
return
|
|
129
|
+
var index = fromIndex - 1, length = array.length;
|
|
130
|
+
while (++index < length) {
|
|
131
|
+
if (array[index] === value) {
|
|
132
|
+
return index;
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
return -1;
|
|
@@ -143,26 +144,26 @@ function arrayIncludes(array, value) {
|
|
|
143
144
|
function noop() {
|
|
144
145
|
}
|
|
145
146
|
var INFINITY = 1 / 0;
|
|
146
|
-
var createSet = !(
|
|
147
|
-
return new
|
|
147
|
+
var createSet = !(FetchIdentity.Set && 1 / FetchIdentity.setToArray(new FetchIdentity.Set([, -0]))[1] == INFINITY) ? noop : function(values) {
|
|
148
|
+
return new FetchIdentity.Set(values);
|
|
148
149
|
};
|
|
149
150
|
var LARGE_ARRAY_SIZE = 200;
|
|
150
151
|
function baseUniq(array, iteratee, comparator) {
|
|
151
|
-
var
|
|
152
|
+
var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
|
|
152
153
|
if (length >= LARGE_ARRAY_SIZE) {
|
|
153
|
-
var set
|
|
154
|
-
if (set
|
|
155
|
-
return
|
|
154
|
+
var set = createSet(array);
|
|
155
|
+
if (set) {
|
|
156
|
+
return FetchIdentity.setToArray(set);
|
|
156
157
|
}
|
|
157
158
|
isCommon = false;
|
|
158
|
-
includes =
|
|
159
|
-
seen = new
|
|
159
|
+
includes = FetchIdentity.cacheHas;
|
|
160
|
+
seen = new FetchIdentity.SetCache();
|
|
160
161
|
} else {
|
|
161
162
|
seen = result;
|
|
162
163
|
}
|
|
163
164
|
outer:
|
|
164
|
-
while (++
|
|
165
|
-
var value = array[
|
|
165
|
+
while (++index < length) {
|
|
166
|
+
var value = array[index], computed = value;
|
|
166
167
|
value = value !== 0 ? value : 0;
|
|
167
168
|
if (isCommon && computed === computed) {
|
|
168
169
|
var seenIndex = seen.length;
|
|
@@ -196,10 +197,10 @@ function deepKeys(obj, stack, parent, intermediate) {
|
|
|
196
197
|
if (intermediate) stack.push(parent ? p : escaped);
|
|
197
198
|
deepKeys(obj[el], stack, p || escaped, intermediate);
|
|
198
199
|
} else if (isArray(obj[el])) {
|
|
199
|
-
obj[el].forEach((item,
|
|
200
|
-
var p2 = parent ? parent + `.${escaped}.${
|
|
201
|
-
if (intermediate) stack.push(parent ? p2 : `${escaped}.${
|
|
202
|
-
deepKeys(item, stack, p2 || `${escaped}.${
|
|
200
|
+
obj[el].forEach((item, index) => {
|
|
201
|
+
var p2 = parent ? parent + `.${escaped}.${index}` : parent;
|
|
202
|
+
if (intermediate) stack.push(parent ? p2 : `${escaped}.${index}`);
|
|
203
|
+
deepKeys(item, stack, p2 || `${escaped}.${index}`, intermediate);
|
|
203
204
|
});
|
|
204
205
|
} else {
|
|
205
206
|
var key = parent ? parent + "." + escaped : escaped;
|
|
@@ -211,7 +212,7 @@ function deepKeys(obj, stack, parent, intermediate) {
|
|
|
211
212
|
var deepKeys_1 = function(obj, intermediate) {
|
|
212
213
|
return deepKeys(obj, [], null, intermediate);
|
|
213
214
|
};
|
|
214
|
-
const deepKeys$1 = /* @__PURE__ */
|
|
215
|
+
const deepKeys$1 = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(deepKeys_1);
|
|
215
216
|
const sortByModelName = (a, b) => {
|
|
216
217
|
const uidA = Object.keys(a)[0].toLowerCase();
|
|
217
218
|
const uidB = Object.keys(b)[0].toLowerCase();
|
|
@@ -282,7 +283,7 @@ const hasModelChanged = async (localizableTree = null, storedSetupSchema = null,
|
|
|
282
283
|
localizableTree = getModelsTree(models, localizableModels);
|
|
283
284
|
}
|
|
284
285
|
if (!storedSetupSchema) {
|
|
285
|
-
storedSetupSchema = (await
|
|
286
|
+
storedSetupSchema = (await FetchIdentity.PluginSettingsService.getContentTransferSetup()).setup;
|
|
286
287
|
}
|
|
287
288
|
if (!allModelsTree) {
|
|
288
289
|
allModelsTree = getModelsTree(models, models);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as createStrapiApiAxiosInstance } from "./
|
|
1
|
+
import { q as castPath, t as toKey, r as Set, d as setToArray, S as SetCache, a as cacheHas, P as PluginSettingsService } from "./FetchIdentity-BWSQAXt-.mjs";
|
|
2
|
+
import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-DjeKGUw7.mjs";
|
|
3
|
+
import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-DWwsNxpa.mjs";
|
|
3
4
|
function baseGet(object, path) {
|
|
4
5
|
path = castPath(path, object);
|
|
5
6
|
var index = 0, length = path.length;
|