yarn upgrade

This commit is contained in:
2025-03-27 12:34:04 +00:00
parent 3a6ff3fa8e
commit 2037953000
1368 changed files with 3662 additions and 11788 deletions

View File

@@ -1,121 +0,0 @@
########################################################################
# Articles
########################################################################
name: articles
uploadPath: ../media/articles
meta:
# Navigationseintrag in der Admin-UI
label: { de: "Artikel", en: "Articles" }
# Icon (Material UI) für den Navigationseintrag
muiIcon: file-document-edit-outline
# Standardsortierung der Liste
defaultSort: { field: "article.general.sort", order: "ASC" }
# Admin-Backend Ansichten
defaultImageFilter: s
views:
# Mobile Darstellung
- type: simpleList
mediaQuery: "(max-width:599px)"
primaryText: path
columns:
- article.general.public
- article.content.title
- article.general.type
- article.general.sort
- source: article.general.locale
type: flag
# Desktop
- type: table
mediaQuery: "(min-width:600px)"
columns:
- article.general.public
- label: { de: "Titel", en: "Title" }
source: article.content.title
filter: true
- article.general.type
- article.general.sort
- source: article.general.locale
type: flag
# Filter Navigation-Items in Collection-Navigation
# navigationFilter:
# - label: { de: "News", en: "News" }
# mdiIcon: filter-outline
# params:
# - sort: article.general.sort
# # - s.article.general.public: true
# - w.article.content.title: lor
# - s.article.general.locale: de
# - label: { de: "Diam", en: "Diam" }
# mdiIcon: filter-outline
# params:
# - sort: article.general.sort
# - s.article.general.public: true
# - w.article.content.title: diam
# - s.article.general.locale: de
imageFilter:
xs:
- fit: true
height: 90
width: 90
resampling: "lancos"
quality: 60
s:
- fit: true
height: 300
width: 300
resampling: "lancos"
quality: 60
m:
- fit: true
height: 600
width: 600
resampling: "lancos"
quality: 60
l:
- fit: true
height: 1200
width: 1200
resampling: "lancos"
quality: 60
xl:
- fit: true
height: 2000
width: 2000
resampling: "lancos"
quality: 60
permissions:
public:
methods:
get: true
post: false
put: false
delete: false
user:
methods:
get: true
post: true
put: true
delete: true
# token als Zusatzsicherung gegen Spam, mehr siehe Hook
"token:${PUBLIC_TOKEN}":
methods:
get: false
post: false
put: false
delete: false
hooks:
post:
create:
type: javascript
file: hooks/articles/post_create.js
put:
update:
type: javascript
file: hooks/articles/put_update.js
fields:
- !include fields/article/_article.yml

View File

@@ -1,136 +0,0 @@
###############################################################
# Content Blöcke
###############################################################
# Name/URL-Anteil der Kollektion
name: external
uploadPath: ../media/external
# Metaangaben zur Kollektion welche in der Admin-UI verwendet werden können
meta:
# Navigationseintrag in der Admin-UI
label: { de: "Extern", en: "External" }
# Icon (Material UI) für den Navigationseintrag
muiIcon: download
# Identifizierung eines Eintrags für z.B. Select-Boxen in der Admin-UI
rowIdentTpl: { twig: "{{ path }}" }
# Standardsortierung der Liste
defaultSort: { field: "file", order: "ASC" }
# Admin-Backend Ansichten
defaultImageFilter: s
views:
# Mobile Darstellung
- type: simpleList
mediaQuery: "(max-width:599px)"
primaryText: path
columns:
- date
- title
- source: file
type: file
# Desktop
- type: table
mediaQuery: "(min-width:600px)"
columns:
- date
- title
- source: file
type: file
imageFilter:
xs:
- fit: true
height: 90
width: 90
resampling: "lancos"
quality: 60
s:
- fit: true
height: 300
width: 300
resampling: "lancos"
quality: 60
m:
- fit: true
height: 600
width: 600
resampling: "lancos"
quality: 60
l:
- fit: true
height: 1200
width: 1200
resampling: "lancos"
quality: 60
xl:
- fit: true
height: 2000
width: 2000
resampling: "lancos"
quality: 60
# Zugriff auf diese Kollektion
permissions:
# öffentlicher Zugriff
public:
methods:
# Liste und Einzeleinträge lesen
get: true
# neuen Eintrag anlegen
post: false
# Eintrag editieren
put: false
# Eintrag löschen
delete: false
# zum Projekt zugeordneter Benutzer ohne Zusatzberechtigungen
user:
methods:
get: true
post: true
put: true
delete: true
hooks:
post:
return:
type: javascript
file: hooks/content/post_return.js
put:
return:
type: javascript
file: hooks/content/put_return.js
delete:
return:
type: javascript
file: hooks/content/delete_return.js
# Feldliste der Kollektion
fields:
- name: date
type: string
meta:
filter: true
widget: date
inputProps:
type: "datetime-local"
label:
de: Datum
en: Date
helperText:
de: "Dieses Feld wird nur zur Filterung innerhalb vom Tibi-CMS verwendet."
en: "This field is only used for filtering within Tibi-CMS."
- name: title
type: string
meta:
filter: true
label: { de: "Titel", en: "Title" }
helperText:
de: "Dieses Feld wird nur zur Filterung innerhalb vom Tibi-CMS verwendet."
en: "This field is only used for filtering within Tibi-CMS."
- name: file
type: file
meta:
masterDomain: "http://localhost:3002"
widget: image
label: { de: "Datei", en: "File" }
externalUrl: true

View File

@@ -1,60 +0,0 @@
name: assignments
type: object
meta:
label: { de: "Verknüpfung", en: "Assignment" }
subFields:
- name: pages
type: string[]
meta:
helperText:
de: "Verknüpft den Artikel mit beliebigen Seiten."
en: "Links the article to any page."
widget: chipArray
label:
de: Verknüpfung zu Seiten
en: Assignment to pages
defaultValue: []
choices:
endpoint: "content"
mapping:
id: "path"
name: "path"
params:
sort: "path"
- name: articles
type: string[]
meta:
helperText:
de: "Verknüpft den Artikel mit beliebigen Artikeln."
en: "Links the article to any articles."
widget: chipArray
label:
de: Verknüpfung zu Artikeln
en: Assignment to articles
defaultValue: []
choices:
endpoint: "articles"
mapping:
id: "id"
name: "article.content.title"
params:
sort: "article.content.title"
- name: tags
type: string[]
meta:
helperText:
de: "Über die Zuweisung von Schlagworten, können Artikel noch einmal genauer kategorisiert werden."
en: "Articles can be categorized more precisely by assigning keywords."
widget: chipArray
label:
de: Tags / Schlagworte / Labels
en: Tags
addAllowed: true
defaultValue: []
choices:
endpoint: "tags"
mapping:
id: "name"
name: "name"
params:
sort: "name"

View File

@@ -1,25 +0,0 @@
name: attachments
type: object
meta:
label:
de: Anhänge / Downloads
en: Attachments / Downloads
css:
subFields:
- name: files
type: object[]
meta:
label: { de: "Anhänge", en: "Attachments" }
subFields:
- name: title
type: string
meta:
label: { de: "Datei-Titel", en: "File Title" }
- name: id
type: string
meta:
label: { de: "Technischer Name / ID", en: "Technical name / ID" }
- name: file
type: file
meta:
label: { de: "", en: "" }

View File

@@ -1,61 +0,0 @@
name: margin
type: object
meta:
label: { de: "Abstand nach außen (Margin)", en: "Distance to the outside (Margin)" }
subFields:
- name: top
type: string
meta:
widget: select
label:
de: Abstand nach Oben
en: Margin Top
choices:
- { id: "", name: "-" }
- { id: "mt-xs", name: "Sehr kleiner Abstand" }
- { id: "mt-sm", name: "Kleiner Abstand" }
- { id: "mt-md", name: "Normal" }
- { id: "mt-lg", name: "Großer Abstand" }
- { id: "mt-xl", name: "Sehr großer Abstand" }
- name: right
type: string
meta:
widget: select
label:
de: Abstand nach Rechts
en: Margin Right
choices:
- { id: "", name: "-" }
- { id: "mr-xs", name: "Sehr kleiner Abstand" }
- { id: "mr-sm", name: "Kleiner Abstand" }
- { id: "mr-md", name: "Normal" }
- { id: "mr-lg", name: "Großer Abstand" }
- { id: "mr-xl", name: "Sehr großer Abstand" }
- name: bottom
type: string
meta:
widget: select
label:
de: Abstand nach Unten
en: Margin Bottom
choices:
- { id: "", name: "-" }
- { id: "mb-xs", name: "Sehr kleiner Abstand" }
- { id: "mb-sm", name: "Kleiner Abstand" }
- { id: "mb-md", name: "Normal" }
- { id: "mb-lg", name: "Großer Abstand" }
- { id: "mb-xl", name: "Sehr großer Abstand" }
- name: left
type: string
meta:
widget: select
label:
de: Abstand nach Links
en: Margin Left
choices:
- { id: "", name: "-" }
- { id: "ml-xs", name: "Sehr kleiner Abstand" }
- { id: "ml-sm", name: "Kleiner Abstand" }
- { id: "ml-md", name: "Normal" }
- { id: "ml-lg", name: "Großer Abstand" }
- { id: "ml-xl", name: "Sehr großer Abstand" }

View File

@@ -1,61 +0,0 @@
name: padding
type: object
meta:
label: { de: "Abstand nach innen (Padding)", en: "Distance inside (Padding)" }
subFields:
- name: top
type: string
meta:
widget: select
label:
de: Innenabstand nach Oben
en: Padding Top
choices:
- { id: "", name: "-" }
- { id: "pt-xs", name: "Sehr kleiner Abstand" }
- { id: "pt-sm", name: "Kleiner Abstand" }
- { id: "pt-md", name: "Normal" }
- { id: "pt-lg", name: "Großer Abstand" }
- { id: "pt-xl", name: "Sehr großer Abstand" }
- name: right
type: string
meta:
widget: select
label:
de: Innenabstand nach Rechts
en: Padding Right
choices:
- { id: "", name: "-" }
- { id: "pr-xs", name: "Sehr kleiner Abstand" }
- { id: "pr-sm", name: "Kleiner Abstand" }
- { id: "pr-md", name: "Normal" }
- { id: "pr-lg", name: "Großer Abstand" }
- { id: "pr-xl", name: "Sehr großer Abstand" }
- name: bottom
type: string
meta:
widget: select
label:
de: Innenabstand nach Unten
en: Padding Bottom
choices:
- { id: "", name: "-" }
- { id: "pb-xs", name: "Sehr kleiner Abstand" }
- { id: "pb-sm", name: "Kleiner Abstand" }
- { id: "pb-md", name: "Normal" }
- { id: "pb-lg", name: "Großer Abstand" }
- { id: "pb-xl", name: "Sehr großer Abstand" }
- name: left
type: string
meta:
widget: select
label:
de: Innenabstand nach Links
en: Padding Left
choices:
- { id: "", name: "-" }
- { id: "pl-xs", name: "Sehr kleiner Abstand" }
- { id: "pl-sm", name: "Kleiner Abstand" }
- { id: "pl-md", name: "Normal" }
- { id: "pl-lg", name: "Großer Abstand" }
- { id: "pl-xl", name: "Sehr großer Abstand" }

View File

