@websolutespa/payload-plugin-bowl 1.10.2 → 1.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +83 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -865,6 +865,7 @@ var translations = {
|
|
|
865
865
|
}
|
|
866
866
|
},
|
|
867
867
|
global: {
|
|
868
|
+
app: "App",
|
|
868
869
|
locale: "Locales"
|
|
869
870
|
},
|
|
870
871
|
field: {
|
|
@@ -875,8 +876,11 @@ var translations = {
|
|
|
875
876
|
alpha3Code: "Alpha3 Code",
|
|
876
877
|
alt: "Alt",
|
|
877
878
|
appearance: "Appearance",
|
|
879
|
+
appName: "App Name",
|
|
878
880
|
bcc: "BCC",
|
|
879
881
|
blocks: "Blocks",
|
|
882
|
+
brand: "Brand",
|
|
883
|
+
businessName: "Business Name",
|
|
880
884
|
category_index: "Index of Category",
|
|
881
885
|
category: "Category",
|
|
882
886
|
cc: "CC",
|
|
@@ -893,6 +897,7 @@ var translations = {
|
|
|
893
897
|
continent: "Continent",
|
|
894
898
|
countries: "Countries",
|
|
895
899
|
country: "Country",
|
|
900
|
+
countryCode: "Country Code",
|
|
896
901
|
countryZone: "Country Zone",
|
|
897
902
|
customClass: "Custom Class",
|
|
898
903
|
date: "Date",
|
|
@@ -922,6 +927,7 @@ var translations = {
|
|
|
922
927
|
lat: "Latitude",
|
|
923
928
|
legalNotice: "Legal Notice",
|
|
924
929
|
link: "Link",
|
|
930
|
+
logo: "Logo",
|
|
925
931
|
lng: "Longitude",
|
|
926
932
|
marketingEmail: "Marketing Email",
|
|
927
933
|
markets: "Markets",
|
|
@@ -939,22 +945,26 @@ var translations = {
|
|
|
939
945
|
position: "Position",
|
|
940
946
|
price: "Price",
|
|
941
947
|
province: "Province",
|
|
948
|
+
provinceCode: "Province Code",
|
|
942
949
|
reference: "Reference",
|
|
943
950
|
region: "Region",
|
|
944
951
|
revoked: "Revoked",
|
|
945
952
|
revokedDate: "Revoked date",
|
|
946
953
|
roles: "Roles",
|
|
947
954
|
slug: "Slug",
|
|
955
|
+
social: "Social",
|
|
948
956
|
status: "Status",
|
|
949
957
|
streetNumber: "Street Number",
|
|
950
958
|
subContinent: "Subcontinent",
|
|
951
959
|
subject: "Subject",
|
|
952
960
|
target: "Target",
|
|
961
|
+
telephone: "Telephone",
|
|
953
962
|
template: "Template",
|
|
954
963
|
tenants: "Tenants",
|
|
955
964
|
text: "Text",
|
|
956
965
|
title: "Title",
|
|
957
966
|
to: "To",
|
|
967
|
+
twitterName: "Twitter",
|
|
958
968
|
type: "Type",
|
|
959
969
|
url: "Url",
|
|
960
970
|
useSplat: "Use Splat",
|
|
@@ -1089,6 +1099,7 @@ var translations = {
|
|
|
1089
1099
|
}
|
|
1090
1100
|
},
|
|
1091
1101
|
global: {
|
|
1102
|
+
app: "App",
|
|
1092
1103
|
locale: "Localizzazioni"
|
|
1093
1104
|
},
|
|
1094
1105
|
field: {
|
|
@@ -1099,8 +1110,11 @@ var translations = {
|
|
|
1099
1110
|
alpha3Code: "Codice Alpha3",
|
|
1100
1111
|
alt: "Testo Alternativo",
|
|
1101
1112
|
appearance: "Aspetto",
|
|
1113
|
+
appName: "Nome dell'applicazione",
|
|
1102
1114
|
bcc: "CCN",
|
|
1103
1115
|
blocks: "Blocchi",
|
|
1116
|
+
brand: "Brand",
|
|
1117
|
+
businessName: "Societ\xE0",
|
|
1104
1118
|
category_index: "Indice di Categoria",
|
|
1105
1119
|
category: "Categoria",
|
|
1106
1120
|
cc: "CC",
|
|
@@ -1117,6 +1131,7 @@ var translations = {
|
|
|
1117
1131
|
continent: "Continente",
|
|
1118
1132
|
countries: "Nazioni",
|
|
1119
1133
|
country: "Nazione",
|
|
1134
|
+
countryCode: "Codice Nazione",
|
|
1120
1135
|
countryZone: "Area Nazionale",
|
|
1121
1136
|
customClass: "Classe Custom",
|
|
1122
1137
|
date: "Data",
|
|
@@ -1144,6 +1159,7 @@ var translations = {
|
|
|
1144
1159
|
lat: "Latitudine",
|
|
1145
1160
|
legalNotice: "Informativa Legale",
|
|
1146
1161
|
link: "Link",
|
|
1162
|
+
logo: "Logo",
|
|
1147
1163
|
lng: "Longitudine",
|
|
1148
1164
|
marketingEmail: "Email marketing",
|
|
1149
1165
|
markets: "Mercati",
|
|
@@ -1161,22 +1177,26 @@ var translations = {
|
|
|
1161
1177
|
position: "Posizione",
|
|
1162
1178
|
price: "Prezzo",
|
|
1163
1179
|
province: "Provincia",
|
|
1180
|
+
provinceCode: "Codice Provincia",
|
|
1164
1181
|
reference: "Riferimento",
|
|
1165
1182
|
region: "Regione",
|
|
1166
1183
|
revoked: "Revocato",
|
|
1167
1184
|
revokedDate: "Data di Revoca",
|
|
1168
1185
|
roles: "Ruoli",
|
|
1169
1186
|
slug: "Slug",
|
|
1187
|
+
social: "Social",
|
|
1170
1188
|
status: "Stato",
|
|
1171
1189
|
streetNumber: "Numero civico",
|
|
1172
1190
|
subContinent: "Subcontinente",
|
|
1173
1191
|
subject: "Oggetto",
|
|
1174
1192
|
target: "Target",
|
|
1193
|
+
telephone: "Telephone",
|
|
1175
1194
|
template: "Template",
|
|
1176
1195
|
tenants: "Tenants",
|
|
1177
1196
|
text: "Testo",
|
|
1178
1197
|
title: "Titolo",
|
|
1179
1198
|
to: "A",
|
|
1199
|
+
twitterName: "Twitter",
|
|
1180
1200
|
type: "Tipo",
|
|
1181
1201
|
url: "Url",
|
|
1182
1202
|
useSplat: "Utilizza Splat",
|
|
@@ -1234,6 +1254,7 @@ var rolesEndUser = [roles.User, roles.Guest];
|
|
|
1234
1254
|
var defaultSlug = {
|
|
1235
1255
|
// core
|
|
1236
1256
|
address: "address",
|
|
1257
|
+
app: "app",
|
|
1237
1258
|
category: "category",
|
|
1238
1259
|
emailConfig: "email_config",
|
|
1239
1260
|
label: "label",
|
|
@@ -4895,6 +4916,11 @@ async function getStore_(req) {
|
|
|
4895
4916
|
store[slug] = [];
|
|
4896
4917
|
}
|
|
4897
4918
|
}
|
|
4919
|
+
const app = await findGlobal(subRequest, "app");
|
|
4920
|
+
store.app = [{
|
|
4921
|
+
id: "app",
|
|
4922
|
+
...app
|
|
4923
|
+
}];
|
|
4898
4924
|
try {
|
|
4899
4925
|
const localeCollection = await fetchCollection_(subRequest, "locale", { richText: false });
|
|
4900
4926
|
store.locale = localeCollection.docs;
|
|
@@ -5258,6 +5284,7 @@ var encryptData = /* @__PURE__ */ __name((collectionConfig) => {
|
|
|
5258
5284
|
}, "encryptData");
|
|
5259
5285
|
|
|
5260
5286
|
// src/core/translations/translations.ts
|
|
5287
|
+
var import_bom_core10 = require("@websolutespa/bom-core");
|
|
5261
5288
|
var missingTranslations = [];
|
|
5262
5289
|
var locales = options.locales.map((x) => typeof x === "string" ? x : x.code);
|
|
5263
5290
|
function getTranslation4(path3, defaultText, locale, node, fullPath) {
|
|
@@ -5269,10 +5296,14 @@ function getTranslation4(path3, defaultText, locale, node, fullPath) {
|
|
|
5269
5296
|
path3 = paths.join(".");
|
|
5270
5297
|
return getTranslation4(path3, defaultText, locale, node[key] || {}, fullPath);
|
|
5271
5298
|
}
|
|
5272
|
-
if (
|
|
5273
|
-
|
|
5299
|
+
if (node[path3]) {
|
|
5300
|
+
return node[path3] || defaultText || "";
|
|
5301
|
+
} else {
|
|
5302
|
+
if (missingTranslations.indexOf(fullPath) === -1) {
|
|
5303
|
+
missingTranslations.push(fullPath);
|
|
5304
|
+
}
|
|
5305
|
+
return (0, import_bom_core10.toCharCase)(fullPath.split(".").pop(), " ");
|
|
5274
5306
|
}
|
|
5275
|
-
return node[path3] || defaultText || "";
|
|
5276
5307
|
}
|
|
5277
5308
|
__name(getTranslation4, "getTranslation");
|
|
5278
5309
|
function getTranslations(path3, defaultText) {
|
|
@@ -5396,7 +5427,7 @@ function logMissingTranslations() {
|
|
|
5396
5427
|
__name(logMissingTranslations, "logMissingTranslations");
|
|
5397
5428
|
|
|
5398
5429
|
// src/core/utils/getPreviewURL.ts
|
|
5399
|
-
var
|
|
5430
|
+
var import_bom_core11 = require("@websolutespa/bom-core");
|
|
5400
5431
|
function getPreviewPublicURL(qs2) {
|
|
5401
5432
|
const PREVIEW_URL = process.env.PAYLOAD_PUBLIC_PREVIEW_URL || "https://localhost:3000";
|
|
5402
5433
|
const queryString2 = Object.keys(qs2).map((x) => `${x}=${qs2[x]}`).join("&");
|
|
@@ -5407,9 +5438,9 @@ __name(getPreviewPublicURL, "getPreviewPublicURL");
|
|
|
5407
5438
|
function getPreviewURL(doc, locale, _token) {
|
|
5408
5439
|
const localeId = locale;
|
|
5409
5440
|
const markets = doc.markets || [];
|
|
5410
|
-
const market = markets.find((x) => x.defaultLanguage === localeId || (x.languages || []).findIndex((language) => (0,
|
|
5441
|
+
const market = markets.find((x) => x.defaultLanguage === localeId || (x.languages || []).findIndex((language) => (0, import_bom_core11.asEntityId)(language) === localeId) !== -1) || markets[0];
|
|
5411
5442
|
const marketId = market ? market.id : options.defaultMarket;
|
|
5412
|
-
const templateId = (0,
|
|
5443
|
+
const templateId = (0, import_bom_core11.asEquatable)(doc.template) || doc.slug;
|
|
5413
5444
|
const _status = doc._status;
|
|
5414
5445
|
const documentId = doc.id;
|
|
5415
5446
|
return getPreviewPublicURL({ marketId, localeId, templateId, documentId, _status, _token });
|
|
@@ -7171,7 +7202,7 @@ var withMenu = /* @__PURE__ */ __name((config) => {
|
|
|
7171
7202
|
}, "withMenu");
|
|
7172
7203
|
|
|
7173
7204
|
// src/core/collections/withPage.ts
|
|
7174
|
-
var
|
|
7205
|
+
var import_bom_core12 = require("@websolutespa/bom-core");
|
|
7175
7206
|
var import_payload_utils46 = require("@websolutespa/payload-utils");
|
|
7176
7207
|
var PageDefault = {
|
|
7177
7208
|
access: {
|
|
@@ -7198,7 +7229,7 @@ var PageDefault = {
|
|
|
7198
7229
|
};
|
|
7199
7230
|
var withPage = /* @__PURE__ */ __name((config) => {
|
|
7200
7231
|
const pageConfig = (0, import_payload_utils46.deepMerge)(PageDefault, config);
|
|
7201
|
-
if (!config.access?.read && (0,
|
|
7232
|
+
if (!config.access?.read && (0, import_bom_core12.isObject)(pageConfig.versions) && pageConfig.versions.drafts) {
|
|
7202
7233
|
pageConfig.access.read = isPageRole(roles.Admin, roles.Contributor, roles.Editor, roles.Guest, roles.User);
|
|
7203
7234
|
}
|
|
7204
7235
|
const defaultFields = [
|
|
@@ -8126,8 +8157,8 @@ var Province = /* @__PURE__ */ __name((options2) => ({
|
|
|
8126
8157
|
}), "Province");
|
|
8127
8158
|
|
|
8128
8159
|
// src/collections/Redirect.ts
|
|
8129
|
-
var
|
|
8130
|
-
var RedirectStatusOptions = Object.entries(
|
|
8160
|
+
var import_bom_core13 = require("@websolutespa/bom-core");
|
|
8161
|
+
var RedirectStatusOptions = Object.entries(import_bom_core13.RedirectReason).map(([k, v]) => ({
|
|
8131
8162
|
value: v,
|
|
8132
8163
|
label: `${v} - ${k}`
|
|
8133
8164
|
}));
|
|
@@ -8400,6 +8431,47 @@ function replaceCircularReference() {
|
|
|
8400
8431
|
}
|
|
8401
8432
|
__name(replaceCircularReference, "replaceCircularReference");
|
|
8402
8433
|
|
|
8434
|
+
// src/globals/App.ts
|
|
8435
|
+
var App = /* @__PURE__ */ __name((options2) => ({
|
|
8436
|
+
type: "withGlobal",
|
|
8437
|
+
slug: options2.slug.app,
|
|
8438
|
+
admin: {
|
|
8439
|
+
group: options2.group.config
|
|
8440
|
+
},
|
|
8441
|
+
access: {
|
|
8442
|
+
read: isRole(roles.Admin, roles.Contributor, roles.Editor, roles.Guest, roles.User),
|
|
8443
|
+
update: isRole(roles.Admin, roles.Contributor, roles.Editor)
|
|
8444
|
+
},
|
|
8445
|
+
fields: [
|
|
8446
|
+
{
|
|
8447
|
+
type: "group",
|
|
8448
|
+
name: "brand",
|
|
8449
|
+
fields: [
|
|
8450
|
+
{ type: "text", name: "name", defaultValue: "Mixer", required: true },
|
|
8451
|
+
{ type: "text", name: "businessName", defaultValue: "Mixer Spa" },
|
|
8452
|
+
{ type: "text", name: "appName", defaultValue: "Mixer" },
|
|
8453
|
+
{ type: "withMedia", name: "logo" },
|
|
8454
|
+
{ type: "text", name: "email", defaultValue: "info@websolute.it" },
|
|
8455
|
+
{ type: "text", name: "telephone", defaultValue: "+39 0721 411112" },
|
|
8456
|
+
{ type: "text", name: "address", defaultValue: "Strada della Campanara, 15" },
|
|
8457
|
+
{ type: "text", name: "city", defaultValue: "Pesaro" },
|
|
8458
|
+
{ type: "text", name: "provinceCode", defaultValue: "PU" },
|
|
8459
|
+
{ type: "text", name: "zipCode", defaultValue: "61122" },
|
|
8460
|
+
{ type: "text", name: "countryCode", defaultValue: "IT" },
|
|
8461
|
+
{ type: "text", name: "twitterName", defaultValue: "@websolute" },
|
|
8462
|
+
{
|
|
8463
|
+
type: "array",
|
|
8464
|
+
name: "social",
|
|
8465
|
+
fields: [
|
|
8466
|
+
{ type: "text", name: "key" },
|
|
8467
|
+
{ type: "text", name: "url" }
|
|
8468
|
+
]
|
|
8469
|
+
}
|
|
8470
|
+
]
|
|
8471
|
+
}
|
|
8472
|
+
]
|
|
8473
|
+
}), "App");
|
|
8474
|
+
|
|
8403
8475
|
// src/globals/Locale.ts
|
|
8404
8476
|
var Locale = /* @__PURE__ */ __name((options2) => ({
|
|
8405
8477
|
type: "withGlobal",
|
|
@@ -8636,6 +8708,7 @@ var bowl = /* @__PURE__ */ __name((sourceOptions = {}) => (sourceConfig) => {
|
|
|
8636
8708
|
].map((x) => x(options));
|
|
8637
8709
|
const bowlGlobals = [
|
|
8638
8710
|
// Admin
|
|
8711
|
+
App,
|
|
8639
8712
|
Locale
|
|
8640
8713
|
].map((x) => x(options));
|
|
8641
8714
|
const missingCollections = [];
|