@@ -1,28 +0,0 @@
name: link
type: object
meta:
label:
de: Verlinkung
en: Link
css:
subFields:
- name: url
type: string
meta:
label: { de: "Ziel-URL", en: "Target URL" }
- name: text
type: string
meta:
label: { de: "Link-Beschriftung", en: "Link-Text" }
- name: target
type: string
meta:
widget: select
label:
de: Zielfenster
en: Target
defaultValue: ["_self"]
choices:
- { id: "_self", name: "(Standardwert) gleicher Tab oder Seite" }
- { id: "_blank", name: "Neuer Tab oder Fenster" }
- { id: "_parent", name: "Elternfenster" }

View File

@@ -1,34 +0,0 @@
name: media
type: object
meta:
label:
de: Medien
en: Media
subFields:
- name: files
type: object[]
meta:
label: { de: "Bilder", en: "Images" }
subFields:
- name: title
type: string
meta:
label: { de: "Datei-Titel", en: "File Title" }
- name: alternateText
type: string
meta:
label: { de: "Alternativer Text", en: "Alternate Text" }
- name: id
type: string
meta:
editableWhileCreating: true
label: { de: "Technischer Name / ID", en: "Technical name / ID" }
- name: file
type: file
meta:
widget: image
label: { de: "Datei", en: "File" }
- name: caption
type: string
meta:
label: { de: "Bildunterschrift", en: "Caption" }

View File

@@ -1,160 +0,0 @@
name: article
type: object
meta:
widget: tabs
label:
de: Einstellungen zum Artikel
en: Article Setings
activeTab: 1
subFields:
- name: general
type: object
meta:
label:
de: Allgemein
en: General
subFields:
- name: public
type: boolean
meta:
filter: true
label:
de: Veröffentlicht
en: Public
helperText:
de: "Der Artikel wird auf der Seite angezeigt."
en: "This article is displayed on the page."
- name: type
type: string
meta:
filter: true
helperText:
de: "Definiert allgemeinen Typ des Artikels."
en: "Defines general type of the article."
widget: select
label:
de: Typ des Artikels
en: Article type
defaultValue: default
choices:
- { id: "default", name: { de: "Artikel", en: "Article" } }
- { id: "news", name: { de: "News", en: "News" } }
- !include ../_locale.yml
- name: publish_date
type: object
meta:
label:
de: Datum der Veröffentlichung
en: Release Date
subFields:
- name: from
type: string
meta:
widget: date
inputProps:
type: "datetime-local"
label:
de: Datum (ab)
en: Date (from)
- name: until
type: string
meta:
widget: date
inputProps:
type: "datetime-local"
label:
de: Datum (bis)
en: Date (until)
- name: interval
type: number
meta:
inputProps:
placeholder: 60000
label:
{
de: "Zeit-Interval für Live-Check der Veröffentlichung.",
en: "Time interval for publication live check",
}
helperText:
de: "Der Zeit-Interval wird in ms (Millisekunden) angebeben. Standard ist 60000 (60sec)"
en: "The time interval is specified in ms (milliseconds). Default is 60000 (60sec)"
- name: sort
type: number
meta:
inputProps:
type: number
placeholder: 0
label: { de: "Sortierung", en: "Sorting" }
helperText:
de: "1...5...10...100"
en: "1...5...10...100"
- name: content
type: object
meta:
label:
de: Inhalt
en: Content
subFields:
- name: slug
type: string
meta:
label: { de: "Permalink", en: "Permalink" }
- name: title
type: string
meta:
label: { de: "Titel", en: "Title" }
- name: subtitle
type: string
meta:
label: { de: "Untertitel", en: "Subtitle" }
- name: types
type: object
meta:
widget: tabs
label:
de: Inhalt dieses Artikel
en: Article Content
activeTab: 0
subFields:
- name: teaser
type: string
meta:
widget: richtext
label: { de: "Teaser-Text des Artikel", en: "Article Teaser Text" }
- name: details
type: string
meta:
widget: richtext
label: { de: "Detail-Text des Artikel", en: "Article Detail Text" }
- !include _article-media.yml
- !include _article-attachments.yml
- name: layout
type: object
meta:
label: { de: Layout, en: Layout }
subFields:
- name: variant
type: string
meta:
helperText:
de: "Definiert das visuelle Erscheinungsbild der aller Teaser-Informationen des Artikels."
en: "Defines the visual appearance of all teaser information of the article."
widget: select
label:
de: Teaser Erscheinungsbild
en: Teaser Layout
defaultValue: default
choices:
- { id: "top", name: { de: "Artikelbild oben", en: "Article picture top" } }
- { id: "right", name: { de: "Artikelbild rechts", en: "Article picture right" } }
- { id: "bottom", name: { de: "Artikelbild unten", en: "Article picture left" } }
- { id: "default", name: { de: "Artikelbild links", en: "Article picture left" } }
- name: properties
type: object
meta:
widget: tabs
subFields:
- !include _article-layout-margin.yml
- !include _article-layout-padding.yml
- !include _article-link.yml
- !include _article-assignments.yml

View File

@@ -1,127 +0,0 @@
###############################################################
# Galleries
###############################################################
# Name/URL-Anteil der Kollektion
name: galleries
uploadPath: ../media/galleries
# Metaangaben zur Kollektion welche in der Admin-UI verwendet werden können
meta:
# Navigationseintrag in der Admin-UI
label: { de: "Galerien", en: "Galleries" }
# Icon (Material UI) für den Navigationseintrag
muiIcon: image-multiple-outline
# Identifizierung eines Eintrags für z.B. Select-Boxen in der Admin-UI
rowIdentTpl: { twig: "{{ path }}" }
# Standardsortierung der Liste
defaultSort: { field: "path", order: "ASC" }
# Admin-Backend Ansichten
defaultImageFilter: s
views:
# Mobile Darstellung
- type: simpleList
mediaQuery: "(max-width:599px)"
primaryText: name
columns:
- name
- variant
# Desktop
- type: table
mediaQuery: "(min-width:600px)"
columns:
- name
- variant
imageFilter:
xs:
- fit: true
height: 90
width: 90
resampling: lancos
quality: 60
s:
- fit: true
height: 300
width: 300
resampling: lancos
quality: 60
m:
- fit: true
height: 600
width: 600
resampling: lancos
quality: 60
l:
- fit: true
height: 1200
width: 1200
resampling: lancos
quality: 60
xl:
- fit: true
height: 2000
width: 2000
resampling: lancos
quality: 60
permissions:
public:
methods:
get: true
post: false
put: false
delete: false
user:
methods:
get: true
post: false
put: false
delete: false
# token als Zusatzsicherung gegen Spam, mehr siehe Hook
"token:${PUBLIC_TOKEN}":
methods:
get: false
post: false
put: false
delete: false
# Feldliste der Kollektion
fields:
- name: name
type: string
meta:
label: { de: "Name der Galerie", en: "Gallery Name" }
- name: variant
type: string
meta:
widget: select
label:
de: Erscheinungsbild
en: Appearance
defaultValue: ["default"]
choices:
- { id: "default", name: { de: "Standard", en: "Default" } }
- { id: "simple-with-title", name: { de: "Einfach mit Titel", en: "Simple with title" } }
- name: items
type: object[]
meta:
label: { de: "Bilder der Galerie", en: "Gallery Images" }
subFields:
- name: file
type: file
meta:
widget: image
label: { de: "Datei", en: "File" }
- name: title
type: string
meta:
label: { de: "Titel", en: "Title" }
- name: description
type: string
meta:
label: { de: "Beschreibung", en: "Description" }
- name: alt
type: string
meta:
label: { de: "Alternativer Text", en: "Alternative caption" }

View File

@@ -1,75 +0,0 @@
########################################################################
# Kontakt Formular
########################################################################
name: contact_form
uploadPath: ../media/contact_form
meta:
label: { de: "Kontaktformular", en: "Contact Form" }
muiIcon: email
rowIdentTpl: { twig: "{{ email }} - {{ subject }}" }
views:
- type: simpleList
mediaQuery: "(max-width: 600px)"
primaryText: email
secondaryText: subject
tertiaryText: insertTime
- type: table
columns:
- insertTime
- email
- subject
# Zugriff auf diese Kollektion
permissions:
# öffentlicher Zugriff
public:
methods:
# Liste und Einzeleinträge lesen
# checked via hook
get: false
# neuen Eintrag anlegen
post: true
# Eintrag editieren
put: false
# Eintrag löschen
delete: false
# zum Projekt zugeordneter Benutzer ohne Zusatzberechtigungen
user:
methods:
get: false
post: false
put: false
delete: false
# token als Zusatzsicherung gegen Spam, mehr siehe Hook
"token:${PUBLIC_TOKEN}":
methods:
get: false
post: true
put: false
delete: false
hooks:
post:
create:
type: javascript
file: hooks/contact_form/post_create.js
fields:
- name: name
type: string
meta:
label: { de: "Name", en: "Name" }
- name: email
type: string
meta:
label: { de: "Email", en: "Email" }
- name: subject
type: string
meta:
label: { de: "Betreff", en: "Subject" }
- name: message
type: string
meta:
widget: richtext
label: { de: "Nachricht", en: "Message" }

View File

@@ -1,294 +0,0 @@
###############################################################
# Content Blöcke
###############################################################
# Name/URL-Anteil der Kollektion
name: content
uploadPath: ../media/content
# Metaangaben zur Kollektion welche in der Admin-UI verwendet werden können
meta:
# Navigationseintrag in der Admin-UI
label: { de: "Seiten / Inhalte", en: "Pages / Content" }
# Icon (Material UI) für den Navigationseintrag
muiIcon: web
# Identifizierung eines Eintrags für z.B. Select-Boxen in der Admin-UI
rowIdentTpl: { twig: "{{ path }}" }
# Standardsortierung der Liste
defaultSort: { field: "path", order: "ASC" }
# Admin-Backend Ansichten
defaultImageFilter: s
views:
# Mobile Darstellung
- type: simpleList
mediaQuery: "(max-width:599px)"
primaryText: path
columns:
- source: public
- source: locale
type: flag
- source: path
# Desktop
- type: table
mediaQuery: "(min-width:600px)"
columns:
- source: public
- source: type
- source: locale
type: flag
- source: path
- source: project.general.title
subNavigation:
- name: page
label:
de: Standardseiten
en: Default Pages
muiIcon: book-open-page-variant
defaultSort:
field: "path"
order: "ASC"
views:
- type: simpleList
mediaQuery: "(max-width:599px)"
primaryText: titel
secondaryText: path
tertiaryText: public
columns:
- source: public
filter: true
- source: locale
type: flag
- source: path
- type: table
mediaQuery: "(min-width:600px)"
columns:
- source: public
filter: true
- source: locale
type: flag
- source: path
- source: updateTime
label: { de: "letzte Aktualisierung", en: "last update" }
type: date
filter:
type: page
tablist:
# meta:
# expand: contentTab
tabs:
- name: general
label: { de: "Allgemein", en: "General" }
subFields:
- source: public
- source: path
- source: locale
- source: type
- source: tags
- name: meta
label: { de: "Meta", en: "Meta" }
subFields:
- source: meta
- name: contentTab
label: { de: "Seiteninhalt", en: "Page Content" }
subFields:
- source: pageBuilder
- name: project
label: { de: "Projektdetails", en: "Project Details" }
dependsOn:
eval: $.type?.includes("project")
subFields:
- source: project
imageFilter:
xs:
- fit: true
height: 90
width: 90
resampling: "lanczos"
quality: 60
s:
- fit: true
height: 300
width: 300
resampling: "lanczos"
quality: 60
m:
- fit: true
height: 600
width: 600
resampling: "lanczos"
quality: 60
l:
- fit: true
height: 1200
width: 1200
resampling: "lanczos"
quality: 60
xl:
- fit: true
height: 2000
width: 2000
resampling: "lanczos"
quality: 60
# Zugriff auf diese Kollektion
permissions:
# öffentlicher Zugriff
public:
methods:
# Liste und Einzeleinträge lesen
get: true
# neuen Eintrag anlegen
post: false
# Eintrag editieren
put: false
# Eintrag löschen
delete: false
# zum Projekt zugeordneter Benutzer ohne Zusatzberechtigungen
user:
methods:
# Liste und Einzeleinträge lesen
get: true
# neuen Eintrag anlegen
post: true
# Eintrag editieren
put: true
# Eintrag löschen
delete: true
# token als Zusatzsicherung gegen Spam, mehr siehe Hook
"token:${PUBLIC_TOKEN}":
methods:
# Liste und Einzeleinträge lesen
get: false
# neuen Eintrag anlegen
post: false
# Eintrag editieren
put: false
# Eintrag löschen
delete: false
hooks:
post:
create:
type: javascript
file: hooks/content/post_create.js
put:
update:
type: javascript
file: hooks/content/put_update.js
# Feldliste der Kollektion
fields:
# Allgemeine Felder
- name: public
type: boolean
meta:
filter: true
label:
de: Veröffentlicht
en: Public
helperText:
de: Der Inhalt wird auf der Seite angezeigt.
en: This content is displayed on the page.
- name: path
type: string
index: [single, unique]
meta:
filter: true
label: { de: "Pfad", en: "Path" }
helperText:
de: "Der Pfad muss eindeutig sein, und zwingend ohne einen Slash (/) beginnen und enden."
en: "The path must be unique and must start and end without a slash (/)."
- !include fields/_locale.yml
- name: type
type: string[]
index: [single]
meta:
widget: chipArray
filter: true
defaultValue:
eval: |
$navigation?.name ? [$navigation.name] : []
label:
de: Inhaltstyp
en: type of content
autocomplete: true
choices:
- id: page
name:
de: Seite (Standard)
en: Page (Standard)
- id: PageProjects
name:
de: Seite (Projekte)
en: Page (Projects)
- id: project
name:
de: Projekt
en: Project
- name: tags
type: string[]
meta:
widget: chipArray
helperText:
de: "Über die Zuweisung von Schlagworten, können Seiten noch einmal genauer kategorisiert werden."
en: "Pages can be categorized more precisely by assigning keywords."
label:
de: Schlagwort / Tag / Label
en: Kayword / Tag / Label
addAllowed: true
choices:
endpoint: "tags"
mapping:
id: "name"
name: "name"
params:
sort: "name"
# Felder für Meta-Informationen der Seite (Meta-Tags) im Tab "Meta"
- name: meta
type: object
subFields:
- name: metaTitle
type: string
meta:
label: { de: "Titel der Webseite", en: "Page Title" }
- name: metaDescription
type: string
meta:
label: { de: "Beschreibung der Webseite", en: "Page Description" }
- name: metaTagRobots
type: string[]
meta:
widget: chipArray
label:
de: Robots
en: Robots
defaultValue: []
autocomplete: true
choices:
- { id: "noindex", name: "noindex" }
- { id: "index", name: "index" }
- { id: "follow", name: "follow" }
- { id: "nofollow", name: "nofollow" }
- { id: "noimageindex", name: "noimageindex" }
- { id: "none", name: "none" }
- { id: "noarchive", name: "noarchive" }
- { id: "nocache", name: "nocache" }
- { id: "nosnippet", name: "nosnippet" }
- { id: "nnavailable_after", name: "nnavailable_after" }
helperText:
de: "<strong>Noindex</strong>: Weist eine Suchmaschine an, eine Seite nicht zu indizieren.<br/><strong>index</strong>: Weist eine Suchmaschine an, eine Seite zu indizieren. Beachten Sie, dass Sie dieses Meta-Tag nicht hinzufügen müssen; es ist die Voreinstellung.<br/><strong>follow</strong>: Auch wenn die Seite nicht indexiert ist, sollte der Crawler allen Links auf einer Seite folgen und Eigenkapital an die verlinkten Seiten weitergeben.<br/><strong>nofollow</strong>: Weist einen Crawler an, keinen Links auf einer Seite zu folgen oder Link-Equity weiterzugeben.<br/><strong>noimageindex</strong>: Weist einen Crawler an, keine Bilder auf einer Seite zu indizieren.<br/><strong>none</strong>: Entspricht der gleichzeitigen Verwendung der noindex- und nofollow-Tags.<br/><strong>noarchive</strong>: Suchmaschinen sollten keinen zwischengespeicherten Link zu dieser Seite auf einem SERP anzeigen.<br/><strong>nocache</strong>: Wie noarchive, aber nur von Internet Explorer und Firefox verwendet.<br/><strong>nosnippet</strong>: Weist eine Suchmaschine an, kein Snippet dieser Seite (d. h. Meta-Beschreibung) dieser Seite auf einem SERP anzuzeigen.<br/><strong>nnavailable_after</strong>: Suchmaschinen sollen diese Seite nach einem bestimmten Datum nicht mehr indexieren.<br/>"
en: "<strong>Noindex</strong>: Tells a search engine not to index a page.<br/><strong>index</strong>: Tells a search engine to index a page. Note that you dont need to add this meta tag; its the default.<br/><strong>follow</strong>: Even if the page isnt indexed, the crawler should follow all the links on a page and pass equity to the linked pages.<br/><strong>nofollow</strong>: Tells a crawler not to follow any links on a page or pass along any link equity.<br/><strong>noimageindex</strong>: Tells a crawler not to index any images on a page.<br/><strong>none</strong>: Equivalent to using both the noindex and nofollow tags simultaneously.<br/><strong>noarchive</strong>: Search engines should not show a cached link to this page on a SERP.<br/><strong>nocache</strong>: Same as noarchive, but only used by Internet Explorer and Firefox.<br/><strong>nosnippet</strong>: Tells a search engine not to show a snippet of this page (i.e. meta description) of this page on a SERP.<br/><strong>nnavailable_after</strong>: Search engines should no longer index this page after a particular date.<br/>"
- name: metaKeywords
type: string
meta:
label: { de: "SEO / Schlüsselwörter", en: "SEO / Keywords" }
helperText:
de: "Beispiel: Stichwort1, Stichwort2, Stichwort3"
en: "Example: keyword1, keyword2, keyword3"
# Page Builder im Tab "Seiteninhalt"
- !include fields/pageBuilder.yml

View File

@@ -1,59 +0,0 @@
name: company
type: object
subFields:
- name: companyName
type: string
meta:
label: { de: "Name des Unternehmens", en: "Company Name" }
- name: companyWebUrl
type: string
meta:
label: { de: "URL zur Webseite", en: "Website URL" }
- name: facebookUrl
type: string
meta:
label: { de: "Facebook URL", en: "Facebook URL" }
- name: instagramUrl
type: string
meta:
label: { de: "Instagram URL", en: "Instagram URL" }
- name: twitterUrl
type: string
meta:
label: { de: "Twitter URL", en: "Twitter URL" }
- name: companyAddresses
type: object[]
meta:
label:
de: Adresse
en: Adresse
css:
subFields:
- name: street
type: string
meta:
label: { de: "Straße", en: "Street" }
- name: houseNumber
type: string
meta:
label: { de: "Hausnummer", en: "House number" }
- name: postcode
type: string
meta:
label: { de: "PLZ", en: "ZIP" }
- name: city
type: string
meta:
label: { de: "Ort", en: "City" }
- name: tel
type: string
meta:
label: { de: "Telefon", en: "Phone number" }
- name: fax
type: string
meta:
label: { de: "Fax", en: "Fax" }
- name: email
type: string
meta:
label: { de: "E-Mail", en: "E-Mail" }

View File

@@ -1,241 +0,0 @@
name: locale
type: string
meta:
widget: select
label: { de: "Sprache", en: "Language" }
helperText:
{
de: "Definiert, in welcher Sprache das Menü verfügbar ist. Die Standard-Sprache ist 'de'.",
en: "Defines in which language the menu is available. The default language is 'de'.",
}
filter: true
defaultValue: de
choices:
# - { id: af, name: { key: "labels.locales.af" } }
# - { id: af-ZA, name: { key: "labels.locales.af-ZA" } }
# - { id: ar, name: { key: "labels.locales.ar" } }
# - { id: ar-AE, name: { key: "labels.locales.ar-AE" } }
# - { id: ar-BH, name: { key: "labels.locales.ar-BH" } }
# - { id: ar-DZ, name: { key: "labels.locales.ar-DZ" } }
# - { id: ar-EG, name: { key: "labels.locales.ar-EG" } }
# - { id: ar-IQ, name: { key: "labels.locales.ar-IQ" } }
# - { id: ar-JO, name: { key: "labels.locales.ar-JO" } }
# - { id: ar-KW, name: { key: "labels.locales.ar-KW" } }
# - { id: ar-LB, name: { key: "labels.locales.ar-LB" } }
# - { id: ar-LY, name: { key: "labels.locales.ar-LY" } }
# - { id: ar-MA, name: { key: "labels.locales.ar-MA" } }
# - { id: ar-OM, name: { key: "labels.locales.ar-OM" } }
# - { id: ar-QA, name: { key: "labels.locales.ar-QA" } }
# - { id: ar-SA, name: { key: "labels.locales.ar-SA" } }
# - { id: ar-SY, name: { key: "labels.locales.ar-SY" } }
# - { id: ar-TN, name: { key: "labels.locales.ar-TN" } }
# - { id: ar-YE, name: { key: "labels.locales.ar-YE" } }
# - { id: az, name: { key: "labels.locales.az" } }
# - { id: az-AZ, name: { key: "labels.locales.az-AZ" } }
# - { id: be, name: { key: "labels.locales.be" } }
# - { id: be-BY, name: { key: "labels.locales.be-BY" } }
# - { id: bg, name: { key: "labels.locales.bg" } }
# - { id: bg-BG, name: { key: "labels.locales.bg-BG" } }
# - { id: bs-BA, name: { key: "labels.locales.bs-BA" } }
# - { id: ca, name: { key: "labels.locales.ca" } }
# - { id: ca-ES, name: { key: "labels.locales.ca-ES" } }
# - { id: cs, name: { key: "labels.locales.cs" } }
# - { id: cs-CZ, name: { key: "labels.locales.cs-CZ" } }
# - { id: cy, name: { key: "labels.locales.cy" } }
# - { id: cy-GB, name: { key: "labels.locales.cy-GB" } }
# - { id: da, name: { key: "labels.locales.da" } }
# - { id: da-DK, name: { key: "labels.locales.da-DK" } }
- { id: de, name: { key: "labels.locales.de" } }
# - { id: de-AT, name: { key: "labels.locales.de-AT" } }
# - { id: de-CH, name: { key: "labels.locales.de-CH" } }
# - { id: de-DE, name: { key: "labels.locales.de-DE" } }
# - { id: de-LI, name: { key: "labels.locales.de-LI" } }
# - { id: de-LU, name: { key: "labels.locales.de-LU" } }
# - { id: dv, name: { key: "labels.locales.dv" } }
# - { id: dv-MV, name: { key: "labels.locales.dv-MV" } }
# - { id: el, name: { key: "labels.locales.el" } }
# - { id: el-GR, name: { key: "labels.locales.el-GR" } }
- { id: en, name: { key: "labels.locales.en" } }
# - { id: en-AU, name: { key: "labels.locales.en-AU" } }
# - { id: en-BZ, name: { key: "labels.locales.en-BZ" } }
# - { id: en-CA, name: { key: "labels.locales.en-CA" } }
# - { id: en-CB, name: { key: "labels.locales.en-CB" } }
# - { id: en-GB, name: { key: "labels.locales.en-GB" } }
# - { id: en-IE, name: { key: "labels.locales.en-IE" } }
# - { id: en-JM, name: { key: "labels.locales.en-JM" } }
# - { id: en-NZ, name: { key: "labels.locales.en-NZ" } }
# - { id: en-PH, name: { key: "labels.locales.en-PH" } }
# - { id: en-TT, name: { key: "labels.locales.en-TT" } }
# - { id: en-US, name: { key: "labels.locales.en-US" } }
# - { id: en-ZA, name: { key: "labels.locales.en-ZA" } }
# - { id: en-ZW, name: { key: "labels.locales.en-ZW" } }
# - { id: eo, name: { key: "labels.locales.eo" } }
# - { id: es, name: { key: "labels.locales.es" } }
# - { id: es-AR, name: { key: "labels.locales.es-AR" } }
# - { id: es-BO, name: { key: "labels.locales.es-BO" } }
# - { id: es-CL, name: { key: "labels.locales.es-CL" } }
# - { id: es-CO, name: { key: "labels.locales.es-CO" } }
# - { id: es-CR, name: { key: "labels.locales.es-CR" } }
# - { id: es-DO, name: { key: "labels.locales.es-DO" } }
# - { id: es-EC, name: { key: "labels.locales.es-EC" } }
# - { id: es-ES, name: { key: "labels.locales.es-ES" } }
# - { id: es-GT, name: { key: "labels.locales.es-GT" } }
# - { id: es-HN, name: { key: "labels.locales.es-HN" } }
# - { id: es-MX, name: { key: "labels.locales.es-MX" } }
# - { id: es-NI, name: { key: "labels.locales.es-NI" } }
# - { id: es-PA, name: { key: "labels.locales.es-PA" } }
# - { id: es-PE, name: { key: "labels.locales.es-PE" } }
# - { id: es-PR, name: { key: "labels.locales.es-PR" } }
# - { id: es-PY, name: { key: "labels.locales.es-PY" } }
# - { id: es-SV, name: { key: "labels.locales.es-SV" } }
# - { id: es-UY, name: { key: "labels.locales.es-UY" } }
# - { id: es-VE, name: { key: "labels.locales.es-VE" } }
# - { id: et, name: { key: "labels.locales.et" } }
# - { id: et-EE, name: { key: "labels.locales.et-EE" } }
# - { id: eu, name: { key: "labels.locales.eu" } }
# - { id: eu-ES, name: { key: "labels.locales.eu-ES" } }
# - { id: fa, name: { key: "labels.locales.fa" } }
# - { id: fa-IR, name: { key: "labels.locales.fa-IR" } }
# - { id: fi, name: { key: "labels.locales.fi" } }
# - { id: fi-FI, name: { key: "labels.locales.fi-FI" } }
# - { id: fo, name: { key: "labels.locales.fo" } }
# - { id: fo-FO, name: { key: "labels.locales.fo-FO" } }
# - { id: fr, name: { key: "labels.locales.fr" } }
# - { id: fr-BE, name: { key: "labels.locales.fr-BE" } }
# - { id: fr-CA, name: { key: "labels.locales.fr-CA" } }
# - { id: fr-CH, name: { key: "labels.locales.fr-CH" } }
# - { id: fr-FR, name: { key: "labels.locales.fr-FR" } }
# - { id: fr-LU, name: { key: "labels.locales.fr-LU" } }
# - { id: fr-MC, name: { key: "labels.locales.fr-MC" } }
# - { id: gl, name: { key: "labels.locales.gl" } }
# - { id: gl-ES, name: { key: "labels.locales.gl-ES" } }
# - { id: gu, name: { key: "labels.locales.gu" } }
# - { id: gu-IN, name: { key: "labels.locales.gu-IN" } }
# - { id: he, name: { key: "labels.locales.he" } }
# - { id: he-IL, name: { key: "labels.locales.he-IL" } }
# - { id: hi, name: { key: "labels.locales.hi" } }
# - { id: hi-IN, name: { key: "labels.locales.hi-IN" } }
# - { id: hr, name: { key: "labels.locales.hr" } }
# - { id: hr-BA, name: { key: "labels.locales.hr-BA" } }
# - { id: hr-HR, name: { key: "labels.locales.hr-HR" } }
# - { id: hu, name: { key: "labels.locales.hu" } }
# - { id: hu-HU, name: { key: "labels.locales.hu-HU" } }
# - { id: hy, name: { key: "labels.locales.hy" } }
# - { id: hy-AM, name: { key: "labels.locales.hy-AM" } }
# - { id: id, name: { key: "labels.locales.id" } }
# - { id: id-ID, name: { key: "labels.locales.id-ID" } }
# - { id: is, name: { key: "labels.locales.is" } }
# - { id: is-IS, name: { key: "labels.locales.is-IS" } }
# - { id: it, name: { key: "labels.locales.it" } }
# - { id: it-CH, name: { key: "labels.locales.it-CH" } }
# - { id: it-IT, name: { key: "labels.locales.it-IT" } }
# - { id: ja, name: { key: "labels.locales.ja" } }
# - { id: ja-JP, name: { key: "labels.locales.ja-JP" } }
# - { id: ka, name: { key: "labels.locales.ka" } }
# - { id: ka-GE, name: { key: "labels.locales.ka-GE" } }
# - { id: kk, name: { key: "labels.locales.kk" } }
# - { id: kk-KZ, name: { key: "labels.locales.kk-KZ" } }
# - { id: kn, name: { key: "labels.locales.kn" } }
# - { id: kn-IN, name: { key: "labels.locales.kn-IN" } }
# - { id: ko, name: { key: "labels.locales.ko" } }
# - { id: ko-KR, name: { key: "labels.locales.ko-KR" } }
# - { id: kok, name: { key: "labels.locales.kok" } }
# - { id: kok-IN, name: { key: "labels.locales.kok-IN" } }
# - { id: ky, name: { key: "labels.locales.ky" } }
# - { id: ky-KG, name: { key: "labels.locales.ky-KG" } }
# - { id: lt, name: { key: "labels.locales.lt" } }
# - { id: lt-LT, name: { key: "labels.locales.lt-LT" } }
# - { id: lv, name: { key: "labels.locales.lv" } }
# - { id: lv-LV, name: { key: "labels.locales.lv-LV" } }
# - { id: mi, name: { key: "labels.locales.mi" } }
# - { id: mi-NZ, name: { key: "labels.locales.mi-NZ" } }
# - { id: mk, name: { key: "labels.locales.mk" } }
# - { id: mk-MK, name: { key: "labels.locales.mk-MK" } }
# - { id: mn, name: { key: "labels.locales.mn" } }
# - { id: mn-MN, name: { key: "labels.locales.mn-MN" } }
# - { id: mr, name: { key: "labels.locales.mr" } }
# - { id: mr-IN, name: { key: "labels.locales.mr-IN" } }
# - { id: ms, name: { key: "labels.locales.ms" } }
# - { id: ms-BN, name: { key: "labels.locales.ms-BN" } }
# - { id: ms-MY, name: { key: "labels.locales.ms-MY" } }
# - { id: mt, name: { key: "labels.locales.mt" } }
# - { id: mt-MT, name: { key: "labels.locales.mt-MT" } }
# - { id: nb, name: { key: "labels.locales.nb" } }
# - { id: nb-NO, name: { key: "labels.locales.nb-NO" } }
# - { id: nl, name: { key: "labels.locales.nl" } }
# - { id: nl-BE, name: { key: "labels.locales.nl-BE" } }
# - { id: nl-NL, name: { key: "labels.locales.nl-NL" } }
# - { id: nn-NO, name: { key: "labels.locales.nn-NO" } }
# - { id: ns, name: { key: "labels.locales.ns" } }
# - { id: ns-ZA, name: { key: "labels.locales.ns-ZA" } }
# - { id: pa, name: { key: "labels.locales.pa" } }
# - { id: pa-IN, name: { key: "labels.locales.pa-IN" } }
# - { id: pl, name: { key: "labels.locales.pl" } }
# - { id: pl-PL, name: { key: "labels.locales.pl-PL" } }
# - { id: ps, name: { key: "labels.locales.ps" } }
# - { id: ps-AR, name: { key: "labels.locales.ps-AR" } }
# - { id: pt, name: { key: "labels.locales.pt" } }
# - { id: pt-BR, name: { key: "labels.locales.pt-BR" } }
# - { id: pt-PT, name: { key: "labels.locales.pt-PT" } }
# - { id: qu, name: { key: "labels.locales.qu" } }
# - { id: qu-BO, name: { key: "labels.locales.qu-BO" } }
# - { id: qu-EC, name: { key: "labels.locales.qu-EC" } }
# - { id: qu-PE, name: { key: "labels.locales.qu-PE" } }
# - { id: ro, name: { key: "labels.locales.ro" } }
# - { id: ro-RO, name: { key: "labels.locales.ro-RO" } }
# - { id: ru, name: { key: "labels.locales.ru" } }
# - { id: ru-RU, name: { key: "labels.locales.ru-RU" } }
# - { id: sa, name: { key: "labels.locales.sa" } }
# - { id: sa-IN, name: { key: "labels.locales.sa-IN" } }
# - { id: se, name: { key: "labels.locales.se" } }
# - { id: se-FI, name: { key: "labels.locales.se-FI" } }
# - { id: se-NO, name: { key: "labels.locales.se-NO" } }
# - { id: se-SE, name: { key: "labels.locales.se-SE" } }
# - { id: sk, name: { key: "labels.locales.sk" } }
# - { id: sk-SK, name: { key: "labels.locales.sk-SK" } }
# - { id: sl, name: { key: "labels.locales.sl" } }
# - { id: sl-SI, name: { key: "labels.locales.sl-SI" } }
# - { id: sq, name: { key: "labels.locales.sq" } }
# - { id: sq-AL, name: { key: "labels.locales.sq-AL" } }
# - { id: sr-BA, name: { key: "labels.locales.sr-BA" } }
# - { id: sr-SP, name: { key: "labels.locales.sr-SP" } }
# - { id: sv, name: { key: "labels.locales.sv" } }
# - { id: sv-FI, name: { key: "labels.locales.sv-FI" } }
# - { id: sv-SE, name: { key: "labels.locales.sv-SE" } }
# - { id: sw, name: { key: "labels.locales.sw" } }
# - { id: sw-KE, name: { key: "labels.locales.sw-KE" } }
# - { id: syr, name: { key: "labels.locales.syr" } }
# - { id: syr-SY, name: { key: "labels.locales.syr-SY" } }
# - { id: ta, name: { key: "labels.locales.ta" } }
# - { id: ta-IN, name: { key: "labels.locales.ta-IN" } }
# - { id: te, name: { key: "labels.locales.te" } }
# - { id: te-IN, name: { key: "labels.locales.te-IN" } }
# - { id: th, name: { key: "labels.locales.th" } }
# - { id: th-TH, name: { key: "labels.locales.th-TH" } }
# - { id: tl, name: { key: "labels.locales.tl" } }
# - { id: tl-PH, name: { key: "labels.locales.tl-PH" } }
# - { id: tn, name: { key: "labels.locales.tn" } }
# - { id: tn-ZA, name: { key: "labels.locales.tn-ZA" } }
# - { id: tr, name: { key: "labels.locales.tr" } }
# - { id: tr-TR, name: { key: "labels.locales.tr-TR" } }
# - { id: tt, name: { key: "labels.locales.tt" } }
# - { id: tt-RU, name: { key: "labels.locales.tt-RU" } }
# - { id: ts, name: { key: "labels.locales.ts" } }
# - { id: uk, name: { key: "labels.locales.uk" } }
# - { id: uk-UA, name: { key: "labels.locales.uk-UA" } }
# - { id: ur, name: { key: "labels.locales.ur" } }
# - { id: ur-PK, name: { key: "labels.locales.ur-PK" } }
# - { id: uz, name: { key: "labels.locales.uz" } }
# - { id: uz-UZ, name: { key: "labels.locales.uz-UZ" } }
# - { id: vi, name: { key: "labels.locales.vi" } }
# - { id: vi-VN, name: { key: "labels.locales.vi-VN" } }
# - { id: xh, name: { key: "labels.locales.xh" } }
# - { id: xh-ZA, name: { key: "labels.locales.xh-ZA" } }
# - { id: zh, name: { key: "labels.locales.zh" } }
# - { id: zh-CN, name: { key: "labels.locales.zh-CN" } }
# - { id: zh-HK, name: { key: "labels.locales.zh-HK" } }
# - { id: zh-MO, name: { key: "labels.locales.zh-MO" } }
# - { id: zh-SG, name: { key: "labels.locales.zh-SG" } }
# - { id: zh-TW, name: { key: "labels.locales.zh-TW" } }
# - { id: zu, name: { key: "labels.locales.zu" } }
# - { id: zu-ZA, name: { key: "labels.locales.zu-ZA" } }

View File

@@ -1,56 +0,0 @@
name: media
type: object
subFields:
- name: favicon
type: file
meta:
label: { de: "Favicon", en: "Favicon" }
helperText:
de: "Ein Favicon ist ein kleines Icon, Symbol oder Logo, das von Webbrowsern verwendet wird, um eine Website auf wiedererkennbare Weise zu kennzeichnen."
en: "A favicon is a small icon, symbol, or logo used by web browsers to identify a website in a recognizable way."
- name: brand
type: file
meta:
label: { de: "Logo / Brand", en: "Logo / Brand" }
helperText:
de: "Logo der Seite"
en: "Page Logo"
- name: additionalBrandInformation1
type: string
meta:
label: { de: "Zusätzliche Infos 1", en: "Additional brand information 1" }
helperText:
de: "Text, welcher neben dem Logo platziert wird"
en: "Text placed next to the logo"
- name: additionalBrandInformation2
type: string
meta:
label: { de: "Zusätzliche Infos 2", en: "Additional brand information 2" }
helperText:
de: "Text, welcher neben dem Logo platziert wird"
en: "Text placed next to the logo"
- name: mediaFiles
type: object[]
meta:
label: { de: "Dateien", en: "Files" }
subFields:
- name: title
type: string
meta:
label: { de: "Datei-Titel", en: "File Title" }
- name: alternateText
type: string
meta:
label: { de: "Alternativer Text", en: "Alternate Text" }
- name: id
type: string
meta:
editableWhileCreating: true
label: { de: "Technischer Name / ID", en: "Technical name / ID" }
helperText:
de: "Achtung: Eine technische ID ist meist fest im Code der Seite verknüpft und darf, wenn sie einmal gesetzt wurde, nicht verändert werden!"
en: "Attention: A technical ID is usually permanently linked in the code of the page and, once it has been set, must not be changed!"
- name: file
type: file
meta:
label: { de: "Datei", en: "File" }

View File

@@ -1,47 +0,0 @@
name: person
type: object
subFields:
- name: salutation
type: string
meta:
label: { de: "Anrede", en: "Salutation" }
- name: firstname
type: string
meta:
label: { de: "Vorname", en: "Firstname" }
- name: lastname
type: string
meta:
label: { de: "Nachname", en: "Lastname" }
- name: additional
type: string
meta:
label: { de: "Zusatz", en: "Additional" }
- name: street
type: string
meta:
label: { de: "Straße", en: "Street" }
- name: postcode
type: string
meta:
label: { de: "Postleitzahl", en: "Postcode" }
- name: city
type: string
meta:
label: { de: "Ort", en: "City" }
- name: tel
type: string
meta:
label: { de: "Telefonnummer", en: "Phone number" }
- name: fax
type: string
meta:
label: { de: "Faxnummer", en: "Fax number" }
- name: mobile
type: string
meta:
label: { de: "Handynummer", en: "Mobile number" }
- name: email
type: string
meta:
label: { de: "E-Mail", en: "E-Mail" }

View File

@@ -1,130 +0,0 @@
name: pageBuilder
type: object[]
meta:
label:
de: Pagebuilder Light
en: pagebuilder light
folding:
unfolded: false
previewFolded:
raw: false
eval: |
(() => {
let text = $this?.columns?.column1?.html?.replace(/<\/?[^>]+(>|$)/g, " ");
if (text?.length > 30) {
return text.substr(0, 30) + "...";
}
return text?.trimStart() || "";
})()
previewUnfolded:
raw: false
eval: |
(() => {
return "";
})()
subFields:
- name: publish
type: boolean
meta:
label:
de: Inhaltszeile ist veröffentlicht
en: Content row is published
- name: columns
type: object
meta:
widget: tabs
label:
de: Spalten
en: Columns
helperText:
de: Spalten ohne Inhalt werden nicht angezeigt.
en: Columns with no content are not displayed.
subFields:
- name: column1
type: object
meta:
label:
de: Spalte 1
en: Column 1
subFields: &columnSubFields
- name: width
type: string
meta:
widget: select
label:
de: Spaltenbreite
en: Column width
defaultValue: "auto"
choices: &widthSelections
- id: "auto"
name:
de: automatisch
en: auto
- id: "25"
name:
de: 25%
en: 25%
- id: "33"
name:
de: 33%
en: 33%
- id: "50"
name:
de: 50%
en: 50%
- id: "66"
name:
de: 66%
en: 66%
- id: "75"
name:
de: 75%
en: 75%
- name: html
type: string
meta:
widget: richtext
label:
de: Text
en: Text
- name: module
type: string
meta:
label:
de: Modul
en: Module
helperText:
de: Ein Modul ist ein vorgefertigter Baustein und wird an der Position des Textelements eingebettet.
en: A module is a ready-made building block and is embedded at the position of the text element.
widget: select
allowEmpty: true
choices:
- id: ContactForm
name: { de: "Kontakt Formular", en: "Contact Form" }
- id: Addresses
name: { de: "Adressen", en: "Adresses" }
- name: column2
type: object
meta:
label:
de: Spalte 2
en: Column 2
subFields: *columnSubFields
- name: column3
type: object
meta:
label:
de: Spalte 3
en: Column 3
subFields: *columnSubFields
- name: column4
type: object
meta:
label:
de: Spalte 4
en: Column 4
subFields: *columnSubFields

View File

@@ -1,186 +0,0 @@
########################################################################
# General Information
########################################################################
name: general
uploadPath: ../media/general
meta:
singleton: true
# Navigationseintrag in der Admin-UI
label: { de: "Allgemeine Informationen", en: "General Information" }
# Icon (Material UI) für den Navigationseintrag
muiIcon: information-outline
# Identifizierung eines Eintrags für z.B. Select-Boxen in der Admin-UI
rowIdentTpl: { twig: "{{ email }} - {{ subject }}" }
# Standardsortierung der Liste
defaultSort: { field: "path", order: "ASC" }
# Admin-Backend Ansichten
defaultImageFilter: s
views:
# Mobile Darstellung
- type: simpleList
mediaQuery: "(max-width:599px)"
primaryText: firstname
columns:
- public
# Desktop
- type: table
mediaQuery: "(min-width:600px)"
columns:
- public
- meta.metaTitle
tablist:
meta:
expand: general
tabs:
- name: general
meta:
label: { de: "Allgemein", en: "General" }
subFields:
- source: public
# - source: meta.metaDescription
- name: meta
meta:
label: { de: "Meta", en: "Meta" }
source: meta
subFields:
- source: meta
- name: person
meta:
label: { de: "Person", en: "Person" }
subFields:
- source: person
- name: company
meta:
label: { de: "Unternehmen", en: "Company" }
subFields:
- source: company
- name: media
meta:
label: { de: "Medien", en: "Media" }
subFields:
- source: media
- name: copyright
meta:
label: { de: "Copyright", en: "Copyright" }
subFields:
- source: copyrightText
imageFilter:
xs:
- fit: true
height: 90
width: 90
resampling: "lanczos"
quality: 60
s:
- fit: true
height: 300
width: 300
resampling: "lanczos"
quality: 60
m:
- fit: true
height: 600
width: 600
resampling: "lanczos"
quality: 60
l:
- fit: true
height: 1200
width: 1200
resampling: "lanczos"
quality: 60
xl:
- fit: true
height: 2000
width: 2000
resampling: "lanczos"
quality: 60
permissions:
public:
methods:
get: true
post: false
put: false
delete: false
user:
methods:
get: true
post: true
put: true
delete: true
# token als Zusatzsicherung gegen Spam, mehr siehe Hook
"token:${PUBLIC_TOKEN}":
methods:
get: false
post: false
put: false
delete: false
fields:
- name: public
type: boolean
meta:
defaultValue: true
label:
de: Veröffentlicht
en: Public
helperText:
de: "Alle allgemeinen Informationen werden auf der Seite angezeigt."
en: "All general information are displayed on the page."
- name: meta
type: object
meta:
subFields:
- name: metaTitle
type: string
meta:
label: { de: "Titel der Webseite", en: "Page Title" }
- name: metaDescription
type: string
meta:
label: { de: "Beschreibung der Webseite", en: "Page Description" }
- name: metaTagRobots
type: string[]
meta:
widget: chipArray
label:
de: Robots
en: Robots
defaultValue: []
autocomplete: true
choices:
- { id: "noindex", name: "noindex" }
- { id: "index", name: "index" }
- { id: "follow", name: "follow" }
- { id: "nofollow", name: "nofollow" }
- { id: "noimageindex", name: "noimageindex" }
- { id: "none", name: "none" }
- { id: "noarchive", name: "noarchive" }
- { id: "nocache", name: "nocache" }
- { id: "nosnippet", name: "nosnippet" }
- { id: "nnavailable_after", name: "nnavailable_after" }
helperText:
de: "<strong>Noindex</strong>: Weist eine Suchmaschine an, eine Seite nicht zu indizieren.<br/><strong>index</strong>: Weist eine Suchmaschine an, eine Seite zu indizieren. Beachten Sie, dass Sie dieses Meta-Tag nicht hinzufügen müssen; es ist die Voreinstellung.<br/><strong>follow</strong>: Auch wenn die Seite nicht indexiert ist, sollte der Crawler allen Links auf einer Seite folgen und Eigenkapital an die verlinkten Seiten weitergeben.<br/><strong>nofollow</strong>: Weist einen Crawler an, keinen Links auf einer Seite zu folgen oder Link-Equity weiterzugeben.<br/><strong>noimageindex</strong>: Weist einen Crawler an, keine Bilder auf einer Seite zu indizieren.<br/><strong>none</strong>: Entspricht der gleichzeitigen Verwendung der noindex- und nofollow-Tags.<br/><strong>noarchive</strong>: Suchmaschinen sollten keinen zwischengespeicherten Link zu dieser Seite auf einem SERP anzeigen.<br/><strong>nocache</strong>: Wie noarchive, aber nur von Internet Explorer und Firefox verwendet.<br/><strong>nosnippet</strong>: Weist eine Suchmaschine an, kein Snippet dieser Seite (d. h. Meta-Beschreibung) dieser Seite auf einem SERP anzuzeigen.<br/><strong>nnavailable_after</strong>: Suchmaschinen sollen diese Seite nach einem bestimmten Datum nicht mehr indexieren.<br/>"
en: "<strong>Noindex</strong>: Tells a search engine not to index a page.<br/><strong>index</strong>: Tells a search engine to index a page. Note that you dont need to add this meta tag; its the default.<br/><strong>follow</strong>: Even if the page isnt indexed, the crawler should follow all the links on a page and pass equity to the linked pages.<br/><strong>nofollow</strong>: Tells a crawler not to follow any links on a page or pass along any link equity.<br/><strong>noimageindex</strong>: Tells a crawler not to index any images on a page.<br/><strong>none</strong>: Equivalent to using both the noindex and nofollow tags simultaneously.<br/><strong>noarchive</strong>: Search engines should not show a cached link to this page on a SERP.<br/><strong>nocache</strong>: Same as noarchive, but only used by Internet Explorer and Firefox.<br/><strong>nosnippet</strong>: Tells a search engine not to show a snippet of this page (i.e. meta description) of this page on a SERP.<br/><strong>nnavailable_after</strong>: Search engines should no longer index this page after a particular date.<br/>"
- name: metaKeywords
type: string
meta:
label: { de: "SEO / Schlüsselwörter", en: "SEO / Keywords" }
helperText:
de: "Beispiel: Stichwort1, Stichwort2, Stichwort3"
en: "Example: keyword1, keyword2, keyword3"
- !include "fields/_person.yml"
- !include "fields/_company.yml"
- !include "fields/_media.yml"
- name: copyrightText
type: string
meta:
label: { de: "Copyright Text", en: "Copyright Text" }

View File

@@ -1,218 +0,0 @@
###############################################################
# Media Library
###############################################################
# Name/URL-Anteil der Kollektion
name: navigation
uploadPath: ../media/navigation
# Metaangaben zur Kollektion welche in der Admin-UI verwendet werden können
meta:
# Navigationseintrag in der Admin-UI
label: { de: "Navigation", en: "Navigation" }
# Icon (Material UI) für den Navigationseintrag
muiIcon: file-tree
# Identifizierung eines Eintrags für z.B. Select-Boxen in der Admin-UI
rowIdentTpl: { twig: "{{ path }}" }
# Standardsortierung der Liste
defaultSort: { field: "id", order: "ASC" }
# Admin-Backend Ansichten
defaultImageFilter: s
views:
- type: simpleList
mediaQuery: "(max-width:599px)"
primaryText: ident
secondaryText: locale
- type: table
mediaQuery: "(min-width:600px)"
columns:
- ident
- { source: locale, type: flag }
imageFilter:
xs:
- fit: true
height: 90
width: 90
resampling: lanczos
quality: 60
s:
- fit: true
height: 300
width: 300
resampling: lanczos
quality: 60
m:
- fit: true
height: 600
width: 600
resampling: lanczos
quality: 60
l:
- fit: true
height: 1200
width: 1200
resampling: lanczos
quality: 60
xl:
- fit: true
height: 2000
width: 2000
resampling: lanczos
quality: 60
permissions:
public:
methods:
get: true
post: false
put: false
delete: false
user:
methods:
get: true
post: false
put: false
delete: false
# token als Zusatzsicherung gegen Spam, mehr siehe Hook
"token:${PUBLIC_TOKEN}":
methods:
get: false
post: false
put: false
delete: false
# Field References
x-title: &title
name: title
type: string
meta:
label: { de: "Titel", en: "Title" }
helperText:
{
de: "Der Titel des Navigationspunkts wird auf der Webseite angezeigt.",
en: "The title of the navigation point is displayed on the page.",
}
x-settings: &settings
name: settings
type: object
meta:
widget: tabs
activeTab: 0
x-page: &page
name: page
type: string
meta:
widget: select
label: { de: Seite, en: "Page" }
choices:
endpoint: "content"
mapping:
id: "path"
name: "path"
params:
count: 1
sort: "ASC"
query: ""
x-url: &url
name: url
type: object
meta:
label: { de: "Link", en: "Link" }
subFields:
- name: url
type: string
meta:
label: { de: "Ziel-URL", en: "Target URL" }
helperText:
{
de: "Definiert eine interne oder externe URL, zu dieser bei Klick auf den Navigationspunkt, gesprungen wird.",
en: "Defines an internal or external URL to which a jump is made when the navigation point is clicked.",
}
inputProps:
type: "url"
- name: target
type: string
meta:
widget: select
label: { de: Zielfenster, en: Target }
defaultValue: "default"
choices:
- { id: "default", name: "Gleicher Tab oder Seite (ohne Refresh)" }
- { id: "_self", name: "Gleicher Tab oder Seite (mit Refresh)" }
- { id: "_blank", name: "Neuer Tab oder Fenster" }
- { id: "_parent", name: "Elternfenster" }
- name: hidden
type: boolean
meta:
label: { de: "Ausgeblendet", en: "Hidden" }
helperText:
{
de: "Definiert, ob der Navigationspunkt in der Navigation angezeigt werden soll oder nicht.",
en: "Defines whether the navigation point should be displayed in the navigation or not.",
}
x-items: &items
name: items
type: object[]
meta:
collapse: { titleFieldName: "settings.title" }
label: { de: "Navigationspunkte", en: "Navigation Points" }
helperText:
{
de: "Definition aller Navigationspunkte für diese Navigation",
en: "Definition of all navigation points for this navigation",
}
# Feldliste der Kollektion
fields:
- name: ident
type: string
meta:
widget: select
choices:
- id: main
name:
de: Hauptnavigation
en: Main Navigation
- id: footer
name:
de: Fußzeile
en: Footer Navigation
- !include fields/_locale.yml
- <<: *items
subFields:
- <<: *settings
subFields:
- *title
- *page
- *url
- <<: *items
subFields:
- <<: *settings
subFields:
- *title
- *page
- *url
- <<: *items
subFields:
- <<: *settings
subFields:
- *title
- *page
- *url
indexes:
- unique: true
key:
- ident
- locale
- path

View File

@@ -5,8 +5,9 @@
name: ssr
meta:
label: { de: "SSR Dummy", en: "ssr dummy" }
muiIcon: http
muiIcon: server
rowIdentTpl: { twig: "{{ id }}" }
views:
- type: simpleList
mediaQuery: "(max-width: 600px)"
@@ -17,28 +18,23 @@ meta:
columns:
- id
- insertTime
- path
- source: path
filter: true
- source: validUntil
permissions:
public:
methods:
get: false
post: false
get: true
post: true
put: false
delete: false
user:
methods:
get: false
post: false
put: false
delete: false
"token:${SSR_TOKEN}":
methods:
# only via url=
get: true
post: false
put: false
delete: false
delete: true
hooks:
get:
@@ -46,14 +42,25 @@ hooks:
type: javascript
file: hooks/ssr/get_read.js
post:
create:
bind:
type: javascript
file: hooks/ssr/post_create.js
file: hooks/ssr/post_bind.js
# we only need hooks
fields:
- name: path
type: string
index: [single, unique]
- name: content
type: string
meta:
inputProps:
multiline: true
- name: validUntil
type: date
index: [single]
meta:
label:
de: Gültig bis
en: Valid until

View File

@@ -1,86 +0,0 @@
###############################################################
# Media Library
###############################################################
# Name/URL-Anteil der Kollektion
name: tags
uploadPath: ../media/tags
# Metaangaben zur Kollektion welche in der Admin-UI verwendet werden können
meta:
# Navigationseintrag in der Admin-UI
label: { de: "Tags / Labels", en: "Tags / Labels" }
# Icon (Material UI) für den Navigationseintrag
muiIcon: tag
# Identifizierung eines Eintrags für z.B. Select-Boxen in der Admin-UI
rowIdentTpl: { twig: "{{ path }}" }
# Standardsortierung der Liste
defaultSort: { field: "tag", order: "ASC" }
# Admin-Backend Ansichten
defaultImageFilter: s
views:
- type: table
mediaQuery: "(min-width:0px)"
columns:
- name
imageFilter:
xs:
- fit: true
height: 90
width: 90
resampling: lanczos
quality: 60
s:
- fit: true
height: 300
width: 300
resampling: lanczos
quality: 60
m:
- fit: true
height: 600
width: 600
resampling: lanczos
quality: 60
l:
- fit: true
height: 1200
width: 1200
resampling: lanczos
quality: 60
xl:
- fit: true
height: 2000
width: 2000
resampling: lanczos
quality: 60
permissions:
public:
methods:
get: true
post: false
put: false
delete: false
user:
methods:
get: true
post: false
put: false
delete: false
# token als Zusatzsicherung gegen Spam, mehr siehe Hook
"token:${PUBLIC_TOKEN}":
methods:
get: false
post: false
put: false
delete: false
# Feldliste der Kollektion
fields:
- name: name
type: string
meta:
label: { de: "Name des Tags", en: "Tag Name" }
filter: true

View File

@@ -1,15 +1,20 @@
namespace: __NAMESPACE__
# Metaangaben zum Projekt welche in der UI verwendet werden können
meta:
# wird in der Admin-UI zum Projekt aufgegeben
imageUrl: https://__MASTER_URL__/media/api-pic.jpg
imageUrl:
eval: "$projectBase + '_/assets/img/admin-pic.jpg'"
injectIntoHead:
# inject font faces (not possible in shadow dom for preview)
eval: |
"<link rel='stylesheet' href='" + $projectBase + "_/assets/fonts/fonts.css?t=" + $project?.updateTime + "'>"
# Liste aller möglichen Kollektionen (Listen, Seiten...) zum Projekt
collections:
- !include collections/general.yml
- !include collections/navigation.yml
- !include collections/content.yml
- !include collections/tags.yml
- !include collections/contact_form.yml
- !include collections/ssr.yml
assets:
- name: dist
path: ../frontend/dist
- name: fonts
path: ../frontend/assets/fonts
- name: img
path: ../frontend/assets/img

View File

@@ -1,3 +0,0 @@
PUBLIC_TOKEN=__PUBLIC_TOKEN__
SSR_TOKEN=__SSR_TOKEN__
PAYPAL_TOKEN=__PAYPAL_TOKEN__

5
api/hooks/clear_cache.js Normal file
View File

@@ -0,0 +1,5 @@
var utils = require("./lib/utils")
;(function () {
utils.clearSSRCache()
})()

View File

@@ -0,0 +1,20 @@
const release = "__PROJECT__.dirty"
const originURL = "https://__PROJECT__.code.testversion.online"
const apiClientBaseURL = "/api/"
const cryptchaSiteId = "6628f06a0938460001505119"
// @ts-ignore
if (release && typeof context !== "undefined") {
context.response.header("X-Release", release)
}
const isMaster = release.includes("master")
module.exports = {
release,
apiClientBaseURL,
cryptchaSiteId,
originURL,
}

View File

@@ -1,17 +1,73 @@
module.exports = {
projectName: "__PROJECT_NAME__",
operatorEmail: "__OPERATOR_EMAIL_",
const apiSsrBaseURL =
"http://localhost:" + context.config.server().api.port + "/api/v1/_/" + context.api().namespace + "/"
apiBase: "http://localhost:8080/api/v1/_/__NAMESPACE__/",
frontendBase: "http://localhost:5501/",
publicToken: "__PUBLIC_TOKEN__",
ssrToken: "__SSR_TOKEN__",
ssrValidatePath: function(path) {
// TODO validate if path ssr rendering is ok, -1 = NOTFOUND, 0 = NO SSR, 1 = SSR
// pe. use context.readCollection("product", {filter: {path: path}}) ... to validate dynamic urls
return path.match(/^\/(home|service)\/?$/)
}
const now = { $date: new Date().toISOString() }
const publishedFilter = {
active: true,
$or: [
{ publication: { $exists: false } },
{ publication: null },
{
$and: [
{
$or: [
{ "publication.from": { $exists: false } },
{ "publication.from": null },
{ "publication.from": { $lte: now } },
],
},
{
$or: [
{ "publication.to": { $exists: false } },
{ "publication.to": null },
{ "publication.to": { $gte: now } },
],
},
],
},
],
}
module.exports = {
apiSsrBaseURL,
publishedFilter,
ssrValidatePath: function (/** @type {string} */ path) {
// validate if path ssr rendering is ok, -1 = NOTFOUND, 0 = NO SSR, 1 = SSR
// pe. use context.readCollection("product", {filter: {path: path}}) ... to validate dynamic urls
// / is fixed url
if (path == "/cart") return 1
// path starts with /products/ is product
if (path?.startsWith("/products/")) {
const slug = path?.replace(/^\/products\//, "")
const resp = context.db.find("product", {
filter: {
$and: [{ slug: slug }, publishedFilter],
},
selector: { _id: 1 },
})
if (resp && resp.length) {
return 1
}
}
// // all other sites are in db
//path = path?.replace(/^\//, "")
const resp = context.db.find("content", {
filter: {
$and: [{ $or: [{ path }, { "alternativePaths.path": path }] }, publishedFilter],
},
selector: { _id: 1 },
})
if (resp && resp.length) {
return 1
}
// not found
return -1
},
ssrPublishCheckCollections: ["content", "product"],
}

View File

@@ -1,68 +0,0 @@
// @ts-check
let utils = require("../lib/utils")
const config = require("../config")
const { operatorEmail } = config
// const { objectToText } = require("../lib/helper")
;(function () {
/** @type {import("tibi-types").HookResponse} */
let hookResponse
const type = context.request().query("type")
if (!type) {
throw {
status: 403,
error: "invalid data",
}
}
if (typeof context.data != "object") {
throw {
status: 400,
error: "invalid body data",
}
}
let to = ""
let from = ""
let fromName = ""
let replyTo = ""
let subject
let plainText
let html
if (utils.isPublicToken(context)) {
to = operatorEmail
from = context.data.email
fromName = context.data.name
replyTo = context.data.email
if (type === "contactForm") {
subject = utils.tpl(context, "templates/operator_contact_form_subject.de.txt")
html = utils.tpl(context, "templates/operator_contact_form_body.de.html")
}
}
if ((!plainText && !html) || !subject) {
throw {
status: 403,
error: "invalid mail data",
}
}
context.smtp.sendMail({
to,
from,
fromName,
subject,
html,
// attach: ["attachments/AGB.pdf"],
})
throw {
status: 200,
message: "ok",
}
return hookResponse
})()

View File

@@ -1,11 +0,0 @@
// @ts-check
const { generateUrlString } = require("../lib/helper")
;(function () {
/** @type {import("tibi-types").HookResponse} */
let hookResponse
context.data.path = generateUrlString(context.data.path)
return hookResponse
})()

View File

@@ -1,11 +0,0 @@
// @ts-check
const { generateUrlString } = require("../lib/helper")
;(function () {
/** @type {import("tibi-types").HookResponse} */
let hookResponse
context.data.path = generateUrlString(context.data.path)
return hookResponse
})()

View File

@@ -0,0 +1,20 @@
const { publishedFilter } = require("./config")
;(function () {
if (!context.user.auth()) {
// it is public
/** @type {HookResponse} */
const hookResponse = {}
if (context.filter && Object.keys(context.filter).length > 0) {
hookResponse.filter = {
$and: [context.filter, publishedFilter],
}
} else {
hookResponse.filter = publishedFilter
}
return hookResponse
}
})()

View File

@@ -0,0 +1,74 @@
const { apiSsrBaseURL, ssrPublishCheckCollections } = require("../config")
/**
* api request via server, cache result in context.ssrCache
* should be elimated in client code via tree shaking
*
* @param {string} cacheKey
* @param {string} endpoint
* @param {string} query
* @param {ApiOptions} options
* @returns {ApiResult<any>}
*/
function ssrRequest(cacheKey, endpoint, query, options) {
let url = endpoint + (query ? "?" + query : "")
if (ssrPublishCheckCollections?.includes(endpoint)) {
// @ts-ignore
let validUntil = context.ssrCacheValidUntil
// check in db for publish date to invalidate cache
const _optionsPublishSearch = Object.assign(
{},
{ filter: options?.filter },
{
selector: { publication: 1 },
projection: null,
}
)
const publishSearch = context.db.find(endpoint, _optionsPublishSearch)
publishSearch?.forEach((item) => {
const publicationFrom = item.publication?.from ? new Date(item.publication.from.unixMilli()) : null
const publicationTo = item.publication?.to ? new Date(item.publication.to.unixMilli()) : null
if (publicationFrom && publicationFrom > new Date()) {
// entry has a publish date that is further in in the future than current, set global validUntil
if (validUntil == null || validUntil > publicationFrom) {
validUntil = publicationFrom
}
}
if (publicationTo && publicationTo > new Date()) {
// entry has a unpublish date that is further in in the future than current, set global validUntil
if (validUntil == null || validUntil > publicationTo) {
validUntil = publicationTo
}
}
})
// @ts-ignore
context.ssrCacheValidUntil = validUntil
}
// console.log("############ FETCHING ", apiSsrBaseURL + url)
const response = context.http.fetch(apiSsrBaseURL + url, {
method: options.method,
headers: options.headers,
})
// console.log(JSON.stringify(response.headers, null, 2))
const json = response.body.json()
const count = parseInt(response.headers["X-Results-Count"] || "0")
// json is go data structure and incompatible with js, so we need to convert it
const r = { data: JSON.parse(JSON.stringify(json)), count: count }
// @ts-ignore
context.ssrCache[cacheKey] = r
return r
}
module.exports = {
ssrRequest,
}

View File

@@ -1,6 +1,9 @@
const { apiClientBaseURL } = require("../config-client")
/**
* convert object to string
* @param {any} obj object
* @returns {string} string
*/
function obj2str(obj) {
if (Array.isArray(obj)) {
@@ -30,8 +33,105 @@ function obj2str(obj) {
if (obj) return obj
}
// can be used by client code, so DONT INCLUDE hooks/config.js (SECRETS INSIDE)
/**
* api request via client or server
* server function ssrRequest is called via context.ssrRequest, binded in ssr hook
*
* @param {string} endpoint
* @param {ApiOptions} options
* @param {any} body
* @param {import("../../../frontend/src/sentry")} sentry
* @param {typeof fetch} _fetch
* @returns {Promise<ApiResult<any>>}
*/
function apiRequest(endpoint, options, body, sentry, _fetch) {
// TODO cache only for GET
// first check cache if on client
const cacheKey = obj2str({ endpoint: endpoint, options: options })
let method = options?.method || "GET"
// @ts-ignore
if (typeof window !== "undefined" && window.__SSR_CACHE__ && method === "GET") {
// @ts-ignore
const cache = window.__SSR_CACHE__[cacheKey]
console.log("SSR HIT:", cacheKey, cache)
if (cache) {
return Promise.resolve(cache)
}
}
let query = "&count=1"
if (options?.filter) query += "&filter=" + encodeURIComponent(JSON.stringify(options.filter))
if (options?.sort) query += "&sort=" + options.sort + "&sort=_id"
if (options?.limit) query += "&limit=" + options.limit
if (options?.offset) query += "&offset=" + options.offset
if (options?.projection) query += "&projection=" + options.projection
if (options?.lookup) query += "&lookup=" + options.lookup
if (options?.params) {
Object.keys(options.params).forEach((p) => {
query += "&" + p + "=" + encodeURIComponent(options.params[p])
})
}
/** @type {{[key: string]: string}} */
let headers = {
"Content-Type": "application/json",
}
if (options?.headers) headers = { ...headers, ...options.headers }
if (typeof window === "undefined" && method === "GET") {
// server
// reference via context from get hook to tree shake in client
// @ts-ignore
const d = context.ssrRequest(cacheKey, endpoint, query, Object.assign({}, options, { method, headers }))
return d
} else {
// client
let url = (endpoint.startsWith("/") ? "" : apiClientBaseURL) + endpoint + (query ? "?" + query : "")
const span = sentry?.currentTransaction()?.startChild({
op: "fetch",
description: method + " " + url,
data: Object.assign({}, options, { url }),
})
const trace_id = span?.toTraceparent()
if (trace_id) {
headers["sentry-trace"] = trace_id
}
/** @type {{[key: string]: any}} */
const requestOptions = {
method,
mode: "cors",
headers,
}
if (method === "POST" || method === "PUT") {
requestOptions.body = JSON.stringify(body)
}
const response = _fetch(url, requestOptions).then((response) => {
return response?.json().then((json) => {
if (response?.status < 200 || response?.status >= 400) {
return Promise.reject({ response, data: json })
}
return Promise.resolve({ data: json || null, count: response.headers?.get("x-results-count") || 0 })
})
})
span?.end()
// @ts-ignore
return response
}
}
module.exports = {
obj2str,
apiRequest,
}

View File

@@ -1,6 +1,4 @@
// @ts-check
var config = require("../config")
const { cryptchaSiteId } = require("../config-client")
/**
*
@@ -9,208 +7,83 @@ var config = require("../config")
function log(str) {
console.log(JSON.stringify(str, undefined, 4))
}
function rand() {
return Math.random().toString(36).substr(2) // remove `0.`
}
/**
* convert object to string
* @param {any} obj object
* @returns {string}
*/
function randomToken() {
return rand() + rand()
}
function obj2str(obj) {
if (Array.isArray(obj)) {
return JSON.stringify(
obj.map(function (idx) {
return obj2str(idx)
})
)
} else if (typeof obj === "object" && obj !== null) {
var elements = Object.keys(obj)
.sort()
.map(function (key) {
var val = obj2str(obj[key])
if (val) {
return key + ":" + val
}
})
/**
*
* @param {import('tibi-types').HookContext} c
* @returns {boolean}
*/
function isPublicToken(c) {
var r = c.request()
var t = r.query("token") || r.header("token")
return t == config.publicToken
}
/**
*
* @param {import('tibi-types').HookContext} c
* @returns {boolean}
*/
function isSsrToken(c) {
var r = c.request()
var t = r.query("token") || r.header("token")
return t == config.ssrToken
}
/**
*
* @param {import('tibi-types').HookContext} c
* @param {string} filename
* @returns {string}
*/
function tpl(c, filename) {
return c.tpl.execute(c.fs.readFile(filename), {
context: c,
config: config,
/**
* @param {number} v
* @param {number} vat
*/
formatPrice: function (v, vat) {
if (vat) {
v *= vat / 100 + 1
}
return v.toFixed(2).toString().replace(".", ",")
},
})
}
/**
*
* Base64 encode / decode
* http://www.webtoolkit.info/
*
**/
var Base64 = {
// private property
_keyStr:
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
// public method for encoding
encode: function (input) {
var output = ""
var chr1, chr2, chr3, enc1, enc2, enc3, enc4
var i = 0
input = Base64._utf8_encode(input)
while (i < input.length) {
chr1 = input.charCodeAt(i++)
chr2 = input.charCodeAt(i++)
chr3 = input.charCodeAt(i++)
enc1 = chr1 >> 2
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)
enc4 = chr3 & 63
if (isNaN(chr2)) {
enc3 = enc4 = 64
} else if (isNaN(chr3)) {
enc4 = 64
}
output =
output +
this._keyStr.charAt(enc1) +
this._keyStr.charAt(enc2) +
this._keyStr.charAt(enc3) +
this._keyStr.charAt(enc4)
var elementsCleaned = []
for (var i = 0; i < elements.length; i++) {
if (elements[i]) elementsCleaned.push(elements[i])
}
return output
},
// public method for decoding
decode: function (input) {
var output = ""
var chr1, chr2, chr3
var enc1, enc2, enc3, enc4
var i = 0
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "")
while (i < input.length) {
enc1 = this._keyStr.indexOf(input.charAt(i++))
enc2 = this._keyStr.indexOf(input.charAt(i++))
enc3 = this._keyStr.indexOf(input.charAt(i++))
enc4 = this._keyStr.indexOf(input.charAt(i++))
chr1 = (enc1 << 2) | (enc2 >> 4)
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2)
chr3 = ((enc3 & 3) << 6) | enc4
output = output + String.fromCharCode(chr1)
if (enc3 != 64) {
output = output + String.fromCharCode(chr2)
}
if (enc4 != 64) {
output = output + String.fromCharCode(chr3)
}
}
output = Base64._utf8_decode(output)
return output
},
// private method for UTF-8 encoding
_utf8_encode: function (string) {
string = string.replace(/\r\n/g, "\n")
var utftext = ""
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n)
if (c < 128) {
utftext += String.fromCharCode(c)
} else if (c > 127 && c < 2048) {
utftext += String.fromCharCode((c >> 6) | 192)
utftext += String.fromCharCode((c & 63) | 128)
} else {
utftext += String.fromCharCode((c >> 12) | 224)
utftext += String.fromCharCode(((c >> 6) & 63) | 128)
utftext += String.fromCharCode((c & 63) | 128)
}
}
return utftext
},
// private method for UTF-8 decoding
_utf8_decode: function (utftext) {
var string = ""
var i = 0
var c = 0
var c1 = 0
var c2 = 0
var c3 = 0
while (i < utftext.length) {
c = utftext.charCodeAt(i)
if (c < 128) {
string += String.fromCharCode(c)
i++
} else if (c > 191 && c < 224) {
c2 = utftext.charCodeAt(i + 1)
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63))
i += 2
} else {
c2 = utftext.charCodeAt(i + 1)
c3 = utftext.charCodeAt(i + 2)
string += String.fromCharCode(
((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)
)
i += 3
}
}
return string
},
}
/**
*
* @param {string} d
*/
function parseDate(d) {
return new Date(
d
.toString()
// go time objects output is not parseable by goja, so fix it
.replace(
/[T ](\d{2}:\d{2}:\d{2})(?:\.\d+)? ([\+\-])(\d{4}).*$/,
"T$1$2$3"
)
)
return "{" + elementsCleaned.join("|") + "}"
}
if (obj) return obj
}
/**
* clear SSR cache
* @returns {number}
*/
function clearSSRCache() {
var info = context.db.deleteMany("ssr", {})
context.response.header("X-SSR-Cleared", info.removed)
return info.removed
}
function cryptchaCheck() {
const solutionId = context.data._sId
const solution = context.data._s
const body = JSON.stringify({ solution: solution })
console.log(body)
const resp = context.http.fetch(
"https://cryptcha.webmakers.de/api/command?siteId=" +
cryptchaSiteId +
"&cmd=check&clear=1&solutionId=" +
solutionId,
{
method: "POST",
body,
headers: { "Content-Type": "application/json" },
}
)
const j = resp.body.json()
const corrent = j.status == "ok" && resp.status == 200
if (!corrent) {
throw {
status: 400,
log: false,
error: "incorrect data",
}
}
return true
}
module.exports = {
log,
randomToken,
isPublicToken,
isSsrToken,
tpl: tpl,
Base64,
parseDate,
clearSSRCache,
ssrValidatePath: config.ssRValidatePath,
obj2str,
cryptchaCheck,
}

View File

@@ -1,23 +1,42 @@
// @ts-check
const utils = require("../lib/utils")
var utils = require("../lib/utils")
const { release } = require("../config-client")
const { ssrValidatePath } = require("../config")
const { ssrRequest } = require("../lib/ssr-server")
;(function () {
var request = context.request()
var url = request.query("url")
var noCache = request.query("noCache")
var trace_id = context.debug.sentryTraceId()
var trackingCall = request.header("x-ssr-skip")
if (trackingCall) {
// skip tracking
// no cache header
context.response.header("Cache-Control", "no-cache, no-store, must-revalidate")
throw {
status: parseInt(trackingCall),
html: "",
log: false,
}
}
let url = request.query("url") || request.header("x-ssr-url") || "/"
const noCache = request.query("noCache")
const trace_id = context.debug.sentryTraceId()
/**
* @param {string} content
*/
function addSentryTrace(content) {
return content.replace(
"</head>",
'<meta name="sentry-trace" content="' + trace_id + '" /></head>'
)
return content.replace("</head>", '<meta name="sentry-trace" content="' + trace_id + '" /></head>')
}
context.response.header("sentry-trace", trace_id)
const auth = context.user.auth()
if (auth && auth.role == 0) {
} else if (url) {
/** @type {Date} */ // @ts-ignore
context.ssrCacheValidUntil = null
if (url) {
var comment = ""
url = url.split("?")[0]
@@ -26,23 +45,36 @@ var utils = require("../lib/utils")
if (url && url.length > 1) {
url = url.replace(/\/$/, "")
}
if (url == "/noindex" || !url) {
if (url == "/index" || !url) {
url = "/" // see .htaccess
}
var cache =
!noCache &&
context.db.find("ssr", {
filter: {
path: url,
},
})
function useCache(/** @type {string} */ _url) {
var cache =
!noCache &&
context.db.find("ssr", {
filter: {
path: _url,
},
})
if (cache && cache.length) {
// use cache
throw {
status: 200,
html: addSentryTrace(cache[0].content),
if (cache && cache.length) {
// check that entry is still allowed to be published
const validUntil = cache[0].validUntil ? new Date(cache[0].validUntil.unixMilli()) : null
if (!validUntil || validUntil > new Date()) {
// use cache
context.response.header("X-SSR-Cache", "true")
throw {
status: 200,
log: false,
html: addSentryTrace(cache[0].content),
}
} else {
// cache is invalid, delete it
context.response.header("X-SSR-Cache", "invalid")
context.db.delete("ssr", cache[0].id)
}
}
}
@@ -52,16 +84,30 @@ var utils = require("../lib/utils")
var pNorender = false
var pNotfound = false
var pR = utils.ssrValidatePath(url)
if (pR < 0) {
const pR = ssrValidatePath(url)
if (pR === -1) {
pNotfound = true
comment += ", notFound"
} else if (!pR) {
pNorender = true
comment += ", noRender"
} else if (typeof pR === "string") {
url = pR
comment += ", cache url: " + url
}
var head = ""
var html = ""
var error = ""
if (noCache) {
comment += ", noCache"
}
if (!pNorender && !pNotfound) {
// check if we have a cache
useCache(url)
}
let head = ""
let html = ""
let error = ""
comment += ", path: " + url
@@ -72,64 +118,17 @@ var utils = require("../lib/utils")
status = 404
html = "404 NOT FOUND"
} else {
// @ts-ignore
context.ssrCache = {}
// @ts-ignore
context.ssrRequest = ssrRequest
try {
// if error, output plain html without prerendering
// @ts-ignore
context.ssrCache = {}
// @ts-ignore
context.ssrFetch = function (endpoint, options) {
var data
if (
endpoint == "product" ||
endpoint == "category" ||
endpoint == "country" ||
endpoint == "content"
) {
var _options = Object.assign({}, options)
const app = require("../lib/app.server")
if (_options.sort) _options.sort = [_options.sort]
try {
/*console.log(
"SSR",
endpoint,
JSON.stringify(_options)
)*/
var goSlice = context.db.find(
endpoint,
_options || {}
)
// need to deep copy, so shift and delete on pure js is possible
data = JSON.parse(JSON.stringify(goSlice))
} catch (e) {
console.log("ERROR", JSON.stringify(e))
data = []
}
} else {
console.log("SSR forbidden", endpoint)
data = []
}
var count = (data && data.length) || 0
if (options && count == options.limit) {
// read count from db
count = context.db.count(endpoint, _options || {})
}
var r = { data: data, count: count }
// @ts-ignore
context.ssrCache[
utils.obj2str({ endpoint: endpoint, options: options })
] = r
return r
}
// @ts-ignore
var app = require("../lib/app.server")
var rendered = app.default.render({
const rendered = app.default.render({
url: url,
})
head = rendered.head
@@ -149,60 +148,47 @@ var utils = require("../lib/utils")
} else {
cacheIt = true
}
} catch (e) {
} catch (/** @type {any} */ e) {
utils.log(e.message)
utils.log(e.stack)
error = "error: " + e.message + "\n\n" + e.stack
// utils.log(e)
// for (var property in e) {
// utils.log(property + ": " + e[property])
// }
// error = JSON.stringify(e)
}
}
var tpl = context.fs.readFile("templates/spa.html")
tpl = tpl.replace("<!--HEAD-->", head)
tpl = tpl.replace("<!--HTML-->", html)
tpl = tpl.replace(
"<!--SSR.ERROR-->",
error ? "<!--" + error + "-->" : ""
)
tpl = tpl.replace(
"<!--SSR.COMMENT-->",
comment ? "<!--" + comment + "-->" : ""
)
tpl = tpl.replace("<!--SSR.ERROR-->", error ? "<!--" + error + "-->" : "")
tpl = tpl.replace("<!--SSR.COMMENT-->", comment ? "<!--" + comment + "-->" : "")
if (cacheIt && !noCache) {
// save cache
context.db.create("ssr", {
path: url,
content: tpl,
// @ts-ignore
validUntil: context.ssrCacheValidUntil,
})
}
tpl.replace(
"</head>",
'<meta name="sentry-trace" content="' + trace_id + '" /></head>'
)
throw {
status: status,
log: false,
html: addSentryTrace(tpl),
}
} else {
var auth = context.user.auth()
if (!auth || auth.role !== 0) {
// only admins are allowed
throw {
status: 403,
message: "invalid auth",
auth: auth,
}
// only admins are allowed
throw {
status: 403,
message: "invalid auth",
auth: auth,
release: release,
}
}
})()
/*
require("../lib/hook.test")
console.log("hook test ende")
throw {
status: 500,
msg: "TEST",
}
*/

View File

@@ -1,8 +1,25 @@
// @ts-check
const { release } = require("../config-client")
var utils = require("../lib/utils")
;(function () {
if (context.request().query("clear")) {
console.log("CLEARING SSR CACHE")
var removed = utils.clearSSRCache()
var stats = {
status: 200,
message: "ok",
removed: removed,
release: release,
}
utils.log(stats)
throw stats
}
throw {
status: 500,
message: "ssr is only a dummy collection",
release: release,
}
})()

View File

@@ -1,22 +0,0 @@
<html>
<body>
<h1>Kontaktformular</h1>
<label>Name:</label> {{context.data.name}}<br />
<label>Email:</label> {{context.data.email}}<br />
<label>Betreff:</label> {{context.data.subject}}<br />
<h3>Nachricht</h3>
<div style="white-space: pre-wrap">{{context.data.message}}</div>
<h4>Dateien</h4>
<ul>
{% for f in context.data.files %}
<li>
<a href="{{config.apiBase}}contact_form/{{context.data.id}}/{{f.file.src}}"
>{{config.apiBase}}contact_form/{{context.data.id}}/{{f.file.src}}</a
>
</li>
{% endfor %}
</ul>
</body>
</html>

View File

@@ -1 +0,0 @@
{{ config.projectName }} Kontaktformular: {{context.data.subject}}