From 4a37899287a68c19129ed44a4c99b2d873674082 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:07 +0000 Subject: [PATCH 01/68] New translations en.json (Czech) --- packages/nc-gui/lang/cs.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/cs.json b/packages/nc-gui/lang/cs.json index 1d2e0f228e..bbddc339ee 100644 --- a/packages/nc-gui/lang/cs.json +++ b/packages/nc-gui/lang/cs.json @@ -74,7 +74,8 @@ "insertBefore": "Vložit před", "hideField": "Skrýt pole", "sortAsc": "Seřadit vzestupně", - "sortDesc": "Seřadit sestupně" + "sortDesc": "Seřadit sestupně", + "geoDataField": "GeoData Field" }, "objects": { "project": "Projekt", @@ -98,7 +99,8 @@ "gallery": "Galerie", "form": "Formulář", "kanban": "Kanban", - "calendar": "Kalendář" + "calendar": "Kalendář", + "map": "Map" }, "user": "Uživatel", "users": "Uživatelé", @@ -136,6 +138,7 @@ "Currency": "Měna", "Percent": "Procenta", "Duration": "Doba trvání", + "GeoData": "GeoData", "Rating": "Hodnocení", "Formula": "Vzorec", "Rollup": "Rollup", @@ -253,6 +256,9 @@ "barcodeFormat": "Formát čárového kódu", "qrCodeValueTooLong": "Příliš mnoho znaků pro QR kód", "barcodeValueTooLong": "Příliš mnoho znaků pro čárový kód", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Agregační funkce", "dbCreateIfNotExists": "Databáze : vytvořit, pokud neexistuje", "clientKey": "Klíč klienta", @@ -452,6 +458,10 @@ "stackedBy": "Naskládáno podle", "chooseGroupingField": "Výběr pole pro seskupení", "addOrEditStack": "Přidat / upravit zásobník" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Tvůrce může vytvářet nové projekty a přistupovat k jakémukoli pozvanému projektu.", "orgViewer": "Prohlížeč nemůže vytvářet nové projekty, ale může přistupovat k jakémukoli pozvanému projektu." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Řádky na stránku", "upload": "Vyberte soubor, který chcete nahrát", "upload_sub": "nebo přetažením souboru", @@ -600,6 +615,7 @@ "gallery": "Přidat zobrazení galerie", "form": "Přidání zobrazení formuláře", "kanban": "Přidání zobrazení Kanban", + "map": "Add Map View", "calendar": "Přidat zobrazení kalendáře" }, "tablesMetadataInSync": "Metadata tabulek jsou synchronizována", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Jméno by mělo začínat abecedou nebo _", "followingCharactersAreNotAllowed": "Následující znaky nejsou povoleny", "columnNameRequired": "Název sloupce je povinný", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Název projektu přesahuje 50 znaků", "projectNameCannotStartWithSpace": "Název projektu nesmí začínat mezerou", "requiredField": "Povinné pole", From f077938a55d830e9a8e8a87198c2654dd29e6714 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:08 +0000 Subject: [PATCH 02/68] New translations en.json (French) --- packages/nc-gui/lang/fr.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/fr.json b/packages/nc-gui/lang/fr.json index b622e88f73..8607928f95 100644 --- a/packages/nc-gui/lang/fr.json +++ b/packages/nc-gui/lang/fr.json @@ -74,7 +74,8 @@ "insertBefore": "Insérer avant", "hideField": "Masquer le champ", "sortAsc": "Trier par ordre croissant", - "sortDesc": "Trier par ordre décroissant" + "sortDesc": "Trier par ordre décroissant", + "geoDataField": "GeoData Field" }, "objects": { "project": "Projet", @@ -98,7 +99,8 @@ "gallery": "Galerie", "form": "Formulaire", "kanban": "Kanban", - "calendar": "Calendrier" + "calendar": "Calendrier", + "map": "Map" }, "user": "Utilisateur", "users": "Utilisateurs", @@ -136,6 +138,7 @@ "Currency": "Devise", "Percent": "Pourcentage", "Duration": "Durée", + "GeoData": "GeoData", "Rating": "Évaluation", "Formula": "Formule", "Rollup": "Synthèse", @@ -253,6 +256,9 @@ "barcodeFormat": "Format du code-barres", "qrCodeValueTooLong": "Trop de caractères pour un code QR", "barcodeValueTooLong": "Trop de caractères pour un code-barres", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Fonction agrégée", "dbCreateIfNotExists": "Base de données : la créer si elle n'existe pas", "clientKey": "Clé client", @@ -452,6 +458,10 @@ "stackedBy": "Empilés par", "chooseGroupingField": "Choisir un champ de regroupement", "addOrEditStack": "Ajouter / Modifier une pile" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Le créateur peut créer de nouveaux projets et accéder à tout projet invité.", "orgViewer": "Le visualisateur n'est pas autorisé à créer de nouveaux projets mais il peut accéder à tout projet invité." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Lignes par page", "upload": "Sélectionner un fichier à téléverser", "upload_sub": "ou glisser-déposer un fichier", @@ -600,6 +615,7 @@ "gallery": "Ajouter une vue Galerie", "form": "Ajouter une vue Formulaire", "kanban": "Ajouter une vue Kanban", + "map": "Add Map View", "calendar": "Ajouter une vue Calendrier" }, "tablesMetadataInSync": "Les métadonnées de tables sont en synchronisation", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Le nom doit commencer par une lettre de l'alphabet ou _", "followingCharactersAreNotAllowed": "Les caractères suivants ne sont pas autorisés", "columnNameRequired": "Nom de la colonne requis", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Le nom du projet dépasse les 50 caractères", "projectNameCannotStartWithSpace": "Le nom du projet ne peut pas commencer par un espace", "requiredField": "Champ requis", From b2cc02604a6d1e822c60defa6facb881f801c6f0 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:09 +0000 Subject: [PATCH 03/68] New translations en.json (Spanish) --- packages/nc-gui/lang/es.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/es.json b/packages/nc-gui/lang/es.json index 85b274ee59..ade0869efe 100644 --- a/packages/nc-gui/lang/es.json +++ b/packages/nc-gui/lang/es.json @@ -74,7 +74,8 @@ "insertBefore": "Insertar antes", "hideField": "Ocultar campo", "sortAsc": "Ordenación ascendente", - "sortDesc": "Orden descendente" + "sortDesc": "Orden descendente", + "geoDataField": "GeoData Field" }, "objects": { "project": "Proyecto", @@ -98,7 +99,8 @@ "gallery": "Galería", "form": "Formulario", "kanban": "Kanban", - "calendar": "Calendario" + "calendar": "Calendario", + "map": "Map" }, "user": "Usuario", "users": "Usuarios", @@ -136,6 +138,7 @@ "Currency": "Divisa", "Percent": "Por ciento", "Duration": "Duración", + "GeoData": "GeoData", "Rating": "Clasificación", "Formula": "Fórmula", "Rollup": "Acumulado", @@ -253,6 +256,9 @@ "barcodeFormat": "Formato del código de barras", "qrCodeValueTooLong": "Demasiados caracteres para un código QR", "barcodeValueTooLong": "Demasiados caracteres para un código de barras", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Función agregada", "dbCreateIfNotExists": "Base de datos : Crear si no existe", "clientKey": "Clave de Cliente", @@ -452,6 +458,10 @@ "stackedBy": "Apilado por", "chooseGroupingField": "Elija un campo de agrupación", "addOrEditStack": "Añadir / Editar pila" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "El creador puede crear nuevos proyectos y acceder a cualquier proyecto invitado.", "orgViewer": "El espectador no puede crear nuevos proyectos, pero puede acceder a cualquier proyecto invitado." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Filas por página", "upload": "Selecciona Archivo para cargar", "upload_sub": "o arrastra y suelta el archivo", @@ -600,6 +615,7 @@ "gallery": "Agregar vista de Galería", "form": "Agregar vista de Formulario", "kanban": "Agregar vista de Kanban", + "map": "Add Map View", "calendar": "Agregar vista de Calendario" }, "tablesMetadataInSync": "Sincronización de tablas de metadatos activa", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "El nombre debe empezar por un alfabeto o _", "followingCharactersAreNotAllowed": "Los siguientes caracteres no están permitidos", "columnNameRequired": "El nombre de la columna es obligatorio", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "El nombre del proyecto supera los 50 caracteres", "projectNameCannotStartWithSpace": "El nombre del proyecto no puede empezar con un espacio", "requiredField": "Campo obligatorio", From 734d94abe24b5198e847969e634775a6c1aace9b Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:10 +0000 Subject: [PATCH 04/68] New translations en.json (Arabic) --- packages/nc-gui/lang/ar.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/ar.json b/packages/nc-gui/lang/ar.json index bfa90afd4c..12bf7e1643 100644 --- a/packages/nc-gui/lang/ar.json +++ b/packages/nc-gui/lang/ar.json @@ -74,7 +74,8 @@ "insertBefore": "Insert Before", "hideField": "Hide Field", "sortAsc": "Sort Ascending", - "sortDesc": "Sort Descending" + "sortDesc": "Sort Descending", + "geoDataField": "GeoData Field" }, "objects": { "project": "مشروع", @@ -98,7 +99,8 @@ "gallery": "معرض صور", "form": "نموذج", "kanban": "كانبان", - "calendar": "تقويم" + "calendar": "تقويم", + "map": "Map" }, "user": "مستخدم", "users": "مستخدمين", @@ -136,6 +138,7 @@ "Currency": "عملة", "Percent": "نسبة مؤية", "Duration": "مدة", + "GeoData": "GeoData", "Rating": "تقييم", "Formula": "معادلة", "Rollup": "جمع البيانات", @@ -253,6 +256,9 @@ "barcodeFormat": "Barcode format", "qrCodeValueTooLong": "Too many characters for a QR code", "barcodeValueTooLong": "Too many characters for a barcode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "وظيفة التجميع", "dbCreateIfNotExists": "قاعدة البيانات: إنشاء إذا لم يكن موجودا", "clientKey": "مفتاح العميل", @@ -452,6 +458,10 @@ "stackedBy": "Stacked By", "chooseGroupingField": "Choose a Grouping Field", "addOrEditStack": "Add / Edit Stack" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Creator can create new projects and access any invited project.", "orgViewer": "Viewer is not allowed to create new projects but they can access any invited project." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "الصفوف لكل صفحة", "upload": "حدد الملف المراد رفعه", "upload_sub": "أو سحب وإسقاط الملف", @@ -600,6 +615,7 @@ "gallery": "إضافة عرض المعرض", "form": "إضافة عرض النموذج", "kanban": "إضافة عرض كانبان", + "map": "Add Map View", "calendar": "إضافة طريقة عرض التقويم" }, "tablesMetadataInSync": "تزامن البيانات الوصفية للجداول", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _", "followingCharactersAreNotAllowed": "Following characters are not allowed", "columnNameRequired": "Column name is required", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Project name exceeds 50 characters", "projectNameCannotStartWithSpace": "Project name cannot start with space", "requiredField": "Required field", From 21ccb5cbe81e9c4322df02e70d09f7ff98f03bec Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:11 +0000 Subject: [PATCH 05/68] New translations en.json (Danish) --- packages/nc-gui/lang/da.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/da.json b/packages/nc-gui/lang/da.json index 7c499612ed..5e6e82e416 100644 --- a/packages/nc-gui/lang/da.json +++ b/packages/nc-gui/lang/da.json @@ -74,7 +74,8 @@ "insertBefore": "Indsæt før", "hideField": "Skjul felt", "sortAsc": "Sortere stigende", - "sortDesc": "Sortere nedadgående" + "sortDesc": "Sortere nedadgående", + "geoDataField": "GeoData Field" }, "objects": { "project": "Projekt", @@ -98,7 +99,8 @@ "gallery": "Galleri", "form": "Formular", "kanban": "Kanban.", - "calendar": "Kalender" + "calendar": "Kalender", + "map": "Map" }, "user": "Bruger", "users": "Brugere", @@ -136,6 +138,7 @@ "Currency": "betalingsmiddel", "Percent": "Procentdel", "Duration": "Varighed", + "GeoData": "GeoData", "Rating": "Bedømmelse", "Formula": "Formel", "Rollup": "Rul op", @@ -253,6 +256,9 @@ "barcodeFormat": "Stregkodeformat", "qrCodeValueTooLong": "For mange tegn til en QR-kode", "barcodeValueTooLong": "For mange tegn til en stregkode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Aggregate Function.", "dbCreateIfNotExists": "DATABASE: Opret, hvis ikke eksisterer", "clientKey": "Klientnøgle", @@ -452,6 +458,10 @@ "stackedBy": "Stablet af", "chooseGroupingField": "Vælg et grupperingsfelt", "addOrEditStack": "Tilføj / Rediger stak" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Skaberen kan oprette nye projekter og få adgang til alle inviterede projekter.", "orgViewer": "Seeren har ikke lov til at oprette nye projekter, men kan få adgang til alle inviterede projekter." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Rækker per side", "upload": "Vælg fil for at uploade", "upload_sub": "eller træk og slip filen", @@ -600,6 +615,7 @@ "gallery": "Tilføj Gallery View.", "form": "Tilføj formularvisning", "kanban": "Tilføj Kanban View.", + "map": "Add Map View", "calendar": "Tilføj kalendervisning" }, "tablesMetadataInSync": "Tabeller Metadata er synkroniseret", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Navnet skal starte med et alfabet eller _", "followingCharactersAreNotAllowed": "Følgende tegn er ikke tilladt", "columnNameRequired": "Kolonnens navn er påkrævet", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Projektnavnet overstiger 50 tegn", "projectNameCannotStartWithSpace": "Projektnavnet kan ikke begynde med et mellemrum", "requiredField": "Obligatorisk felt", From e15cd6e33f21074f43cf4c3da0ca0f8f5b75aac3 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:12 +0000 Subject: [PATCH 06/68] New translations en.json (German) --- packages/nc-gui/lang/de.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/de.json b/packages/nc-gui/lang/de.json index 0e37ab87b5..2d3d9f5e1d 100644 --- a/packages/nc-gui/lang/de.json +++ b/packages/nc-gui/lang/de.json @@ -74,7 +74,8 @@ "insertBefore": "davor einfügen", "hideField": "Feld ausblenden", "sortAsc": "Aufsteigend sortieren", - "sortDesc": "Absteigend sortieren" + "sortDesc": "Absteigend sortieren", + "geoDataField": "GeoData Field" }, "objects": { "project": "Projekt", @@ -98,7 +99,8 @@ "gallery": "Galerie", "form": "Formular", "kanban": "Kanban", - "calendar": "Kalender" + "calendar": "Kalender", + "map": "Map" }, "user": "Nutzer", "users": "Benutzer", @@ -136,6 +138,7 @@ "Currency": "Währung", "Percent": "Prozent", "Duration": "Dauer", + "GeoData": "GeoData", "Rating": "Klassifizierung", "Formula": "Formel", "Rollup": "Zusammenfassung", @@ -253,6 +256,9 @@ "barcodeFormat": "Barcode-Format", "qrCodeValueTooLong": "Zu viele Zeichen für einen QR-Code", "barcodeValueTooLong": "Zu viele Zeichen für einen Barcode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Globale Funktion", "dbCreateIfNotExists": "Datenbank: Erstellen, falls nicht vorhanden", "clientKey": "Client-Schlüssel", @@ -452,6 +458,10 @@ "stackedBy": "Gestapelt von", "chooseGroupingField": "Wählen Sie ein Gruppierungsfeld", "addOrEditStack": "Stapel hinzufügen / bearbeiten" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Der Ersteller kann neue Projekte erstellen und auf alle eingeladenen Projekte zugreifen.", "orgViewer": "Betrachter können keine neuen Projekte erstellen, aber sie können auf alle eingeladenen Projekte zugreifen." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Zeilen pro Seite", "upload": "Datei zum Hochladen auswählen", "upload_sub": "oder Drag & Drop Datei", @@ -600,6 +615,7 @@ "gallery": "Galerie-Ansicht hinzufügen", "form": "Formular-Ansicht hinzufügen", "kanban": "Kanban-Ansicht hinzufügen", + "map": "Add Map View", "calendar": "Kalender-Ansicht hinzufügen" }, "tablesMetadataInSync": "Tabellen-Metadaten sind synchron", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Name muss mit einem Buchstaben oder _ beginnen", "followingCharactersAreNotAllowed": "Folgende Zeichen sind nicht erlaubt", "columnNameRequired": "Spaltenname ist erforderlich", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Projektname überschreitet 50 Zeichen", "projectNameCannotStartWithSpace": "Projektname darf nicht mit einem Leerzeichen beginnen", "requiredField": "Pflichtfeld", From 6b591214ffbe77cdbd5f545cb0cc17cd68789083 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:13 +0000 Subject: [PATCH 07/68] New translations en.json (Basque) --- packages/nc-gui/lang/eu.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/eu.json b/packages/nc-gui/lang/eu.json index 1527721ea3..225443c97e 100644 --- a/packages/nc-gui/lang/eu.json +++ b/packages/nc-gui/lang/eu.json @@ -74,7 +74,8 @@ "insertBefore": "Txertatu aurretik", "hideField": "Ezkutatu eremua", "sortAsc": "Ordenatu gorantz", - "sortDesc": "Ordenatu beherantz" + "sortDesc": "Ordenatu beherantz", + "geoDataField": "GeoData Field" }, "objects": { "project": "Proiektua", @@ -98,7 +99,8 @@ "gallery": "Galeria", "form": "Inprimakia", "kanban": "Kanban", - "calendar": "Egutegia" + "calendar": "Egutegia", + "map": "Map" }, "user": "Erabiltzailea", "users": "Erabiltzaileak", @@ -136,6 +138,7 @@ "Currency": "Moneta", "Percent": "Ehunekoa", "Duration": "Iraupena", + "GeoData": "GeoData", "Rating": "Balorazioa", "Formula": "Ekuazioa", "Rollup": "Rollup", @@ -253,6 +256,9 @@ "barcodeFormat": "Barcode format", "qrCodeValueTooLong": "Too many characters for a QR code", "barcodeValueTooLong": "Too many characters for a barcode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Aggregate function", "dbCreateIfNotExists": "Database : create if not exists", "clientKey": "Client Key", @@ -452,6 +458,10 @@ "stackedBy": "Stacked By", "chooseGroupingField": "Choose a Grouping Field", "addOrEditStack": "Add / Edit Stack" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Creator can create new projects and access any invited project.", "orgViewer": "Viewer is not allowed to create new projects but they can access any invited project." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Rows per page", "upload": "Select file to Upload", "upload_sub": "or drag and drop file", @@ -600,6 +615,7 @@ "gallery": "Add Gallery View", "form": "Add Form View", "kanban": "Add Kanban View", + "map": "Add Map View", "calendar": "Add Calendar View" }, "tablesMetadataInSync": "Tables metadata is in Sync", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _", "followingCharactersAreNotAllowed": "Following characters are not allowed", "columnNameRequired": "Column name is required", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Project name exceeds 50 characters", "projectNameCannotStartWithSpace": "Project name cannot start with space", "requiredField": "Required field", From db4432d775671ecde995a73140f283436b9462e8 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:14 +0000 Subject: [PATCH 08/68] New translations en.json (Russian) --- packages/nc-gui/lang/ru.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/ru.json b/packages/nc-gui/lang/ru.json index f67403136d..b388d7eb7d 100644 --- a/packages/nc-gui/lang/ru.json +++ b/packages/nc-gui/lang/ru.json @@ -74,7 +74,8 @@ "insertBefore": "Вставить перед", "hideField": "Скрыть поле", "sortAsc": "По Возрастанию", - "sortDesc": "По убыванию" + "sortDesc": "По убыванию", + "geoDataField": "GeoData Field" }, "objects": { "project": "Проект", @@ -98,7 +99,8 @@ "gallery": "Галерея", "form": "Форма", "kanban": "Канбан", - "calendar": "Календарь" + "calendar": "Календарь", + "map": "Map" }, "user": "Пользователь", "users": "Пользователи", @@ -136,6 +138,7 @@ "Currency": "Валюта", "Percent": "Процент", "Duration": "Интервал времени", + "GeoData": "GeoData", "Rating": "Рейтинг", "Formula": "Формула", "Rollup": "Итоги (Rollup)", @@ -253,6 +256,9 @@ "barcodeFormat": "Формат штрих-кода", "qrCodeValueTooLong": "Слишком много символов для QR-кода", "barcodeValueTooLong": "Слишком много символов для штрихкода", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Агрегатная функция", "dbCreateIfNotExists": "База данных: создать, если не существует", "clientKey": "Ключ клиента", @@ -452,6 +458,10 @@ "stackedBy": "Группировка по", "chooseGroupingField": "Выберите поле группировки", "addOrEditStack": "Добавление / редактирование стека" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Создатель может создавать новые проекты и получать доступ к любому приглашенному проекту.", "orgViewer": "Наблюдатель не может создавать новые проекты, но может получить доступ к любому проекту по приглашению." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Количество строк на странице", "upload": "Выберите файл для загрузки", "upload_sub": "или перетащите файл", @@ -600,6 +615,7 @@ "gallery": "Добавить представление галерея", "form": "Добавить представление форма", "kanban": "Добавить представление Канбан", + "map": "Add Map View", "calendar": "Добавить представление календарь" }, "tablesMetadataInSync": "Таблицы метаданные синхронизируются", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Имя должно начинаться с алфавита или _", "followingCharactersAreNotAllowed": "Нельзя использовать следующие символы", "columnNameRequired": "Требуется название столбца", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Название проекта превышает 50 символов", "projectNameCannotStartWithSpace": "Название проекта не может начинаться с пробела", "requiredField": "Обязательное поле", From 5e36bf2998d53dc1faa8ae1ec94cbf98eaca4fca Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:15 +0000 Subject: [PATCH 09/68] New translations en.json (Ukrainian) --- packages/nc-gui/lang/uk.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/uk.json b/packages/nc-gui/lang/uk.json index 4720215934..2ed4552a0a 100644 --- a/packages/nc-gui/lang/uk.json +++ b/packages/nc-gui/lang/uk.json @@ -74,7 +74,8 @@ "insertBefore": "Вставити перед", "hideField": "Приховати поле", "sortAsc": "За зростанням", - "sortDesc": "За спаданням" + "sortDesc": "За спаданням", + "geoDataField": "GeoData Field" }, "objects": { "project": "Проєкт", @@ -98,7 +99,8 @@ "gallery": "Галерея", "form": "Форма", "kanban": "Канбан", - "calendar": "Календар" + "calendar": "Календар", + "map": "Map" }, "user": "Користувач", "users": "Користувачі", @@ -136,6 +138,7 @@ "Currency": "Валюта", "Percent": "Відсоток", "Duration": "Тривалість", + "GeoData": "GeoData", "Rating": "Рейтинг", "Formula": "Формула", "Rollup": "Накопичення", @@ -253,6 +256,9 @@ "barcodeFormat": "Формат штрих-коду", "qrCodeValueTooLong": "Забагато символів для QR-коду", "barcodeValueTooLong": "Забагато символів для штрих-коду", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Агрегатна функція", "dbCreateIfNotExists": "База даних: створити, якщо не існує", "clientKey": "Ключ клієнта", @@ -452,6 +458,10 @@ "stackedBy": "Групувати по", "chooseGroupingField": "Виберіть поле групування", "addOrEditStack": "Додавання/Редагування Стеку" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Розробник може створювати нові проєкти та мати доступ до будь-якого відкритого проєкту.", "orgViewer": "Глядач не може створювати нові проєкти, але він може отримати доступ до будь-якого відкритого проєкту." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Рядків на сторінці", "upload": "Виберіть файл для завантаження", "upload_sub": "або перетягніть файл", @@ -600,6 +615,7 @@ "gallery": "Додати вигляд галереї", "form": "Додати вигляд форми", "kanban": "Додати вигляд Kanban", + "map": "Add Map View", "calendar": "Додати вигляд календаря" }, "tablesMetadataInSync": "Таблиці метаданих синхронізуються", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Ім'я повинно починатися з літери або _", "followingCharactersAreNotAllowed": "Наступні символи не допускаються", "columnNameRequired": "Ім'я стовпця є обов'язковим", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Назва проєкту перевищує 50 символів", "projectNameCannotStartWithSpace": "Назва проєкту не може починатися з пробілу", "requiredField": "Обов'язкове поле", From 1644eb093c8d3e70eed60d2b9de1e7cd29276e02 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:16 +0000 Subject: [PATCH 10/68] New translations en.json (Chinese Simplified) --- packages/nc-gui/lang/zh-Hans.json | 53 ++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/packages/nc-gui/lang/zh-Hans.json b/packages/nc-gui/lang/zh-Hans.json index 3c52639863..328a296f47 100644 --- a/packages/nc-gui/lang/zh-Hans.json +++ b/packages/nc-gui/lang/zh-Hans.json @@ -67,14 +67,15 @@ "questions": "问题", "reachOut": "联系我们", "betaNote": "此功能仍在测试中。", - "moreInfo": "点击此处了解更多信息。", + "moreInfo": "这里可以找到更多信息", "logs": "日志", "groupingField": "分组字段", "insertAfter": "在右侧插入列", "insertBefore": "在左侧插入列", "hideField": "隐藏字段", "sortAsc": "升序", - "sortDesc": "降序" + "sortDesc": "降序", + "geoDataField": "GeoData Field" }, "objects": { "project": "项目", @@ -98,7 +99,8 @@ "gallery": "画廊", "form": "表单", "kanban": "看板", - "calendar": "日历" + "calendar": "日历", + "map": "Map" }, "user": "用户", "users": "用户", @@ -136,6 +138,7 @@ "Currency": "货币", "Percent": "百分比", "Duration": "时长", + "GeoData": "GeoData", "Rating": "评分", "Formula": "公式", "Rollup": "聚合", @@ -253,6 +256,9 @@ "barcodeFormat": "条形码码制", "qrCodeValueTooLong": "字数超出二维码容量", "barcodeValueTooLong": "字数超出条形码容量", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "汇总功能", "dbCreateIfNotExists": "自动创建数据库", "clientKey": "客户端密钥", @@ -298,7 +304,7 @@ "noData": "暂无数据", "goToDashboard": "转到仪表板", "importing": "导入中", - "flattenNested": "Flatten Nested", + "flattenNested": "扁平化嵌套", "downloadAllowed": "允许下载", "weAreHiring": "我们在招募!", "primaryKey": "主键", @@ -380,14 +386,14 @@ "renameTable": "重命名表格", "deleteTable": "删除表格", "addField": "添加新字段", - "setDisplay": "Set as Display value", + "setDisplay": "设置为显示值", "addRow": "添加新行", "saveRow": "保存行", "saveAndExit": "保存并退出", "saveAndStay": "保存并留在此页", "insertRow": "插入新行", "deleteRow": "删除行", - "duplicateRow": "Duplicate Row", + "duplicateRow": "复制该行", "deleteSelectedRow": "删除所选行", "importExcel": "导入 Excel", "importCSV": "导入 CSV", @@ -452,6 +458,10 @@ "stackedBy": "分类依据为", "chooseGroupingField": "选择分组字段", "addOrEditStack": "添加/编辑分类标签" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -508,16 +518,21 @@ "renderError": "条形码错误 - 请注意输入数据和条形码类型之间的兼容性" }, "nonEditableFields": { - "computedFieldUnableToClear": "Warning: Computed field - unable to clear text", - "qrFieldsCannotBeDirectlyChanged": "Warning: QR fields cannot be directly changed." + "computedFieldUnableToClear": "警告:自动计算的字段无法被清除内容。", + "qrFieldsCannotBeDirectlyChanged": "警告:二维码字段无法更改。" } }, "info": { - "pasteNotSupported": "Paste operation is not supported on the active cell", + "pasteNotSupported": "处于活动状态的单元格不能粘贴内容", "roles": { "orgCreator": "创始人可以创建新项目,访问受邀项目。", "orgViewer": "游客不能创建新项目,仅允许访问受邀项目。" }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "每页行驶", "upload": "选择文件以上传", "upload_sub": "或拖放文件", @@ -600,6 +615,7 @@ "gallery": "添加画廊视图", "form": "添加表单视图", "kanban": "添加看板视图", + "map": "Add Map View", "calendar": "添加日历视图" }, "tablesMetadataInSync": "表元数据同步", @@ -627,18 +643,18 @@ "valueAlreadyInList": "此值已经在列表中", "noColumnsToUpdate": "没有要更新的列", "tableDeleted": "已成功删除表", - "generatePublicShareableReadonlyBase": "Generate publicly shareable readonly base", + "generatePublicShareableReadonlyBase": "生成公开可共享的只读库", "deleteViewConfirmation": "您确定要删除此视图?", "deleteTableConfirmation": "您想要删除该表吗?", "showM2mTables": "显示中间表", - "showM2mTablesDesc": "Many-to-many relation is supported via a junction table & is hidden by default. Enable this option to list all such tables along with existing tables.", - "showNullInCells": "Show NULL in Cells", - "showNullInCellsDesc": "Display 'NULL' tag in cells holding NULL value. This helps differentiate against cells holding EMPTY string.", - "showNullAndEmptyInFilter": "Show NULL and EMPTY in Filter", - "showNullAndEmptyInFilterDesc": "Enable 'additional' filters to differentiate fields containing NULL & Empty Strings. Default support for Blank treats both NULL & Empty strings alike.", + "showM2mTablesDesc": "NocoDB 用来支持多对多关系的中间表默认不可见。打开此选项将显示所有中间表。", + "showNullInCells": "单元格为空时显示 NULL", + "showNullInCellsDesc": "未设置值的单元格将显示 NULL。这是为了和值为空字符串(显示 EMPTY)的单元格作出区分。", + "showNullAndEmptyInFilter": "在过滤器中显示 NULL 和 EMPTY 选项", + "showNullAndEmptyInFilterDesc": "启用”附加”过滤器来区分未设置值(NULL)和值为空字符串(EMPTY)的字段。默认对 NULL 的处理和对空字符串的处理一样。", "deleteKanbanStackConfirmation": "删除这个类别标签也将从 \"{groupingField}\"中删除选择选项 \"{stackToBeDeleted}\"。这类记录将移到未分类的类别中。", - "computedFieldEditWarning": "Computed field: contents are read-only. Use column edit menu to reconfigure", - "computedFieldDeleteWarning": "Computed field: contents are read-only. Unable to clear content.", + "computedFieldEditWarning": "计算字段:此内容是只读的。使用列编辑菜单来重新配置该字段", + "computedFieldDeleteWarning": "计算字段:此内容是只读的。无法清除内容。", "noMoreRecords": "暂无数据" }, "error": { @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "名称应该以字母或 _ 开头", "followingCharactersAreNotAllowed": "不允许使用以下字符", "columnNameRequired": "列名是必填项", + "columnNameExceedsCharacters": "列名的长度超过了 {value} 字符的限制", "projectNameExceeds50Characters": "项目名称超过 50 个字符", "projectNameCannotStartWithSpace": "项目名称不能以空格开头", "requiredField": "必填字段", @@ -722,7 +739,7 @@ }, "success": { "columnDuplicated": "此列的副本创建成功", - "rowDuplicatedWithoutSavedYet": "Row duplicated (not saved)", + "rowDuplicatedWithoutSavedYet": "该行已复制(未保存)", "updatedUIACL": "已成功更新表的 UI ACL", "pluginUninstalled": "插件卸载成功", "pluginSettingsSaved": "插件设置保存成功", From 92b71ce05a7b87c8f5a179a35fc68b7bfc6e14e2 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:17 +0000 Subject: [PATCH 11/68] New translations en.json (Finnish) --- packages/nc-gui/lang/fi.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/fi.json b/packages/nc-gui/lang/fi.json index e1e4dbc96d..d9d6af711b 100644 --- a/packages/nc-gui/lang/fi.json +++ b/packages/nc-gui/lang/fi.json @@ -74,7 +74,8 @@ "insertBefore": "Lisää ennen", "hideField": "Piilota kenttä", "sortAsc": "Lajittelu nouseva", - "sortDesc": "Lajittelu laskeva" + "sortDesc": "Lajittelu laskeva", + "geoDataField": "GeoData Field" }, "objects": { "project": "Hanke", @@ -98,7 +99,8 @@ "gallery": "Galleria", "form": "Lomake", "kanban": "Kanban", - "calendar": "Kalenteri" + "calendar": "Kalenteri", + "map": "Map" }, "user": "Käyttäjä", "users": "Käyttäjät", @@ -136,6 +138,7 @@ "Currency": "Valuutta", "Percent": "Prosentti", "Duration": "Kesto", + "GeoData": "GeoData", "Rating": "Luokitus", "Formula": "Kaava", "Rollup": "Rullaus", @@ -253,6 +256,9 @@ "barcodeFormat": "Viivakoodin muoto", "qrCodeValueTooLong": "Liian monta merkkiä QR-koodiin", "barcodeValueTooLong": "Liikaa merkkejä viivakoodiin", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Kokonaistoiminto", "dbCreateIfNotExists": "Tietokanta: Luo jos ei ole olemassa", "clientKey": "Asiakasnäppäin", @@ -452,6 +458,10 @@ "stackedBy": "Pinottu by", "chooseGroupingField": "Valitse ryhmittelykenttä", "addOrEditStack": "Lisää / Muokkaa pinoa" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Luoja voi luoda uusia projekteja ja käyttää kaikkia kutsuttuja projekteja.", "orgViewer": "Katsoja ei saa luoda uusia projekteja, mutta hän voi käyttää mitä tahansa kutsuttua projektia." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Rivit sivua kohti", "upload": "Valitse lataa tiedosto", "upload_sub": "tai vedä ja pudota tiedosto", @@ -600,6 +615,7 @@ "gallery": "Lisää galleria-näkymä", "form": "Lisää lomake", "kanban": "Lisää Kanban View", + "map": "Add Map View", "calendar": "Lisää kalenteri-näkymä" }, "tablesMetadataInSync": "Taulukot Metatieto on synkronoitu", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Nimen on alettava aakkosilla tai _", "followingCharactersAreNotAllowed": "Seuraavat merkit eivät ole sallittuja", "columnNameRequired": "Sarakkeen nimi vaaditaan", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Hankkeen nimi ylittää 50 merkkiä", "projectNameCannotStartWithSpace": "Projektin nimi ei voi alkaa välilyönnillä", "requiredField": "Pakollinen kenttä", From cf8c4d1fac2f4ada75d46a301f4d8a22948b0fc6 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:18 +0000 Subject: [PATCH 12/68] New translations en.json (Hebrew) --- packages/nc-gui/lang/he.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/he.json b/packages/nc-gui/lang/he.json index 612d3d7b90..cacce26319 100644 --- a/packages/nc-gui/lang/he.json +++ b/packages/nc-gui/lang/he.json @@ -74,7 +74,8 @@ "insertBefore": "Insert Before", "hideField": "Hide Field", "sortAsc": "Sort Ascending", - "sortDesc": "Sort Descending" + "sortDesc": "Sort Descending", + "geoDataField": "GeoData Field" }, "objects": { "project": "פּרוֹיֶקט", @@ -98,7 +99,8 @@ "gallery": "גלריה", "form": "טופס", "kanban": "קאנב\"כ", - "calendar": "לוּחַ שָׁנָה" + "calendar": "לוּחַ שָׁנָה", + "map": "Map" }, "user": "מִשׁתַמֵשׁ", "users": "משתמשים.", @@ -136,6 +138,7 @@ "Currency": "מַטְבֵּעַ", "Percent": "אָחוּז", "Duration": "אורך זמן", + "GeoData": "GeoData", "Rating": "דירוג", "Formula": "נוּסחָה", "Rollup": "Rullup", @@ -253,6 +256,9 @@ "barcodeFormat": "Barcode format", "qrCodeValueTooLong": "Too many characters for a QR code", "barcodeValueTooLong": "Too many characters for a barcode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "פונקציה מצטברת", "dbCreateIfNotExists": "מסד נתונים: צור אם לא קיים", "clientKey": "מפתח הלקוח", @@ -452,6 +458,10 @@ "stackedBy": "Stacked By", "chooseGroupingField": "Choose a Grouping Field", "addOrEditStack": "Add / Edit Stack" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Creator can create new projects and access any invited project.", "orgViewer": "Viewer is not allowed to create new projects but they can access any invited project." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "שורות לדף", "upload": "בחר קובץ להעלאה", "upload_sub": "או גרור ושחרר קובץ", @@ -600,6 +615,7 @@ "gallery": "הוסף תצוגת גלריה", "form": "הוסף טופס View.", "kanban": "הוסף Kanban View.", + "map": "Add Map View", "calendar": "הוסף תצוגת לוח שנה" }, "tablesMetadataInSync": "טבלאות מטא נתונים מסונכרנים", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _", "followingCharactersAreNotAllowed": "Following characters are not allowed", "columnNameRequired": "Column name is required", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Project name exceeds 50 characters", "projectNameCannotStartWithSpace": "Project name cannot start with space", "requiredField": "Required field", From e879d34e61740357f33b23b3f57c480bb7ef0946 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:19 +0000 Subject: [PATCH 13/68] New translations en.json (Italian) --- packages/nc-gui/lang/it.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/it.json b/packages/nc-gui/lang/it.json index 07423e524e..f9ad41d9b6 100644 --- a/packages/nc-gui/lang/it.json +++ b/packages/nc-gui/lang/it.json @@ -74,7 +74,8 @@ "insertBefore": "Inserire prima", "hideField": "Campo nascosto", "sortAsc": "Ordinamento crescente", - "sortDesc": "Ordinamento decrescente" + "sortDesc": "Ordinamento decrescente", + "geoDataField": "GeoData Field" }, "objects": { "project": "Progetto", @@ -98,7 +99,8 @@ "gallery": "Galleria", "form": "Modulo", "kanban": "Kanban", - "calendar": "Calendario" + "calendar": "Calendario", + "map": "Map" }, "user": "Utente", "users": "Utenti", @@ -136,6 +138,7 @@ "Currency": "Moneta", "Percent": "Percento", "Duration": "Durata", + "GeoData": "GeoData", "Rating": "Valutazione", "Formula": "Formula", "Rollup": "Rollup", @@ -253,6 +256,9 @@ "barcodeFormat": "Formato del codice a barre", "qrCodeValueTooLong": "Troppi caratteri per un codice QR", "barcodeValueTooLong": "Troppi caratteri per un codice a barre", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Aggrega funzione", "dbCreateIfNotExists": "Database: crea se non esiste", "clientKey": "Chiave client", @@ -452,6 +458,10 @@ "stackedBy": "Impilato da", "chooseGroupingField": "Scegliere un campo di raggruppamento", "addOrEditStack": "Aggiungere / modificare la pila" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Il Creatore può creare nuovi progetti e accedere a qualsiasi progetto invitato.", "orgViewer": "Il visualizzatore non può creare nuovi progetti, ma può accedere a qualsiasi progetto invitato." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Righe per pagina", "upload": "Seleziona il file da caricare", "upload_sub": "o trascinalo qui", @@ -600,6 +615,7 @@ "gallery": "Aggiungi vista galleria", "form": "Aggiungi vista modulo", "kanban": "Aggiungi vista kanban", + "map": "Add Map View", "calendar": "Aggiungi vista calendario" }, "tablesMetadataInSync": "I metadati delle tabelle sono sincronizzati", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Il nome deve iniziare con un alfabeto o con _", "followingCharactersAreNotAllowed": "I seguenti caratteri non sono ammessi", "columnNameRequired": "Il nome della colonna è richiesto", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Il nome del progetto supera i 50 caratteri", "projectNameCannotStartWithSpace": "Il nome del progetto non può iniziare con uno spazio", "requiredField": "Campo obbligatorio", From 8336f8fd5d98f559154c3081fa2cbe080596f786 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:20 +0000 Subject: [PATCH 14/68] New translations en.json (Japanese) --- packages/nc-gui/lang/ja.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/ja.json b/packages/nc-gui/lang/ja.json index 7cde87decc..03e492f329 100644 --- a/packages/nc-gui/lang/ja.json +++ b/packages/nc-gui/lang/ja.json @@ -74,7 +74,8 @@ "insertBefore": "前に挿入", "hideField": "フィールドを隠す", "sortAsc": "昇順", - "sortDesc": "降順" + "sortDesc": "降順", + "geoDataField": "GeoData Field" }, "objects": { "project": "プロジェクト", @@ -98,7 +99,8 @@ "gallery": "ギャラリー", "form": "フォーム", "kanban": "カンバン", - "calendar": "カレンダー" + "calendar": "カレンダー", + "map": "Map" }, "user": "ユーザー", "users": "ユーザー", @@ -136,6 +138,7 @@ "Currency": "通貨", "Percent": "パーセント", "Duration": "間隔", + "GeoData": "GeoData", "Rating": "レーティング", "Formula": "方式", "Rollup": "ロールアップ", @@ -253,6 +256,9 @@ "barcodeFormat": "バーコードのフォーマット", "qrCodeValueTooLong": "QRコードにするには文字数が多すぎる", "barcodeValueTooLong": "バーコードの文字数が多すぎる", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "集約関数", "dbCreateIfNotExists": "データベース:存在しない場合は作成", "clientKey": "クライアントキー", @@ -452,6 +458,10 @@ "stackedBy": "スタック", "chooseGroupingField": "グループ化するフィールドを選択", "addOrEditStack": "スタックの追加/編集" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "「作成者」は新しいプロジェクトを作成でき、かつ招待されたプロジェクトにもアクセスできます。", "orgViewer": "ビューアーは新規プロジェクトを作成することはできませんが、招待されたプロジェクトにアクセスできます。" }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "1ページあたりの行数", "upload": "アップロードするファイルを選択してください", "upload_sub": "またはファイルをドラッグ & ドロップ", @@ -600,6 +615,7 @@ "gallery": "ギャラリービューを追加", "form": "フォームビューを追加", "kanban": "カンバンビューを追加", + "map": "Add Map View", "calendar": "カレンダービューを追加" }, "tablesMetadataInSync": "テーブルメタデータは同期されています", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "名前はアルファベットまたは_で始まる必要があります", "followingCharactersAreNotAllowed": "以下の文字種は使用できません", "columnNameRequired": "列名が必要です", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "プロジェクト名が50文字を超えています", "projectNameCannotStartWithSpace": "プロジェクト名の先頭にはスペースは利用できません", "requiredField": "必須フィールド", From d1bf1f705326c484fdd371b832d0ea46d47ce5ab Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:21 +0000 Subject: [PATCH 15/68] New translations en.json (Korean) --- packages/nc-gui/lang/ko.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/ko.json b/packages/nc-gui/lang/ko.json index 999a8ed615..99ab014235 100644 --- a/packages/nc-gui/lang/ko.json +++ b/packages/nc-gui/lang/ko.json @@ -74,7 +74,8 @@ "insertBefore": "Insert Before", "hideField": "Hide Field", "sortAsc": "Sort Ascending", - "sortDesc": "Sort Descending" + "sortDesc": "Sort Descending", + "geoDataField": "GeoData Field" }, "objects": { "project": "프로젝트", @@ -98,7 +99,8 @@ "gallery": "갤러리", "form": "폼", "kanban": "칸반", - "calendar": "캘린더" + "calendar": "캘린더", + "map": "Map" }, "user": "사용자", "users": "사용자", @@ -136,6 +138,7 @@ "Currency": "통화", "Percent": "퍼센트", "Duration": "기간", + "GeoData": "GeoData", "Rating": "등급", "Formula": "공식", "Rollup": "롤업", @@ -253,6 +256,9 @@ "barcodeFormat": "Barcode format", "qrCodeValueTooLong": "Too many characters for a QR code", "barcodeValueTooLong": "Too many characters for a barcode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "집합 함수", "dbCreateIfNotExists": "데이터베이스 : 존재하지 않는 경우 생성", "clientKey": "클라이언트 키", @@ -452,6 +458,10 @@ "stackedBy": "Stacked By", "chooseGroupingField": "Choose a Grouping Field", "addOrEditStack": "Add / Edit Stack" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Creator can create new projects and access any invited project.", "orgViewer": "Viewer is not allowed to create new projects but they can access any invited project." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "페이지 당 행", "upload": "업로드 할 파일 선택", "upload_sub": "또는 끌어서 놓기 파일", @@ -600,6 +615,7 @@ "gallery": "갤러리 뷰 추가", "form": "폼 뷰 추가", "kanban": "칸반 뷰 추가", + "map": "Add Map View", "calendar": "캘린더 뷰 추가" }, "tablesMetadataInSync": "테이블 메타 데이터가 동기화되어 있습니다", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _", "followingCharactersAreNotAllowed": "Following characters are not allowed", "columnNameRequired": "Column name is required", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Project name exceeds 50 characters", "projectNameCannotStartWithSpace": "Project name cannot start with space", "requiredField": "Required field", From 6513e69f83fcfb0439e8f6ce5adccb5be351877a Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:22 +0000 Subject: [PATCH 16/68] New translations en.json (Dutch) --- packages/nc-gui/lang/nl.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/nl.json b/packages/nc-gui/lang/nl.json index 0b12f95e1b..004c5205aa 100644 --- a/packages/nc-gui/lang/nl.json +++ b/packages/nc-gui/lang/nl.json @@ -74,7 +74,8 @@ "insertBefore": "Invoegen voor", "hideField": "Verberg veld", "sortAsc": "Oplopend sorteren", - "sortDesc": "Aflopend sorteren" + "sortDesc": "Aflopend sorteren", + "geoDataField": "GeoData Field" }, "objects": { "project": "Project", @@ -98,7 +99,8 @@ "gallery": "Galerij", "form": "Formulier", "kanban": "Kanban", - "calendar": "Kalender" + "calendar": "Kalender", + "map": "Map" }, "user": "Gebruiker", "users": "Gebruikers", @@ -136,6 +138,7 @@ "Currency": "Munteenheid", "Percent": "Procent", "Duration": "Looptijd", + "GeoData": "GeoData", "Rating": "Beoordeling", "Formula": "Formule", "Rollup": "Rollup", @@ -253,6 +256,9 @@ "barcodeFormat": "Barcode formaat", "qrCodeValueTooLong": "Te veel tekens voor een QR-code", "barcodeValueTooLong": "Te veel tekens voor een streepjescode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Geaggregeerde functie", "dbCreateIfNotExists": "Database: creëer als het niet bestaat", "clientKey": "Klantensleutel", @@ -452,6 +458,10 @@ "stackedBy": "Gestapeld door", "chooseGroupingField": "Kies een groepeerveld", "addOrEditStack": "Stapel toevoegen / bewerken" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Creator kan nieuwe projecten aanmaken en heeft toegang tot elk uitgenodigd project.", "orgViewer": "De Viewer mag geen nieuwe projecten aanmaken, maar heeft wel toegang tot elk uitgenodigd project." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Rijen per pagina", "upload": "Selecteer bestand om te uploaden", "upload_sub": "of sleep het bestand naar hier", @@ -600,6 +615,7 @@ "gallery": "Gallerijweergave toevoegen", "form": "Formulierweergave toevoegen", "kanban": "Kanbanweergave toevoegen", + "map": "Add Map View", "calendar": "Kalenderweergave toevoegen" }, "tablesMetadataInSync": "Tabelmetadata is gesynchroniseerd", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "De naam moet beginnen met een alfabet of _", "followingCharactersAreNotAllowed": "De volgende tekens zijn niet toegestaan", "columnNameRequired": "Kolomnaam is verplicht", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Projectnaam meer dan 50 tekens", "projectNameCannotStartWithSpace": "Projectnaam kan niet beginnen met een spatie", "requiredField": "Verplicht veld", From b0687ee9101c6faa3c390e902015f896c0bb61da Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:23 +0000 Subject: [PATCH 17/68] New translations en.json (Norwegian) --- packages/nc-gui/lang/no.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/no.json b/packages/nc-gui/lang/no.json index 62f9b897d2..c4ec420be1 100644 --- a/packages/nc-gui/lang/no.json +++ b/packages/nc-gui/lang/no.json @@ -74,7 +74,8 @@ "insertBefore": "Insert Before", "hideField": "Hide Field", "sortAsc": "Sort Ascending", - "sortDesc": "Sort Descending" + "sortDesc": "Sort Descending", + "geoDataField": "GeoData Field" }, "objects": { "project": "Prosjekt", @@ -98,7 +99,8 @@ "gallery": "Galleri", "form": "Skjema", "kanban": "Kanban", - "calendar": "Kalender" + "calendar": "Kalender", + "map": "Map" }, "user": "Bruker", "users": "Brukere", @@ -136,6 +138,7 @@ "Currency": "Valuta", "Percent": "Prosent", "Duration": "Varighet", + "GeoData": "GeoData", "Rating": "Vurdering", "Formula": "Formel", "Rollup": "Rull opp", @@ -253,6 +256,9 @@ "barcodeFormat": "Barcode format", "qrCodeValueTooLong": "Too many characters for a QR code", "barcodeValueTooLong": "Too many characters for a barcode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Samlet funksjon", "dbCreateIfNotExists": "Database: Opprett hvis ikke eksisterer", "clientKey": "Klientnøkkel", @@ -452,6 +458,10 @@ "stackedBy": "Stacked By", "chooseGroupingField": "Choose a Grouping Field", "addOrEditStack": "Add / Edit Stack" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Creator can create new projects and access any invited project.", "orgViewer": "Viewer is not allowed to create new projects but they can access any invited project." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Rader per side.", "upload": "Velg Fil for å laste opp", "upload_sub": "eller dra og slipp filen", @@ -600,6 +615,7 @@ "gallery": "Legg til galleriutsikt", "form": "Legg til skjemavisning", "kanban": "Legg til Kanban View", + "map": "Add Map View", "calendar": "Legg til kalendervisning" }, "tablesMetadataInSync": "Tabeller Metadata er synkronisert", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _", "followingCharactersAreNotAllowed": "Following characters are not allowed", "columnNameRequired": "Column name is required", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Project name exceeds 50 characters", "projectNameCannotStartWithSpace": "Project name cannot start with space", "requiredField": "Required field", From 2edd24f3fe36ec3b76b9cb66f019cbed2048c309 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:24 +0000 Subject: [PATCH 18/68] New translations en.json (Polish) --- packages/nc-gui/lang/pl.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/pl.json b/packages/nc-gui/lang/pl.json index 082bf75fa7..d3c9dae2c4 100644 --- a/packages/nc-gui/lang/pl.json +++ b/packages/nc-gui/lang/pl.json @@ -74,7 +74,8 @@ "insertBefore": "Wstaw przed", "hideField": "Ukryj pole", "sortAsc": "Sortowanie rosnące", - "sortDesc": "Sortuj malejąco" + "sortDesc": "Sortuj malejąco", + "geoDataField": "GeoData Field" }, "objects": { "project": "Projekt", @@ -98,7 +99,8 @@ "gallery": "Galeria", "form": "Formularz", "kanban": "Kanban", - "calendar": "Kalendarz" + "calendar": "Kalendarz", + "map": "Map" }, "user": "Użytkownik", "users": "Użytkownicy", @@ -136,6 +138,7 @@ "Currency": "Waluta", "Percent": "Procent", "Duration": "Czas trwania", + "GeoData": "GeoData", "Rating": "Ocena", "Formula": "Formuła", "Rollup": "Zliczanie", @@ -253,6 +256,9 @@ "barcodeFormat": "Format kodu kreskowego", "qrCodeValueTooLong": "Zbyt wiele znaków dla kodu QR", "barcodeValueTooLong": "Zbyt wiele znaków dla kodu kreskowego", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Funkcja agregacji", "dbCreateIfNotExists": "Baza danych: Utwórz, jeśli nie istnieje", "clientKey": "Klucz klienta", @@ -452,6 +458,10 @@ "stackedBy": "Ułożone według", "chooseGroupingField": "Wybierz pole grupowania", "addOrEditStack": "Dodaj / Edytuj stos" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Twórca może tworzyć nowe projekty i mieć dostęp do każdego zaproszonego projektu.", "orgViewer": "Widz nie może tworzyć nowych projektów, ale może mieć dostęp do każdego zaproszonego projektu." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Wiersze na stronę", "upload": "Wybierz plik do przesłania", "upload_sub": "lub przeciągnij i upuść plik", @@ -600,6 +615,7 @@ "gallery": "Dodaj widok galerii.", "form": "Dodaj widok formy", "kanban": "Dodaj widok Kanban.", + "map": "Add Map View", "calendar": "Dodaj widok kalendarza" }, "tablesMetadataInSync": "Tabele Metadane są synchronizowane", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Nazwa powinna zaczynać się od alfabetu lub od _", "followingCharactersAreNotAllowed": "Następujące znaki są niedozwolone", "columnNameRequired": "Nazwa kolumny jest wymagana", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Nazwa projektu przekracza 50 znaków", "projectNameCannotStartWithSpace": "Nazwa projektu nie może zaczynać się od spacji", "requiredField": "Pole wymagane", From 36ac75811be747ab68067bc15a87e5f3a5ef6fa3 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:25 +0000 Subject: [PATCH 19/68] New translations en.json (Portuguese) --- packages/nc-gui/lang/pt.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/pt.json b/packages/nc-gui/lang/pt.json index 1444dbe424..93427b42bd 100644 --- a/packages/nc-gui/lang/pt.json +++ b/packages/nc-gui/lang/pt.json @@ -74,7 +74,8 @@ "insertBefore": "Inserir Antes", "hideField": "Ocultar Campo", "sortAsc": "Ordenar Ascendente", - "sortDesc": "Ordenar Descendente" + "sortDesc": "Ordenar Descendente", + "geoDataField": "GeoData Field" }, "objects": { "project": "Projeto", @@ -98,7 +99,8 @@ "gallery": "Galeria", "form": "Formulário", "kanban": "Kanban", - "calendar": "Calendário" + "calendar": "Calendário", + "map": "Map" }, "user": "Do utilizador", "users": "Comercial", @@ -136,6 +138,7 @@ "Currency": "Moeda", "Percent": "Por cento", "Duration": "Duração", + "GeoData": "GeoData", "Rating": "Avaliação", "Formula": "Fórmula", "Rollup": "Rolar", @@ -253,6 +256,9 @@ "barcodeFormat": "Formato do código de barras", "qrCodeValueTooLong": "Demasiados caracteres para um código QR", "barcodeValueTooLong": "Demasiados caracteres para um código de barras", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Função agregada", "dbCreateIfNotExists": "Base de Dados : criar se não existir", "clientKey": "Chave do Cliente", @@ -452,6 +458,10 @@ "stackedBy": "Empilhado por", "chooseGroupingField": "Escolha um Campo de Agrupamento", "addOrEditStack": "Adicionar / Editar Pilha" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "O criador pode criar novos projectos e aceder a qualquer projecto convidado.", "orgViewer": "O espectador não está autorizado a criar novos projectos, mas pode aceder a qualquer projecto convidado." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Linhas por página", "upload": "Selecione Arquivo para upload", "upload_sub": "ou arrastar e soltar arquivo", @@ -600,6 +615,7 @@ "gallery": "Adicionar vista de galeria", "form": "Adicionar vista de formulário", "kanban": "Adicionar vista de Kanban", + "map": "Add Map View", "calendar": "Adicionar vista de calendário" }, "tablesMetadataInSync": "Metadados de tabelas está em sincronia", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "O nome deve começar com um alfabeto ou _", "followingCharactersAreNotAllowed": "Os seguintes caracteres não são permitidos", "columnNameRequired": "O nome da coluna é obrigatório", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "O nome do projecto excede 50 caracteres", "projectNameCannotStartWithSpace": "O nome do projecto não pode começar com espaço", "requiredField": "Campo obrigatório", From f137d649d2edee281df9bb25f0bd903f05aeff8b Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:26 +0000 Subject: [PATCH 20/68] New translations en.json (Slovak) --- packages/nc-gui/lang/sk.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/sk.json b/packages/nc-gui/lang/sk.json index 080d3f3a1b..33846c7b85 100644 --- a/packages/nc-gui/lang/sk.json +++ b/packages/nc-gui/lang/sk.json @@ -74,7 +74,8 @@ "insertBefore": "Vložiť pred", "hideField": "Skryť pole", "sortAsc": "Zoradiť vzostupne", - "sortDesc": "Zoradiť zostupne" + "sortDesc": "Zoradiť zostupne", + "geoDataField": "GeoData Field" }, "objects": { "project": "Projekt", @@ -98,7 +99,8 @@ "gallery": "Galéria", "form": "Formulár", "kanban": "Kanban", - "calendar": "Kalendár" + "calendar": "Kalendár", + "map": "Map" }, "user": "Používateľ", "users": "Používatelia", @@ -136,6 +138,7 @@ "Currency": "Mena", "Percent": "Percentá", "Duration": "Trvanie", + "GeoData": "GeoData", "Rating": "Hodnotenie", "Formula": "Vzorec", "Rollup": "Rollup", @@ -253,6 +256,9 @@ "barcodeFormat": "Formát čiarového kódu", "qrCodeValueTooLong": "Príliš veľa znakov pre kód QR", "barcodeValueTooLong": "Príliš veľa znakov pre čiarový kód", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Súhrnná funkcia", "dbCreateIfNotExists": "Databáza : vytvoriť, ak neexistuje", "clientKey": "Kľúč klienta", @@ -452,6 +458,10 @@ "stackedBy": "Naskladané podľa", "chooseGroupingField": "Výber zoskupovacieho poľa", "addOrEditStack": "Pridať / upraviť zásobník" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Creator môže vytvárať nové projekty a pristupovať k ľubovoľnému pozvanému projektu.", "orgViewer": "Prehliadač nemôže vytvárať nové projekty, ale môže pristupovať k ľubovoľnému pozvanému projektu." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Riadky na stránku", "upload": "Vyberte súbor na odoslanie", "upload_sub": "alebo potiahnite a pustite súbor", @@ -600,6 +615,7 @@ "gallery": "Pridanie zobrazenia galérie", "form": "Pridanie zobrazenia formulára", "kanban": "Pridanie zobrazenia Kanban", + "map": "Add Map View", "calendar": "Pridanie zobrazenia kalendára" }, "tablesMetadataInSync": "Metadáta tabuliek sú synchronizované", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Meno by malo začínať abecedou alebo _", "followingCharactersAreNotAllowed": "Nasledujúce znaky nie sú povolené", "columnNameRequired": "Vyžaduje sa názov stĺpca", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Názov projektu presahuje 50 znakov", "projectNameCannotStartWithSpace": "Názov projektu nemôže začínať medzerou", "requiredField": "Povinné pole", From ae3e8c6c45395f6035ee760013e5ecc83fa6a720 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:27 +0000 Subject: [PATCH 21/68] New translations en.json (Slovenian) --- packages/nc-gui/lang/sl.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/sl.json b/packages/nc-gui/lang/sl.json index 61b37fbc8a..628409afd4 100644 --- a/packages/nc-gui/lang/sl.json +++ b/packages/nc-gui/lang/sl.json @@ -74,7 +74,8 @@ "insertBefore": "Vstavljanje pred", "hideField": "Skrij polje", "sortAsc": "Razvrsti naraščajoče", - "sortDesc": "Razvrsti padajoče" + "sortDesc": "Razvrsti padajoče", + "geoDataField": "GeoData Field" }, "objects": { "project": "Project.", @@ -98,7 +99,8 @@ "gallery": "Galerija", "form": "Obrazec", "kanban": "Kanban", - "calendar": "Koledar" + "calendar": "Koledar", + "map": "Map" }, "user": "Uporabnik", "users": "Uporabniki", @@ -136,6 +138,7 @@ "Currency": "Valuta", "Percent": "Odstotek", "Duration": "Trajanje", + "GeoData": "GeoData", "Rating": "Ocena", "Formula": "Formula", "Rollup": "Zavihamo", @@ -253,6 +256,9 @@ "barcodeFormat": "Format črtne kode", "qrCodeValueTooLong": "Preveč znakov za kodo QR", "barcodeValueTooLong": "Preveč znakov za črtno kodo", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Agregatna funkcija", "dbCreateIfNotExists": "Baza podatkov: Ustvari, če ne obstaja", "clientKey": "Odjemalski ključ", @@ -452,6 +458,10 @@ "stackedBy": "Zloženo po", "chooseGroupingField": "Izberite polje za združevanje", "addOrEditStack": "Dodajanje / urejanje sklada" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Ustvarjalec lahko ustvarja nove projekte in dostopa do vseh povabljenih projektov.", "orgViewer": "Pregledovalec ne sme ustvarjati novih projektov, lahko pa dostopa do vseh povabljenih projektov." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Vrstice na stran.", "upload": "Izberite datoteko za nalaganje", "upload_sub": "ali datoteko povlecite in spustite", @@ -600,6 +615,7 @@ "gallery": "Dodaj ogled galerije", "form": "Dodaj pogled obrazca", "kanban": "Dodaj pogled Kanban-a", + "map": "Add Map View", "calendar": "Dodaj pogled koledarja" }, "tablesMetadataInSync": "Tabele metapodatkov je v sinhronizaciji", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Ime se mora začeti z abecedo ali _", "followingCharactersAreNotAllowed": "Naslednji znaki niso dovoljeni", "columnNameRequired": "Ime stolpca je obvezno", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Ime projekta presega 50 znakov", "projectNameCannotStartWithSpace": "Ime projekta se ne sme začeti s presledkom", "requiredField": "Obvezno polje", From 321e41446541af1415f2b226ff6d5923a5b23d39 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:28 +0000 Subject: [PATCH 22/68] New translations en.json (Swedish) --- packages/nc-gui/lang/sv.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/sv.json b/packages/nc-gui/lang/sv.json index de04bf3d48..ee63c50cfd 100644 --- a/packages/nc-gui/lang/sv.json +++ b/packages/nc-gui/lang/sv.json @@ -74,7 +74,8 @@ "insertBefore": "Infoga före", "hideField": "Dölj fältet", "sortAsc": "Sortera i stigande riktning", - "sortDesc": "Sortera fallande" + "sortDesc": "Sortera fallande", + "geoDataField": "GeoData Field" }, "objects": { "project": "Projekt", @@ -98,7 +99,8 @@ "gallery": "Galleri", "form": "Formulär", "kanban": "Kanban", - "calendar": "Kalender" + "calendar": "Kalender", + "map": "Map" }, "user": "Användare", "users": "Användare", @@ -136,6 +138,7 @@ "Currency": "Valuta", "Percent": "Procent", "Duration": "Varaktighet", + "GeoData": "GeoData", "Rating": "Betyg", "Formula": "Formel", "Rollup": "Rulla upp", @@ -253,6 +256,9 @@ "barcodeFormat": "Streckkodsformat", "qrCodeValueTooLong": "För många tecken för en QR-kod", "barcodeValueTooLong": "För många tecken för en streckkod", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Aggregatfunktion", "dbCreateIfNotExists": "Databas: Skapa om det inte finns", "clientKey": "Klientnyckel", @@ -452,6 +458,10 @@ "stackedBy": "Staplade av", "chooseGroupingField": "Välj ett grupperingsfält", "addOrEditStack": "Lägg till/redigera stacken" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Skaparen kan skapa nya projekt och få tillgång till alla inbjudna projekt.", "orgViewer": "Visaren får inte skapa nya projekt, men kan få tillgång till alla inbjudna projekt." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Rader per sida", "upload": "Välj fil för att ladda upp", "upload_sub": "eller dra och släpp filen", @@ -600,6 +615,7 @@ "gallery": "Lägg till Gallery View", "form": "Lägg till formulärvy", "kanban": "Lägg till Kanban View", + "map": "Add Map View", "calendar": "Lägg till kalendervisning" }, "tablesMetadataInSync": "Tabeller Metadata är synkroniserad", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Namnet ska börja med ett alfabet eller _", "followingCharactersAreNotAllowed": "Följande tecken är inte tillåtna", "columnNameRequired": "Kolumnnamn krävs", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Projektnamnet har mer än 50 tecken", "projectNameCannotStartWithSpace": "Projektnamnet kan inte börja med ett mellanslag", "requiredField": "Obligatoriskt fält", From 96b1ac8395890bee26b31cf0e94cb1796354368d Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:29 +0000 Subject: [PATCH 23/68] New translations en.json (Turkish) --- packages/nc-gui/lang/tr.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/tr.json b/packages/nc-gui/lang/tr.json index 1ecc9d6aac..23ad9a2bf6 100644 --- a/packages/nc-gui/lang/tr.json +++ b/packages/nc-gui/lang/tr.json @@ -74,7 +74,8 @@ "insertBefore": "Önce Ekle", "hideField": "Alanı Gizle", "sortAsc": "Artan Sırala", - "sortDesc": "Azalan Sıralama" + "sortDesc": "Azalan Sıralama", + "geoDataField": "GeoData Field" }, "objects": { "project": "Proje", @@ -98,7 +99,8 @@ "gallery": "Galeri", "form": "Form", "kanban": "Kanban", - "calendar": "Takvim" + "calendar": "Takvim", + "map": "Map" }, "user": "Kullanıcı", "users": "Kullanıcılar", @@ -136,6 +138,7 @@ "Currency": "Para birimi", "Percent": "Yüzde", "Duration": "Süre", + "GeoData": "GeoData", "Rating": "Değerlendirme", "Formula": "Formül", "Rollup": "Referans hesapla", @@ -253,6 +256,9 @@ "barcodeFormat": "Barkod formatı", "qrCodeValueTooLong": "QR kodu için çok fazla karakter", "barcodeValueTooLong": "Barkod için çok fazla karakter", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Birleştirme fonksiyonu", "dbCreateIfNotExists": "Veritabanı : yoksa oluştur", "clientKey": "İstemci Anahtarı", @@ -452,6 +458,10 @@ "stackedBy": "Tarafından Yığılmış", "chooseGroupingField": "Bir Gruplama Alanı Seçin", "addOrEditStack": "Yığın Ekle / Düzenle" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "İçerik oluşturucu yeni projeler oluşturabilir ve davet edilen herhangi bir projeye erişebilir.", "orgViewer": "İzleyicinin yeni proje oluşturmasına izin verilmez ancak davet edilen herhangi bir projeye erişebilir." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Sayfa başına satır", "upload": "Yüklenecek Dosyayı Seçin", "upload_sub": "veya dosyayı sürükleyip bırakın", @@ -600,6 +615,7 @@ "gallery": "Galeri görünümü ekle", "form": "Form görünümü ekle", "kanban": "Kanban görünümü ekle", + "map": "Add Map View", "calendar": "Takvim görünümü ekle" }, "tablesMetadataInSync": "Tablonun meta verileri senkronize", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "İsim bir alfabe veya _ ile başlamalıdır", "followingCharactersAreNotAllowed": "Aşağıdaki karakterlere izin verilmez", "columnNameRequired": "Sütun adı gereklidir", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Proje adı 50 karakteri aşıyor", "projectNameCannotStartWithSpace": "Proje adı boşlukla başlayamaz", "requiredField": "Zorunlu alan", From e7d65488b37a7ab6879d5f24a91234cd91097be3 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:30 +0000 Subject: [PATCH 24/68] New translations en.json (Chinese Traditional) --- packages/nc-gui/lang/zh-Hant.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/zh-Hant.json b/packages/nc-gui/lang/zh-Hant.json index e51d2eedd5..18a6d91fe0 100644 --- a/packages/nc-gui/lang/zh-Hant.json +++ b/packages/nc-gui/lang/zh-Hant.json @@ -74,7 +74,8 @@ "insertBefore": "Insert Before", "hideField": "Hide Field", "sortAsc": "Sort Ascending", - "sortDesc": "Sort Descending" + "sortDesc": "Sort Descending", + "geoDataField": "GeoData Field" }, "objects": { "project": "項目", @@ -98,7 +99,8 @@ "gallery": "相簿", "form": "表單", "kanban": "看板", - "calendar": "日曆" + "calendar": "日曆", + "map": "Map" }, "user": "使用者", "users": "使用者", @@ -136,6 +138,7 @@ "Currency": "貨幣", "Percent": "百分", "Duration": "期間", + "GeoData": "GeoData", "Rating": "評分", "Formula": "公式", "Rollup": "捲起", @@ -253,6 +256,9 @@ "barcodeFormat": "Barcode format", "qrCodeValueTooLong": "Too many characters for a QR code", "barcodeValueTooLong": "Too many characters for a barcode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "匯總功能", "dbCreateIfNotExists": "資料庫:不存在則建立", "clientKey": "用戶端金鑰", @@ -452,6 +458,10 @@ "stackedBy": "Stacked By", "chooseGroupingField": "Choose a Grouping Field", "addOrEditStack": "Add / Edit Stack" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "建立者可以建立專案與存取任何受邀請的專案", "orgViewer": "檢視者不能建立專案但可以存取任何受邀請的專案" }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "每頁行駛", "upload": "選擇檔案以上傳", "upload_sub": "或拖放檔案", @@ -600,6 +615,7 @@ "gallery": "加入相簿檢視", "form": "加入表單檢視", "kanban": "加入看板檢視", + "map": "Add Map View", "calendar": "加入日曆檢視" }, "tablesMetadataInSync": "表元數據同步", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "名稱必須用 英文字母 或 _ 當開頭", "followingCharactersAreNotAllowed": "Following characters are not allowed", "columnNameRequired": "欄位名稱必填", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "專案名稱超過 50 個字元", "projectNameCannotStartWithSpace": "專案名稱不能有空白開頭", "requiredField": "必填欄位", From 9ae43effe5b89312eaf61670a967329ed85aac6f Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:30 +0000 Subject: [PATCH 25/68] New translations en.json (English) --- packages/nc-gui/lang/en.json | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/en.json b/packages/nc-gui/lang/en.json index bdbc84d36d..7674e26aff 100644 --- a/packages/nc-gui/lang/en.json +++ b/packages/nc-gui/lang/en.json @@ -74,7 +74,8 @@ "insertBefore": "Insert Before", "hideField": "Hide Field", "sortAsc": "Sort Ascending", - "sortDesc": "Sort Descending" + "sortDesc": "Sort Descending", + "geoDataField": "GeoData Field" }, "objects": { "project": "Project", @@ -98,7 +99,8 @@ "gallery": "Gallery", "form": "Form", "kanban": "Kanban", - "calendar": "Calendar" + "calendar": "Calendar", + "map": "Map" }, "user": "User", "users": "Users", @@ -136,6 +138,7 @@ "Currency": "Currency", "Percent": "Percent", "Duration": "Duration", + "GeoData": "GeoData", "Rating": "Rating", "Formula": "Formula", "Rollup": "Rollup", @@ -253,6 +256,9 @@ "barcodeFormat": "Barcode format", "qrCodeValueTooLong": "Too many characters for a QR code", "barcodeValueTooLong": "Too many characters for a barcode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Aggregate function", "dbCreateIfNotExists": "Database : create if not exists", "clientKey": "Client Key", @@ -452,6 +458,10 @@ "stackedBy": "Stacked By", "chooseGroupingField": "Choose a Grouping Field", "addOrEditStack": "Add / Edit Stack" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Creator can create new projects and access any invited project.", "orgViewer": "Viewer is not allowed to create new projects but they can access any invited project." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Rows per page", "upload": "Select file to Upload", "upload_sub": "or drag and drop file", @@ -600,6 +615,7 @@ "gallery": "Add Gallery View", "form": "Add Form View", "kanban": "Add Kanban View", + "map": "Add Map View", "calendar": "Add Calendar View" }, "tablesMetadataInSync": "Tables metadata is in Sync", From 1e01fbf2081342da4d070ed5f57c4b32eb5c7f85 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:31 +0000 Subject: [PATCH 26/68] New translations en.json (Vietnamese) --- packages/nc-gui/lang/vi.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/vi.json b/packages/nc-gui/lang/vi.json index 8d2e9ba7be..95b6ae905c 100644 --- a/packages/nc-gui/lang/vi.json +++ b/packages/nc-gui/lang/vi.json @@ -74,7 +74,8 @@ "insertBefore": "Insert Before", "hideField": "Hide Field", "sortAsc": "Sort Ascending", - "sortDesc": "Sort Descending" + "sortDesc": "Sort Descending", + "geoDataField": "GeoData Field" }, "objects": { "project": "Dự định", @@ -98,7 +99,8 @@ "gallery": "Bộ sưu tập", "form": "Mẫu đơn", "kanban": "Kanban.", - "calendar": "Lịch" + "calendar": "Lịch", + "map": "Map" }, "user": "Người dùng", "users": "Người dùng", @@ -136,6 +138,7 @@ "Currency": "Tiền tệ", "Percent": "Phần trăm", "Duration": "Khoảng thời gian", + "GeoData": "GeoData", "Rating": "Xếp hạng", "Formula": "Công thức", "Rollup": "ROLLUP.", @@ -253,6 +256,9 @@ "barcodeFormat": "Barcode format", "qrCodeValueTooLong": "Too many characters for a QR code", "barcodeValueTooLong": "Too many characters for a barcode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Chức năng tổng hợp", "dbCreateIfNotExists": "Cơ sở dữ liệu: Tạo nếu không tồn tại", "clientKey": "Khóa khách", @@ -452,6 +458,10 @@ "stackedBy": "Stacked By", "chooseGroupingField": "Choose a Grouping Field", "addOrEditStack": "Add / Edit Stack" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Creator can create new projects and access any invited project.", "orgViewer": "Viewer is not allowed to create new projects but they can access any invited project." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Hàng trên mỗi trang", "upload": "Chọn tệp để tải lên", "upload_sub": "hoặc kéo và thả tập tin", @@ -600,6 +615,7 @@ "gallery": "Thêm Gallery View.", "form": "Thêm hình thức xem", "kanban": "Thêm tầm nhìn Kanban", + "map": "Add Map View", "calendar": "Thêm chế độ xem lịch" }, "tablesMetadataInSync": "Bảng siêu dữ liệu được đồng bộ hóa", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _", "followingCharactersAreNotAllowed": "Following characters are not allowed", "columnNameRequired": "Column name is required", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Project name exceeds 50 characters", "projectNameCannotStartWithSpace": "Project name cannot start with space", "requiredField": "Required field", From 8931f94a4f861286266ce0bb5aac03e6a78c8a00 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:32 +0000 Subject: [PATCH 27/68] New translations en.json (Portuguese, Brazilian) --- packages/nc-gui/lang/pt_BR.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/pt_BR.json b/packages/nc-gui/lang/pt_BR.json index 3e090fa336..49ee9dff36 100644 --- a/packages/nc-gui/lang/pt_BR.json +++ b/packages/nc-gui/lang/pt_BR.json @@ -74,7 +74,8 @@ "insertBefore": "Inserir Antes", "hideField": "Ocultar Campo", "sortAsc": "Ordenar Ascendente", - "sortDesc": "Ordenar Descendente" + "sortDesc": "Ordenar Descendente", + "geoDataField": "GeoData Field" }, "objects": { "project": "Projeto", @@ -98,7 +99,8 @@ "gallery": "Galeria", "form": "Formulário", "kanban": "Kanban", - "calendar": "Calendário" + "calendar": "Calendário", + "map": "Map" }, "user": "Do utilizador", "users": "Comercial", @@ -136,6 +138,7 @@ "Currency": "Moeda", "Percent": "Por cento", "Duration": "Duração", + "GeoData": "GeoData", "Rating": "Avaliação", "Formula": "Fórmula", "Rollup": "Rolar", @@ -253,6 +256,9 @@ "barcodeFormat": "Formato do código de barras", "qrCodeValueTooLong": "Demasiados caracteres para um código QR", "barcodeValueTooLong": "Demasiados caracteres para um código de barras", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Função agregada", "dbCreateIfNotExists": "Base de Dados : criar se não existir", "clientKey": "Chave do Cliente", @@ -452,6 +458,10 @@ "stackedBy": "Empilhado por", "chooseGroupingField": "Escolha um Campo de Agrupamento", "addOrEditStack": "Adicionar / Editar Pilha" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "O criador pode criar novos projectos e aceder a qualquer projecto convidado.", "orgViewer": "O espectador não está autorizado a criar novos projectos, mas pode aceder a qualquer projecto convidado." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Linhas por página", "upload": "Selecione Arquivo para upload", "upload_sub": "ou arrastar e soltar arquivo", @@ -600,6 +615,7 @@ "gallery": "Adicionar vizualização de galeria", "form": "Adicionar vizualização de formulário", "kanban": "Adicionar vizualização de Kanban", + "map": "Add Map View", "calendar": "Adicionar vizualização de calendário" }, "tablesMetadataInSync": "Metadados de tabelas está em sincronia", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "O nome deve começar com um alfabeto ou _", "followingCharactersAreNotAllowed": "Os seguintes caracteres não são permitidos", "columnNameRequired": "O nome da coluna é obrigatório", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "O nome do projecto excede 50 caracteres", "projectNameCannotStartWithSpace": "O nome do projecto não pode começar com espaço", "requiredField": "Campo obrigatório", From e82434770794e604102eb77ac302537af005572b Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:33 +0000 Subject: [PATCH 28/68] New translations en.json (Indonesian) --- packages/nc-gui/lang/id.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/id.json b/packages/nc-gui/lang/id.json index dda93cd5c0..dd5ae4a49c 100644 --- a/packages/nc-gui/lang/id.json +++ b/packages/nc-gui/lang/id.json @@ -74,7 +74,8 @@ "insertBefore": "Sisipkan Sebelum", "hideField": "Sembunyikan Bidang", "sortAsc": "Urutkan Menaik", - "sortDesc": "Urutkan Menurun" + "sortDesc": "Urutkan Menurun", + "geoDataField": "GeoData Field" }, "objects": { "project": "Proyek", @@ -98,7 +99,8 @@ "gallery": "Galeri", "form": "Membentuk", "kanban": "Kanban.", - "calendar": "Kalender" + "calendar": "Kalender", + "map": "Map" }, "user": "Pengguna", "users": "Pengguna.", @@ -136,6 +138,7 @@ "Currency": "Mata uang", "Percent": "Persen", "Duration": "Durasi", + "GeoData": "GeoData", "Rating": "Peringkat", "Formula": "Rumus", "Rollup": "Rollup.", @@ -253,6 +256,9 @@ "barcodeFormat": "Format kode batang", "qrCodeValueTooLong": "Terlalu banyak karakter untuk kode QR", "barcodeValueTooLong": "Terlalu banyak karakter untuk barcode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Fungsi agregat.", "dbCreateIfNotExists": "Basis Data: Buat jika tidak ada", "clientKey": "Kunci klien", @@ -452,6 +458,10 @@ "stackedBy": "Ditumpuk oleh", "chooseGroupingField": "Pilih Bidang Pengelompokan", "addOrEditStack": "Tambah / Edit Tumpukan" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Kreator dapat membuat proyek baru dan mengakses proyek yang diundang.", "orgViewer": "Penonton tidak diizinkan untuk membuat proyek baru, tetapi mereka dapat mengakses proyek yang diundang." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Baris per halaman", "upload": "Pilih file untuk diunggah", "upload_sub": "atau seret dan jatuhkan file", @@ -600,6 +615,7 @@ "gallery": "Tambahkan Tampilan Galeri", "form": "Tambahkan tampilan formulir", "kanban": "Tambahkan Kanban Lihat", + "map": "Add Map View", "calendar": "Tambahkan tampilan kalender" }, "tablesMetadataInSync": "Tabel metadata sedang disinkronkan", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Nama harus dimulai dengan alfabet atau _", "followingCharactersAreNotAllowed": "Karakter berikut tidak diperbolehkan", "columnNameRequired": "Nama kolom harus diisi", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Nama proyek melebihi 50 karakter", "projectNameCannotStartWithSpace": "Nama proyek tidak boleh dimulai dengan spasi", "requiredField": "Bidang yang dibutuhkan", From 187495052ce6044794f4321bf24c45639ba687ee Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:34 +0000 Subject: [PATCH 29/68] New translations en.json (Persian) --- packages/nc-gui/lang/fa.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/fa.json b/packages/nc-gui/lang/fa.json index 475643336f..143ebc22da 100644 --- a/packages/nc-gui/lang/fa.json +++ b/packages/nc-gui/lang/fa.json @@ -74,7 +74,8 @@ "insertBefore": "Insert Before", "hideField": "Hide Field", "sortAsc": "Sort Ascending", - "sortDesc": "Sort Descending" + "sortDesc": "Sort Descending", + "geoDataField": "GeoData Field" }, "objects": { "project": "پروژه", @@ -98,7 +99,8 @@ "gallery": "گالری", "form": "فرم", "kanban": "کانبان", - "calendar": "تقویم" + "calendar": "تقویم", + "map": "Map" }, "user": "کاربر", "users": "کاربران", @@ -136,6 +138,7 @@ "Currency": "واحد پول", "Percent": "درصد", "Duration": "مدت زمان", + "GeoData": "GeoData", "Rating": "امتیاز", "Formula": "فرمول", "Rollup": "تجمیع کردن", @@ -253,6 +256,9 @@ "barcodeFormat": "Barcode format", "qrCodeValueTooLong": "Too many characters for a QR code", "barcodeValueTooLong": "Too many characters for a barcode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "تابع جمع", "dbCreateIfNotExists": "پایگاه داده: ایجاد در صورت عدم وجود", "clientKey": "کلید Client", @@ -452,6 +458,10 @@ "stackedBy": "Stacked By", "chooseGroupingField": "Choose a Grouping Field", "addOrEditStack": "Add / Edit Stack" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Creator can create new projects and access any invited project.", "orgViewer": "Viewer is not allowed to create new projects but they can access any invited project." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "تعداد ردیف‌ها در هر صفحه", "upload": "فایل را برای بارگذاری انتخاب کنید", "upload_sub": "یا فایل را بکشید و رها کنید", @@ -600,6 +615,7 @@ "gallery": "افزودن نمایش گالری", "form": "افزودن نمایش فرم", "kanban": "افزودن نمایش کانبان", + "map": "Add Map View", "calendar": "افزودن نمایش تقویم" }, "tablesMetadataInSync": "متاداده جداول در حالت همگام‌سازی است", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _", "followingCharactersAreNotAllowed": "Following characters are not allowed", "columnNameRequired": "Column name is required", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Project name exceeds 50 characters", "projectNameCannotStartWithSpace": "Project name cannot start with space", "requiredField": "Required field", From da48b42638dd87d83f555f2f5ff3a8dea0a72f03 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:36 +0000 Subject: [PATCH 30/68] New translations en.json (Thai) --- packages/nc-gui/lang/th.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/th.json b/packages/nc-gui/lang/th.json index a08a489270..53197156b0 100644 --- a/packages/nc-gui/lang/th.json +++ b/packages/nc-gui/lang/th.json @@ -74,7 +74,8 @@ "insertBefore": "Insert Before", "hideField": "Hide Field", "sortAsc": "Sort Ascending", - "sortDesc": "Sort Descending" + "sortDesc": "Sort Descending", + "geoDataField": "GeoData Field" }, "objects": { "project": "โครงการ", @@ -98,7 +99,8 @@ "gallery": "แกลลอรี่", "form": "รูปร่าง", "kanban": "ภาษาคณาตา", - "calendar": "ปฏิทิน" + "calendar": "ปฏิทิน", + "map": "Map" }, "user": "ผู้ใช้", "users": "ผู้ใช้", @@ -136,6 +138,7 @@ "Currency": "สกุลเงิน", "Percent": "ร้อยละ", "Duration": "ระยะเวลา", + "GeoData": "GeoData", "Rating": "การจัดอันดับ", "Formula": "สูตร", "Rollup": "ม้วน", @@ -253,6 +256,9 @@ "barcodeFormat": "Barcode format", "qrCodeValueTooLong": "Too many characters for a QR code", "barcodeValueTooLong": "Too many characters for a barcode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "ฟังก์ชั่นรวม", "dbCreateIfNotExists": "ฐานข้อมูล: สร้างถ้าไม่มีอยู่", "clientKey": "รหัสลูกค้า", @@ -452,6 +458,10 @@ "stackedBy": "Stacked By", "chooseGroupingField": "Choose a Grouping Field", "addOrEditStack": "Add / Edit Stack" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Creator can create new projects and access any invited project.", "orgViewer": "Viewer is not allowed to create new projects but they can access any invited project." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "แถวต่อหน้า", "upload": "เลือกไฟล์ที่จะอัปโหลด", "upload_sub": "หรือลากและวางไฟล์", @@ -600,6 +615,7 @@ "gallery": "เพิ่มมุมมองแกลลอรี่", "form": "เพิ่มมุมมองแบบฟอร์ม", "kanban": "เพิ่มมุมมอง Kanban", + "map": "Add Map View", "calendar": "เพิ่มมุมมองปฏิทิน" }, "tablesMetadataInSync": "ตารางเมตาดาต้ากำลังซิงค์", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _", "followingCharactersAreNotAllowed": "Following characters are not allowed", "columnNameRequired": "Column name is required", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Project name exceeds 50 characters", "projectNameCannotStartWithSpace": "Project name cannot start with space", "requiredField": "Required field", From 7550ec4c26c487f4663727a38e3685b13683b8ca Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:36 +0000 Subject: [PATCH 31/68] New translations en.json (Croatian) --- packages/nc-gui/lang/hr.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/hr.json b/packages/nc-gui/lang/hr.json index 953fa0869b..d24505daeb 100644 --- a/packages/nc-gui/lang/hr.json +++ b/packages/nc-gui/lang/hr.json @@ -74,7 +74,8 @@ "insertBefore": "Insert Before", "hideField": "Hide Field", "sortAsc": "Sort Ascending", - "sortDesc": "Sort Descending" + "sortDesc": "Sort Descending", + "geoDataField": "GeoData Field" }, "objects": { "project": "Projekt", @@ -98,7 +99,8 @@ "gallery": "Galerija", "form": "Oblik", "kanban": "Kanban", - "calendar": "Kalendar" + "calendar": "Kalendar", + "map": "Map" }, "user": "Korisnik", "users": "Korisnik", @@ -136,6 +138,7 @@ "Currency": "Valuta", "Percent": "Postotak", "Duration": "Trajanje", + "GeoData": "GeoData", "Rating": "Ocjena", "Formula": "Formula", "Rollup": "Valjak", @@ -253,6 +256,9 @@ "barcodeFormat": "Barcode format", "qrCodeValueTooLong": "Too many characters for a QR code", "barcodeValueTooLong": "Too many characters for a barcode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Agregatna funkcija", "dbCreateIfNotExists": "Baza podataka: stvoriti ako ne postoji", "clientKey": "Ključ klijenta", @@ -452,6 +458,10 @@ "stackedBy": "Stacked By", "chooseGroupingField": "Choose a Grouping Field", "addOrEditStack": "Add / Edit Stack" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Creator can create new projects and access any invited project.", "orgViewer": "Viewer is not allowed to create new projects but they can access any invited project." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "Redaka po stranici", "upload": "Odaberite datoteku za prijenos", "upload_sub": "ili povucite i ispustite datoteku", @@ -600,6 +615,7 @@ "gallery": "Dodajte pogled na galeriju", "form": "Dodajte prikaz obrasca", "kanban": "Dodajte Kanban pogled", + "map": "Add Map View", "calendar": "Dodajte prikaz kalendara" }, "tablesMetadataInSync": "Metapodaci tablice se sinkroniziraju", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _", "followingCharactersAreNotAllowed": "Following characters are not allowed", "columnNameRequired": "Column name is required", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Project name exceeds 50 characters", "projectNameCannotStartWithSpace": "Project name cannot start with space", "requiredField": "Required field", From 3d8b95700effe1a709f9fddce74df0e4c6d08051 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:38 +0000 Subject: [PATCH 32/68] New translations en.json (Latvian) --- packages/nc-gui/lang/lv.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/lv.json b/packages/nc-gui/lang/lv.json index 8e0da88a4f..b859e014fd 100644 --- a/packages/nc-gui/lang/lv.json +++ b/packages/nc-gui/lang/lv.json @@ -74,7 +74,8 @@ "insertBefore": "Ievietot pirms", "hideField": "Slēpt lauku", "sortAsc": "Kārtot augošā secībā", - "sortDesc": "Kārtot dilstošā secībā" + "sortDesc": "Kārtot dilstošā secībā", + "geoDataField": "GeoData Field" }, "objects": { "project": "Projekts", @@ -98,7 +99,8 @@ "gallery": "Galerija", "form": "Forma", "kanban": "Kanban", - "calendar": "Kalendārs" + "calendar": "Kalendārs", + "map": "Map" }, "user": "Lietotājs", "users": "Lietotāji", @@ -136,6 +138,7 @@ "Currency": "Valūta", "Percent": "Procenti", "Duration": "Ilgums", + "GeoData": "GeoData", "Rating": "Vērtējums", "Formula": "Formula", "Rollup": "Apkopojums", @@ -253,6 +256,9 @@ "barcodeFormat": "Svītrkoda formāts", "qrCodeValueTooLong": "Pārāk daudz rakstzīmju QR kodam", "barcodeValueTooLong": "Pārāk daudz zīmju svītrkodam", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "Agregācijas funkcija", "dbCreateIfNotExists": "Datubāze : izveidotm ja neeksistē", "clientKey": "Klienta atslēga", @@ -452,6 +458,10 @@ "stackedBy": "Sakrautas ar", "chooseGroupingField": "Izvēlieties grupēšanas lauku", "addOrEditStack": "Pievienot / rediģēt kaudzi" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Radītājs var izveidot jaunus projektus un piekļūt jebkuram uzaicinātajam projektam.", "orgViewer": "Skatītājs nedrīkst veidot jaunus projektus, bet var piekļūt jebkuram uzaicinātajam projektam." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "ieraksti lapā", "upload": "Izvēlēties datni augšupielādei", "upload_sub": "vai vilkt un nomest datni", @@ -600,6 +615,7 @@ "gallery": "Pievienot galerijas skatu", "form": "Pievienot formas skatu", "kanban": "Pievienot Kanban skatu", + "map": "Add Map View", "calendar": "Pievienot kalendāra skatu" }, "tablesMetadataInSync": "Tabulu metadati ir sinhronizācijā", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Vārdam jāsākas ar alfabētu vai _", "followingCharactersAreNotAllowed": "Šādas rakstzīmes nav atļautas", "columnNameRequired": "Slejas nosaukums ir obligāts", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Projekta nosaukums pārsniedz 50 rakstzīmes", "projectNameCannotStartWithSpace": "Projekta nosaukums nedrīkst sākties ar atstarpi", "requiredField": "Obligātais lauks", From 7f84cf12392d6ce34c890d3ef0f59fc28c4d2f17 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:39 +0000 Subject: [PATCH 33/68] New translations en.json (Hindi) --- packages/nc-gui/lang/hi.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/hi.json b/packages/nc-gui/lang/hi.json index 66c393a922..5740c4e26a 100644 --- a/packages/nc-gui/lang/hi.json +++ b/packages/nc-gui/lang/hi.json @@ -74,7 +74,8 @@ "insertBefore": "Insert Before", "hideField": "Hide Field", "sortAsc": "Sort Ascending", - "sortDesc": "Sort Descending" + "sortDesc": "Sort Descending", + "geoDataField": "GeoData Field" }, "objects": { "project": "परियोजना", @@ -98,7 +99,8 @@ "gallery": "गेलरी", "form": "प्रपत्र", "kanban": "Kanban", - "calendar": "पंचांग" + "calendar": "पंचांग", + "map": "Map" }, "user": "उपयोगकर्ता", "users": "उपयोगकर्ताओं", @@ -136,6 +138,7 @@ "Currency": "मुद्रा", "Percent": "प्रतिशत", "Duration": "अवधि", + "GeoData": "GeoData", "Rating": "रेटिंग", "Formula": "सूत्र", "Rollup": "जमना", @@ -253,6 +256,9 @@ "barcodeFormat": "Barcode format", "qrCodeValueTooLong": "Too many characters for a QR code", "barcodeValueTooLong": "Too many characters for a barcode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "कुल समारोह", "dbCreateIfNotExists": "डेटाबेस: बनाएं यदि मौजूद नहीं है", "clientKey": "ग्राहक कुंजी", @@ -452,6 +458,10 @@ "stackedBy": "Stacked By", "chooseGroupingField": "Choose a Grouping Field", "addOrEditStack": "Add / Edit Stack" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Creator can create new projects and access any invited project.", "orgViewer": "Viewer is not allowed to create new projects but they can access any invited project." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "प्रति पृष्ठ पंक्तियाँ", "upload": "अपलोड करने के लिए फ़ाइल का चयन करें", "upload_sub": "या ड्रैग एंड ड्रॉप फाइल", @@ -600,6 +615,7 @@ "gallery": "गैलरी दृश्य जोड़ें", "form": "फॉर्म व्यू जोड़ें", "kanban": "कनबान दृश्य जोड़ें", + "map": "Add Map View", "calendar": "कैलेंडर दृश्य जोड़ें" }, "tablesMetadataInSync": "टेबल के मेटाडेटा SYNC है", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _", "followingCharactersAreNotAllowed": "Following characters are not allowed", "columnNameRequired": "Column name is required", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Project name exceeds 50 characters", "projectNameCannotStartWithSpace": "Project name cannot start with space", "requiredField": "Required field", From 65ed7f5708d8c34c0e1274860c4e4ba7ebe103d3 Mon Sep 17 00:00:00 2001 From: navi Date: Fri, 24 Feb 2023 03:37:40 +0000 Subject: [PATCH 34/68] New translations en.json (Bengali, India) --- packages/nc-gui/lang/bn_IN.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/bn_IN.json b/packages/nc-gui/lang/bn_IN.json index e4cabed1bd..0076d7f265 100644 --- a/packages/nc-gui/lang/bn_IN.json +++ b/packages/nc-gui/lang/bn_IN.json @@ -74,7 +74,8 @@ "insertBefore": "Insert Before", "hideField": "Hide Field", "sortAsc": "Sort Ascending", - "sortDesc": "Sort Descending" + "sortDesc": "Sort Descending", + "geoDataField": "GeoData Field" }, "objects": { "project": "প্রকল্প", @@ -98,7 +99,8 @@ "gallery": "গ্যালারী", "form": "ফর্ম", "kanban": "কানবান", - "calendar": "ক্যালেন্ডার" + "calendar": "ক্যালেন্ডার", + "map": "Map" }, "user": "ব্যবহারকারী", "users": "ব্যবহারকারীরা", @@ -136,6 +138,7 @@ "Currency": "মুদ্রা", "Percent": "শতাংশ", "Duration": "সময়কাল", + "GeoData": "GeoData", "Rating": "রেটিং", "Formula": "সূত্র", "Rollup": "রোলআপ", @@ -253,6 +256,9 @@ "barcodeFormat": "Barcode format", "qrCodeValueTooLong": "Too many characters for a QR code", "barcodeValueTooLong": "Too many characters for a barcode", + "yourLocation": "Your Location", + "lng": "Lng", + "lat": "Lat", "aggregateFunction": "সামগ্রিক ফাংশন", "dbCreateIfNotExists": "ডাটাবেস: উপস্থিত না থাকলে তৈরি করুন", "clientKey": "ক্লায়েন্ট কী", @@ -452,6 +458,10 @@ "stackedBy": "Stacked By", "chooseGroupingField": "Choose a Grouping Field", "addOrEditStack": "Add / Edit Stack" + }, + "map": { + "mappedBy": "Mapped By", + "chooseMappingField": "Choose a Mapping Field" } }, "tooltip": { @@ -518,6 +528,11 @@ "orgCreator": "Creator can create new projects and access any invited project.", "orgViewer": "Viewer is not allowed to create new projects but they can access any invited project." }, + "map": { + "overLimit": "You're over the limit.", + "closeLimit": "You're getting close to the limit.", + "limitNumber": "The limit of markers shown in a Map View is 1000 records." + }, "footerInfo": "প্রতি পৃষ্ঠায় সারি", "upload": "আপলোড করতে ফাইল নির্বাচন করুন", "upload_sub": "অথবা ফাইল টেনে আনুন", @@ -600,6 +615,7 @@ "gallery": "গ্যালারী ভিউ যুক্ত করুন", "form": "ফর্ম ভিউ যোগ করুন", "kanban": "কানবান ভিউ যুক্ত করুন", + "map": "Add Map View", "calendar": "ক্যালেন্ডার ভিউ যুক্ত করুন" }, "tablesMetadataInSync": "টেবিলের মেটাডেটা সিঙ্ক করা আছে", @@ -690,6 +706,7 @@ "nameShouldStartWithAnAlphabetOr_": "Name should start with an alphabet or _", "followingCharactersAreNotAllowed": "Following characters are not allowed", "columnNameRequired": "Column name is required", + "columnNameExceedsCharacters": "The length of column name exceeds the max {value} characters", "projectNameExceeds50Characters": "Project name exceeds 50 characters", "projectNameCannotStartWithSpace": "Project name cannot start with space", "requiredField": "Required field", From 1811fc7ba09498bbacb0f6704c1519f105aae940 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 20 Feb 2023 15:27:15 +0530 Subject: [PATCH 35/68] feat(gui): add ajv middleware Signed-off-by: Pranav C --- packages/nocodb/package-lock.json | 325 ++++++++++++++---- packages/nocodb/package.json | 1 + .../src/lib/meta/api/helpers/apiHelpers.ts | 34 ++ packages/nocodb/tsconfig.json | 3 +- 4 files changed, 287 insertions(+), 76 deletions(-) diff --git a/packages/nocodb/package-lock.json b/packages/nocodb/package-lock.json index c63e48dd18..1f94426e0a 100644 --- a/packages/nocodb/package-lock.json +++ b/packages/nocodb/package-lock.json @@ -13,6 +13,7 @@ "@graphql-tools/merge": "^6.0.12", "@sentry/node": "^6.3.5", "airtable": "^0.11.3", + "ajv": "^8.12.0", "archiver": "^5.0.2", "auto-bind": "^4.0.0", "aws-sdk": "^2.829.0", @@ -658,6 +659,22 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/@eslint/eslintrc/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "13.15.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", @@ -682,6 +699,12 @@ "node": ">= 4" } }, + "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, "node_modules/@eslint/eslintrc/node_modules/type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", @@ -2215,13 +2238,13 @@ "integrity": "sha512-x5W9s+8P4XteaxT/jKF0PSb7XEvo5VmqEWgsMlyeY4ZlLK8I6aH6g5TPPyDlLAep+GYf4kefb7HFyc7PAO3m+Q==" }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dependencies": { "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", "uri-js": "^4.2.2" }, "funding": { @@ -2238,15 +2261,6 @@ "ajv": ">=5.0.0" } }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "peerDependencies": { - "ajv": "^6.9.1" - } - }, "node_modules/amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", @@ -5957,6 +5971,22 @@ "@babel/highlight": "^7.10.4" } }, + "node_modules/eslint/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/eslint/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -6042,6 +6072,12 @@ "node": ">= 4" } }, + "node_modules/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, "node_modules/eslint/node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -8002,6 +8038,26 @@ "node": ">=6" } }, + "node_modules/har-validator/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/har-validator/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -9465,9 +9521,9 @@ "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" }, "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -13898,7 +13954,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -14179,6 +14234,37 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/schema-utils/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/schema-utils/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/schema-utils/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, "node_modules/scmp": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/scmp/-/scmp-2.1.0.tgz", @@ -15573,22 +15659,6 @@ "node": ">=10.0.0" } }, - "node_modules/table/node_modules/ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/table/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -15598,12 +15668,6 @@ "node": ">=8" } }, - "node_modules/table/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, "node_modules/table/node_modules/slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -18168,6 +18232,31 @@ "node": ">=0.4.0" } }, + "node_modules/webpack/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/webpack/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, "node_modules/webpack/node_modules/braces": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", @@ -18303,6 +18392,12 @@ "node": ">=0.10.0" } }, + "node_modules/webpack/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, "node_modules/webpack/node_modules/json5": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", @@ -19500,6 +19595,18 @@ "strip-json-comments": "^3.1.1" }, "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "globals": { "version": "13.15.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", @@ -19515,6 +19622,12 @@ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, "type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", @@ -20789,13 +20902,13 @@ } }, "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "requires": { "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", "uri-js": "^4.2.2" } }, @@ -20806,13 +20919,6 @@ "dev": true, "requires": {} }, - "ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "requires": {} - }, "amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", @@ -23538,6 +23644,18 @@ "@babel/highlight": "^7.10.4" } }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -23592,6 +23710,12 @@ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -25352,6 +25476,24 @@ "requires": { "ajv": "^6.12.3", "har-schema": "^2.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + } } }, "has": { @@ -26420,9 +26562,9 @@ "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" }, "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -29930,8 +30072,7 @@ "require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" }, "require-main-filename": { "version": "2.0.0", @@ -30138,6 +30279,33 @@ "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", "ajv-keywords": "^3.5.2" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "requires": {} + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + } } }, "scmp": { @@ -31273,30 +31441,12 @@ "strip-ansi": "^6.0.1" }, "dependencies": { - "ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", - "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, "slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -32978,6 +33128,25 @@ "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", "dev": true }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "requires": {} + }, "braces": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", @@ -33095,6 +33264,12 @@ } } }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, "json5": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", diff --git a/packages/nocodb/package.json b/packages/nocodb/package.json index 87bcff9e79..0b77966f58 100644 --- a/packages/nocodb/package.json +++ b/packages/nocodb/package.json @@ -53,6 +53,7 @@ "@graphql-tools/merge": "^6.0.12", "@sentry/node": "^6.3.5", "airtable": "^0.11.3", + "ajv": "^8.12.0", "archiver": "^5.0.2", "auto-bind": "^4.0.0", "aws-sdk": "^2.829.0", diff --git a/packages/nocodb/src/lib/meta/api/helpers/apiHelpers.ts b/packages/nocodb/src/lib/meta/api/helpers/apiHelpers.ts index 4ffeeb82b6..7ecf58587d 100644 --- a/packages/nocodb/src/lib/meta/api/helpers/apiHelpers.ts +++ b/packages/nocodb/src/lib/meta/api/helpers/apiHelpers.ts @@ -1,4 +1,38 @@ +import { NextFunction, Request, Response } from 'express'; +import Ajv, { ErrorObject } from 'ajv'; +// @ts-ignore +import swagger from '../../../../../../../scripts/sdk/swagger.json'; + export function parseHrtimeToSeconds(hrtime) { const seconds = (hrtime[0] + hrtime[1] / 1e6).toFixed(3); return seconds; } + +const ajv = new Ajv({ strictSchema: false }); // Initialize AJV + +ajv.addSchema(swagger, 'swagger.json'); + +// A middleware generator to validate the request body +export const getAjvValidatorMw = (schema) => { + return (req: Request, res: Response, next: NextFunction) => { + // Validate the request body against the schema + const valid = ajv.validate( + typeof schema === 'string' ? { $ref: schema } : schema, + req.body + ); + + // If the request body is valid, call the next middleware + if (valid) { + next(); + } else { + const errors: ErrorObject[] | null | undefined = ajv.errors; + + // If the request body is invalid, send a response with an error message + res.status(400).json({ + status: 'error', + message: 'Invalid request body', + errors, + }); + } + }; +}; diff --git a/packages/nocodb/tsconfig.json b/packages/nocodb/tsconfig.json index 0a94f925a7..ff49fbac9c 100644 --- a/packages/nocodb/tsconfig.json +++ b/packages/nocodb/tsconfig.json @@ -58,7 +58,8 @@ "include": [ "src/**/*.ts", // "src/lib/xgene/migrations/*.js", - "src/**/*.json" + "src/**/*.json", + "../../scripts/sdk/swagger.json" ], "exclude": [ "node_modules/**", From 8fea4689254070b12210366dbdc88389736a9ba5 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 20 Feb 2023 17:54:54 +0530 Subject: [PATCH 36/68] feat(nocodb): map swagger schema for api payload validation Signed-off-by: Pranav C --- packages/nc-gui/components.d.ts | 4 + packages/nocodb-sdk/src/lib/Api.ts | 43 ++++- .../src/lib/meta/api/ajvSchemas/index.ts | 1 + .../nocodb/src/lib/meta/api/columnApis.ts | 5 +- .../nocodb/src/lib/meta/api/filterApis.ts | 4 + packages/nocodb/src/lib/meta/api/hookApis.ts | 4 + .../nocodb/src/lib/meta/api/projectApis.ts | 3 +- packages/nocodb/src/lib/meta/api/sortApis.ts | 3 + packages/nocodb/src/lib/meta/api/tableApis.ts | 3 + scripts/sdk/swagger.json | 151 +++++++++++++++++- 10 files changed, 215 insertions(+), 6 deletions(-) create mode 100644 packages/nocodb/src/lib/meta/api/ajvSchemas/index.ts diff --git a/packages/nc-gui/components.d.ts b/packages/nc-gui/components.d.ts index 2a111be52c..78f37aba7f 100644 --- a/packages/nc-gui/components.d.ts +++ b/packages/nc-gui/components.d.ts @@ -251,8 +251,12 @@ declare module '@vue/runtime-core' { NcIconsRowHeightMedium: typeof import('~icons/nc-icons/row-height-medium')['default'] NcIconsRowHeightShort: typeof import('~icons/nc-icons/row-height-short')['default'] NcIconsRowHeightTall: typeof import('~icons/nc-icons/row-height-tall')['default'] + PhChatTextThin: typeof import('~icons/ph/chat-text-thin')['default'] PhCloudLightningDuotone: typeof import('~icons/ph/cloud-lightning-duotone')['default'] + PhCloudLightningThin: typeof import('~icons/ph/cloud-lightning-thin')['default'] PhFileCsv: typeof import('~icons/ph/file-csv')['default'] + PhUserPlusThin: typeof import('~icons/ph/user-plus-thin')['default'] + PhUsersThreeThin: typeof import('~icons/ph/users-three-thin')['default'] RiLineHeight: typeof import('~icons/ri/line-height')['default'] RiTeamFill: typeof import('~icons/ri/team-fill')['default'] RouterLink: typeof import('vue-router')['RouterLink'] diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index c8c9d0ed31..ef19be0774 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -45,7 +45,7 @@ export interface UserListType { } export interface ProjectReqType { - title?: string; + title: string; description?: string; color?: string; bases?: BaseReqType[]; @@ -201,6 +201,22 @@ export interface FilterType { fk_hook_id?: string; } +export interface FilterReqType { + id?: string; + fk_model_id?: string; + fk_column_id?: string; + logical_op?: string; + comparison_op?: string; + value?: string | number | boolean | null; + is_group?: boolean; + children?: FilterType[]; + project_id?: string; + base_id?: string; + fk_parent_id?: string; + fk_view_id?: string; + fk_hook_id?: string; +} + export interface FilterListType { filters: { list: FilterType[]; @@ -543,6 +559,31 @@ export interface HookType { active?: boolean; } +export interface HookReqType { + id?: string; + fk_model_id?: string; + title: string; + description?: string; + env?: string; + event: 'after' | 'before'; + operation: 'insert' | 'delete' | 'update'; + async?: boolean; + payload?: string; + url?: string; + headers?: string; + condition?: boolean; + notification: object; + retries?: number; + retry_interval?: number; + timeout?: number; + active?: boolean; +} + +export interface HookTestReqType { + payload: any; + hook: HookReqType; +} + export interface PluginType { id?: string; title?: string; diff --git a/packages/nocodb/src/lib/meta/api/ajvSchemas/index.ts b/packages/nocodb/src/lib/meta/api/ajvSchemas/index.ts new file mode 100644 index 0000000000..0fac873d02 --- /dev/null +++ b/packages/nocodb/src/lib/meta/api/ajvSchemas/index.ts @@ -0,0 +1 @@ +export * from './ajiAjv' diff --git a/packages/nocodb/src/lib/meta/api/columnApis.ts b/packages/nocodb/src/lib/meta/api/columnApis.ts index ab36b0103c..ef52fc0b98 100644 --- a/packages/nocodb/src/lib/meta/api/columnApis.ts +++ b/packages/nocodb/src/lib/meta/api/columnApis.ts @@ -40,12 +40,12 @@ import { MetaTable } from '../../utils/globals'; import formulaQueryBuilderv2 from '../../db/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2'; import { createHmAndBtColumn, - generateFkName, + generateFkName, getAjvValidatorMw, randomID, validateLookupPayload, validateRequiredField, validateRollupPayload, -} from './helpers'; +} from './helpers' export enum Altered { NEW_COLUMN = 1, @@ -1785,6 +1785,7 @@ const router = Router({ mergeParams: true }); router.post( '/api/v1/db/meta/tables/:tableId/columns/', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/ColumnReq'), ncMetaAclMw(columnAdd, 'columnAdd') ); diff --git a/packages/nocodb/src/lib/meta/api/filterApis.ts b/packages/nocodb/src/lib/meta/api/filterApis.ts index 0f3393229f..d45f00085a 100644 --- a/packages/nocodb/src/lib/meta/api/filterApis.ts +++ b/packages/nocodb/src/lib/meta/api/filterApis.ts @@ -13,6 +13,7 @@ import Project from '../../models/Project'; import Filter from '../../models/Filter'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; +import { getAjvValidatorMw } from './helpers' // @ts-ignore export async function filterGet(req: Request, res: Response, next) { @@ -135,6 +136,7 @@ router.get( router.post( '/api/v1/db/meta/views/:viewId/filters', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/filterReq'), ncMetaAclMw(filterCreate, 'filterCreate') ); @@ -145,6 +147,7 @@ router.get( router.post( '/api/v1/db/meta/hooks/:hookId/filters', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/filterReq'), ncMetaAclMw(hookFilterCreate, 'filterCreate') ); @@ -156,6 +159,7 @@ router.get( router.patch( '/api/v1/db/meta/filters/:filterId', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/filterReq'), ncMetaAclMw(filterUpdate, 'filterUpdate') ); router.delete( diff --git a/packages/nocodb/src/lib/meta/api/hookApis.ts b/packages/nocodb/src/lib/meta/api/hookApis.ts index cde045c5e6..c59617607a 100644 --- a/packages/nocodb/src/lib/meta/api/hookApis.ts +++ b/packages/nocodb/src/lib/meta/api/hookApis.ts @@ -9,6 +9,7 @@ import Model from '../../models/Model'; import populateSamplePayload from '../helpers/populateSamplePayload'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; +import { getAjvValidatorMw } from './helpers' export async function hookList( req: Request, @@ -85,11 +86,13 @@ router.get( router.post( '/api/v1/db/meta/tables/:tableId/hooks/test', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/HookTestReq'), ncMetaAclMw(hookTest, 'hookTest') ); router.post( '/api/v1/db/meta/tables/:tableId/hooks', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/HookReq'), ncMetaAclMw(hookCreate, 'hookCreate') ); router.delete( @@ -100,6 +103,7 @@ router.delete( router.patch( '/api/v1/db/meta/hooks/:hookId', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/HookReq'), ncMetaAclMw(hookUpdate, 'hookUpdate') ); router.get( diff --git a/packages/nocodb/src/lib/meta/api/projectApis.ts b/packages/nocodb/src/lib/meta/api/projectApis.ts index 7accf2d075..388d6ae120 100644 --- a/packages/nocodb/src/lib/meta/api/projectApis.ts +++ b/packages/nocodb/src/lib/meta/api/projectApis.ts @@ -18,7 +18,7 @@ import { metaApiMetrics } from '../helpers/apiMetrics'; import { extractPropsAndSanitize } from '../helpers/extractProps'; import NcConfigFactory from '../../utils/NcConfigFactory'; import { promisify } from 'util'; -import { populateMeta } from './helpers'; +import { getAjvValidatorMw, populateMeta } from './helpers' import Filter from '../../models/Filter'; const nanoid = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 4); @@ -272,6 +272,7 @@ export default (router) => { router.post( '/api/v1/db/meta/projects', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/ProjectReq'), ncMetaAclMw(projectCreate, 'projectCreate') ); router.get( diff --git a/packages/nocodb/src/lib/meta/api/sortApis.ts b/packages/nocodb/src/lib/meta/api/sortApis.ts index 60cb02953e..8a6508fbc4 100644 --- a/packages/nocodb/src/lib/meta/api/sortApis.ts +++ b/packages/nocodb/src/lib/meta/api/sortApis.ts @@ -12,6 +12,7 @@ import Project from '../../models/Project'; import Sort from '../../models/Sort'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; +import { getAjvValidatorMw } from './helpers' // @ts-ignore export async function sortGet(req: Request, res: Response) {} @@ -58,6 +59,7 @@ router.get( router.post( '/api/v1/db/meta/views/:viewId/sorts/', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/sortReq'), ncMetaAclMw(sortCreate, 'sortCreate') ); router.get( @@ -68,6 +70,7 @@ router.get( router.patch( '/api/v1/db/meta/sorts/:sortId', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/sortReq'), ncMetaAclMw(sortUpdate, 'sortUpdate') ); router.delete( diff --git a/packages/nocodb/src/lib/meta/api/tableApis.ts b/packages/nocodb/src/lib/meta/api/tableApis.ts index b47fa5e5e6..fecfcb0551 100644 --- a/packages/nocodb/src/lib/meta/api/tableApis.ts +++ b/packages/nocodb/src/lib/meta/api/tableApis.ts @@ -17,6 +17,7 @@ import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; import Project from '../../models/Project'; import Audit from '../../models/Audit'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; +import { getAjvValidatorMw } from './helpers' import { xcVisibilityMetaGet } from './modelVisibilityApis'; import View from '../../models/View'; import getColumnPropsFromUIDT from '../helpers/getColumnPropsFromUIDT'; @@ -410,11 +411,13 @@ router.get( router.post( '/api/v1/db/meta/projects/:projectId/tables', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/TableReq'), ncMetaAclMw(tableCreate, 'tableCreate') ); router.post( '/api/v1/db/meta/projects/:projectId/:baseId/tables', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/TableReq'), ncMetaAclMw(tableCreate, 'tableCreate') ); router.get( diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 9c54581fda..c7ae4d2552 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -7318,7 +7318,10 @@ "$ref": "#/components/schemas/BaseReq" } } - } + }, + "required": [ + "title" + ] }, "Project": { "title": "Project", @@ -8128,6 +8131,63 @@ }, "readOnly": true }, + "FilterReq": { + "type": "object", + "title": "Filter", + "properties": { + "id": { + "type": "string" + }, + "fk_model_id": { + "type": "string" + }, + "fk_column_id": { + "type": "string" + }, + "logical_op": { + "type": "string" + }, + "comparison_op": { + "type": "string" + }, + "value": { + "type": [ + "string", + "number", + "integer", + "boolean", + "null" + ] + }, + "is_group": { + "type": "boolean" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Filter" + } + }, + "project_id": { + "type": "string", + "readOnly": true + }, + "base_id": { + "type": "string", + "readOnly": true + }, + "fk_parent_id": { + "type": "string" + }, + "fk_view_id": { + "type": "string" + }, + "fk_hook_id": { + "type": "string" + } + }, + "readOnly": true + }, "FilterList": { "description": "", "type": "object", @@ -9396,6 +9456,93 @@ } } }, + "HookReq": { + "title": "AuditType", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "fk_model_id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "env": { + "type": "string" + }, + "event": { + "type": "string", + "enum": [ + "after", + "before" + ] + }, + "operation": { + "type": "string", + "enum": [ + "insert", + "delete", + "update" + ] + }, + "async": { + "type": "boolean" + }, + "payload": { + "type": "string" + }, + "url": { + "type": "string" + }, + "headers": { + "type": "string" + }, + "condition": { + "type": "boolean" + }, + "notification": { + "type": "object" + }, + "retries": { + "type": "number" + }, + "retry_interval": { + "type": "number" + }, + "timeout": { + "type": "number" + }, + "active": { + "type": "boolean" + } + }, + "required": [ + "title", + "event", + "notification", + "operation" + ] + }, + "HookTestReq": { + "title": "Hook test request payload", + "type": "object", + "properties": { + "payload": {}, + "hook": { + "$ref": "#/components/schemas/HookReq" + } + }, + "required": [ + "payload", + "hook" + ] + }, + "Plugin": { "title": "Plugin", "type": "object", @@ -10309,4 +10456,4 @@ } } } -} \ No newline at end of file +} From be377add99814400c67167c86aebf8a40838a208 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 21 Feb 2023 04:52:12 +0530 Subject: [PATCH 37/68] feat(nocodb): add missing schema Signed-off-by: Pranav C --- .../src/lib/meta/api/ajvSchemas/index.ts | 1 - .../nocodb/src/lib/meta/api/apiTokenApis.ts | 2 + packages/nocodb/src/lib/meta/api/baseApis.ts | 4 +- .../nocodb/src/lib/meta/api/formViewApis.ts | 2 + .../src/lib/meta/api/formViewColumnApis.ts | 2 + .../src/lib/meta/api/galleryViewApis.ts | 3 + .../nocodb/src/lib/meta/api/gridViewApis.ts | 2 + .../src/lib/meta/api/gridViewColumnApis.ts | 2 + .../nocodb/src/lib/meta/api/hookFilterApis.ts | 3 + .../nocodb/src/lib/meta/api/kanbanViewApis.ts | 3 + .../src/lib/meta/api/modelVisibilityApis.ts | 2 + .../nocodb/src/lib/meta/api/orgLicenseApis.ts | 2 + .../src/lib/meta/api/userApi/userApis.ts | 64 ++++- .../nocodb/src/lib/meta/helpers/catchError.ts | 10 + scripts/sdk/swagger.json | 246 +++++++++++++++++- 15 files changed, 334 insertions(+), 14 deletions(-) delete mode 100644 packages/nocodb/src/lib/meta/api/ajvSchemas/index.ts diff --git a/packages/nocodb/src/lib/meta/api/ajvSchemas/index.ts b/packages/nocodb/src/lib/meta/api/ajvSchemas/index.ts deleted file mode 100644 index 0fac873d02..0000000000 --- a/packages/nocodb/src/lib/meta/api/ajvSchemas/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './ajiAjv' diff --git a/packages/nocodb/src/lib/meta/api/apiTokenApis.ts b/packages/nocodb/src/lib/meta/api/apiTokenApis.ts index dea013346d..5470ca3f50 100644 --- a/packages/nocodb/src/lib/meta/api/apiTokenApis.ts +++ b/packages/nocodb/src/lib/meta/api/apiTokenApis.ts @@ -5,6 +5,7 @@ import { NcError } from '../helpers/catchError'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ApiToken from '../../models/ApiToken'; import { metaApiMetrics } from '../helpers/apiMetrics'; +import { getAjvValidatorMw } from './helpers' export async function apiTokenList(req: Request, res: Response) { res.json(await ApiToken.list(req['user'].id)); @@ -40,6 +41,7 @@ router.get( router.post( '/api/v1/db/meta/projects/:projectId/api-tokens', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/ApiTokenReq'), ncMetaAclMw(apiTokenCreate, 'apiTokenCreate') ); router.delete( diff --git a/packages/nocodb/src/lib/meta/api/baseApis.ts b/packages/nocodb/src/lib/meta/api/baseApis.ts index 9b81d8e06b..7c97afa8cc 100644 --- a/packages/nocodb/src/lib/meta/api/baseApis.ts +++ b/packages/nocodb/src/lib/meta/api/baseApis.ts @@ -7,7 +7,7 @@ import Base from '../../models/Base'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Tele } from 'nc-help'; import { metaApiMetrics } from '../helpers/apiMetrics'; -import { populateMeta } from './helpers'; +import { getAjvValidatorMw, populateMeta } from './helpers' export async function baseGet( req: Request, @@ -107,6 +107,7 @@ export default (router) => { router.patch( '/api/v1/db/meta/projects/:projectId/bases/:baseId', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/BaseReq'), ncMetaAclMw(baseUpdate, 'baseUpdate') ); router.delete( @@ -117,6 +118,7 @@ export default (router) => { router.post( '/api/v1/db/meta/projects/:projectId/bases', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/BaseReq'), ncMetaAclMw(baseCreate, 'baseCreate') ); router.get( diff --git a/packages/nocodb/src/lib/meta/api/formViewApis.ts b/packages/nocodb/src/lib/meta/api/formViewApis.ts index d5932ea0d6..1edb3b2dcf 100644 --- a/packages/nocodb/src/lib/meta/api/formViewApis.ts +++ b/packages/nocodb/src/lib/meta/api/formViewApis.ts @@ -13,6 +13,7 @@ import View from '../../models/View'; import FormView from '../../models/FormView'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; +import { getAjvValidatorMw } from './helpers' // @ts-ignore export async function formViewGet(req: Request, res: Response) { @@ -43,6 +44,7 @@ const router = Router({ mergeParams: true }); router.post( '/api/v1/db/meta/tables/:tableId/forms', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/FormReq'), ncMetaAclMw(formViewCreate, 'formViewCreate') ); router.get( diff --git a/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts b/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts index 0485cb79be..4c470050cf 100644 --- a/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts +++ b/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts @@ -3,6 +3,7 @@ import FormViewColumn from '../../models/FormViewColumn'; import { Tele } from 'nc-help'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; +// import { getAjvValidatorMw } from './helpers' export async function columnUpdate(req: Request, res: Response) { Tele.emit('evt', { evt_type: 'formViewColumn:updated' }); @@ -13,6 +14,7 @@ const router = Router({ mergeParams: true }); router.patch( '/api/v1/db/meta/form-columns/:formViewColumnId', metaApiMetrics, + // getAjvValidatorMw('swagger.json#/components/schemas/FormViewColumnReq'), ncMetaAclMw(columnUpdate, 'columnUpdate') ); export default router; diff --git a/packages/nocodb/src/lib/meta/api/galleryViewApis.ts b/packages/nocodb/src/lib/meta/api/galleryViewApis.ts index 56ca905ffb..d563a32f6f 100644 --- a/packages/nocodb/src/lib/meta/api/galleryViewApis.ts +++ b/packages/nocodb/src/lib/meta/api/galleryViewApis.ts @@ -5,6 +5,7 @@ import GalleryView from '../../models/GalleryView'; import { Tele } from 'nc-help'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; +import { getAjvValidatorMw } from './helpers' export async function galleryViewGet(req: Request, res: Response) { res.json(await GalleryView.get(req.params.galleryViewId)); } @@ -29,11 +30,13 @@ const router = Router({ mergeParams: true }); router.post( '/api/v1/db/meta/tables/:tableId/galleries', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/GalleryReq'), ncMetaAclMw(galleryViewCreate, 'galleryViewCreate') ); router.patch( '/api/v1/db/meta/galleries/:galleryViewId', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/GalleryReq'), ncMetaAclMw(galleryViewUpdate, 'galleryViewUpdate') ); router.get( diff --git a/packages/nocodb/src/lib/meta/api/gridViewApis.ts b/packages/nocodb/src/lib/meta/api/gridViewApis.ts index 80f8574efb..400fc52fe8 100644 --- a/packages/nocodb/src/lib/meta/api/gridViewApis.ts +++ b/packages/nocodb/src/lib/meta/api/gridViewApis.ts @@ -13,6 +13,7 @@ import View from '../../models/View'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; import GridView from '../../models/GridView'; +import { getAjvValidatorMw } from './helpers' // @ts-ignore export async function gridViewCreate(req: Request, res) { @@ -35,6 +36,7 @@ const router = Router({ mergeParams: true }); router.post( '/api/v1/db/meta/tables/:tableId/grids/', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/GridReq'), ncMetaAclMw(gridViewCreate, 'gridViewCreate') ); router.patch( diff --git a/packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts b/packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts index b19147a323..7f4c21be5c 100644 --- a/packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts +++ b/packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts @@ -3,6 +3,7 @@ import GridViewColumn from '../../models/GridViewColumn'; import { Tele } from 'nc-help'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; +import { getAjvValidatorMw } from './helpers' export async function columnList(req: Request, res: Response) { res.json(await GridViewColumn.list(req.params.gridViewId)); @@ -22,6 +23,7 @@ router.get( router.patch( '/api/v1/db/meta/grid-columns/:gridViewColumnId', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/GridViewColumnReq'), ncMetaAclMw(gridColumnUpdate, 'gridColumnUpdate') ); export default router; diff --git a/packages/nocodb/src/lib/meta/api/hookFilterApis.ts b/packages/nocodb/src/lib/meta/api/hookFilterApis.ts index 4e714479ed..4ba268fbb6 100644 --- a/packages/nocodb/src/lib/meta/api/hookFilterApis.ts +++ b/packages/nocodb/src/lib/meta/api/hookFilterApis.ts @@ -13,6 +13,7 @@ import Project from '../../models/Project'; import Filter from '../../models/Filter'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; +import { getAjvValidatorMw } from './helpers' // @ts-ignore export async function filterGet(req: Request, res: Response, next) { @@ -117,6 +118,7 @@ router.get( router.post( '/hooks/:hookId/filters/', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/filterReq'), ncMetaAclMw(filterCreate, 'filterCreate') ); router.get( @@ -127,6 +129,7 @@ router.get( router.patch( '/hooks/:hookId/filters/:filterId', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/filterReq'), ncMetaAclMw(filterUpdate, 'filterUpdate') ); router.delete( diff --git a/packages/nocodb/src/lib/meta/api/kanbanViewApis.ts b/packages/nocodb/src/lib/meta/api/kanbanViewApis.ts index df94f1fe94..5509751f93 100644 --- a/packages/nocodb/src/lib/meta/api/kanbanViewApis.ts +++ b/packages/nocodb/src/lib/meta/api/kanbanViewApis.ts @@ -5,6 +5,7 @@ import KanbanView from '../../models/KanbanView'; import { Tele } from 'nc-help'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; +import { getAjvValidatorMw } from './helpers' export async function kanbanViewGet(req: Request, res: Response) { res.json(await KanbanView.get(req.params.kanbanViewId)); @@ -31,11 +32,13 @@ const router = Router({ mergeParams: true }); router.post( '/api/v1/db/meta/tables/:tableId/kanbans', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/KanbanReq'), ncMetaAclMw(kanbanViewCreate, 'kanbanViewCreate') ); router.patch( '/api/v1/db/meta/kanbans/:kanbanViewId', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/KanbanUpdateReq'), ncMetaAclMw(kanbanViewUpdate, 'kanbanViewUpdate') ); router.get( diff --git a/packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts b/packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts index 3504418a0a..c7c8d18058 100644 --- a/packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts +++ b/packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts @@ -4,6 +4,7 @@ import { Router } from 'express'; import { Tele } from 'nc-help'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; +import { getAjvValidatorMw } from './helpers' async function xcVisibilityMetaSetAll(req, res) { Tele.emit('evt', { evt_type: 'uiAcl:updated' }); for (const d of req.body) { @@ -122,6 +123,7 @@ router.get( router.post( '/api/v1/db/meta/projects/:projectId/visibility-rules', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/KanbanViewReq'), ncMetaAclMw(xcVisibilityMetaSetAll, 'modelVisibilitySet') ); export default router; diff --git a/packages/nocodb/src/lib/meta/api/orgLicenseApis.ts b/packages/nocodb/src/lib/meta/api/orgLicenseApis.ts index 7bbbd43106..63366b4e4d 100644 --- a/packages/nocodb/src/lib/meta/api/orgLicenseApis.ts +++ b/packages/nocodb/src/lib/meta/api/orgLicenseApis.ts @@ -5,6 +5,7 @@ import Store from '../../models/Store'; import Noco from '../../Noco'; import { metaApiMetrics } from '../helpers/apiMetrics'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; +import { getAjvValidatorMw } from './helpers' async function licenseGet(_req, res) { const license = await Store.get(NC_LICENSE_KEY); @@ -30,6 +31,7 @@ router.get( router.post( '/api/v1/license', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/LicenseReq'), ncMetaAclMw(licenseSet, 'licenseSet', { allowedRoles: [OrgUserRoles.SUPER_ADMIN], blockApiTokenAccess: true, diff --git a/packages/nocodb/src/lib/meta/api/userApi/userApis.ts b/packages/nocodb/src/lib/meta/api/userApi/userApis.ts index 63aadfc393..7c4b90b5cb 100644 --- a/packages/nocodb/src/lib/meta/api/userApi/userApis.ts +++ b/packages/nocodb/src/lib/meta/api/userApi/userApis.ts @@ -22,6 +22,7 @@ import extractProjectIdAndAuthenticate from '../../helpers/extractProjectIdAndAu import ncMetaAclMw from '../../helpers/ncMetaAclMw'; import { MetaTable } from '../../../utils/globals'; import Noco from '../../../Noco'; +import { getAjvValidatorMw } from '../helpers'; import { genJwt } from './helpers'; import { randomTokenString } from '../../helpers/stringHelpers'; @@ -523,15 +524,32 @@ async function renderPasswordReset(req, res): Promise { const mapRoutes = (router) => { // todo: old api - /auth/signup?tool=1 - router.post('/auth/user/signup', catchError(signup)); - router.post('/auth/user/signin', catchError(signin)); + router.post( + '/auth/user/signup', + getAjvValidatorMw('swagger.json#/components/schemas/SignUpReq'), + catchError(signup) + ); + router.post( + '/auth/user/signin', + getAjvValidatorMw('swagger.json#/components/schemas/SignInReq'), + catchError(signin) + ); router.get('/auth/user/me', extractProjectIdAndAuthenticate, catchError(me)); - router.post('/auth/password/forgot', catchError(passwordForgot)); + router.post( + '/auth/password/forgot', + getAjvValidatorMw('swagger.json#/components/schemas/ForgotPasswordReq'), + catchError(passwordForgot) + ); router.post('/auth/token/validate/:tokenId', catchError(tokenValidate)); - router.post('/auth/password/reset/:tokenId', catchError(passwordReset)); + router.post( + '/auth/password/reset/:tokenId', + getAjvValidatorMw('swagger.json#/components/schemas/PasswordResetReq'), + catchError(passwordReset) + ); router.post('/auth/email/validate/:tokenId', catchError(emailVerification)); router.post( '/user/password/change', + getAjvValidatorMw('swagger.json#/components/schemas/PasswordChangeReq'), ncMetaAclMw(passwordChange, 'passwordChange') ); router.post('/auth/token/refresh', catchError(refreshToken)); @@ -549,14 +567,26 @@ const mapRoutes = (router) => { ); // deprecated APIs - router.post('/api/v1/db/auth/user/signup', catchError(signup)); - router.post('/api/v1/db/auth/user/signin', catchError(signin)); + router.post( + '/api/v1/db/auth/user/signup', + getAjvValidatorMw('swagger.json#/components/schemas/SignUpReq'), + catchError(signup) + ); + router.post( + '/api/v1/db/auth/user/signin', + getAjvValidatorMw('swagger.json#/components/schemas/SignInReq'), + catchError(signin) + ); router.get( '/api/v1/db/auth/user/me', extractProjectIdAndAuthenticate, catchError(me) ); - router.post('/api/v1/db/auth/password/forgot', catchError(passwordForgot)); + router.post( + '/api/v1/db/auth/password/forgot', + getAjvValidatorMw('swagger.json#/components/schemas/ForgotPasswordReq'), + catchError(passwordForgot) + ); router.post( '/api/v1/db/auth/token/validate/:tokenId', catchError(tokenValidate) @@ -571,6 +601,7 @@ const mapRoutes = (router) => { ); router.post( '/api/v1/db/auth/password/change', + getAjvValidatorMw('swagger.json#/components/schemas/PasswordChangeReq'), ncMetaAclMw(passwordChange, 'passwordChange') ); router.post('/api/v1/db/auth/token/refresh', catchError(refreshToken)); @@ -580,14 +611,26 @@ const mapRoutes = (router) => { ); // new API - router.post('/api/v1/auth/user/signup', catchError(signup)); - router.post('/api/v1/auth/user/signin', catchError(signin)); + router.post( + '/api/v1/auth/user/signup', + getAjvValidatorMw('swagger.json#/components/schemas/SignUpReq'), + catchError(signup) + ); + router.post( + '/api/v1/auth/user/signin', + getAjvValidatorMw('swagger.json#/components/schemas/SignInReq'), + catchError(signin) + ); router.get( '/api/v1/auth/user/me', extractProjectIdAndAuthenticate, catchError(me) ); - router.post('/api/v1/auth/password/forgot', catchError(passwordForgot)); + router.post( + '/api/v1/auth/password/forgot', + getAjvValidatorMw('swagger.json#/components/schemas/ForgotPasswordReq'), + catchError(passwordForgot) + ); router.post( '/api/v1/auth/token/validate/:tokenId', catchError(tokenValidate) @@ -602,6 +645,7 @@ const mapRoutes = (router) => { ); router.post( '/api/v1/auth/password/change', + getAjvValidatorMw('swagger.json#/components/schemas/PasswordChangeReq'), ncMetaAclMw(passwordChange, 'passwordChange') ); router.post('/api/v1/auth/token/refresh', catchError(refreshToken)); diff --git a/packages/nocodb/src/lib/meta/helpers/catchError.ts b/packages/nocodb/src/lib/meta/helpers/catchError.ts index 95e2d94cea..0278cd757b 100644 --- a/packages/nocodb/src/lib/meta/helpers/catchError.ts +++ b/packages/nocodb/src/lib/meta/helpers/catchError.ts @@ -1,3 +1,9 @@ + + +function extractDBError(_error:Error) { + // if (error instanceof knex.DBError) { switch (error.code) { case 'ER_NO_SUCH_TABLE': console.error('Table does not exist'); break; case 'ER_BAD_FIELD_ERROR': console.error('Invalid column name'); break; // Add more cases for other common errors here default: console.error('Unknown error:', error); break; } } else { console.error('Unexpected error:', error); } }).finally(() => { knex.destroy(); // Close the database connection }); +} + export default function ( requestHandler: (req: any, res: any, next?: any) => any ) { @@ -5,6 +11,10 @@ export default function ( try { return await requestHandler(req, res, next); } catch (e) { + + extractDBError(e) + + // todo: error log console.log(requestHandler.name ? `${requestHandler.name} ::` : '', e); diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index c7ae4d2552..db48744801 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -6975,7 +6975,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApiToken" + "$ref": "#/components/schemas/ApiTokenReq" } } } @@ -8739,6 +8739,33 @@ }, "description": "" }, + "GridReq": { + "title": "Grid", + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "order": { + "type": "number" + }, + "lock_type": { + "type": "string", + "enum": [ + "collaborative", + "locked", + "personal" + ] + }, + "row_height": { + "type": "number" + } + }, + "description": "", + "required": [ + "title" + ] + }, "Gallery": { "title": "Gallery", "type": "object", @@ -8802,6 +8829,51 @@ } } }, + "GalleryReq": { + "title": "Gallery", + "type": "object", + "description": "", + "properties": { + "title": { + "type": "string" + }, + "next_enabled": { + "type": "boolean" + }, + "prev_enabled": { + "type": "boolean" + }, + "cover_image_idx": { + "type": "integer" + }, + "cover_image": { + "type": "string" + }, + "restrict_types": { + "type": "string" + }, + "restrict_size": { + "type": "string" + }, + "restrict_number": { + "type": "string" + }, + "fk_cover_image_col_id": { + "type": "string" + }, + "lock_type": { + "type": "string", + "enum": [ + "collaborative", + "locked", + "personal" + ] + } + }, + "required": [ + "title" + ] + }, "GalleryColumn": { "title": "GalleryColumn", "type": "object", @@ -8992,6 +9064,46 @@ } } }, + "KanbanReq": { + "title": "Kanban", + "type": "object", + "description": "", + "properties": { + "title": { + "type": "string" + }, + "fk_grp_col_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "title" + ] + }, + "KanbanUpdateReq": { + "title": "Kanban", + "type": "object", + "description": "", + "properties": { + "fk_grp_col_id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + } + }, "Form": { "title": "Form", "type": "object", @@ -9053,6 +9165,61 @@ "meta": {} } }, + "FormReq": { + "title": "Form", + "type": "object", + "description": "", + "properties": { + "title": { + "type": "string" + }, + "heading": { + "type": "string" + }, + "subheading": { + "type": "string" + }, + "success_msg": { + "type": "string" + }, + "redirect_url": { + "type": "string" + }, + "redirect_after_secs": { + "type": "string" + }, + "email": { + "type": "string" + }, + "banner_image_url": { + "type": "string" + }, + "logo_url": { + "type": "string" + }, + "submit_another_form": { + "type": "boolean" + }, + "show_blank_form": { + "type": "boolean" + }, + "fk_model_id": { + "type": "string" + }, + "lock_type": { + "type": "string", + "enum": [ + "collaborative", + "locked", + "personal" + ] + }, + "meta": {} + }, + "required": [ + "title" + ] + }, "FormColumn": { "description": "", "type": "object", @@ -9542,7 +9709,82 @@ "hook" ] }, - + "SignUpReq": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "required": [ + "email", + "password" + ] + }, + "SignInReq": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "required": [ + "email", + "password" + ] + }, + "ForgotPasswordReq": { + "type": "object", + "properties": { + "email": { + "type": "string" + } + }, + "required": [ + "email" + ] + }, + "PasswordResetReq": { + "type": "object", + "properties": { + "password": { + "type": "string" + } + }, + "required": [ + "password" + ] + }, + "PasswordChangeReq": { + "type": "object", + "properties": { + "currentPassword": { + "type": "string" + }, + "newPassword": { + "type": "string" + } + }, + "required": [ + "currentPassword", + "newPassword" + ] + }, + "ApiTokenReq": { + "title": "API Token Request", + "type": "object", + "properties": { + "description": { + "type": "string" + } + } + }, "Plugin": { "title": "Plugin", "type": "object", From fae02790b3dc7170ec46d044646ed5c4216ef419 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 22 Feb 2023 02:29:33 +0530 Subject: [PATCH 38/68] feat: on db error respond with human-readable message Signed-off-by: Pranav C --- .../nocodb/src/lib/meta/helpers/catchError.ts | 386 +++++++++++++++++- 1 file changed, 380 insertions(+), 6 deletions(-) diff --git a/packages/nocodb/src/lib/meta/helpers/catchError.ts b/packages/nocodb/src/lib/meta/helpers/catchError.ts index 0278cd757b..1c3393ed0d 100644 --- a/packages/nocodb/src/lib/meta/helpers/catchError.ts +++ b/packages/nocodb/src/lib/meta/helpers/catchError.ts @@ -1,7 +1,369 @@ +enum DBError { + TABLE_EXIST = 'TABLE_EXIST', + TABLE_NOT_EXIST = 'TABLE_NOT_EXIST', + COLUMN_EXIST = 'COLUMN_EXIST', + COLUMN_NOT_EXIST = 'COLUMN_NOT_EXIST', + CONSTRAINT_EXIST = 'CONSTRAINT_EXIST', + CONSTRAINT_NOT_EXIST = 'CONSTRAINT_NOT_EXIST', +} + +// extract db errors using database error code +function extractDBError(error): { + type: DBError; + message: string; + info: any; + extra?: Record; +} | void { + if (!error.code) return; + + let message: string; + let extra: Record; + let type: DBError; + + switch (error.code) { + // sqlite errors + case 'SQLITE_BUSY': + message = 'The database is locked by another process or transaction.'; + break; + case 'SQLITE_CONSTRAINT': + { + const constraint = /FOREIGN KEY|UNIQUE/.test(error.message) + ? error.message.match(/FOREIGN KEY|UNIQUE/gi)?.join(' ') + : 'constraint'; + message = `A ${constraint} constraint was violated: ${error.message}`; + extra = { + constraint, + }; + } + break; + case 'SQLITE_CORRUPT': + message = 'The database file is corrupt.'; + break; + case 'SQLITE_ERROR': + message = 'A SQL error occurred.'; + + if (error.message) { + const noSuchTableMatch = error.message.match(/no such table: (\w+)/); + const tableAlreadyExistsMatch = error.message.match( + /SQLITE_ERROR: table `?(\w+)`? already exists/ + ); + + const duplicateColumnExistsMatch = error.message.match( + /SQLITE_ERROR: duplicate column name: (\w+)/ + ); + const unrecognizedTokenMatch = error.message.match( + /SQLITE_ERROR: unrecognized token: "(\w+)"/ + ); + const columnDoesNotExistMatch = error.message.match( + /SQLITE_ERROR: no such column: (\w+)/ + ); + const constraintFailedMatch = error.message.match( + /SQLITE_ERROR: constraint failed: (\w+)/ + ); + + if (noSuchTableMatch && noSuchTableMatch[1]) { + message = `The table '${noSuchTableMatch[1]}' does not exist.`; + type = DBError.TABLE_NOT_EXIST; + extra = { + table: noSuchTableMatch[1], + }; + } else if (tableAlreadyExistsMatch && tableAlreadyExistsMatch[1]) { + message = `The table '${tableAlreadyExistsMatch[1]}' already exists.`; + type = DBError.TABLE_EXIST; + extra = { + table: tableAlreadyExistsMatch[1], + }; + } else if (unrecognizedTokenMatch && unrecognizedTokenMatch[1]) { + message = `Unrecognized token: ${unrecognizedTokenMatch[1]}`; + extra = { + token: unrecognizedTokenMatch[1], + }; + } else if (columnDoesNotExistMatch && columnDoesNotExistMatch[1]) { + message = `The column ${columnDoesNotExistMatch[1]} does not exist.`; + type = DBError.COLUMN_NOT_EXIST; + extra = { + column: columnDoesNotExistMatch[1], + }; + } else if (constraintFailedMatch && constraintFailedMatch[1]) { + message = `A constraint failed: ${constraintFailedMatch[1]}`; + } else if ( + duplicateColumnExistsMatch && + duplicateColumnExistsMatch[1] + ) { + message = `The column '${duplicateColumnExistsMatch[1]}' already exists.`; + type = DBError.COLUMN_EXIST; + extra = { + column: duplicateColumnExistsMatch[1], + }; + } else { + const match = error.message.match(/SQLITE_ERROR:\s*(\w+)/); + if (match && match[1]) { + message = match[1]; + } + } + } + break; + case 'SQLITE_RANGE': + message = 'A column index is out of range.'; + break; + case 'SQLITE_SCHEMA': + message = 'The database schema has changed.'; + break; + + // mysql errors + case 'ER_TABLE_EXISTS_ERROR': + message = 'The table already exists.'; + + if (error.message) { + const extractTableNameMatch = error.message.match( + / Table '?(\w+)'? already exists/i + ); + if (extractTableNameMatch && extractTableNameMatch[1]) { + message = `The table '${extractTableNameMatch[1]}' already exists.`; + type = DBError.TABLE_EXIST; + extra = { + table: extractTableNameMatch[1], + }; + } + } + break; + case 'ER_DUP_FIELDNAME': + message = 'The column already exists.'; + + if (error.message) { + const extractColumnNameMatch = error.message.match( + / Duplicate column name '(\w+)'/i + ); + if (extractColumnNameMatch && extractColumnNameMatch[1]) { + message = `The column '${extractColumnNameMatch[1]}' already exists.`; + type = DBError.COLUMN_EXIST; + extra = { + column: extractColumnNameMatch[1], + }; + } + } + break; + case 'ER_NO_SUCH_TABLE': + message = 'The table does not exist.'; -function extractDBError(_error:Error) { - // if (error instanceof knex.DBError) { switch (error.code) { case 'ER_NO_SUCH_TABLE': console.error('Table does not exist'); break; case 'ER_BAD_FIELD_ERROR': console.error('Invalid column name'); break; // Add more cases for other common errors here default: console.error('Unknown error:', error); break; } } else { console.error('Unexpected error:', error); } }).finally(() => { knex.destroy(); // Close the database connection }); + if (error.message) { + const missingTableMatch = error.message.match( + / Table '(?:\w+\.)?(\w+)' doesn't exist/i + ); + if (missingTableMatch && missingTableMatch[1]) { + message = `The table '${missingTableMatch[1]}' does not exist`; + type = DBError.TABLE_NOT_EXIST; + extra = { + table: missingTableMatch[1], + }; + } + } + + break; + case 'ER_DUP_ENTRY': + message = 'This record already exists.'; + break; + case 'ER_PARSE_ERROR': + message = 'There was a syntax error in your SQL query.'; + break; + case 'ER_NO_DEFAULT_FOR_FIELD': + message = 'A value is required for this field.'; + break; + case 'ER_BAD_NULL_ERROR': + message = 'A null value is not allowed for this field.'; + break; + case 'ER_DATA_TOO_LONG': + message = 'The data entered is too long for this field.'; + break; + case 'ER_BAD_FIELD_ERROR': + { + message = 'The field you are trying to access does not exist.'; + const extractColNameMatch = error.message.match( + / Unknown column '(\w+)' in 'field list'/i + ); + if (extractColNameMatch && extractColNameMatch[1]) { + message = `The column '${extractColNameMatch[1]}' does not exist.`; + type = DBError.COLUMN_NOT_EXIST; + extra = { + column: extractColNameMatch[1], + }; + } + } + break; + case 'ER_ACCESS_DENIED_ERROR': + message = 'You do not have permission to perform this action.'; + break; + case 'ER_LOCK_WAIT_TIMEOUT': + message = 'A timeout occurred while waiting for a table lock.'; + break; + case 'ER_NO_REFERENCED_ROW': + message = 'The referenced row does not exist.'; + break; + case 'ER_ROW_IS_REFERENCED': + message = 'This record is being referenced by other records.'; + break; + + // postgres errors + case '23505': + message = 'This record already exists.'; + break; + case '42601': + message = 'There was a syntax error in your SQL query.'; + break; + case '23502': + message = 'A value is required for this field.'; + break; + case '23503': + message = 'The referenced row does not exist.'; + break; + case '23514': + message = 'A null value is not allowed for this field.'; + break; + case '22001': + message = 'The data entered is too long for this field.'; + break; + case '28000': + message = 'You do not have permission to perform this action.'; + break; + case '40P01': + message = 'A timeout occurred while waiting for a table lock.'; + break; + case '23506': + message = 'This record is being referenced by other records.'; + break; + case '42P07': + message = 'The table already exists.'; + if (error.message) { + const extractTableNameMatch = error.message.match( + / relation "?(\w+)"? already exists/i + ); + if (extractTableNameMatch && extractTableNameMatch[1]) { + message = `The table '${extractTableNameMatch[1]}' already exists.`; + type = DBError.TABLE_EXIST; + extra = { + table: extractTableNameMatch[1], + }; + } + } + break; + case '42701': + message = 'The column already exists.'; + if (error.message) { + const extractTableNameMatch = error.message.match( + / column "(\w+)" of relation "(\w+)" already exists/i + ); + if (extractTableNameMatch && extractTableNameMatch[1]) { + message = `The column '${extractTableNameMatch[1]}' already exists.`; + type = DBError.COLUMN_EXIST; + extra = { + column: extractTableNameMatch[1], + }; + } + } + break; + case '42P01': + message = 'The table does not exist.'; + if (error.message) { + const extractTableNameMatch = error.message.match( + / relation "(\w+)" does not exist/i + ); + if (extractTableNameMatch && extractTableNameMatch[1]) { + message = `The table '${extractTableNameMatch[1]}' does not exist.`; + type = DBError.TABLE_NOT_EXIST; + extra = { + table: extractTableNameMatch[1], + }; + } + } + break; + case '42703': + message = 'The column does not exist.'; + if (error.message) { + const extractTableNameMatch = error.message.match( + / column "(\w+)" does not exist/i + ); + if (extractTableNameMatch && extractTableNameMatch[1]) { + message = `The column '${extractTableNameMatch[1]}' does not exist.`; + type = DBError.COLUMN_NOT_EXIST; + extra = { + column: extractTableNameMatch[1], + }; + } + } + break; + // mssql errors + case 'EREQUEST': + message = 'There was a syntax error in your SQL query.'; + if (error.message) { + const extractTableNameMatch = error.message.match( + / There is already an object named '(\w+)' in the database/i + ); + const extractDupColMatch = error.message.match( + / Column name '(\w+)' in table '(\w+)' is specified more than once/i + ); + const extractMissingTableMatch = error.message.match( + / Invalid object name '(\w+)'./i + ); + const extractMissingColMatch = error.message.match( + / Invalid column name '(\w+)'./i + ); + + if (extractTableNameMatch && extractTableNameMatch[1]) { + message = `The table '${extractTableNameMatch[1]}' already exists.`; + type = DBError.TABLE_EXIST; + extra = { + table: extractTableNameMatch[1], + }; + } else if (extractDupColMatch && extractDupColMatch[1]) { + message = `The column '${extractDupColMatch[1]}' already exists.`; + type = DBError.COLUMN_EXIST; + extra = { + column: extractDupColMatch[1], + }; + } else if (extractMissingTableMatch && extractMissingTableMatch[1]) { + message = `The table '${extractMissingTableMatch[1]}' does not exist`; + type = DBError.TABLE_NOT_EXIST; + extra = { + table: extractMissingTableMatch[1], + }; + } else if (extractMissingColMatch && extractMissingColMatch[1]) { + message = `The column '${extractMissingColMatch[1]}' does not exist`; + type = DBError.COLUMN_NOT_EXIST; + extra = { + column: extractMissingColMatch[1], + }; + } + } + break; + case 'ELOGIN': + message = 'You do not have permission to perform this action.'; + break; + case 'ETIMEOUT': + message = 'A timeout occurred while waiting for a table lock.'; + break; + case 'ECONNRESET': + message = 'The connection was reset.'; + break; + case 'ECONNREFUSED': + message = 'The connection was refused.'; + break; + case 'EHOSTUNREACH': + message = 'The host is unreachable.'; + break; + case 'EHOSTDOWN': + message = 'The host is down.'; + break; + } + + if (message) { + return { + message, + type, + extra, + info: { message: error.message, code: error.code }, + }; + } } export default function ( @@ -11,13 +373,15 @@ export default function ( try { return await requestHandler(req, res, next); } catch (e) { - - extractDBError(e) - - // todo: error log console.log(requestHandler.name ? `${requestHandler.name} ::` : '', e); + const dbError = extractDBError(e); + + if (dbError) { + return res.status(400).json(dbError); + } + if (e instanceof BadRequest) { return res.status(400).json({ msg: e.message }); } else if (e instanceof Unauthorized) { @@ -37,28 +401,38 @@ export default function ( } class BadRequest extends Error {} + class Unauthorized extends Error {} + class Forbidden extends Error {} + class NotFound extends Error {} + class InternalServerError extends Error {} + class NotImplemented extends Error {} export class NcError { static notFound(message = 'Not found') { throw new NotFound(message); } + static badRequest(message) { throw new BadRequest(message); } + static unauthorized(message) { throw new Unauthorized(message); } + static forbidden(message) { throw new Forbidden(message); } + static internalServerError(message = 'Internal server error') { throw new InternalServerError(message); } + static notImplemented(message = 'Not implemented') { throw new NotImplemented(message); } From b67d3a52702836bc7d1625cb5265d6d174b47e0c Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 22 Feb 2023 02:30:40 +0530 Subject: [PATCH 39/68] fix: swagger schema correction Signed-off-by: Pranav C --- scripts/sdk/swagger.json | 122 ++++++++++++++++++++++++++++++++------- 1 file changed, 100 insertions(+), 22 deletions(-) diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index db48744801..9f3bd840c4 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -8014,7 +8014,7 @@ "columns": { "type": "array", "items": { - "$ref": "#/components/schemas/Column" + "$ref": "#/components/schemas/NormalColumnRequest" } }, "meta": {} @@ -8348,15 +8348,42 @@ "type": "string" }, "np": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] }, "ns": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] }, "clen": { - "type": [ - "string", - "integer" + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } ] }, "cop": { @@ -10012,20 +10039,31 @@ "type": "string" }, "np": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] }, "ns": { - "type": "string" - }, - "clen": { - "type": [ - "string", - "integer" + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } ] }, - "cop": { - "type": "string" - }, "pk": { "type": "boolean" }, @@ -10033,13 +10071,33 @@ "type": "boolean" }, "rqd": { - "type": "boolean" + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + }, + { + "type": "boolean" + } + ] }, "column_name": { "type": "string" }, "un": { - "type": "boolean" + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] }, "ct": { "type": "string" @@ -10051,7 +10109,14 @@ "type": "boolean" }, "cdf": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "cc": { "type": "string" @@ -10062,11 +10127,24 @@ "dtx": { "type": "string" }, - "dtxp": { - "type": "string" + "dtxp": { "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "dtxs": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "au": { "type": "boolean" From ba352da48c237aad8b3bf60cec3afed873dbb426 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 22 Feb 2023 02:58:49 +0530 Subject: [PATCH 40/68] feat: ui acl post request schema definition Signed-off-by: Pranav C --- .../src/lib/meta/api/modelVisibilityApis.ts | 2 +- scripts/sdk/swagger.json | 51 +++++++++++++++---- 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts b/packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts index c7c8d18058..b9b9fc1498 100644 --- a/packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts +++ b/packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts @@ -123,7 +123,7 @@ router.get( router.post( '/api/v1/db/meta/projects/:projectId/visibility-rules', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/KanbanViewReq'), + getAjvValidatorMw('swagger.json#/components/schemas/VisibilityRuleReq'), ncMetaAclMw(xcVisibilityMetaSetAll, 'modelVisibilitySet') ); export default router; diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 9f3bd840c4..eca3b0f3ed 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -10127,14 +10127,15 @@ "dtx": { "type": "string" }, - "dtxp": { "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + "dtxp": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "dtxs": { "oneOf": [ @@ -10144,7 +10145,7 @@ { "type": "null" } - ] + ] }, "au": { "type": "boolean" @@ -10313,6 +10314,38 @@ }, "roles": {} } + }, + "VisibilityRuleReq": { + "title": "Visibility Rule", + "type": "array", + "items": { + "type": "object", + "properties": { + "disabled": { + "type": "object", + "properties": { + "commenter": { + "type": "boolean" + }, + "creator": { + "type": "boolean" + }, + "editor": { + "type": "boolean" + }, + "guest": { + "type": "boolean" + }, + "owner": { + "type": "boolean" + }, + "viewer": { + "type": "boolean" + } + } + } + } + } } }, "requestBodies": { From a5cea7883a11119b9f136a2dbb151cb1d2328468 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 22 Feb 2023 02:59:17 +0530 Subject: [PATCH 41/68] feat: extract validation error and combine if found Signed-off-by: Pranav C --- packages/nc-gui/utils/errorUtils.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/utils/errorUtils.ts b/packages/nc-gui/utils/errorUtils.ts index 6601b5b1dc..ff805aef2e 100644 --- a/packages/nc-gui/utils/errorUtils.ts +++ b/packages/nc-gui/utils/errorUtils.ts @@ -1,14 +1,23 @@ export async function extractSdkResponseErrorMsg(e: Error & { response: any }) { if (!e || !e.response) return e.message let msg + let errors: any[] if (e.response.data instanceof Blob) { try { - msg = JSON.parse(await e.response.data.text()).msg + const parsedData = JSON.parse(await e.response.data.text()) + msg = parsedData.msg + errors = parsedData.errors } catch { msg = 'Some internal error occurred' } } else { msg = e.response.data.msg || e.response.data.message || 'Some internal error occurred' + errors = e.response.data.errors } + + if (errors && errors.length) { + return errors.map((e: any) => e.message).join(', ') + } + return msg || 'Some error occurred' } From 6427dee28c9fdf59f06aa3e8bf6ceeee0c8a2d6b Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 22 Feb 2023 03:04:22 +0530 Subject: [PATCH 42/68] refactor(gui): check errors is an array or not Signed-off-by: Pranav C --- packages/nc-gui/utils/errorUtils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/utils/errorUtils.ts b/packages/nc-gui/utils/errorUtils.ts index ff805aef2e..373881783c 100644 --- a/packages/nc-gui/utils/errorUtils.ts +++ b/packages/nc-gui/utils/errorUtils.ts @@ -1,7 +1,7 @@ export async function extractSdkResponseErrorMsg(e: Error & { response: any }) { if (!e || !e.response) return e.message let msg - let errors: any[] + let errors: any[] | null = null if (e.response.data instanceof Blob) { try { const parsedData = JSON.parse(await e.response.data.text()) @@ -15,8 +15,8 @@ export async function extractSdkResponseErrorMsg(e: Error & { response: any }) { errors = e.response.data.errors } - if (errors && errors.length) { - return errors.map((e: any) => e.message).join(', ') + if (Array.isArray(errors) && errors.length) { + return errors.map((e: any) => (e.instancePath ? `${e.instancePath} - ` : '') + e.message).join(', ') } return msg || 'Some error occurred' From 90fe5ef1fccfa57cc5228af431b66b7c87abb7be Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 23 Feb 2023 01:25:38 +0530 Subject: [PATCH 43/68] fix: column api type corrections Signed-off-by: Pranav C --- packages/nocodb-sdk/src/lib/Api.ts | 166 +++++++++++++----- .../src/lib/meta/api/helpers/apiHelpers.ts | 2 +- packages/nocodb/src/lib/meta/api/tableApis.ts | 13 +- scripts/sdk/swagger.json | 29 ++- 4 files changed, 157 insertions(+), 53 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index ef19be0774..aef49929ce 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -176,7 +176,7 @@ export interface TableReqType { deleted?: boolean; order?: number; mm?: boolean; - columns: ColumnType[]; + columns: NormalColumnRequestType[]; meta?: any; } @@ -244,17 +244,17 @@ export interface ColumnType { base_id?: string; fk_model_id?: string; title?: string; - uidt: string; + uidt?: string; dt?: string; - np?: string; - ns?: string; - clen?: string | number; + np?: string | number | null; + ns?: string | number | null; + clen?: string | number | null; cop?: string; pk?: boolean; pv?: boolean; - rqd?: boolean; + rqd?: boolean | number | null; column_name?: string; - un?: boolean; + un?: boolean | number | null; ct?: string; ai?: boolean; unique?: boolean; @@ -359,6 +359,13 @@ export interface GridType { row_height?: number; } +export interface GridReqType { + title: string; + order?: number; + lock_type?: 'collaborative' | 'locked' | 'personal'; + row_height?: number; +} + export interface GalleryType { fk_view_id?: string; title?: string; @@ -378,6 +385,19 @@ export interface GalleryType { lock_type?: 'collaborative' | 'locked' | 'personal'; } +export interface GalleryReqType { + title: string; + next_enabled?: boolean; + prev_enabled?: boolean; + cover_image_idx?: number; + cover_image?: string; + restrict_types?: string; + restrict_size?: string; + restrict_number?: string; + fk_cover_image_col_id?: string; + lock_type?: 'collaborative' | 'locked' | 'personal'; +} + export interface GalleryColumnType { id?: string; label?: string; @@ -441,6 +461,15 @@ export interface MapColumnType { fk_gallery_id?: string; } +export interface KanbanReqType { + title: string; + fk_grp_col_id?: string | null; +} + +export interface KanbanUpdateReqType { + fk_grp_col_id?: string | null; +} + export interface FormType { id?: string; title?: string; @@ -460,6 +489,23 @@ export interface FormType { meta?: any; } +export interface FormReqType { + title: string; + heading?: string; + subheading?: string; + success_msg?: string; + redirect_url?: string; + redirect_after_secs?: string; + email?: string; + banner_image_url?: string; + logo_url?: string; + submit_another_form?: boolean; + show_blank_form?: boolean; + fk_model_id?: string; + lock_type?: 'collaborative' | 'locked' | 'personal'; + meta?: any; +} + export interface FormColumnType { fk_column_id?: string; id?: string; @@ -584,6 +630,33 @@ export interface HookTestReqType { hook: HookReqType; } +export interface SignUpReqType { + email: string; + password: string; +} + +export interface SignInReqType { + email: string; + password: string; +} + +export interface ForgotPasswordReqType { + email: string; +} + +export interface PasswordResetReqType { + password: string; +} + +export interface PasswordChangeReqType { + currentPassword: string; + newPassword: string; +} + +export interface ApiTokenReqType { + description?: string; +} + export interface PluginType { id?: string; title?: string; @@ -684,24 +757,22 @@ export interface NormalColumnRequestType { fk_model_id?: string; title?: string; dt?: string; - np?: string; - ns?: string; - clen?: string | number; - cop?: string; + np?: string | number | null; + ns?: string | number | null; pk?: boolean; pv?: boolean; - rqd?: boolean; + rqd?: number | null | boolean; column_name?: string; - un?: boolean; + un?: boolean | number | null; ct?: string; ai?: boolean; unique?: boolean; - cdf?: string; + cdf?: string | null; cc?: string; csn?: string; dtx?: string; - dtxp?: string; - dtxs?: string; + dtxp?: string | null; + dtxs?: string | null; au?: boolean; } @@ -760,6 +831,17 @@ export interface UserInfoType { roles?: any; } +export type VisibilityRuleReqType = { + disabled?: { + commenter?: boolean; + creator?: boolean; + editor?: boolean; + guest?: boolean; + owner?: boolean; + viewer?: boolean; + }; +}[]; + import axios, { AxiosInstance, AxiosRequestConfig, ResponseType } from 'axios'; export type QueryParamsType = Record; @@ -928,8 +1010,8 @@ export class Api< > extends HttpClient { auth = { /** - * @description Create a new user with provided email and password and first user is marked as super admin. - * + * @description Create a new user with provided email and password and first user is marked as super admin. + * * @tags Auth * @name Signup * @summary Signup @@ -968,8 +1050,8 @@ export class Api< }), /** - * @description Authenticate existing user with their email and password. Successful login will return a JWT access-token. - * + * @description Authenticate existing user with their email and password. Successful login will return a JWT access-token. + * * @tags Auth * @name Signin * @summary Signin @@ -1056,7 +1138,7 @@ export class Api< /** * @description Change password of authenticated user with a new one. - * + * * @tags Auth * @name PasswordChange * @summary Password change @@ -1167,7 +1249,7 @@ export class Api< /** * No description - * + * * @tags Auth * @name ProjectUserList * @summary Project users @@ -1288,7 +1370,7 @@ export class Api< orgTokens = { /** * No description - * + * * @tags Org tokens * @name List * @summary Organisation API Tokens List @@ -1358,7 +1440,7 @@ export class Api< orgLicense = { /** * No description - * + * * @tags Org license * @name Get * @summary App license get @@ -1407,7 +1489,7 @@ export class Api< orgAppSettings = { /** * No description - * + * * @tags Org app settings * @name Get * @summary App settings get @@ -1456,7 +1538,7 @@ export class Api< orgUsers = { /** * No description - * + * * @tags Org users * @name List * @summary Organisation Users @@ -1557,7 +1639,7 @@ export class Api< /** * No description - * + * * @tags Org users * @name GeneratePasswordResetToken * @summary Organisation User Generate Password Reset Token @@ -1585,7 +1667,7 @@ export class Api< project = { /** * No description - * + * * @tags Project * @name MetaGet * @summary Project info @@ -1770,7 +1852,7 @@ export class Api< /** * @description Read project details - * + * * @tags Project * @name SharedBaseGet * @request GET:/api/v1/db/meta/projects/{projectId}/shared @@ -1813,7 +1895,7 @@ export class Api< /** * No description - * + * * @tags Project * @name SharedBaseCreate * @request POST:/api/v1/db/meta/projects/{projectId}/shared @@ -1850,7 +1932,7 @@ export class Api< /** * No description - * + * * @tags Project * @name SharedBaseUpdate * @request PATCH:/api/v1/db/meta/projects/{projectId}/shared @@ -1952,7 +2034,7 @@ export class Api< /** * No description - * + * * @tags Project * @name AuditList * @request GET:/api/v1/db/meta/projects/{projectId}/audits @@ -2832,7 +2914,7 @@ export class Api< /** * No description - * + * * @tags DB view share * @name Create * @request POST:/api/v1/db/meta/views/{viewId}/share @@ -2951,7 +3033,7 @@ export class Api< dbTableSort = { /** * No description - * + * * @tags DB table sort * @name List * @request GET:/api/v1/db/meta/views/{viewId}/sorts @@ -4148,7 +4230,7 @@ export class Api< /** * @description Read project details - * + * * @tags Public * @name SharedBaseGet * @request GET:/api/v1/db/public/shared-base/{sharedBaseUuid}/meta @@ -4172,7 +4254,7 @@ export class Api< /** * No description - * + * * @tags Public * @name SharedViewMetaGet * @request GET:/api/v1/db/public/shared-view/{sharedViewUuid}/meta @@ -4309,7 +4391,7 @@ export class Api< /** * No description - * + * * @tags Utils * @name TestConnection * @request POST:/api/v1/db/meta/connection/test @@ -4419,7 +4501,7 @@ export class Api< /** * No description - * + * * @tags Utils * @name AggregatedMetaInfo * @request GET:/api/v1/aggregated-meta-info @@ -4536,7 +4618,7 @@ export class Api< dbTableWebhook = { /** * No description - * + * * @tags DB table webhook * @name List * @request GET:/api/v1/db/meta/tables/{tableId}/hooks @@ -4608,7 +4690,7 @@ export class Api< /** * No description - * + * * @tags DB table webhook * @name SamplePayloadGet * @request GET:/api/v1/db/meta/tables/{tableId}/hooks/samplePayload/{operation} @@ -4677,7 +4759,7 @@ export class Api< plugin = { /** * No description - * + * * @tags Plugin * @name List * @request GET:/api/v1/db/meta/plugins @@ -4804,7 +4886,7 @@ export class Api< * @name Create * @request POST:/api/v1/db/meta/projects/{projectId}/api-tokens * @response `200` `void` OK - * @response `201` `ApiTokenType` Created + * @response `201` `ApiTokenReqType` Created */ create: ( projectId: string, diff --git a/packages/nocodb/src/lib/meta/api/helpers/apiHelpers.ts b/packages/nocodb/src/lib/meta/api/helpers/apiHelpers.ts index 7ecf58587d..fe4438b1f2 100644 --- a/packages/nocodb/src/lib/meta/api/helpers/apiHelpers.ts +++ b/packages/nocodb/src/lib/meta/api/helpers/apiHelpers.ts @@ -8,7 +8,7 @@ export function parseHrtimeToSeconds(hrtime) { return seconds; } -const ajv = new Ajv({ strictSchema: false }); // Initialize AJV +const ajv = new Ajv({ strictSchema: false, strict: false }); // Initialize AJV ajv.addSchema(swagger, 'swagger.json'); diff --git a/packages/nocodb/src/lib/meta/api/tableApis.ts b/packages/nocodb/src/lib/meta/api/tableApis.ts index fecfcb0551..83d11cd8b2 100644 --- a/packages/nocodb/src/lib/meta/api/tableApis.ts +++ b/packages/nocodb/src/lib/meta/api/tableApis.ts @@ -6,8 +6,10 @@ import DOMPurify from 'isomorphic-dompurify'; import { AuditOperationSubTypes, AuditOperationTypes, + ColumnType, isVirtualCol, ModelTypes, + NormalColumnRequestType, TableListType, TableReqType, TableType, @@ -17,7 +19,7 @@ import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; import Project from '../../models/Project'; import Audit from '../../models/Audit'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; -import { getAjvValidatorMw } from './helpers' +import { getAjvValidatorMw } from './helpers'; import { xcVisibilityMetaGet } from './modelVisibilityApis'; import View from '../../models/View'; import getColumnPropsFromUIDT from '../helpers/getColumnPropsFromUIDT'; @@ -217,10 +219,13 @@ export async function tableCreate(req: Request, res) { columns: columns.map((c, i) => { const colMetaFromReq = req.body?.columns?.find( (c1) => c.cn === c1.column_name - ); + ) as NormalColumnRequestType; return { ...colMetaFromReq, - uidt: colMetaFromReq?.uidt || c.uidt || getColumnUiType(base, c), + uidt: + (colMetaFromReq?.uidt as string) || + c.uidt || + getColumnUiType(base, c), ...c, dtxp: [UITypes.MultiSelect, UITypes.SingleSelect].includes( colMetaFromReq.uidt as any @@ -230,7 +235,7 @@ export async function tableCreate(req: Request, res) { title: colMetaFromReq?.title || getColumnNameAlias(c.cn, base), column_name: c.cn, order: i + 1, - }; + } as NormalColumnRequestType; }), order: +(tables?.pop()?.order ?? 0) + 1, }) diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index eca3b0f3ed..c797eae4c6 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -8396,13 +8396,33 @@ "type": "boolean" }, "rqd": { - "type": "boolean" + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] }, "column_name": { "type": "string" }, "un": { - "type": "boolean" + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] }, "ct": { "type": "string" @@ -8472,10 +8492,7 @@ } ] } - }, - "required": [ - "uidt" - ] + } }, "ColumnList": { "description": "", From 06f7bcc2be5f0ffe0fa868b3f34c910ac1aab7ea Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 24 Feb 2023 00:54:17 +0530 Subject: [PATCH 44/68] fix: replace oneOf with anyOf Signed-off-by: Pranav C --- packages/nocodb/src/lib/meta/api/tableApis.ts | 1 - scripts/sdk/swagger.json | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/nocodb/src/lib/meta/api/tableApis.ts b/packages/nocodb/src/lib/meta/api/tableApis.ts index 83d11cd8b2..4c5d6856a5 100644 --- a/packages/nocodb/src/lib/meta/api/tableApis.ts +++ b/packages/nocodb/src/lib/meta/api/tableApis.ts @@ -6,7 +6,6 @@ import DOMPurify from 'isomorphic-dompurify'; import { AuditOperationSubTypes, AuditOperationTypes, - ColumnType, isVirtualCol, ModelTypes, NormalColumnRequestType, diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index c797eae4c6..de5e953b32 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -10170,6 +10170,7 @@ } }, "LinkToAnotherColumnReq": { + "type": "object", "properties": { "uidt": { "type": "string", @@ -10207,6 +10208,7 @@ ] }, "RollupColumnReq": { + "type": "object", "properties": { "uidt": { "type": "string", @@ -10266,10 +10268,7 @@ "ColumnReq": { "allOf": [ { - "oneOf": [ - { - "$ref": "#/components/schemas/NormalColumnRequest" - }, + "anyOf": [ { "$ref": "#/components/schemas/LinkToAnotherColumnReq" }, @@ -10281,6 +10280,9 @@ }, { "$ref": "#/components/schemas/LookupColumnReq" + }, + { + "$ref": "#/components/schemas/NormalColumnRequest" } ] }, From dbcc489c0dd0a118ceee07362946b0fc7efc8a4a Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 24 Feb 2023 00:56:44 +0530 Subject: [PATCH 45/68] fix: replace oneOf with anyOf - update all the places Signed-off-by: Pranav C --- packages/nocodb-sdk/src/lib/Api.ts | 32 ++++++++++++++++++++++++------ scripts/sdk/swagger.json | 8 ++++---- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index aef49929ce..5b478c68fa 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -276,7 +276,13 @@ export interface ColumnType { | RollupType | LookupType | SelectOptionsType - | object; + | object + | (LinkToAnotherRecordType & + FormulaType & + RollupType & + LookupType & + SelectOptionsType & + object); } export interface ColumnListType { @@ -808,11 +814,16 @@ export interface FormulaColumnReqType { } export type ColumnReqType = ( - | NormalColumnRequestType | LinkToAnotherColumnReqType | RollupColumnReqType | FormulaColumnReqType | LookupColumnReqType + | NormalColumnRequestType + | (LinkToAnotherColumnReqType & + RollupColumnReqType & + FormulaColumnReqType & + LookupColumnReqType & + NormalColumnRequestType) ) & { column_name?: string; title?: string; @@ -4262,11 +4273,11 @@ export class Api< relatedMetas?: any, client?: string, base_id?: string, - columns?: ((GridColumnType | FormColumnType | GalleryColumnType) & ColumnType), + columns?: ((GridColumnType | FormColumnType | GalleryColumnType | (GridColumnType & FormColumnType & GalleryColumnType)) & ColumnType), model?: TableType, } & { - view?: (FormType | GridType | GalleryType), + view?: (FormType | GridType | GalleryType | (FormType & GridType & GalleryType)), })` OK */ @@ -4276,11 +4287,20 @@ export class Api< relatedMetas?: any; client?: string; base_id?: string; - columns?: (GridColumnType | FormColumnType | GalleryColumnType) & + columns?: ( + | GridColumnType + | FormColumnType + | GalleryColumnType + | (GridColumnType & FormColumnType & GalleryColumnType) + ) & ColumnType; model?: TableType; } & { - view?: FormType | GridType | GalleryType; + view?: + | FormType + | GridType + | GalleryType + | (FormType & GridType & GalleryType); }, any >({ diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index de5e953b32..39dc85adaf 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -5713,7 +5713,7 @@ "columns": { "allOf": [ { - "oneOf": [ + "anyOf": [ { "$ref": "#/components/schemas/GridColumn" }, @@ -5739,7 +5739,7 @@ "type": "object", "properties": { "view": { - "oneOf": [ + "anyOf": [ { "$ref": "#/components/schemas/Form" }, @@ -7787,7 +7787,7 @@ "type": "number" }, "view": { - "oneOf": [ + "anyOf": [ { "$ref": "#/components/schemas/Form" }, @@ -8471,7 +8471,7 @@ }, "meta": {}, "colOptions": { - "oneOf": [ + "anyOf": [ { "$ref": "#/components/schemas/LinkToAnotherRecord" }, From 18a6c3a15542f48b39683fd4956a23029286a966 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 24 Feb 2023 17:16:29 +0530 Subject: [PATCH 46/68] chore: generate sdk file Signed-off-by: Pranav C --- packages/nocodb-sdk/src/lib/Api.ts | 58 ++++++++++++++++-------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index 5b478c68fa..61a4963e0d 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -139,7 +139,13 @@ export interface ViewType { show_system_fields?: boolean; lock_type?: 'collaborative' | 'locked' | 'personal'; type?: number; - view?: FormType | GridType | GalleryType | KanbanType | MapType; + view?: + | FormType + | GridType + | GalleryType + | KanbanType + | MapType + | (FormType & GridType & GalleryType & KanbanType & MapType); } export interface TableInfoType { @@ -1021,8 +1027,8 @@ export class Api< > extends HttpClient { auth = { /** - * @description Create a new user with provided email and password and first user is marked as super admin. - * + * @description Create a new user with provided email and password and first user is marked as super admin. + * * @tags Auth * @name Signup * @summary Signup @@ -1061,8 +1067,8 @@ export class Api< }), /** - * @description Authenticate existing user with their email and password. Successful login will return a JWT access-token. - * + * @description Authenticate existing user with their email and password. Successful login will return a JWT access-token. + * * @tags Auth * @name Signin * @summary Signin @@ -1149,7 +1155,7 @@ export class Api< /** * @description Change password of authenticated user with a new one. - * + * * @tags Auth * @name PasswordChange * @summary Password change @@ -1260,7 +1266,7 @@ export class Api< /** * No description - * + * * @tags Auth * @name ProjectUserList * @summary Project users @@ -1381,7 +1387,7 @@ export class Api< orgTokens = { /** * No description - * + * * @tags Org tokens * @name List * @summary Organisation API Tokens List @@ -1451,7 +1457,7 @@ export class Api< orgLicense = { /** * No description - * + * * @tags Org license * @name Get * @summary App license get @@ -1500,7 +1506,7 @@ export class Api< orgAppSettings = { /** * No description - * + * * @tags Org app settings * @name Get * @summary App settings get @@ -1549,7 +1555,7 @@ export class Api< orgUsers = { /** * No description - * + * * @tags Org users * @name List * @summary Organisation Users @@ -1650,7 +1656,7 @@ export class Api< /** * No description - * + * * @tags Org users * @name GeneratePasswordResetToken * @summary Organisation User Generate Password Reset Token @@ -1678,7 +1684,7 @@ export class Api< project = { /** * No description - * + * * @tags Project * @name MetaGet * @summary Project info @@ -1863,7 +1869,7 @@ export class Api< /** * @description Read project details - * + * * @tags Project * @name SharedBaseGet * @request GET:/api/v1/db/meta/projects/{projectId}/shared @@ -1906,7 +1912,7 @@ export class Api< /** * No description - * + * * @tags Project * @name SharedBaseCreate * @request POST:/api/v1/db/meta/projects/{projectId}/shared @@ -1943,7 +1949,7 @@ export class Api< /** * No description - * + * * @tags Project * @name SharedBaseUpdate * @request PATCH:/api/v1/db/meta/projects/{projectId}/shared @@ -2045,7 +2051,7 @@ export class Api< /** * No description - * + * * @tags Project * @name AuditList * @request GET:/api/v1/db/meta/projects/{projectId}/audits @@ -2925,7 +2931,7 @@ export class Api< /** * No description - * + * * @tags DB view share * @name Create * @request POST:/api/v1/db/meta/views/{viewId}/share @@ -3044,7 +3050,7 @@ export class Api< dbTableSort = { /** * No description - * + * * @tags DB table sort * @name List * @request GET:/api/v1/db/meta/views/{viewId}/sorts @@ -4241,7 +4247,7 @@ export class Api< /** * @description Read project details - * + * * @tags Public * @name SharedBaseGet * @request GET:/api/v1/db/public/shared-base/{sharedBaseUuid}/meta @@ -4265,7 +4271,7 @@ export class Api< /** * No description - * + * * @tags Public * @name SharedViewMetaGet * @request GET:/api/v1/db/public/shared-view/{sharedViewUuid}/meta @@ -4411,7 +4417,7 @@ export class Api< /** * No description - * + * * @tags Utils * @name TestConnection * @request POST:/api/v1/db/meta/connection/test @@ -4521,7 +4527,7 @@ export class Api< /** * No description - * + * * @tags Utils * @name AggregatedMetaInfo * @request GET:/api/v1/aggregated-meta-info @@ -4638,7 +4644,7 @@ export class Api< dbTableWebhook = { /** * No description - * + * * @tags DB table webhook * @name List * @request GET:/api/v1/db/meta/tables/{tableId}/hooks @@ -4710,7 +4716,7 @@ export class Api< /** * No description - * + * * @tags DB table webhook * @name SamplePayloadGet * @request GET:/api/v1/db/meta/tables/{tableId}/hooks/samplePayload/{operation} @@ -4779,7 +4785,7 @@ export class Api< plugin = { /** * No description - * + * * @tags Plugin * @name List * @request GET:/api/v1/db/meta/plugins From e757e97b02cec5dce7b201ed5aed79e4dd889dee Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 24 Feb 2023 19:22:40 +0530 Subject: [PATCH 47/68] fix(swagger): change order type from integer to number Signed-off-by: Pranav C --- scripts/sdk/swagger.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 39dc85adaf..db0673371c 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -10302,7 +10302,7 @@ "type": "string" }, "order": { - "type": "integer" + "type": "number" } } } From 19f773fae01b43570ce20d02e643d5ef0a51675d Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 24 Feb 2023 19:31:27 +0530 Subject: [PATCH 48/68] fix: type and schema name corrections Signed-off-by: Pranav C --- packages/nocodb-sdk/src/lib/Api.ts | 2 +- packages/nocodb/src/lib/meta/api/filterApis.ts | 6 +++--- packages/nocodb/src/lib/meta/api/hookFilterApis.ts | 4 ++-- packages/nocodb/src/lib/meta/api/sortApis.ts | 4 ++-- scripts/sdk/swagger.json | 9 ++++++++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index 61a4963e0d..504a9fddd2 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -621,7 +621,7 @@ export interface HookReqType { id?: string; fk_model_id?: string; title: string; - description?: string; + description?: string | null; env?: string; event: 'after' | 'before'; operation: 'insert' | 'delete' | 'update'; diff --git a/packages/nocodb/src/lib/meta/api/filterApis.ts b/packages/nocodb/src/lib/meta/api/filterApis.ts index d45f00085a..ff751d47df 100644 --- a/packages/nocodb/src/lib/meta/api/filterApis.ts +++ b/packages/nocodb/src/lib/meta/api/filterApis.ts @@ -136,7 +136,7 @@ router.get( router.post( '/api/v1/db/meta/views/:viewId/filters', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/filterReq'), + getAjvValidatorMw('swagger.json#/components/schemas/FilterReq'), ncMetaAclMw(filterCreate, 'filterCreate') ); @@ -147,7 +147,7 @@ router.get( router.post( '/api/v1/db/meta/hooks/:hookId/filters', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/filterReq'), + getAjvValidatorMw('swagger.json#/components/schemas/FilterReq'), ncMetaAclMw(hookFilterCreate, 'filterCreate') ); @@ -159,7 +159,7 @@ router.get( router.patch( '/api/v1/db/meta/filters/:filterId', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/filterReq'), + getAjvValidatorMw('swagger.json#/components/schemas/FilterReq'), ncMetaAclMw(filterUpdate, 'filterUpdate') ); router.delete( diff --git a/packages/nocodb/src/lib/meta/api/hookFilterApis.ts b/packages/nocodb/src/lib/meta/api/hookFilterApis.ts index 4ba268fbb6..662b7243a2 100644 --- a/packages/nocodb/src/lib/meta/api/hookFilterApis.ts +++ b/packages/nocodb/src/lib/meta/api/hookFilterApis.ts @@ -118,7 +118,7 @@ router.get( router.post( '/hooks/:hookId/filters/', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/filterReq'), + getAjvValidatorMw('swagger.json#/components/schemas/FilterReq'), ncMetaAclMw(filterCreate, 'filterCreate') ); router.get( @@ -129,7 +129,7 @@ router.get( router.patch( '/hooks/:hookId/filters/:filterId', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/filterReq'), + getAjvValidatorMw('swagger.json#/components/schemas/FilterReq'), ncMetaAclMw(filterUpdate, 'filterUpdate') ); router.delete( diff --git a/packages/nocodb/src/lib/meta/api/sortApis.ts b/packages/nocodb/src/lib/meta/api/sortApis.ts index 8a6508fbc4..233fc4ae13 100644 --- a/packages/nocodb/src/lib/meta/api/sortApis.ts +++ b/packages/nocodb/src/lib/meta/api/sortApis.ts @@ -59,7 +59,7 @@ router.get( router.post( '/api/v1/db/meta/views/:viewId/sorts/', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/sortReq'), + getAjvValidatorMw('swagger.json#/components/schemas/SortReq'), ncMetaAclMw(sortCreate, 'sortCreate') ); router.get( @@ -70,7 +70,7 @@ router.get( router.patch( '/api/v1/db/meta/sorts/:sortId', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/sortReq'), + getAjvValidatorMw('swagger.json#/components/schemas/SortReq'), ncMetaAclMw(sortUpdate, 'sortUpdate') ); router.delete( diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index db0673371c..175ee10092 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -9681,7 +9681,14 @@ "type": "string" }, "description": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "env": { "type": "string" From ad92b5895256dbed0951022477d08229d7762500 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 25 Feb 2023 15:00:10 +0530 Subject: [PATCH 49/68] fix: add missing schema Signed-off-by: Pranav C --- packages/nocodb-sdk/src/lib/Api.ts | 15 ++++++-- scripts/sdk/swagger.json | 59 ++++++++++++++++++++++++++++-- 2 files changed, 68 insertions(+), 6 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index 504a9fddd2..098d6b447f 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -198,7 +198,7 @@ export interface FilterType { logical_op?: string; comparison_op?: string; value?: string | number | boolean | null; - is_group?: boolean; + is_group?: string | number | null; children?: FilterType[]; project_id?: string; base_id?: string; @@ -214,7 +214,7 @@ export interface FilterReqType { logical_op?: string; comparison_op?: string; value?: string | number | boolean | null; - is_group?: boolean; + is_group?: string | number | null; children?: FilterType[]; project_id?: string; base_id?: string; @@ -239,6 +239,11 @@ export interface SortType { base_id?: string; } +export interface SortReqType { + fk_column_id?: string; + direction?: string; +} + export interface SortListType { sorts: { list: SharedViewType[]; @@ -473,6 +478,10 @@ export interface MapColumnType { fk_gallery_id?: string; } +export interface LicenseReqType { + key?: string; +} + export interface KanbanReqType { title: string; fk_grp_col_id?: string | null; @@ -625,7 +634,7 @@ export interface HookReqType { env?: string; event: 'after' | 'before'; operation: 'insert' | 'delete' | 'update'; - async?: boolean; + async?: string | number | null; payload?: string; url?: string; headers?: string; diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 175ee10092..95ae0a26f9 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -8103,7 +8103,17 @@ ] }, "is_group": { - "type": "boolean" + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] }, "children": { "type": "array", @@ -8160,7 +8170,17 @@ ] }, "is_group": { - "type": "boolean" + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] }, "children": { "type": "array", @@ -8271,6 +8291,19 @@ } } }, + "SortReq": { + "title": "Sort", + "type": "object", + "properties": { + "fk_column_id": { + "type": "string" + }, + "direction": { + "type": "string" + } + }, + "minProperties": "1" + }, "SortList": { "description": "", "type": "object", @@ -9108,6 +9141,16 @@ } } }, + "LicenseReq": { + "title": "License Key", + "type": "object", + "description": "", + "properties": { + "key": { + "type": "string" + } + } + }, "KanbanReq": { "title": "Kanban", "type": "object", @@ -9709,7 +9752,17 @@ ] }, "async": { - "type": "boolean" + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] }, "payload": { "type": "string" From f1b75b16e1a5eeef5460da99ee5bbc7ad75b4869 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 25 Feb 2023 15:19:01 +0530 Subject: [PATCH 50/68] fix: type corrections Signed-off-by: Pranav C --- packages/nocodb-sdk/src/lib/Api.ts | 4 ++-- .../src/lib/db/sql-data-mapper/lib/sql/CustomKnex.ts | 9 ++++++++- packages/nocodb/src/lib/models/Filter.ts | 2 +- scripts/sdk/swagger.json | 4 ++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index 098d6b447f..f08cb738de 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -198,7 +198,7 @@ export interface FilterType { logical_op?: string; comparison_op?: string; value?: string | number | boolean | null; - is_group?: string | number | null; + is_group?: boolean | number | null; children?: FilterType[]; project_id?: string; base_id?: string; @@ -214,7 +214,7 @@ export interface FilterReqType { logical_op?: string; comparison_op?: string; value?: string | number | boolean | null; - is_group?: string | number | null; + is_group?: boolean | number | null; children?: FilterType[]; project_id?: string; base_id?: string; diff --git a/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/CustomKnex.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/CustomKnex.ts index 704225e569..e12dd700e6 100644 --- a/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/CustomKnex.ts +++ b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/CustomKnex.ts @@ -1,5 +1,6 @@ import { Knex, knex } from 'knex'; import { SnowflakeClient } from 'nc-help'; +import { FilterType } from 'nocodb-sdk'; const types = require('pg').types; // override parsing date column to Date() @@ -1248,7 +1249,13 @@ knex.QueryBuilder.extend('conditionv2', function (conditionObj: Filter) { return parseConditionv2(conditionObj, this); } as any); -const parseConditionv2 = (obj: Filter, qb: Knex.QueryBuilder) => { +const parseConditionv2 = (_obj: Filter | FilterType, qb: Knex.QueryBuilder) => { + let obj: Filter; + if (_obj instanceof Filter) { + obj = _obj; + } else { + obj = new Filter(_obj); + } if (obj.is_group) { qb = qb.where(function () { const children = obj.children; diff --git a/packages/nocodb/src/lib/models/Filter.ts b/packages/nocodb/src/lib/models/Filter.ts index 1e6a0dfaee..8bd2ef73b2 100644 --- a/packages/nocodb/src/lib/models/Filter.ts +++ b/packages/nocodb/src/lib/models/Filter.ts @@ -55,7 +55,7 @@ export default class Filter { value?: string; logical_op?: string; - is_group?: boolean; + is_group?: boolean | number; children?: Filter[]; project_id?: string; base_id?: string; diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 95ae0a26f9..66f66447db 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -8105,7 +8105,7 @@ "is_group": { "oneOf": [ { - "type": "string" + "type": "boolean" }, { "type": "integer" @@ -8172,7 +8172,7 @@ "is_group": { "oneOf": [ { - "type": "string" + "type": "boolean" }, { "type": "integer" From ed401ba830489fa018743da953a8bbb1709e0e0e Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 25 Feb 2023 16:16:30 +0530 Subject: [PATCH 51/68] fix: swagger schema corrections Signed-off-by: Pranav C --- scripts/sdk/swagger.json | 137 +++++++++++++++++++++++++++++---------- 1 file changed, 101 insertions(+), 36 deletions(-) diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 66f66447db..3e716a3f21 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -8133,10 +8133,24 @@ "type": "string" }, "fk_view_id": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "fk_hook_id": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } }, "readOnly": true @@ -8200,10 +8214,24 @@ "type": "string" }, "fk_view_id": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "fk_hook_id": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] } }, "readOnly": true @@ -9044,18 +9072,29 @@ "type": "string" }, "fk_grp_col_id": { - "type": [ - "string", - "null" + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] }, "fk_cover_image_col_id": { "type": "string" }, "meta": { - "type": [ - "string", - "object" + "oneOf": [ + { + "type": "object" + }, + { + "type": "null" + }, + { + "type": "string" + } ] } } @@ -9100,9 +9139,13 @@ "minLength": 1 }, "fk_geo_data_col_id": { - "type": [ - "string", - "null" + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } ] }, "columns": { @@ -9112,9 +9155,13 @@ } }, "meta": { - "type": [ - "string", - "object" + "oneOf": [ + { + "type": "string" + }, + { + "type": "object" + } ] } } @@ -9382,13 +9429,17 @@ "type": "integer" }, "sort": { - "type": [ - "string", - "array" - ], - "items": { - "$ref": "#/components/schemas/Sort" - } + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/Sort" + } + } + ] }, "isFirstPage": { "type": "boolean" @@ -9681,9 +9732,7 @@ "async": { "type": "boolean" }, - "payload": { - "type": "string" - }, + "payload": { }, "url": { "type": "string" }, @@ -9764,9 +9813,7 @@ } ] }, - "payload": { - "type": "string" - }, + "payload": {}, "url": { "type": "string" }, @@ -9936,9 +9983,20 @@ "type": "string" }, "input": { - "type": [ - "string", - "null" + + "items": { + "$ref": "#/components/schemas/Sort" + } + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } ] }, "creator": { @@ -10013,7 +10071,16 @@ "type": "string" }, "fk_hook_id": { - "type": "string" + + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, "type": { "type": "string" @@ -10027,9 +10094,7 @@ "test_call": { "type": "boolean" }, - "payload": { - "type": "string" - }, + "payload": {}, "conditions": { "type": "string" }, From c6e5d5463b41e742b962dac01c13f91fba493b6d Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 25 Feb 2023 16:18:55 +0530 Subject: [PATCH 52/68] fix: convert minProperties value to number Signed-off-by: Pranav C --- scripts/sdk/swagger.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 3e716a3f21..a2d8937397 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -8330,7 +8330,7 @@ "type": "string" } }, - "minProperties": "1" + "minProperties": 1 }, "SortList": { "description": "", From ea73fb75b2e6ce1c893002a0475dcb1fbd4c8416 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 25 Feb 2023 16:26:00 +0530 Subject: [PATCH 53/68] fix: swagger - missing comma Signed-off-by: Pranav C --- scripts/sdk/swagger.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index a2d8937397..508afd9112 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -9983,10 +9983,6 @@ "type": "string" }, "input": { - - "items": { - "$ref": "#/components/schemas/Sort" - } "oneOf": [ { "type": "string" From 8a1036b23788d7d3fb75555c5c5101e55ff2a5c4 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 25 Feb 2023 17:05:03 +0530 Subject: [PATCH 54/68] fix: hook request schema correction Signed-off-by: Pranav C --- scripts/sdk/swagger.json | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 508afd9112..001a99292d 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -9815,13 +9815,34 @@ }, "payload": {}, "url": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "headers": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "condition": { - "type": "boolean" + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] }, "notification": { "type": "object" From 4770210568aa711af96b9b1380d7cc005c8c63f3 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 25 Feb 2023 17:21:46 +0530 Subject: [PATCH 55/68] fix: dtxp type correction Signed-off-by: Pranav C --- packages/nocodb-sdk/src/lib/Api.ts | 36 +++++++++++++++--------------- scripts/sdk/swagger.json | 30 +++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 20 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index f08cb738de..ad1b387925 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -203,8 +203,8 @@ export interface FilterType { project_id?: string; base_id?: string; fk_parent_id?: string; - fk_view_id?: string; - fk_hook_id?: string; + fk_view_id?: string | null; + fk_hook_id?: string | null; } export interface FilterReqType { @@ -219,8 +219,8 @@ export interface FilterReqType { project_id?: string; base_id?: string; fk_parent_id?: string; - fk_view_id?: string; - fk_hook_id?: string; + fk_view_id?: string | null; + fk_hook_id?: string | null; } export interface FilterListType { @@ -273,8 +273,8 @@ export interface ColumnType { cc?: string; csn?: string; dtx?: string; - dtxp?: string; - dtxs?: string; + dtxp?: string | number | null; + dtxs?: string | number | null; au?: boolean; deleted?: boolean; visible?: boolean; @@ -448,7 +448,7 @@ export interface KanbanType { fk_model_id?: string; fk_grp_col_id?: string | null; fk_cover_image_col_id?: string; - meta?: string | object; + meta?: object | null | string; } export interface GeoLocationType { @@ -546,7 +546,7 @@ export interface FormColumnType { export interface PaginatedType { pageSize?: number; totalRows?: number; - sort?: string | any[]; + sort?: string | SortType[]; isFirstPage?: boolean; isLastPage?: boolean; page?: number; @@ -615,7 +615,7 @@ export interface HookType { event?: 'after' | 'before'; operation?: 'insert' | 'delete' | 'update'; async?: boolean; - payload?: string; + payload?: any; url?: string; headers?: string; condition?: boolean; @@ -635,10 +635,10 @@ export interface HookReqType { event: 'after' | 'before'; operation: 'insert' | 'delete' | 'update'; async?: string | number | null; - payload?: string; - url?: string; - headers?: string; - condition?: boolean; + payload?: any; + url?: string | null; + headers?: string | null; + condition?: boolean | null; notification: object; retries?: number; retry_interval?: number; @@ -693,7 +693,7 @@ export interface PluginType { tags?: string; category?: string; input_schema?: string; - input?: string | null; + input?: string | number | null; creator?: string; creator_website?: string; price?: string; @@ -722,12 +722,12 @@ export interface HookLogType { id?: string; base_id?: string; project_id?: string; - fk_hook_id?: string; + fk_hook_id?: string | null; type?: string; event?: string; operation?: string; test_call?: boolean; - payload?: string; + payload?: any; conditions?: string; notifications?: string; error_code?: string; @@ -792,8 +792,8 @@ export interface NormalColumnRequestType { cc?: string; csn?: string; dtx?: string; - dtxp?: string | null; - dtxs?: string | null; + dtxp?: string | number | null; + dtxs?: string | number | null; au?: boolean; } diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 001a99292d..efe0023012 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -8507,10 +8507,30 @@ "type": "string" }, "dtxp": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "null" + } + ] }, "dtxs": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "null" + } + ] }, "au": { "type": "boolean" @@ -10291,6 +10311,9 @@ { "type": "string" }, + { + "type": "number" + }, { "type": "null" } @@ -10301,6 +10324,9 @@ { "type": "string" }, + { + "type": "number" + }, { "type": "null" } From eabaa635f3df88ca3a0870bd28734e9947f66cf3 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 25 Feb 2023 18:11:01 +0530 Subject: [PATCH 56/68] fix: use newly added schema in swagger apis Signed-off-by: Pranav C --- packages/nocodb-sdk/src/lib/Api.ts | 84 +++++++----------- scripts/sdk/swagger.json | 137 ++++++++--------------------- 2 files changed, 65 insertions(+), 156 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index ad1b387925..1e361669c5 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -1053,13 +1053,7 @@ export class Api< * @response `401` `void` Unauthorized * @response `403` `void` Forbidden */ - signup: ( - data: { - email?: string; - password?: string; - }, - params: RequestParams = {} - ) => + signup: (data: SignUpReqType, params: RequestParams = {}) => this.request< { token?: string; @@ -1091,13 +1085,7 @@ export class Api< }` Bad Request */ - signin: ( - data: { - email: string; - password: string; - }, - params: RequestParams = {} - ) => + signin: (data: SignInReqType, params: RequestParams = {}) => this.request< { token?: string; @@ -1148,12 +1136,7 @@ export class Api< * @response `200` `void` OK * @response `401` `void` Unauthorized */ - passwordForgot: ( - data: { - email?: string; - }, - params: RequestParams = {} - ) => + passwordForgot: (data: ForgotPasswordReqType, params: RequestParams = {}) => this.request({ path: `/api/v1/auth/password/forgot`, method: 'POST', @@ -1178,13 +1161,7 @@ export class Api< }` Bad request */ - passwordChange: ( - data: { - currentPassword?: string; - newPassword?: string; - }, - params: RequestParams = {} - ) => + passwordChange: (data: PasswordChangeReqType, params: RequestParams = {}) => this.request< { msg?: string; @@ -1244,9 +1221,7 @@ export class Api< */ passwordReset: ( token: string, - data: { - new_password?: string; - }, + data: PasswordResetReqType, params: RequestParams = {} ) => this.request({ @@ -1498,12 +1473,7 @@ export class Api< * @request POST:/api/v1/license * @response `200` `void` OK */ - set: ( - data: { - key?: string; - }, - params: RequestParams = {} - ) => + set: (data: LicenseReqType, params: RequestParams = {}) => this.request({ path: `/api/v1/license`, method: 'POST', @@ -1761,14 +1731,14 @@ export class Api< * @tags Project * @name ModelVisibilitySet * @request POST:/api/v1/db/meta/projects/{projectId}/visibility-rules - * @response `200` `any` OK + * @response `200` `VisibilityRuleReqType` OK */ modelVisibilitySet: ( projectId: string, data: any, params: RequestParams = {} ) => - this.request({ + this.request({ path: `/api/v1/db/meta/projects/${projectId}/visibility-rules`, method: 'POST', body: data, @@ -2612,7 +2582,11 @@ export class Api< * @request POST:/api/v1/db/meta/tables/{tableId}/grids * @response `200` `GridType` OK */ - gridCreate: (tableId: string, data: GridType, params: RequestParams = {}) => + gridCreate: ( + tableId: string, + data: GridReqType, + params: RequestParams = {} + ) => this.request({ path: `/api/v1/db/meta/tables/${tableId}/grids`, method: 'POST', @@ -2630,7 +2604,11 @@ export class Api< * @request POST:/api/v1/db/meta/tables/{tableId}/forms * @response `200` `FormType` OK */ - formCreate: (tableId: string, data: FormType, params: RequestParams = {}) => + formCreate: ( + tableId: string, + data: FormReqType, + params: RequestParams = {} + ) => this.request({ path: `/api/v1/db/meta/tables/${tableId}/forms`, method: 'POST', @@ -2761,7 +2739,7 @@ export class Api< */ galleryCreate: ( tableId: string, - data: GalleryType, + data: GalleryReqType, params: RequestParams = {} ) => this.request({ @@ -2783,7 +2761,7 @@ export class Api< */ galleryUpdate: ( galleryId: string, - data: GalleryType, + data: GalleryReqType, params: RequestParams = {} ) => this.request({ @@ -2820,7 +2798,7 @@ export class Api< */ kanbanCreate: ( tableId: string, - data: KanbanType, + data: KanbanReqType, params: RequestParams = {} ) => this.request({ @@ -2842,7 +2820,7 @@ export class Api< */ kanbanUpdate: ( kanbanId: string, - data: KanbanType, + data: KanbanUpdateReqType, params: RequestParams = {} ) => this.request({ @@ -3182,7 +3160,7 @@ export class Api< * @request POST:/api/v1/db/meta/views/{viewId}/filters * @response `200` `FilterType` OK */ - create: (viewId: string, data: FilterType, params: RequestParams = {}) => + create: (viewId: string, data: FilterReqType, params: RequestParams = {}) => this.request({ path: `/api/v1/db/meta/views/${viewId}/filters`, method: 'POST', @@ -3216,7 +3194,11 @@ export class Api< * @request PATCH:/api/v1/db/meta/filters/{filterId} * @response `200` `void` OK */ - update: (filterId: string, data: FilterType, params: RequestParams = {}) => + update: ( + filterId: string, + data: FilterReqType, + params: RequestParams = {} + ) => this.request({ path: `/api/v1/db/meta/filters/${filterId}`, method: 'PATCH', @@ -3280,7 +3262,7 @@ export class Api< * @request POST:/api/v1/db/meta/hooks/{hookId}/filters * @response `200` `void` OK */ - create: (hookId: string, data: FilterType, params: RequestParams = {}) => + create: (hookId: string, data: FilterReqType, params: RequestParams = {}) => this.request({ path: `/api/v1/db/meta/hooks/${hookId}/filters`, method: 'POST', @@ -4705,13 +4687,7 @@ export class Api< */ test: ( tableId: string, - data: { - payload?: { - data?: any; - user?: any; - }; - hook?: HookType; - }, + data: HookTestReqType, params: RequestParams = {} ) => this.request({ diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index efe0023012..e9ee0925a1 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -138,19 +138,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "email": { - "type": "string" - }, - "password": { - "type": "string" - } - }, - "required": [ - "email", - "password" - ] + "$ref": "#/components/schemas/SignInReq" }, "examples": { "example-1": { @@ -234,12 +222,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "email": { - "type": "string" - } - } + "$ref": "#/components/schemas/ForgotPasswordReq" } } }, @@ -311,15 +294,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "currentPassword": { - "type": "string" - }, - "newPassword": { - "type": "string" - } - } + "$ref": "#/components/schemas/PasswordChangeReq" }, "examples": { "example-1": { @@ -403,12 +378,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "new_password": { - "type": "string" - } - } + "$ref": "#/components/schemas/PasswordResetReq" } } } @@ -557,12 +527,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "key": { - "type": "string" - } - } + "$ref": "#/components/schemas/LicenseReq" } } } @@ -1087,7 +1052,9 @@ "description": "OK", "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/VisibilityRuleReq" + } } } } @@ -2701,7 +2668,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Filter" + "$ref": "#/components/schemas/FilterReq" } } } @@ -2746,7 +2713,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Filter" + "$ref": "#/components/schemas/FilterReq" } } } @@ -2798,7 +2765,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Filter" + "$ref": "#/components/schemas/FilterReq" } } } @@ -2884,7 +2851,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Grid" + "$ref": "#/components/schemas/GridReq" } } } @@ -2925,7 +2892,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Form" + "$ref": "#/components/schemas/FormReq" } } } @@ -3168,7 +3135,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Gallery" + "$ref": "#/components/schemas/GalleryReq" } } } @@ -3201,7 +3168,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Gallery" + "$ref": "#/components/schemas/GalleryReq" } } } @@ -3261,7 +3228,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Kanban" + "$ref": "#/components/schemas/KanbanReq" } } } @@ -3294,7 +3261,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Kanban" + "$ref": "#/components/schemas/KanbanUpdateReq" } } } @@ -6113,19 +6080,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "payload": { - "type": "object", - "properties": { - "data": {}, - "user": {} - } - }, - "hook": { - "$ref": "#/components/schemas/Hook" - } - } + "$ref": "#/components/schemas/HookTestReq" } } } @@ -9106,12 +9061,12 @@ }, "meta": { "oneOf": [ - { - "type": "object" - }, - { - "type": "null" - }, + { + "type": "object" + }, + { + "type": "null" + }, { "type": "string" } @@ -9752,7 +9707,7 @@ "async": { "type": "boolean" }, - "payload": { }, + "payload": {}, "url": { "type": "string" }, @@ -9821,7 +9776,7 @@ ] }, "async": { - "oneOf": [ + "oneOf": [ { "type": "string" }, @@ -10108,16 +10063,14 @@ "type": "string" }, "fk_hook_id": { - - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "type": { "type": "string" @@ -10540,27 +10493,7 @@ "content": { "application/json": { "schema": { - "description": "", - "type": "object", - "x-examples": { - "example-1": { - "email": true - } - }, - "properties": { - "email": { - "type": "string" - }, - "password": { - "type": "string" - } - } - } - }, - "application/xml": { - "schema": { - "type": "object", - "properties": {} + "$ref": "#/components/schemas/SignUpReq" } } } From 04c87a0d7ffe43b889e06067b67696778d3f548d Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 25 Feb 2023 18:17:18 +0530 Subject: [PATCH 57/68] fix: remove unused hook table props from json schema Signed-off-by: Pranav C --- scripts/sdk/swagger.json | 41 ---------------------------------------- 1 file changed, 41 deletions(-) diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index e9ee0925a1..8871c8af88 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -9707,16 +9707,6 @@ "async": { "type": "boolean" }, - "payload": {}, - "url": { - "type": "string" - }, - "headers": { - "type": "string" - }, - "condition": { - "type": "boolean" - }, "notification": { "type": "string" }, @@ -9788,37 +9778,6 @@ } ] }, - "payload": {}, - "url": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "headers": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "condition": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, "notification": { "type": "object" }, From b54d2d22a43b0f5a15e632cb836e329a7565f907 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 25 Feb 2023 19:23:52 +0530 Subject: [PATCH 58/68] refactor: use a generic boolean type which could be number, null or boolean - In databases boolean is stored as 0/1 so all boolean field could be number as well Signed-off-by: Pranav C --- packages/nocodb-sdk/src/lib/Api.ts | 159 ++++++----- .../src/lib/meta/api/formViewColumnApis.ts | 3 +- .../src/lib/meta/api/gridViewColumnApis.ts | 2 +- .../src/lib/meta/api/helpers/columnHelpers.ts | 6 +- packages/nocodb/src/lib/models/Base.ts | 6 +- .../lib/models/LinkToAnotherRecordColumn.ts | 3 +- packages/nocodb/src/lib/models/Model.ts | 15 +- packages/nocodb/src/lib/models/Project.ts | 4 +- scripts/sdk/swagger.json | 265 ++++++++++-------- 9 files changed, 251 insertions(+), 212 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index 1e361669c5..918aa4fe2d 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -58,10 +58,10 @@ export interface ProjectType { description?: string; meta?: string | object; color?: string; - deleted?: string | boolean; + deleted?: NcBoolType; order?: number; bases?: BaseType[]; - is_meta?: boolean; + is_meta?: NcBoolType; prefix?: string; created_at?: any; updated_at?: any; @@ -78,14 +78,14 @@ export interface BaseType { project_id?: string; alias?: string; type?: string; - is_meta?: boolean; + is_meta?: NcBoolType; config?: any; created_at?: any; updated_at?: any; inflection_column?: string; inflection_table?: string; order?: number; - enabled?: boolean; + enabled?: NcBoolType; } export interface BaseReqType { @@ -113,30 +113,30 @@ export interface TableType { table_name: string; title: string; type?: string; - enabled?: boolean; + enabled?: NcBoolType; parent_id?: string; show_as?: string; tags?: string; - pinned?: boolean; - deleted?: boolean; + pinned?: NcBoolType; + deleted?: NcBoolType; order?: number; columns?: ColumnType[]; columnsById?: object; slug?: string; - mm?: boolean | number; + mm?: NcBoolType; meta?: any; } export interface ViewType { id?: string; title: string; - deleted?: boolean; + deleted?: NcBoolType; order?: number; fk_model_id?: string; slug?: string; uuid?: string; meta?: any; - show_system_fields?: boolean; + show_system_fields?: NcBoolType; lock_type?: 'collaborative' | 'locked' | 'personal'; type?: number; view?: @@ -159,8 +159,8 @@ export interface TableInfoType { parent_id?: string; show_as?: string; tags?: string; - pinned?: boolean; - deleted?: boolean; + pinned?: NcBoolType; + deleted?: NcBoolType; order?: number; column?: ColumnType[]; filters?: FilterType[]; @@ -178,10 +178,10 @@ export interface TableReqType { parent_id?: string; show_as?: string; tags?: string; - pinned?: boolean; - deleted?: boolean; + pinned?: NcBoolType; + deleted?: NcBoolType; order?: number; - mm?: boolean; + mm?: NcBoolType; columns: NormalColumnRequestType[]; meta?: any; } @@ -197,7 +197,7 @@ export interface FilterType { fk_column_id?: string; logical_op?: string; comparison_op?: string; - value?: string | number | boolean | null; + value?: any; is_group?: boolean | number | null; children?: FilterType[]; project_id?: string; @@ -213,7 +213,7 @@ export interface FilterReqType { fk_column_id?: string; logical_op?: string; comparison_op?: string; - value?: string | number | boolean | null; + value?: any; is_group?: boolean | number | null; children?: FilterType[]; project_id?: string; @@ -261,25 +261,25 @@ export interface ColumnType { ns?: string | number | null; clen?: string | number | null; cop?: string; - pk?: boolean; - pv?: boolean; - rqd?: boolean | number | null; + pk?: NcBoolType; + pv?: NcBoolType; + rqd?: NcBoolType; column_name?: string; - un?: boolean | number | null; + un?: NcBoolType; ct?: string; - ai?: boolean; - unique?: boolean; + ai?: NcBoolType; + unique?: NcBoolType; cdf?: string; cc?: string; csn?: string; dtx?: string; dtxp?: string | number | null; dtxs?: string | number | null; - au?: boolean; - deleted?: boolean; - visible?: boolean; + au?: NcBoolType; + deleted?: NcBoolType; + visible?: NcBoolType; order?: number; - system?: number | boolean; + system?: NcBoolType; meta?: any; colOptions?: | LinkToAnotherRecordType @@ -305,7 +305,7 @@ export interface ColumnListType { export interface LinkToAnotherRecordType { id?: string; type?: string; - virtual?: boolean; + virtual?: NcBoolType; fk_column_id?: string; fk_child_column_id?: string; fk_parent_column_id?: string; @@ -323,7 +323,7 @@ export interface LinkToAnotherRecordType { export interface LookupType { id?: string; type?: string; - virtual?: boolean; + virtual?: NcBoolType; fk_column_id?: string; fk_relation_column_id?: string; fk_lookup_column_id?: string; @@ -334,7 +334,7 @@ export interface LookupType { export interface RollupType { id?: string; type?: string; - virtual?: boolean; + virtual?: NcBoolType; fk_column_id?: string; fk_relation_column_id?: string; fk_rollup_column_id?: string; @@ -346,7 +346,7 @@ export interface RollupType { export interface FormulaType { id?: string; type?: string; - virtual?: boolean; + virtual?: NcBoolType; fk_column_id?: string; formula?: string; formula_raw?: string; @@ -370,7 +370,7 @@ export interface GridType { id?: string; title?: string; alias?: string; - deleted?: boolean; + deleted?: NcBoolType; order?: number; lock_type?: 'collaborative' | 'locked' | 'personal'; row_height?: number; @@ -387,10 +387,10 @@ export interface GalleryType { fk_view_id?: string; title?: string; alias?: string; - deleted?: boolean; + deleted?: NcBoolType; order?: number; - next_enabled?: boolean; - prev_enabled?: boolean; + next_enabled?: NcBoolType; + prev_enabled?: NcBoolType; cover_image_idx?: number; cover_image?: string; restrict_types?: string; @@ -404,8 +404,8 @@ export interface GalleryType { export interface GalleryReqType { title: string; - next_enabled?: boolean; - prev_enabled?: boolean; + next_enabled?: NcBoolType; + prev_enabled?: NcBoolType; cover_image_idx?: number; cover_image?: string; restrict_types?: string; @@ -423,6 +423,14 @@ export interface GalleryColumnType { fk_gallery_id?: string; } +export interface GridColumnReqType { + label?: string; + help?: string; + fk_column_id?: string; + fk_gallery_id?: string; + width?: string; +} + export interface GridColumnType { id?: string; label?: string; @@ -502,8 +510,8 @@ export interface FormType { email?: string; banner_image_url?: string; logo_url?: string; - submit_another_form?: boolean; - show_blank_form?: boolean; + submit_another_form?: NcBoolType; + show_blank_form?: NcBoolType; columns?: FormColumnType[]; fk_model_id?: string; lock_type?: 'collaborative' | 'locked' | 'personal'; @@ -520,8 +528,8 @@ export interface FormReqType { email?: string; banner_image_url?: string; logo_url?: string; - submit_another_form?: boolean; - show_blank_form?: boolean; + submit_another_form?: NcBoolType; + show_blank_form?: NcBoolType; fk_model_id?: string; lock_type?: 'collaborative' | 'locked' | 'personal'; meta?: any; @@ -534,8 +542,8 @@ export interface FormColumnType { uuid?: any; label?: string; help?: any; - required?: boolean; - show?: boolean; + required?: NcBoolType; + show?: NcBoolType; order?: number; created_at?: string; updated_at?: string; @@ -543,6 +551,17 @@ export interface FormColumnType { meta?: any; } +export interface FormColumnReqType { + uuid?: any; + label?: string; + help?: any; + required?: NcBoolType; + show?: NcBoolType; + order?: number; + description?: string; + meta?: any; +} + export interface PaginatedType { pageSize?: number; totalRows?: number; @@ -614,16 +633,12 @@ export interface HookType { type?: string; event?: 'after' | 'before'; operation?: 'insert' | 'delete' | 'update'; - async?: boolean; - payload?: any; - url?: string; - headers?: string; - condition?: boolean; + async?: NcBoolType; notification?: string; retries?: number; retry_interval?: number; timeout?: number; - active?: boolean; + active?: NcBoolType; } export interface HookReqType { @@ -635,15 +650,11 @@ export interface HookReqType { event: 'after' | 'before'; operation: 'insert' | 'delete' | 'update'; async?: string | number | null; - payload?: any; - url?: string | null; - headers?: string | null; - condition?: boolean | null; notification: object; retries?: number; retry_interval?: number; timeout?: number; - active?: boolean; + active?: NcBoolType; } export interface HookTestReqType { @@ -682,7 +693,7 @@ export interface PluginType { id?: string; title?: string; description?: string; - active?: boolean; + active?: NcBoolType; rating?: number; version?: string; docs?: string; @@ -706,7 +717,7 @@ export interface ModelRoleVisibilityType { fk_model_id?: string; fk_view_id?: string; role?: string; - disabled?: boolean; + disabled?: NcBoolType; } export interface ApiTokenType { @@ -726,7 +737,7 @@ export interface HookLogType { type?: string; event?: string; operation?: string; - test_call?: boolean; + test_call?: NcBoolType; payload?: any; conditions?: string; notifications?: string; @@ -780,27 +791,27 @@ export interface NormalColumnRequestType { dt?: string; np?: string | number | null; ns?: string | number | null; - pk?: boolean; - pv?: boolean; - rqd?: number | null | boolean; + pk?: NcBoolType; + pv?: NcBoolType; + rqd?: number | null | NcBoolType; column_name?: string; - un?: boolean | number | null; + un?: NcBoolType; ct?: string; - ai?: boolean; - unique?: boolean; + ai?: NcBoolType; + unique?: NcBoolType; cdf?: string | null; cc?: string; csn?: string; dtx?: string; dtxp?: string | number | null; dtxs?: string | number | null; - au?: boolean; + au?: NcBoolType; } export interface LinkToAnotherColumnReqType { uidt: 'LinkToAnotherRecord'; title: string; - virtual?: boolean; + virtual?: NcBoolType; parentId: string; childId: string; type: 'hm' | 'bt' | 'mm'; @@ -859,15 +870,17 @@ export interface UserInfoType { export type VisibilityRuleReqType = { disabled?: { - commenter?: boolean; - creator?: boolean; - editor?: boolean; - guest?: boolean; - owner?: boolean; - viewer?: boolean; + commenter?: NcBoolType; + creator?: NcBoolType; + editor?: NcBoolType; + guest?: NcBoolType; + owner?: NcBoolType; + viewer?: NcBoolType; }; }[]; +export type NcBoolType = boolean | number | null; + import axios, { AxiosInstance, AxiosRequestConfig, ResponseType } from 'axios'; export type QueryParamsType = Record; @@ -2661,7 +2674,7 @@ export class Api< */ formColumnUpdate: ( formViewColumnId: string, - data: FormColumnType, + data: FormColumnReqType, params: RequestParams = {} ) => this.request({ @@ -2717,7 +2730,7 @@ export class Api< */ gridColumnUpdate: ( columnId: string, - data: GridColumnType, + data: GridColumnReqType, params: RequestParams = {} ) => this.request({ diff --git a/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts b/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts index 4c470050cf..99a85cabf5 100644 --- a/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts +++ b/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts @@ -3,6 +3,7 @@ import FormViewColumn from '../../models/FormViewColumn'; import { Tele } from 'nc-help'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; +import { getAjvValidatorMw } from './helpers' // import { getAjvValidatorMw } from './helpers' export async function columnUpdate(req: Request, res: Response) { @@ -14,7 +15,7 @@ const router = Router({ mergeParams: true }); router.patch( '/api/v1/db/meta/form-columns/:formViewColumnId', metaApiMetrics, - // getAjvValidatorMw('swagger.json#/components/schemas/FormViewColumnReq'), + getAjvValidatorMw('swagger.json#/components/schemas/FormViewColumnReq'), ncMetaAclMw(columnUpdate, 'columnUpdate') ); export default router; diff --git a/packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts b/packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts index 7f4c21be5c..4680935414 100644 --- a/packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts +++ b/packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts @@ -23,7 +23,7 @@ router.get( router.patch( '/api/v1/db/meta/grid-columns/:gridViewColumnId', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/GridViewColumnReq'), + getAjvValidatorMw('swagger.json#/components/schemas/GridColumnReq'), ncMetaAclMw(gridColumnUpdate, 'gridColumnUpdate') ); export default router; diff --git a/packages/nocodb/src/lib/meta/api/helpers/columnHelpers.ts b/packages/nocodb/src/lib/meta/api/helpers/columnHelpers.ts index bc331105ba..d53d7d1c01 100644 --- a/packages/nocodb/src/lib/meta/api/helpers/columnHelpers.ts +++ b/packages/nocodb/src/lib/meta/api/helpers/columnHelpers.ts @@ -2,12 +2,12 @@ import { customAlphabet } from 'nanoid'; import { ColumnReqType, LinkToAnotherRecordType, - LookupColumnReqType, + LookupColumnReqType, NcBoolType, RelationTypes, RollupColumnReqType, TableType, UITypes, -} from 'nocodb-sdk'; +} from 'nocodb-sdk' import Column from '../../../models/Column'; import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; import LookupColumn from '../../../models/LookupColumn'; @@ -27,7 +27,7 @@ export async function createHmAndBtColumn( type?: RelationTypes, alias?: string, fkColName?: string, - virtual = false, + virtual: NcBoolType = false, isSystemCol = false ) { // save bt column diff --git a/packages/nocodb/src/lib/models/Base.ts b/packages/nocodb/src/lib/models/Base.ts index 5ff4a4a5fd..040848eea9 100644 --- a/packages/nocodb/src/lib/models/Base.ts +++ b/packages/nocodb/src/lib/models/Base.ts @@ -7,7 +7,7 @@ import { MetaTable, } from '../utils/globals'; import Model from './Model'; -import { BaseType, UITypes } from 'nocodb-sdk'; +import { BaseType, NcBoolType, UITypes } from 'nocodb-sdk' import NocoCache from '../cache/NocoCache'; import CryptoJS from 'crypto-js'; import { extractProps } from '../meta/helpers/extractProps'; @@ -20,14 +20,14 @@ export default class Base implements BaseType { project_id?: string; alias?: string; type?: string; - is_meta?: boolean; + is_meta?: NcBoolType; config?: any; created_at?: any; updated_at?: any; inflection_column?: string; inflection_table?: string; order?: number; - enabled?: boolean; + enabled?: NcBoolType; constructor(base: Partial) { Object.assign(this, base); diff --git a/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts b/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts index bbed654ea2..e607dab0a3 100644 --- a/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts +++ b/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts @@ -1,3 +1,4 @@ +import { NcBoolType } from 'nocodb-sdk' import Noco from '../Noco'; import Column from './Column'; import Model from './Model'; @@ -19,7 +20,7 @@ export default class LinkToAnotherRecordColumn { fk_index_name?: string; type: 'hm' | 'bt' | 'mm'; - virtual = false; + virtual: NcBoolType = false; mmModel?: Model; relatedTable?: Model; diff --git a/packages/nocodb/src/lib/models/Model.ts b/packages/nocodb/src/lib/models/Model.ts index 5c214c7d1e..922b547c40 100644 --- a/packages/nocodb/src/lib/models/Model.ts +++ b/packages/nocodb/src/lib/models/Model.ts @@ -7,6 +7,7 @@ import { BaseModelSqlv2 } from '../db/sql-data-mapper/lib/sql/BaseModelSqlv2'; import { isVirtualCol, ModelTypes, + NcBoolType, TableReqType, TableType, UITypes, @@ -25,17 +26,17 @@ import { sanitize } from '../db/sql-data-mapper/lib/sql/helpers/sanitize'; import { extractProps } from '../meta/helpers/extractProps'; export default class Model implements TableType { - copy_enabled: boolean; + copy_enabled: NcBoolType; created_at: Date | number | string; base_id: 'db' | string; - deleted: boolean; - enabled: boolean; - export_enabled: boolean; + deleted: NcBoolType; + enabled: NcBoolType; + export_enabled: NcBoolType; id: string; order: number; parent_id: string; password: string; - pin: boolean; + pin: NcBoolType; project_id: string; schema: any; show_all_fields: boolean; @@ -46,7 +47,7 @@ export default class Model implements TableType { table_name: string; title: string; - mm: boolean; + mm: NcBoolType; uuid: string; @@ -98,7 +99,7 @@ export default class Model implements TableType { projectId, baseId, model: Partial & { - mm?: boolean; + mm?: NcBoolType; created_at?: any; updated_at?: any; }, diff --git a/packages/nocodb/src/lib/models/Project.ts b/packages/nocodb/src/lib/models/Project.ts index ec69d51b88..939b28d74d 100644 --- a/packages/nocodb/src/lib/models/Project.ts +++ b/packages/nocodb/src/lib/models/Project.ts @@ -1,6 +1,6 @@ import Base from './/Base'; import Noco from '../Noco'; -import { ProjectType } from 'nocodb-sdk'; +import { NcBoolType, ProjectType } from 'nocodb-sdk' import { CacheDelDirection, CacheGetType, @@ -18,7 +18,7 @@ export default class Project implements ProjectType { public description: string; public meta: string; public color: string; - public deleted: string; + public deleted: NcBoolType; public order: number; public is_meta = false; public bases?: Base[]; diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 8871c8af88..e9d5da208e 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -2984,7 +2984,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FormColumn" + "$ref": "#/components/schemas/FormColumnReq" } } } @@ -3094,7 +3094,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridColumn" + "$ref": "#/components/schemas/GridColumnReq" } } } @@ -7304,10 +7304,7 @@ "type": "string" }, "deleted": { - "type": [ - "string", - "boolean" - ] + "$ref": "#/components/schemas/NcBool" }, "order": { "type": "number" @@ -7319,7 +7316,7 @@ } }, "is_meta": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "prefix": { "type": "string" @@ -7394,8 +7391,7 @@ "type": "string" }, "is_meta": { - "type": "boolean", - "readOnly": true + "$ref": "#/components/schemas/NcBool" }, "config": {}, "created_at": {}, @@ -7410,7 +7406,7 @@ "type": "number" }, "enabled": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" } } }, @@ -7590,7 +7586,7 @@ "type": "string" }, "enabled": { - "type": "boolean" + "$ref" : "#/components/schemas/NcBool" }, "parent_id": { "type": "string" @@ -7602,10 +7598,10 @@ "type": "string" }, "pinned": { - "type": "boolean" + "$ref" : "#/components/schemas/NcBool" }, "deleted": { - "type": "boolean" + "$ref" : "#/components/schemas/NcBool" }, "order": { "type": "number" @@ -7623,10 +7619,7 @@ "type": "string" }, "mm": { - "type": [ - "boolean", - "number" - ] + "$ref": "#/components/schemas/NcBool" }, "meta": {} }, @@ -7712,7 +7705,7 @@ "type": "string" }, "deleted": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "order": { "type": "number" @@ -7728,7 +7721,7 @@ }, "meta": {}, "show_system_fields": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "lock_type": { "type": "string", @@ -7888,10 +7881,10 @@ "type": "string" }, "pinned": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "deleted": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "order": { "type": "number" @@ -7955,16 +7948,16 @@ "type": "string" }, "pinned": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "deleted": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "order": { "type": "number" }, "mm": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "columns": { "type": "array", @@ -8048,15 +8041,7 @@ "comparison_op": { "type": "string" }, - "value": { - "type": [ - "string", - "number", - "integer", - "boolean", - "null" - ] - }, + "value": { }, "is_group": { "oneOf": [ { @@ -8129,15 +8114,7 @@ "comparison_op": { "type": "string" }, - "value": { - "type": [ - "string", - "number", - "integer", - "boolean", - "null" - ] - }, + "value": { }, "is_group": { "oneOf": [ { @@ -8406,48 +8383,28 @@ "type": "string" }, "pk": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "pv": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "rqd": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/NcBool" }, "column_name": { "type": "string" }, "un": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/NcBool" }, "ct": { "type": "string" }, "ai": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "unique": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "cdf": { "type": "string" @@ -8488,22 +8445,19 @@ ] }, "au": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "deleted": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "visible": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "order": { "type": "number" }, "system": { - "type": [ - "number", - "boolean" - ] + "$ref": "#/components/schemas/NcBool" }, "meta": {}, "colOptions": { @@ -8595,7 +8549,7 @@ "type": "string" }, "virtual": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "fk_column_id": { "type": "string" @@ -8646,7 +8600,7 @@ "type": "string" }, "virtual": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "fk_column_id": { "type": "string" @@ -8676,7 +8630,7 @@ "type": "string" }, "virtual": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "fk_column_id": { "type": "string" @@ -8709,7 +8663,7 @@ "type": "string" }, "virtual": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "fk_column_id": { "type": "string" @@ -8800,7 +8754,7 @@ "type": "string" }, "deleted": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "order": { "type": "number" @@ -8861,16 +8815,16 @@ "type": "string" }, "deleted": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "order": { "type": "number" }, "next_enabled": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "prev_enabled": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "cover_image_idx": { "type": "integer" @@ -8918,10 +8872,10 @@ "type": "string" }, "next_enabled": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "prev_enabled": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "cover_image_idx": { "type": "integer" @@ -8976,6 +8930,28 @@ } } }, + "GridColumnReq": { + "title": "GridColumn", + "type": "object", + "description": "", + "properties": { + "label": { + "type": "string" + }, + "help": { + "type": "string" + }, + "fk_column_id": { + "type": "string" + }, + "fk_gallery_id": { + "type": "string" + }, + "width": { + "type": "string" + } + } + }, "GridColumn": { "title": "GridColumn", "type": "object", @@ -9249,10 +9225,10 @@ "type": "string" }, "submit_another_form": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "show_blank_form": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "columns": { "type": "array", @@ -9307,10 +9283,10 @@ "type": "string" }, "submit_another_form": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "show_blank_form": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "fk_model_id": { "type": "string" @@ -9370,10 +9346,10 @@ }, "help": {}, "required": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "show": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "order": { "type": "number" @@ -9393,6 +9369,50 @@ "meta": {} } }, + "FormColumnReq": { + "description": "", + "type": "object", + "x-examples": { + "example-1": { + "_cn": "first_name", + "alias": "first_name", + "fk_column_id": "cl_yvyhsl9u81tokc", + "id": "fvc_8z1i7t8aswkqxx", + "fk_view_id": "vw_s1pf4umdnikoyn", + "uuid": null, + "label": "dsdsds", + "help": null, + "required": false, + "show": 1, + "order": 1, + "created_at": "2022-02-15 12:39:04", + "updated_at": "2022-02-15 12:39:16", + "description": "dsdsdsdsd" + } + }, + "properties": { + "uuid": {}, + "label": { + "type": "string", + "minLength": 1 + }, + "help": {}, + "required": { + "$ref": "#/components/schemas/NcBool" + }, + "show": { + "$ref": "#/components/schemas/NcBool" + }, + "order": { + "type": "number" + }, + "description": { + "type": "string", + "minLength": 1 + }, + "meta": {} + } + }, "Paginated": { "title": "Paginated", "type": "object", @@ -9705,7 +9725,7 @@ ] }, "async": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "notification": { "type": "string" @@ -9720,7 +9740,7 @@ "type": "number" }, "active": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" } } }, @@ -9791,7 +9811,7 @@ "type": "number" }, "active": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" } }, "required": [ @@ -9905,7 +9925,7 @@ "type": "string" }, "active": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "rating": { "type": "number" @@ -9984,7 +10004,7 @@ "type": "string" }, "disabled": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" } } }, @@ -10041,7 +10061,7 @@ "type": "string" }, "test_call": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "payload": {}, "conditions": { @@ -10156,10 +10176,10 @@ ] }, "pk": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "pv": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "rqd": { "oneOf": [ @@ -10170,7 +10190,7 @@ "type": "null" }, { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" } ] }, @@ -10178,26 +10198,16 @@ "type": "string" }, "un": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/NcBool" }, "ct": { "type": "string" }, "ai": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "unique": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "cdf": { "oneOf": [ @@ -10245,7 +10255,7 @@ ] }, "au": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" } } }, @@ -10262,7 +10272,7 @@ "type": "string" }, "virtual": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "parentId": { "type": "string" @@ -10424,27 +10434,40 @@ "type": "object", "properties": { "commenter": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "creator": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "editor": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "guest": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "owner": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" }, "viewer": { - "type": "boolean" + "$ref": "#/components/schemas/NcBool" } } } } } + }, + "NcBool": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ] } }, "requestBodies": { From 12fb3fe3c6e613cd71a99277115a1fa9d6ef65da Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 26 Feb 2023 01:27:15 +0530 Subject: [PATCH 59/68] fix: schema name correction Signed-off-by: Pranav C --- packages/nocodb/src/lib/meta/api/formViewColumnApis.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts b/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts index 99a85cabf5..4a5053b0ac 100644 --- a/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts +++ b/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts @@ -15,7 +15,7 @@ const router = Router({ mergeParams: true }); router.patch( '/api/v1/db/meta/form-columns/:formViewColumnId', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/FormViewColumnReq'), + getAjvValidatorMw('swagger.json#/components/schemas/FormColumnReq'), ncMetaAclMw(columnUpdate, 'columnUpdate') ); export default router; From 011fc0b3d0e49b0defedd46672edccff65b8f332 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 26 Feb 2023 01:27:51 +0530 Subject: [PATCH 60/68] refactor: follow same naming pattern for schema Signed-off-by: Pranav C --- scripts/sdk/swagger.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index e9d5da208e..521a9d6c61 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -222,7 +222,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ForgotPasswordReq" + "$ref": "#/components/schemas/PasswordForgotReq" } } }, @@ -9865,7 +9865,7 @@ "password" ] }, - "ForgotPasswordReq": { + "PasswordForgotReq": { "type": "object", "properties": { "email": { From d0e24415590b0389a1ea16f0a7c0ccef5063770d Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 26 Feb 2023 01:31:05 +0530 Subject: [PATCH 61/68] chore: lint Signed-off-by: Pranav C --- .../src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts | 8 ++++---- packages/nocodb/src/lib/meta/api/apiTokenApis.ts | 2 +- packages/nocodb/src/lib/meta/api/baseApis.ts | 2 +- packages/nocodb/src/lib/meta/api/columnApis.ts | 5 +++-- packages/nocodb/src/lib/meta/api/filterApis.ts | 2 +- packages/nocodb/src/lib/meta/api/formViewApis.ts | 2 +- packages/nocodb/src/lib/meta/api/formViewColumnApis.ts | 2 +- packages/nocodb/src/lib/meta/api/galleryViewApis.ts | 2 +- packages/nocodb/src/lib/meta/api/gridViewApis.ts | 2 +- packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts | 2 +- packages/nocodb/src/lib/meta/api/helpers/columnHelpers.ts | 5 +++-- packages/nocodb/src/lib/meta/api/hookApis.ts | 2 +- packages/nocodb/src/lib/meta/api/hookFilterApis.ts | 2 +- packages/nocodb/src/lib/meta/api/kanbanViewApis.ts | 2 +- packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts | 2 +- packages/nocodb/src/lib/meta/api/orgLicenseApis.ts | 2 +- packages/nocodb/src/lib/meta/api/projectApis.ts | 2 +- .../nocodb/src/lib/meta/api/publicApis/publicDataApis.ts | 2 +- packages/nocodb/src/lib/meta/api/sortApis.ts | 2 +- packages/nocodb/src/lib/meta/api/viewApis.ts | 1 - packages/nocodb/src/lib/models/Base.ts | 2 +- .../nocodb/src/lib/models/LinkToAnotherRecordColumn.ts | 2 +- packages/nocodb/src/lib/models/MapView.ts | 1 - packages/nocodb/src/lib/models/Project.ts | 2 +- packages/nocodb/src/lib/utils/globals.ts | 1 - 25 files changed, 29 insertions(+), 30 deletions(-) diff --git a/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts index 67834641d9..8b8c3def97 100644 --- a/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts +++ b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts @@ -81,13 +81,13 @@ const getAst = async ({ ...(await obj), [col.title]: allowedCols && (!includePkByDefault || !col.pk) - ? (allowedCols[col.id] && + ? allowedCols[col.id] && (!isSystemColumn(col) || view.show_system_fields) && (!fields?.length || fields.includes(col.title)) && - value) - : (fields?.length + value + : fields?.length ? fields.includes(col.title) && value - : value), + : value, }; }, Promise.resolve({})); }; diff --git a/packages/nocodb/src/lib/meta/api/apiTokenApis.ts b/packages/nocodb/src/lib/meta/api/apiTokenApis.ts index 5470ca3f50..5ed4c08094 100644 --- a/packages/nocodb/src/lib/meta/api/apiTokenApis.ts +++ b/packages/nocodb/src/lib/meta/api/apiTokenApis.ts @@ -5,7 +5,7 @@ import { NcError } from '../helpers/catchError'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ApiToken from '../../models/ApiToken'; import { metaApiMetrics } from '../helpers/apiMetrics'; -import { getAjvValidatorMw } from './helpers' +import { getAjvValidatorMw } from './helpers'; export async function apiTokenList(req: Request, res: Response) { res.json(await ApiToken.list(req['user'].id)); diff --git a/packages/nocodb/src/lib/meta/api/baseApis.ts b/packages/nocodb/src/lib/meta/api/baseApis.ts index 7c97afa8cc..c13bbd18d3 100644 --- a/packages/nocodb/src/lib/meta/api/baseApis.ts +++ b/packages/nocodb/src/lib/meta/api/baseApis.ts @@ -7,7 +7,7 @@ import Base from '../../models/Base'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Tele } from 'nc-help'; import { metaApiMetrics } from '../helpers/apiMetrics'; -import { getAjvValidatorMw, populateMeta } from './helpers' +import { getAjvValidatorMw, populateMeta } from './helpers'; export async function baseGet( req: Request, diff --git a/packages/nocodb/src/lib/meta/api/columnApis.ts b/packages/nocodb/src/lib/meta/api/columnApis.ts index ef52fc0b98..a5e9e8e9ec 100644 --- a/packages/nocodb/src/lib/meta/api/columnApis.ts +++ b/packages/nocodb/src/lib/meta/api/columnApis.ts @@ -40,12 +40,13 @@ import { MetaTable } from '../../utils/globals'; import formulaQueryBuilderv2 from '../../db/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2'; import { createHmAndBtColumn, - generateFkName, getAjvValidatorMw, + generateFkName, + getAjvValidatorMw, randomID, validateLookupPayload, validateRequiredField, validateRollupPayload, -} from './helpers' +} from './helpers'; export enum Altered { NEW_COLUMN = 1, diff --git a/packages/nocodb/src/lib/meta/api/filterApis.ts b/packages/nocodb/src/lib/meta/api/filterApis.ts index ff751d47df..1be850b7d8 100644 --- a/packages/nocodb/src/lib/meta/api/filterApis.ts +++ b/packages/nocodb/src/lib/meta/api/filterApis.ts @@ -13,7 +13,7 @@ import Project from '../../models/Project'; import Filter from '../../models/Filter'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; -import { getAjvValidatorMw } from './helpers' +import { getAjvValidatorMw } from './helpers'; // @ts-ignore export async function filterGet(req: Request, res: Response, next) { diff --git a/packages/nocodb/src/lib/meta/api/formViewApis.ts b/packages/nocodb/src/lib/meta/api/formViewApis.ts index 1edb3b2dcf..98955f9076 100644 --- a/packages/nocodb/src/lib/meta/api/formViewApis.ts +++ b/packages/nocodb/src/lib/meta/api/formViewApis.ts @@ -13,7 +13,7 @@ import View from '../../models/View'; import FormView from '../../models/FormView'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; -import { getAjvValidatorMw } from './helpers' +import { getAjvValidatorMw } from './helpers'; // @ts-ignore export async function formViewGet(req: Request, res: Response) { diff --git a/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts b/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts index 4a5053b0ac..9349b5ae68 100644 --- a/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts +++ b/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts @@ -3,7 +3,7 @@ import FormViewColumn from '../../models/FormViewColumn'; import { Tele } from 'nc-help'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; -import { getAjvValidatorMw } from './helpers' +import { getAjvValidatorMw } from './helpers'; // import { getAjvValidatorMw } from './helpers' export async function columnUpdate(req: Request, res: Response) { diff --git a/packages/nocodb/src/lib/meta/api/galleryViewApis.ts b/packages/nocodb/src/lib/meta/api/galleryViewApis.ts index d563a32f6f..2c6c79db9e 100644 --- a/packages/nocodb/src/lib/meta/api/galleryViewApis.ts +++ b/packages/nocodb/src/lib/meta/api/galleryViewApis.ts @@ -5,7 +5,7 @@ import GalleryView from '../../models/GalleryView'; import { Tele } from 'nc-help'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; -import { getAjvValidatorMw } from './helpers' +import { getAjvValidatorMw } from './helpers'; export async function galleryViewGet(req: Request, res: Response) { res.json(await GalleryView.get(req.params.galleryViewId)); } diff --git a/packages/nocodb/src/lib/meta/api/gridViewApis.ts b/packages/nocodb/src/lib/meta/api/gridViewApis.ts index 400fc52fe8..96880398cb 100644 --- a/packages/nocodb/src/lib/meta/api/gridViewApis.ts +++ b/packages/nocodb/src/lib/meta/api/gridViewApis.ts @@ -13,7 +13,7 @@ import View from '../../models/View'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; import GridView from '../../models/GridView'; -import { getAjvValidatorMw } from './helpers' +import { getAjvValidatorMw } from './helpers'; // @ts-ignore export async function gridViewCreate(req: Request, res) { diff --git a/packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts b/packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts index 4680935414..28669a6a2f 100644 --- a/packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts +++ b/packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts @@ -3,7 +3,7 @@ import GridViewColumn from '../../models/GridViewColumn'; import { Tele } from 'nc-help'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; -import { getAjvValidatorMw } from './helpers' +import { getAjvValidatorMw } from './helpers'; export async function columnList(req: Request, res: Response) { res.json(await GridViewColumn.list(req.params.gridViewId)); diff --git a/packages/nocodb/src/lib/meta/api/helpers/columnHelpers.ts b/packages/nocodb/src/lib/meta/api/helpers/columnHelpers.ts index d53d7d1c01..ad53a41b6d 100644 --- a/packages/nocodb/src/lib/meta/api/helpers/columnHelpers.ts +++ b/packages/nocodb/src/lib/meta/api/helpers/columnHelpers.ts @@ -2,12 +2,13 @@ import { customAlphabet } from 'nanoid'; import { ColumnReqType, LinkToAnotherRecordType, - LookupColumnReqType, NcBoolType, + LookupColumnReqType, + NcBoolType, RelationTypes, RollupColumnReqType, TableType, UITypes, -} from 'nocodb-sdk' +} from 'nocodb-sdk'; import Column from '../../../models/Column'; import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; import LookupColumn from '../../../models/LookupColumn'; diff --git a/packages/nocodb/src/lib/meta/api/hookApis.ts b/packages/nocodb/src/lib/meta/api/hookApis.ts index c59617607a..bf0b29b6ec 100644 --- a/packages/nocodb/src/lib/meta/api/hookApis.ts +++ b/packages/nocodb/src/lib/meta/api/hookApis.ts @@ -9,7 +9,7 @@ import Model from '../../models/Model'; import populateSamplePayload from '../helpers/populateSamplePayload'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; -import { getAjvValidatorMw } from './helpers' +import { getAjvValidatorMw } from './helpers'; export async function hookList( req: Request, diff --git a/packages/nocodb/src/lib/meta/api/hookFilterApis.ts b/packages/nocodb/src/lib/meta/api/hookFilterApis.ts index 662b7243a2..7b182fcab4 100644 --- a/packages/nocodb/src/lib/meta/api/hookFilterApis.ts +++ b/packages/nocodb/src/lib/meta/api/hookFilterApis.ts @@ -13,7 +13,7 @@ import Project from '../../models/Project'; import Filter from '../../models/Filter'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; -import { getAjvValidatorMw } from './helpers' +import { getAjvValidatorMw } from './helpers'; // @ts-ignore export async function filterGet(req: Request, res: Response, next) { diff --git a/packages/nocodb/src/lib/meta/api/kanbanViewApis.ts b/packages/nocodb/src/lib/meta/api/kanbanViewApis.ts index 5509751f93..c8d864bf82 100644 --- a/packages/nocodb/src/lib/meta/api/kanbanViewApis.ts +++ b/packages/nocodb/src/lib/meta/api/kanbanViewApis.ts @@ -5,7 +5,7 @@ import KanbanView from '../../models/KanbanView'; import { Tele } from 'nc-help'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; -import { getAjvValidatorMw } from './helpers' +import { getAjvValidatorMw } from './helpers'; export async function kanbanViewGet(req: Request, res: Response) { res.json(await KanbanView.get(req.params.kanbanViewId)); diff --git a/packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts b/packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts index b9b9fc1498..26dc965bb1 100644 --- a/packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts +++ b/packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts @@ -4,7 +4,7 @@ import { Router } from 'express'; import { Tele } from 'nc-help'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; -import { getAjvValidatorMw } from './helpers' +import { getAjvValidatorMw } from './helpers'; async function xcVisibilityMetaSetAll(req, res) { Tele.emit('evt', { evt_type: 'uiAcl:updated' }); for (const d of req.body) { diff --git a/packages/nocodb/src/lib/meta/api/orgLicenseApis.ts b/packages/nocodb/src/lib/meta/api/orgLicenseApis.ts index 63366b4e4d..ec13f4f9e7 100644 --- a/packages/nocodb/src/lib/meta/api/orgLicenseApis.ts +++ b/packages/nocodb/src/lib/meta/api/orgLicenseApis.ts @@ -5,7 +5,7 @@ import Store from '../../models/Store'; import Noco from '../../Noco'; import { metaApiMetrics } from '../helpers/apiMetrics'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; -import { getAjvValidatorMw } from './helpers' +import { getAjvValidatorMw } from './helpers'; async function licenseGet(_req, res) { const license = await Store.get(NC_LICENSE_KEY); diff --git a/packages/nocodb/src/lib/meta/api/projectApis.ts b/packages/nocodb/src/lib/meta/api/projectApis.ts index 388d6ae120..3c5b536e05 100644 --- a/packages/nocodb/src/lib/meta/api/projectApis.ts +++ b/packages/nocodb/src/lib/meta/api/projectApis.ts @@ -18,7 +18,7 @@ import { metaApiMetrics } from '../helpers/apiMetrics'; import { extractPropsAndSanitize } from '../helpers/extractProps'; import NcConfigFactory from '../../utils/NcConfigFactory'; import { promisify } from 'util'; -import { getAjvValidatorMw, populateMeta } from './helpers' +import { getAjvValidatorMw, populateMeta } from './helpers'; import Filter from '../../models/Filter'; const nanoid = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 4); diff --git a/packages/nocodb/src/lib/meta/api/publicApis/publicDataApis.ts b/packages/nocodb/src/lib/meta/api/publicApis/publicDataApis.ts index b756424fdc..bb678b10f3 100644 --- a/packages/nocodb/src/lib/meta/api/publicApis/publicDataApis.ts +++ b/packages/nocodb/src/lib/meta/api/publicApis/publicDataApis.ts @@ -28,7 +28,7 @@ export async function dataList(req: Request, res: Response) { if ( view.type !== ViewTypes.GRID && view.type !== ViewTypes.KANBAN && - view.type !== ViewTypes.GALLERY && + view.type !== ViewTypes.GALLERY && view.type !== ViewTypes.MAP ) { NcError.notFound('Not found'); diff --git a/packages/nocodb/src/lib/meta/api/sortApis.ts b/packages/nocodb/src/lib/meta/api/sortApis.ts index 233fc4ae13..5341d07cba 100644 --- a/packages/nocodb/src/lib/meta/api/sortApis.ts +++ b/packages/nocodb/src/lib/meta/api/sortApis.ts @@ -12,7 +12,7 @@ import Project from '../../models/Project'; import Sort from '../../models/Sort'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; -import { getAjvValidatorMw } from './helpers' +import { getAjvValidatorMw } from './helpers'; // @ts-ignore export async function sortGet(req: Request, res: Response) {} diff --git a/packages/nocodb/src/lib/meta/api/viewApis.ts b/packages/nocodb/src/lib/meta/api/viewApis.ts index 996fe81de4..b062a2b2ef 100644 --- a/packages/nocodb/src/lib/meta/api/viewApis.ts +++ b/packages/nocodb/src/lib/meta/api/viewApis.ts @@ -89,7 +89,6 @@ async function showAllColumns(req: Request, res) { } async function hideAllColumns(req: Request, res) { - res.json( await View.hideAllColumns( req.params.viewId, diff --git a/packages/nocodb/src/lib/models/Base.ts b/packages/nocodb/src/lib/models/Base.ts index 040848eea9..c0568b6bd4 100644 --- a/packages/nocodb/src/lib/models/Base.ts +++ b/packages/nocodb/src/lib/models/Base.ts @@ -7,7 +7,7 @@ import { MetaTable, } from '../utils/globals'; import Model from './Model'; -import { BaseType, NcBoolType, UITypes } from 'nocodb-sdk' +import { BaseType, NcBoolType, UITypes } from 'nocodb-sdk'; import NocoCache from '../cache/NocoCache'; import CryptoJS from 'crypto-js'; import { extractProps } from '../meta/helpers/extractProps'; diff --git a/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts b/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts index e607dab0a3..8b12d7aa47 100644 --- a/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts +++ b/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts @@ -1,4 +1,4 @@ -import { NcBoolType } from 'nocodb-sdk' +import { NcBoolType } from 'nocodb-sdk'; import Noco from '../Noco'; import Column from './Column'; import Model from './Model'; diff --git a/packages/nocodb/src/lib/models/MapView.ts b/packages/nocodb/src/lib/models/MapView.ts index d8d4c56e3e..fe4d5f2547 100644 --- a/packages/nocodb/src/lib/models/MapView.ts +++ b/packages/nocodb/src/lib/models/MapView.ts @@ -93,7 +93,6 @@ export default class MapView implements MapType { await View.updateColumn(body.fk_view_id, mapViewMappedByColumn.id, { show: true, }); - } // update meta diff --git a/packages/nocodb/src/lib/models/Project.ts b/packages/nocodb/src/lib/models/Project.ts index 939b28d74d..6b3f724e4d 100644 --- a/packages/nocodb/src/lib/models/Project.ts +++ b/packages/nocodb/src/lib/models/Project.ts @@ -1,6 +1,6 @@ import Base from './/Base'; import Noco from '../Noco'; -import { NcBoolType, ProjectType } from 'nocodb-sdk' +import { NcBoolType, ProjectType } from 'nocodb-sdk'; import { CacheDelDirection, CacheGetType, diff --git a/packages/nocodb/src/lib/utils/globals.ts b/packages/nocodb/src/lib/utils/globals.ts index f39a0efda7..efade2f1b0 100644 --- a/packages/nocodb/src/lib/utils/globals.ts +++ b/packages/nocodb/src/lib/utils/globals.ts @@ -42,7 +42,6 @@ export enum MetaTable { MAP_VIEW = 'nc_map_view_v2', MAP_VIEW_COLUMNS = 'nc_map_view_columns_v2', STORE = 'nc_store', - } export const orderedMetaTables = [ From 373da6d83dd308ad03eb81fb96d06577f9f44232 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 26 Feb 2023 02:31:03 +0530 Subject: [PATCH 62/68] feat: add validations and schema for all apis Signed-off-by: Pranav C --- packages/nocodb-sdk/src/lib/Api.ts | 116 ++++++----- packages/nocodb/src/lib/meta/api/auditApis.ts | 3 + .../nocodb/src/lib/meta/api/formViewApis.ts | 1 + .../nocodb/src/lib/meta/api/mapViewApis.ts | 1 + .../nocodb/src/lib/meta/api/orgTokenApis.ts | 2 + .../nocodb/src/lib/meta/api/orgUserApis.ts | 3 + .../nocodb/src/lib/meta/api/pluginApis.ts | 4 + .../src/lib/meta/api/projectUserApis.ts | 3 + .../nocodb/src/lib/meta/api/sharedBaseApis.ts | 3 + .../src/lib/meta/api/userApi/userApis.ts | 1 + scripts/sdk/swagger.json | 197 ++++++++++++------ 11 files changed, 215 insertions(+), 119 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index 918aa4fe2d..814c90e2c9 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -672,7 +672,7 @@ export interface SignInReqType { password: string; } -export interface ForgotPasswordReqType { +export interface PasswordForgotReqType { email: string; } @@ -686,7 +686,7 @@ export interface PasswordChangeReqType { } export interface ApiTokenReqType { - description?: string; + description?: string | null; } export interface PluginType { @@ -881,6 +881,45 @@ export type VisibilityRuleReqType = { export type NcBoolType = boolean | number | null; +export interface CommentReqType { + row_id: string; + fk_model_id: string; + description?: string; +} + +export interface AuditRowUpdateReqType { + fk_model_id?: string; + column_name?: string; + row_id?: string; + value?: any; + prev_value?: any; +} + +export interface OrgUserReqType { + email?: string; + roles?: string; +} + +export interface ProjectUserReqType { + email?: string; + roles?: string; +} + +export interface SharedBaseReqType { + uuid?: string | null; + roles?: string | null; +} + +export interface PluginTestReqType { + title?: string; + input?: any; +} + +export interface PluginReqType { + active?: NcBoolType; + input?: any; +} + import axios, { AxiosInstance, AxiosRequestConfig, ResponseType } from 'axios'; export type QueryParamsType = Record; @@ -1149,7 +1188,7 @@ export class Api< * @response `200` `void` OK * @response `401` `void` Unauthorized */ - passwordForgot: (data: ForgotPasswordReqType, params: RequestParams = {}) => + passwordForgot: (data: PasswordForgotReqType, params: RequestParams = {}) => this.request({ path: `/api/v1/auth/password/forgot`, method: 'POST', @@ -1304,7 +1343,7 @@ export class Api< */ projectUserAdd: ( projectId: string, - data: any, + data: ProjectUserReqType, params: RequestParams = {} ) => this.request({ @@ -1328,7 +1367,7 @@ export class Api< projectUserUpdate: ( projectId: string, userId: string, - data: any, + data: ProjectUserReqType, params: RequestParams = {} ) => this.request({ @@ -1427,7 +1466,7 @@ export class Api< * @request POST:/api/v1/tokens * @response `200` `void` OK */ - create: (data: ApiTokenType, params: RequestParams = {}) => + create: (data: ApiTokenReqType, params: RequestParams = {}) => this.request({ path: `/api/v1/tokens`, method: 'POST', @@ -1605,7 +1644,11 @@ export class Api< * @request PATCH:/api/v1/users/{userId} * @response `200` `void` OK */ - update: (userId: string, data: UserType, params: RequestParams = {}) => + update: ( + userId: string, + data: OrgUserReqType, + params: RequestParams = {} + ) => this.request({ path: `/api/v1/users/${userId}`, method: 'PATCH', @@ -1903,18 +1946,13 @@ export class Api< }), /** - * No description - * - * @tags Project - * @name SharedBaseCreate - * @request POST:/api/v1/db/meta/projects/{projectId}/shared - * @response `200` `{ - uuid?: string, - url?: string, - roles?: string, - -}` OK - */ + * No description + * + * @tags Project + * @name SharedBaseCreate + * @request POST:/api/v1/db/meta/projects/{projectId}/shared + * @response `200` `SharedBaseReqType` OK + */ sharedBaseCreate: ( projectId: string, data: { @@ -1923,14 +1961,7 @@ export class Api< }, params: RequestParams = {} ) => - this.request< - { - uuid?: string; - url?: string; - roles?: string; - }, - any - >({ + this.request({ path: `/api/v1/db/meta/projects/${projectId}/shared`, method: 'POST', body: data, @@ -4353,14 +4384,7 @@ export class Api< * @request POST:/api/v1/db/meta/audits/comments * @response `200` `void` OK */ - commentRow: ( - data: { - row_id: string; - fk_model_id: string; - description?: string; - }, - params: RequestParams = {} - ) => + commentRow: (data: CommentReqType, params: RequestParams = {}) => this.request({ path: `/api/v1/db/meta/audits/comments`, method: 'POST', @@ -4402,13 +4426,7 @@ export class Api< */ auditRowUpdate: ( rowId: string, - data: { - fk_model_id?: string; - column_name?: string; - row_id?: string; - value?: string; - prev_value?: string; - }, + data: AuditRowUpdateReqType, params: RequestParams = {} ) => this.request({ @@ -4833,15 +4851,7 @@ export class Api< * @response `400` `void` Bad Request * @response `401` `void` Unauthorized */ - test: ( - data: { - id?: string; - title?: string; - input?: any; - category?: string; - }, - params: RequestParams = {} - ) => + test: (data: PluginTestReqType, params: RequestParams = {}) => this.request({ path: `/api/v1/db/meta/plugins/test`, method: 'POST', @@ -4857,10 +4867,10 @@ export class Api< * @tags Plugin * @name Update * @request PATCH:/api/v1/db/meta/plugins/{pluginId} - * @response `200` `PluginType` OK + * @response `200` `PluginReqType` OK */ update: (pluginId: string, data: PluginType, params: RequestParams = {}) => - this.request({ + this.request({ path: `/api/v1/db/meta/plugins/${pluginId}`, method: 'PATCH', body: data, diff --git a/packages/nocodb/src/lib/meta/api/auditApis.ts b/packages/nocodb/src/lib/meta/api/auditApis.ts index a9c6b89dcd..fdf9f70daf 100644 --- a/packages/nocodb/src/lib/meta/api/auditApis.ts +++ b/packages/nocodb/src/lib/meta/api/auditApis.ts @@ -6,6 +6,7 @@ import { PagedResponseImpl } from '../helpers/PagedResponse'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import DOMPurify from 'isomorphic-dompurify'; +import { getAjvValidatorMw } from './helpers'; export async function commentRow(req: Request, res) { res.json( @@ -69,10 +70,12 @@ router.get( ); router.post( '/api/v1/db/meta/audits/comments', + getAjvValidatorMw('swagger.json#/components/schemas/CommentReq'), ncMetaAclMw(commentRow, 'commentRow') ); router.post( '/api/v1/db/meta/audits/rows/:rowId/update', + getAjvValidatorMw('swagger.json#/components/schemas/AuditRowUpdateReq'), ncMetaAclMw(auditRowUpdate, 'auditRowUpdate') ); router.get( diff --git a/packages/nocodb/src/lib/meta/api/formViewApis.ts b/packages/nocodb/src/lib/meta/api/formViewApis.ts index 98955f9076..fda614c803 100644 --- a/packages/nocodb/src/lib/meta/api/formViewApis.ts +++ b/packages/nocodb/src/lib/meta/api/formViewApis.ts @@ -55,6 +55,7 @@ router.get( router.patch( '/api/v1/db/meta/forms/:formViewId', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/FormReq'), ncMetaAclMw(formViewUpdate, 'formViewUpdate') ); router.delete( diff --git a/packages/nocodb/src/lib/meta/api/mapViewApis.ts b/packages/nocodb/src/lib/meta/api/mapViewApis.ts index ca0dcca4ed..5771284da4 100644 --- a/packages/nocodb/src/lib/meta/api/mapViewApis.ts +++ b/packages/nocodb/src/lib/meta/api/mapViewApis.ts @@ -28,6 +28,7 @@ export async function mapViewUpdate(req, res) { const router = Router({ mergeParams: true }); +// todo: add schema in swagger and use getAjvValidatorMw router.post( '/api/v1/db/meta/tables/:tableId/maps', metaApiMetrics, diff --git a/packages/nocodb/src/lib/meta/api/orgTokenApis.ts b/packages/nocodb/src/lib/meta/api/orgTokenApis.ts index a9f1f9fc14..300a804c4e 100644 --- a/packages/nocodb/src/lib/meta/api/orgTokenApis.ts +++ b/packages/nocodb/src/lib/meta/api/orgTokenApis.ts @@ -8,6 +8,7 @@ import getHandler from '../helpers/getHandler'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { PagedResponseImpl } from '../helpers/PagedResponse'; import { apiTokenListEE } from './ee/orgTokenApis'; +import { getAjvValidatorMw } from './helpers'; async function apiTokenList(req, res) { const fk_user_id = req.user.id; @@ -65,6 +66,7 @@ router.get( router.post( '/api/v1/tokens', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/ApiTokenReq'), ncMetaAclMw(apiTokenCreate, 'apiTokenCreate', { // allowedRoles: [OrgUserRoles.SUPER], blockApiTokenAccess: true, diff --git a/packages/nocodb/src/lib/meta/api/orgUserApis.ts b/packages/nocodb/src/lib/meta/api/orgUserApis.ts index f9d5e077f7..62c3cdf2aa 100644 --- a/packages/nocodb/src/lib/meta/api/orgUserApis.ts +++ b/packages/nocodb/src/lib/meta/api/orgUserApis.ts @@ -22,6 +22,7 @@ import { extractProps } from '../helpers/extractProps'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { PagedResponseImpl } from '../helpers/PagedResponse'; import { randomTokenString } from '../helpers/stringHelpers'; +import { getAjvValidatorMw } from './helpers'; import { sendInviteEmail } from './projectUserApis'; async function userList(req, res) { @@ -266,6 +267,7 @@ router.get( router.patch( '/api/v1/users/:userId', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/OrgUserReq'), ncMetaAclMw(userUpdate, 'userUpdate', { allowedRoles: [OrgUserRoles.SUPER_ADMIN], blockApiTokenAccess: true, @@ -282,6 +284,7 @@ router.delete( router.post( '/api/v1/users', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/OrgUserReq'), ncMetaAclMw(userAdd, 'userAdd', { allowedRoles: [OrgUserRoles.SUPER_ADMIN], blockApiTokenAccess: true, diff --git a/packages/nocodb/src/lib/meta/api/pluginApis.ts b/packages/nocodb/src/lib/meta/api/pluginApis.ts index e0a39646af..6934e17b41 100644 --- a/packages/nocodb/src/lib/meta/api/pluginApis.ts +++ b/packages/nocodb/src/lib/meta/api/pluginApis.ts @@ -6,6 +6,7 @@ import { PluginType } from 'nocodb-sdk'; import NcPluginMgrv2 from '../helpers/NcPluginMgrv2'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; +import { getAjvValidatorMw } from './helpers'; export async function pluginList(_req: Request, res: Response) { res.json(new PagedResponseImpl(await Plugin.list())); @@ -43,6 +44,8 @@ router.get( router.post( '/api/v1/db/meta/plugins/test', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/PluginTestReq'), + ncMetaAclMw(pluginTest, 'pluginTest') ); router.get( @@ -53,6 +56,7 @@ router.get( router.patch( '/api/v1/db/meta/plugins/:pluginId', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/PluginReq'), ncMetaAclMw(pluginUpdate, 'pluginUpdate') ); router.get( diff --git a/packages/nocodb/src/lib/meta/api/projectUserApis.ts b/packages/nocodb/src/lib/meta/api/projectUserApis.ts index e0165452ac..3f0610fee6 100644 --- a/packages/nocodb/src/lib/meta/api/projectUserApis.ts +++ b/packages/nocodb/src/lib/meta/api/projectUserApis.ts @@ -17,6 +17,7 @@ import Noco from '../../Noco'; import { PluginCategory } from 'nocodb-sdk'; import { metaApiMetrics } from '../helpers/apiMetrics'; import { randomTokenString } from '../helpers/stringHelpers'; +import { getAjvValidatorMw } from './helpers'; async function userList(req, res) { res.json({ @@ -310,11 +311,13 @@ router.get( router.post( '/api/v1/db/meta/projects/:projectId/users', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/ProjectUserReq'), ncMetaAclMw(userInvite, 'userInvite') ); router.patch( '/api/v1/db/meta/projects/:projectId/users/:userId', metaApiMetrics, + getAjvValidatorMw('swagger.json#/components/schemas/ProjectUserReq'), ncMetaAclMw(projectUserUpdate, 'projectUserUpdate') ); router.delete( diff --git a/packages/nocodb/src/lib/meta/api/sharedBaseApis.ts b/packages/nocodb/src/lib/meta/api/sharedBaseApis.ts index e1ce599a8f..c232327aa8 100644 --- a/packages/nocodb/src/lib/meta/api/sharedBaseApis.ts +++ b/packages/nocodb/src/lib/meta/api/sharedBaseApis.ts @@ -4,6 +4,7 @@ import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { v4 as uuidv4 } from 'uuid'; import Project from '../../models/Project'; import { NcError } from '../helpers/catchError'; +import { getAjvValidatorMw } from './helpers'; // todo: load from config const config = { dashboardPath: '/nc', @@ -96,10 +97,12 @@ router.get( ); router.post( '/api/v1/db/meta/projects/:projectId/shared', + getAjvValidatorMw('swagger.json#/components/schemas/SharedBaseReq'), ncMetaAclMw(createSharedBaseLink, 'createSharedBaseLink') ); router.patch( '/api/v1/db/meta/projects/:projectId/shared', + getAjvValidatorMw('swagger.json#/components/schemas/SharedBaseReq'), ncMetaAclMw(updateSharedBaseLink, 'updateSharedBaseLink') ); router.delete( diff --git a/packages/nocodb/src/lib/meta/api/userApi/userApis.ts b/packages/nocodb/src/lib/meta/api/userApi/userApis.ts index 7c4b90b5cb..4d5b5ce7c5 100644 --- a/packages/nocodb/src/lib/meta/api/userApi/userApis.ts +++ b/packages/nocodb/src/lib/meta/api/userApi/userApis.ts @@ -593,6 +593,7 @@ const mapRoutes = (router) => { ); router.post( '/api/v1/db/auth/password/reset/:tokenId', + getAjvValidatorMw('swagger.json#/components/schemas/PasswordResetReq'), catchError(passwordReset) ); router.post( diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 521a9d6c61..3571cb5a98 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -478,7 +478,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApiToken" + "$ref": "#/components/schemas/ApiTokenReq" } } } @@ -713,7 +713,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/User" + "$ref": "#/components/schemas/OrgUserReq" } } }, @@ -858,7 +858,8 @@ "description": "OK", "content": { "application/json": { - "schema": {} + "schema": { + } } } } @@ -866,7 +867,9 @@ "requestBody": { "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/ProjectUserReq" + } } } }, @@ -977,7 +980,9 @@ "requestBody": { "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/ProjectUserReq" + } } } }, @@ -1472,18 +1477,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "uuid": { - "type": "string" - }, - "url": { - "type": "string" - }, - "roles": { - "type": "string" - } - } + "$ref": "#/components/schemas/SharedBaseReq" } } } @@ -5793,23 +5787,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "row_id": { - "type": "string" - }, - "fk_model_id": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "required": [ - "row_id", - "fk_model_id", - "comment" - ] + "$ref": "#/components/schemas/CommentReq" } } } @@ -5946,24 +5924,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "fk_model_id": { - "type": "string" - }, - "column_name": { - "type": "string" - }, - "row_id": { - "type": "string" - }, - "value": { - "type": "string" - }, - "prev_value": { - "type": "string" - } - } + "$ref": "#/components/schemas/AuditRowUpdateReq" } } } @@ -6307,19 +6268,7 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "title": { - "type": "string" - }, - "input": {}, - "category": { - "type": "string" - } - } + "$ref": "#/components/schemas/PluginTestReq" } } } @@ -6346,7 +6295,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Plugin" + "$ref": "#/components/schemas/PluginReq" } } } @@ -10028,6 +9977,22 @@ "updated_at": {} } }, + "ApiTokenReq": { + "title": "ApiToken", + "type": "object", + "properties": { + "description": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + } + }, "HookLog": { "title": "ApiToken", "type": "object", @@ -10468,6 +10433,106 @@ "type": "null" } ] + }, + "CommentReq": { + "type": "object", + "properties": { + "row_id": { + "type": "string" + }, + "fk_model_id": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "row_id", + "fk_model_id", + "comment" + ] + }, + "AuditRowUpdateReq": { + "type": "object", + "properties": { + "fk_model_id": { + "type": "string" + }, + "column_name": { + "type": "string" + }, + "row_id": { + "type": "string" + }, + "value": { }, + "prev_value": { } + } + }, + "OrgUserReq": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "roles": { + "type": "string" + } + } + }, + "ProjectUserReq": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "roles": { + "type": "string" + } + } + }, + "SharedBaseReq": { + "type": "object", + "properties": { + "uuid": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "roles": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + } + }, + "PluginTestReq": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "input": {} + } + }, + "PluginReq": { + "type": "object", + "properties": { + "active": { + "$ref": "#/components/schemas/NcBool" + }, + "input": {} + } } }, "requestBodies": { From 4e084ed8ead95c8b926721f8096b42d3c528fca9 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 26 Feb 2023 11:33:53 +0530 Subject: [PATCH 63/68] refactor: Use generic type for meta field Signed-off-by: Pranav C --- packages/nocodb-sdk/src/lib/Api.ts | 160 ++++++------- .../src/lib/meta/api/helpers/columnHelpers.ts | 4 +- packages/nocodb/src/lib/models/Base.ts | 6 +- .../lib/models/LinkToAnotherRecordColumn.ts | 4 +- packages/nocodb/src/lib/models/Model.ts | 16 +- packages/nocodb/src/lib/models/Project.ts | 4 +- scripts/sdk/swagger.json | 215 +++++++++--------- 7 files changed, 211 insertions(+), 198 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index 814c90e2c9..a885de1708 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -56,12 +56,12 @@ export interface ProjectType { title?: string; status?: string; description?: string; - meta?: string | object; + meta?: MetaType; color?: string; - deleted?: NcBoolType; + deleted?: BoolType; order?: number; bases?: BaseType[]; - is_meta?: NcBoolType; + is_meta?: BoolType; prefix?: string; created_at?: any; updated_at?: any; @@ -78,14 +78,14 @@ export interface BaseType { project_id?: string; alias?: string; type?: string; - is_meta?: NcBoolType; + is_meta?: BoolType; config?: any; created_at?: any; updated_at?: any; inflection_column?: string; inflection_table?: string; order?: number; - enabled?: NcBoolType; + enabled?: BoolType; } export interface BaseReqType { @@ -113,30 +113,30 @@ export interface TableType { table_name: string; title: string; type?: string; - enabled?: NcBoolType; + enabled?: BoolType; parent_id?: string; show_as?: string; tags?: string; - pinned?: NcBoolType; - deleted?: NcBoolType; + pinned?: BoolType; + deleted?: BoolType; order?: number; columns?: ColumnType[]; columnsById?: object; slug?: string; - mm?: NcBoolType; - meta?: any; + mm?: BoolType; + meta?: MetaType; } export interface ViewType { id?: string; title: string; - deleted?: NcBoolType; + deleted?: BoolType; order?: number; fk_model_id?: string; slug?: string; uuid?: string; - meta?: any; - show_system_fields?: NcBoolType; + meta?: MetaType; + show_system_fields?: BoolType; lock_type?: 'collaborative' | 'locked' | 'personal'; type?: number; view?: @@ -159,8 +159,8 @@ export interface TableInfoType { parent_id?: string; show_as?: string; tags?: string; - pinned?: NcBoolType; - deleted?: NcBoolType; + pinned?: BoolType; + deleted?: BoolType; order?: number; column?: ColumnType[]; filters?: FilterType[]; @@ -178,12 +178,12 @@ export interface TableReqType { parent_id?: string; show_as?: string; tags?: string; - pinned?: NcBoolType; - deleted?: NcBoolType; + pinned?: BoolType; + deleted?: BoolType; order?: number; - mm?: NcBoolType; + mm?: BoolType; columns: NormalColumnRequestType[]; - meta?: any; + meta?: MetaType; } export interface TableListType { @@ -261,26 +261,26 @@ export interface ColumnType { ns?: string | number | null; clen?: string | number | null; cop?: string; - pk?: NcBoolType; - pv?: NcBoolType; - rqd?: NcBoolType; + pk?: BoolType; + pv?: BoolType; + rqd?: BoolType; column_name?: string; - un?: NcBoolType; + un?: BoolType; ct?: string; - ai?: NcBoolType; - unique?: NcBoolType; + ai?: BoolType; + unique?: BoolType; cdf?: string; cc?: string; csn?: string; dtx?: string; dtxp?: string | number | null; dtxs?: string | number | null; - au?: NcBoolType; - deleted?: NcBoolType; - visible?: NcBoolType; + au?: BoolType; + deleted?: BoolType; + visible?: BoolType; order?: number; - system?: NcBoolType; - meta?: any; + system?: BoolType; + meta?: MetaType; colOptions?: | LinkToAnotherRecordType | FormulaType @@ -305,7 +305,7 @@ export interface ColumnListType { export interface LinkToAnotherRecordType { id?: string; type?: string; - virtual?: NcBoolType; + virtual?: BoolType; fk_column_id?: string; fk_child_column_id?: string; fk_parent_column_id?: string; @@ -323,7 +323,7 @@ export interface LinkToAnotherRecordType { export interface LookupType { id?: string; type?: string; - virtual?: NcBoolType; + virtual?: BoolType; fk_column_id?: string; fk_relation_column_id?: string; fk_lookup_column_id?: string; @@ -334,7 +334,7 @@ export interface LookupType { export interface RollupType { id?: string; type?: string; - virtual?: NcBoolType; + virtual?: BoolType; fk_column_id?: string; fk_relation_column_id?: string; fk_rollup_column_id?: string; @@ -346,7 +346,7 @@ export interface RollupType { export interface FormulaType { id?: string; type?: string; - virtual?: NcBoolType; + virtual?: BoolType; fk_column_id?: string; formula?: string; formula_raw?: string; @@ -370,7 +370,7 @@ export interface GridType { id?: string; title?: string; alias?: string; - deleted?: NcBoolType; + deleted?: BoolType; order?: number; lock_type?: 'collaborative' | 'locked' | 'personal'; row_height?: number; @@ -387,10 +387,10 @@ export interface GalleryType { fk_view_id?: string; title?: string; alias?: string; - deleted?: NcBoolType; + deleted?: BoolType; order?: number; - next_enabled?: NcBoolType; - prev_enabled?: NcBoolType; + next_enabled?: BoolType; + prev_enabled?: BoolType; cover_image_idx?: number; cover_image?: string; restrict_types?: string; @@ -404,8 +404,8 @@ export interface GalleryType { export interface GalleryReqType { title: string; - next_enabled?: NcBoolType; - prev_enabled?: NcBoolType; + next_enabled?: BoolType; + prev_enabled?: BoolType; cover_image_idx?: number; cover_image?: string; restrict_types?: string; @@ -456,7 +456,7 @@ export interface KanbanType { fk_model_id?: string; fk_grp_col_id?: string | null; fk_cover_image_col_id?: string; - meta?: object | null | string; + meta?: MetaType; } export interface GeoLocationType { @@ -475,7 +475,7 @@ export interface MapType { fk_view_id?: string; fk_geo_data_col_id?: string | null; columns?: MapColumnType[]; - meta?: string | object; + meta?: MetaType; } export interface MapColumnType { @@ -510,12 +510,12 @@ export interface FormType { email?: string; banner_image_url?: string; logo_url?: string; - submit_another_form?: NcBoolType; - show_blank_form?: NcBoolType; + submit_another_form?: BoolType; + show_blank_form?: BoolType; columns?: FormColumnType[]; fk_model_id?: string; lock_type?: 'collaborative' | 'locked' | 'personal'; - meta?: any; + meta?: MetaType; } export interface FormReqType { @@ -528,11 +528,11 @@ export interface FormReqType { email?: string; banner_image_url?: string; logo_url?: string; - submit_another_form?: NcBoolType; - show_blank_form?: NcBoolType; + submit_another_form?: BoolType; + show_blank_form?: BoolType; fk_model_id?: string; lock_type?: 'collaborative' | 'locked' | 'personal'; - meta?: any; + meta?: MetaType; } export interface FormColumnType { @@ -542,24 +542,24 @@ export interface FormColumnType { uuid?: any; label?: string; help?: any; - required?: NcBoolType; - show?: NcBoolType; + required?: BoolType; + show?: BoolType; order?: number; created_at?: string; updated_at?: string; description?: string; - meta?: any; + meta?: MetaType; } export interface FormColumnReqType { uuid?: any; label?: string; help?: any; - required?: NcBoolType; - show?: NcBoolType; + required?: BoolType; + show?: BoolType; order?: number; description?: string; - meta?: any; + meta?: MetaType; } export interface PaginatedType { @@ -633,12 +633,12 @@ export interface HookType { type?: string; event?: 'after' | 'before'; operation?: 'insert' | 'delete' | 'update'; - async?: NcBoolType; + async?: BoolType; notification?: string; retries?: number; retry_interval?: number; timeout?: number; - active?: NcBoolType; + active?: BoolType; } export interface HookReqType { @@ -654,7 +654,7 @@ export interface HookReqType { retries?: number; retry_interval?: number; timeout?: number; - active?: NcBoolType; + active?: BoolType; } export interface HookTestReqType { @@ -693,7 +693,7 @@ export interface PluginType { id?: string; title?: string; description?: string; - active?: NcBoolType; + active?: BoolType; rating?: number; version?: string; docs?: string; @@ -717,7 +717,7 @@ export interface ModelRoleVisibilityType { fk_model_id?: string; fk_view_id?: string; role?: string; - disabled?: NcBoolType; + disabled?: BoolType; } export interface ApiTokenType { @@ -737,7 +737,7 @@ export interface HookLogType { type?: string; event?: string; operation?: string; - test_call?: NcBoolType; + test_call?: BoolType; payload?: any; conditions?: string; notifications?: string; @@ -791,27 +791,27 @@ export interface NormalColumnRequestType { dt?: string; np?: string | number | null; ns?: string | number | null; - pk?: NcBoolType; - pv?: NcBoolType; - rqd?: number | null | NcBoolType; + pk?: BoolType; + pv?: BoolType; + rqd?: number | null | BoolType; column_name?: string; - un?: NcBoolType; + un?: BoolType; ct?: string; - ai?: NcBoolType; - unique?: NcBoolType; + ai?: BoolType; + unique?: BoolType; cdf?: string | null; cc?: string; csn?: string; dtx?: string; dtxp?: string | number | null; dtxs?: string | number | null; - au?: NcBoolType; + au?: BoolType; } export interface LinkToAnotherColumnReqType { uidt: 'LinkToAnotherRecord'; title: string; - virtual?: NcBoolType; + virtual?: BoolType; parentId: string; childId: string; type: 'hm' | 'bt' | 'mm'; @@ -870,16 +870,18 @@ export interface UserInfoType { export type VisibilityRuleReqType = { disabled?: { - commenter?: NcBoolType; - creator?: NcBoolType; - editor?: NcBoolType; - guest?: NcBoolType; - owner?: NcBoolType; - viewer?: NcBoolType; + commenter?: BoolType; + creator?: BoolType; + editor?: BoolType; + guest?: BoolType; + owner?: BoolType; + viewer?: BoolType; }; }[]; -export type NcBoolType = boolean | number | null; +export type BoolType = boolean | number | null; + +export type MetaType = object | string | null; export interface CommentReqType { row_id: string; @@ -916,7 +918,7 @@ export interface PluginTestReqType { } export interface PluginReqType { - active?: NcBoolType; + active?: BoolType; input?: any; } @@ -2372,7 +2374,7 @@ export class Api< table_name?: string; title?: string; project_id?: string; - meta?: any; + meta?: MetaType; }, params: RequestParams = {} ) => @@ -2544,7 +2546,7 @@ export class Api< viewId: string, data: { order?: number; - meta?: any; + meta?: MetaType; title?: string; show_system_fields?: boolean; lock_type?: 'collaborative' | 'locked' | 'personal'; @@ -2996,7 +2998,7 @@ export class Api< viewId: string, data: { password?: string; - meta?: any; + meta?: MetaType; }, params: RequestParams = {} ) => diff --git a/packages/nocodb/src/lib/meta/api/helpers/columnHelpers.ts b/packages/nocodb/src/lib/meta/api/helpers/columnHelpers.ts index ad53a41b6d..daf9344126 100644 --- a/packages/nocodb/src/lib/meta/api/helpers/columnHelpers.ts +++ b/packages/nocodb/src/lib/meta/api/helpers/columnHelpers.ts @@ -3,7 +3,7 @@ import { ColumnReqType, LinkToAnotherRecordType, LookupColumnReqType, - NcBoolType, + BoolType, RelationTypes, RollupColumnReqType, TableType, @@ -28,7 +28,7 @@ export async function createHmAndBtColumn( type?: RelationTypes, alias?: string, fkColName?: string, - virtual: NcBoolType = false, + virtual: BoolType = false, isSystemCol = false ) { // save bt column diff --git a/packages/nocodb/src/lib/models/Base.ts b/packages/nocodb/src/lib/models/Base.ts index c0568b6bd4..9cd94bf75d 100644 --- a/packages/nocodb/src/lib/models/Base.ts +++ b/packages/nocodb/src/lib/models/Base.ts @@ -7,7 +7,7 @@ import { MetaTable, } from '../utils/globals'; import Model from './Model'; -import { BaseType, NcBoolType, UITypes } from 'nocodb-sdk'; +import { BaseType, BoolType, UITypes } from 'nocodb-sdk'; import NocoCache from '../cache/NocoCache'; import CryptoJS from 'crypto-js'; import { extractProps } from '../meta/helpers/extractProps'; @@ -20,14 +20,14 @@ export default class Base implements BaseType { project_id?: string; alias?: string; type?: string; - is_meta?: NcBoolType; + is_meta?: BoolType; config?: any; created_at?: any; updated_at?: any; inflection_column?: string; inflection_table?: string; order?: number; - enabled?: NcBoolType; + enabled?: BoolType; constructor(base: Partial) { Object.assign(this, base); diff --git a/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts b/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts index 8b12d7aa47..3a9056d9a7 100644 --- a/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts +++ b/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts @@ -1,4 +1,4 @@ -import { NcBoolType } from 'nocodb-sdk'; +import { BoolType } from 'nocodb-sdk'; import Noco from '../Noco'; import Column from './Column'; import Model from './Model'; @@ -20,7 +20,7 @@ export default class LinkToAnotherRecordColumn { fk_index_name?: string; type: 'hm' | 'bt' | 'mm'; - virtual: NcBoolType = false; + virtual: BoolType = false; mmModel?: Model; relatedTable?: Model; diff --git a/packages/nocodb/src/lib/models/Model.ts b/packages/nocodb/src/lib/models/Model.ts index 922b547c40..834e8025e4 100644 --- a/packages/nocodb/src/lib/models/Model.ts +++ b/packages/nocodb/src/lib/models/Model.ts @@ -7,7 +7,7 @@ import { BaseModelSqlv2 } from '../db/sql-data-mapper/lib/sql/BaseModelSqlv2'; import { isVirtualCol, ModelTypes, - NcBoolType, + BoolType, TableReqType, TableType, UITypes, @@ -26,17 +26,17 @@ import { sanitize } from '../db/sql-data-mapper/lib/sql/helpers/sanitize'; import { extractProps } from '../meta/helpers/extractProps'; export default class Model implements TableType { - copy_enabled: NcBoolType; + copy_enabled: BoolType; created_at: Date | number | string; base_id: 'db' | string; - deleted: NcBoolType; - enabled: NcBoolType; - export_enabled: NcBoolType; + deleted: BoolType; + enabled: BoolType; + export_enabled: BoolType; id: string; order: number; parent_id: string; password: string; - pin: NcBoolType; + pin: BoolType; project_id: string; schema: any; show_all_fields: boolean; @@ -47,7 +47,7 @@ export default class Model implements TableType { table_name: string; title: string; - mm: NcBoolType; + mm: BoolType; uuid: string; @@ -99,7 +99,7 @@ export default class Model implements TableType { projectId, baseId, model: Partial & { - mm?: NcBoolType; + mm?: BoolType; created_at?: any; updated_at?: any; }, diff --git a/packages/nocodb/src/lib/models/Project.ts b/packages/nocodb/src/lib/models/Project.ts index 6b3f724e4d..3014f86877 100644 --- a/packages/nocodb/src/lib/models/Project.ts +++ b/packages/nocodb/src/lib/models/Project.ts @@ -1,6 +1,6 @@ import Base from './/Base'; import Noco from '../Noco'; -import { NcBoolType, ProjectType } from 'nocodb-sdk'; +import { BoolType, ProjectType } from 'nocodb-sdk'; import { CacheDelDirection, CacheGetType, @@ -18,7 +18,7 @@ export default class Project implements ProjectType { public description: string; public meta: string; public color: string; - public deleted: NcBoolType; + public deleted: BoolType; public order: number; public is_meta = false; public bases?: Base[]; diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 3571cb5a98..7e18c5fb92 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -1933,7 +1933,9 @@ "project_id": { "type": "string" }, - "meta": {} + "meta": { + "$ref": "#/components/schemas/Meta" + } } } } @@ -2166,7 +2168,9 @@ "order": { "type": "number" }, - "meta": {}, + "meta": { + "$ref": "#/components/schemas/Meta" + }, "title": { "type": "string" }, @@ -2363,7 +2367,9 @@ "password": { "type": "string" }, - "meta": {} + "meta": { + "$ref": "#/components/schemas/Meta" + } } } } @@ -7244,16 +7250,13 @@ "type": "string" }, "meta": { - "type": [ - "string", - "object" - ] + "$ref": "#/components/schemas/Meta" }, "color": { "type": "string" }, "deleted": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "order": { "type": "number" @@ -7265,7 +7268,7 @@ } }, "is_meta": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "prefix": { "type": "string" @@ -7340,7 +7343,7 @@ "type": "string" }, "is_meta": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "config": {}, "created_at": {}, @@ -7355,7 +7358,7 @@ "type": "number" }, "enabled": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" } } }, @@ -7535,7 +7538,7 @@ "type": "string" }, "enabled": { - "$ref" : "#/components/schemas/NcBool" + "$ref" : "#/components/schemas/Bool" }, "parent_id": { "type": "string" @@ -7547,10 +7550,10 @@ "type": "string" }, "pinned": { - "$ref" : "#/components/schemas/NcBool" + "$ref" : "#/components/schemas/Bool" }, "deleted": { - "$ref" : "#/components/schemas/NcBool" + "$ref" : "#/components/schemas/Bool" }, "order": { "type": "number" @@ -7568,9 +7571,11 @@ "type": "string" }, "mm": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, - "meta": {} + "meta": { + "$ref": "#/components/schemas/Meta" + } }, "required": [ "table_name", @@ -7654,7 +7659,7 @@ "type": "string" }, "deleted": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "order": { "type": "number" @@ -7668,9 +7673,11 @@ "uuid": { "type": "string" }, - "meta": {}, + "meta": { + "$ref": "#/components/schemas/Meta" + }, "show_system_fields": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "lock_type": { "type": "string", @@ -7830,10 +7837,10 @@ "type": "string" }, "pinned": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "deleted": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "order": { "type": "number" @@ -7897,16 +7904,16 @@ "type": "string" }, "pinned": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "deleted": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "order": { "type": "number" }, "mm": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "columns": { "type": "array", @@ -7914,7 +7921,9 @@ "$ref": "#/components/schemas/NormalColumnRequest" } }, - "meta": {} + "meta": { + "$ref": "#/components/schemas/Meta" + } }, "required": [ "table_name", @@ -8332,28 +8341,28 @@ "type": "string" }, "pk": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "pv": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "rqd": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "column_name": { "type": "string" }, "un": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "ct": { "type": "string" }, "ai": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "unique": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "cdf": { "type": "string" @@ -8394,21 +8403,23 @@ ] }, "au": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "deleted": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "visible": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "order": { "type": "number" }, "system": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" + }, + "meta": { + "$ref": "#/components/schemas/Meta" }, - "meta": {}, "colOptions": { "anyOf": [ { @@ -8498,7 +8509,7 @@ "type": "string" }, "virtual": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "fk_column_id": { "type": "string" @@ -8549,7 +8560,7 @@ "type": "string" }, "virtual": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "fk_column_id": { "type": "string" @@ -8579,7 +8590,7 @@ "type": "string" }, "virtual": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "fk_column_id": { "type": "string" @@ -8612,7 +8623,7 @@ "type": "string" }, "virtual": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "fk_column_id": { "type": "string" @@ -8703,7 +8714,7 @@ "type": "string" }, "deleted": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "order": { "type": "number" @@ -8764,16 +8775,16 @@ "type": "string" }, "deleted": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "order": { "type": "number" }, "next_enabled": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "prev_enabled": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "cover_image_idx": { "type": "integer" @@ -8821,10 +8832,10 @@ "type": "string" }, "next_enabled": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "prev_enabled": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "cover_image_idx": { "type": "integer" @@ -8985,17 +8996,7 @@ "type": "string" }, "meta": { - "oneOf": [ - { - "type": "object" - }, - { - "type": "null" - }, - { - "type": "string" - } - ] + "$ref": "#/components/schemas/Meta" } } }, @@ -9054,15 +9055,8 @@ "$ref": "#/components/schemas/MapColumn" } }, - "meta": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "object" - } - ] + "meta":{ + "$ref": "#/components/schemas/Meta" } } }, @@ -9174,10 +9168,10 @@ "type": "string" }, "submit_another_form": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "show_blank_form": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "columns": { "type": "array", @@ -9196,7 +9190,9 @@ "personal" ] }, - "meta": {} + "meta": { + "$ref": "#/components/schemas/Meta" + } } }, "FormReq": { @@ -9232,10 +9228,10 @@ "type": "string" }, "submit_another_form": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "show_blank_form": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "fk_model_id": { "type": "string" @@ -9248,7 +9244,9 @@ "personal" ] }, - "meta": {} + "meta": { + "$ref": "#/components/schemas/Meta" + } }, "required": [ "title" @@ -9295,10 +9293,10 @@ }, "help": {}, "required": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "show": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "order": { "type": "number" @@ -9315,7 +9313,9 @@ "type": "string", "minLength": 1 }, - "meta": {} + "meta": { + "$ref": "#/components/schemas/Meta" + } } }, "FormColumnReq": { @@ -9347,10 +9347,10 @@ }, "help": {}, "required": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "show": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "order": { "type": "number" @@ -9359,7 +9359,9 @@ "type": "string", "minLength": 1 }, - "meta": {} + "meta": { + "$ref": "#/components/schemas/Meta" + } } }, "Paginated": { @@ -9674,7 +9676,7 @@ ] }, "async": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "notification": { "type": "string" @@ -9689,7 +9691,7 @@ "type": "number" }, "active": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" } } }, @@ -9760,7 +9762,7 @@ "type": "number" }, "active": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" } }, "required": [ @@ -9874,7 +9876,7 @@ "type": "string" }, "active": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "rating": { "type": "number" @@ -9953,7 +9955,7 @@ "type": "string" }, "disabled": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" } } }, @@ -10026,7 +10028,7 @@ "type": "string" }, "test_call": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "payload": {}, "conditions": { @@ -10141,10 +10143,10 @@ ] }, "pk": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "pv": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "rqd": { "oneOf": [ @@ -10155,7 +10157,7 @@ "type": "null" }, { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" } ] }, @@ -10163,16 +10165,16 @@ "type": "string" }, "un": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "ct": { "type": "string" }, "ai": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "unique": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "cdf": { "oneOf": [ @@ -10220,7 +10222,7 @@ ] }, "au": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" } } }, @@ -10237,7 +10239,7 @@ "type": "string" }, "virtual": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "parentId": { "type": "string" @@ -10399,40 +10401,49 @@ "type": "object", "properties": { "commenter": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "creator": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "editor": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "guest": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "owner": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "viewer": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" } } } } } }, - "NcBool": { + "Bool": { "oneOf": [ { "type": "boolean" }, { "type": "integer" + } + ], + "nullable": true + }, + "Meta": { + "oneOf": [ + { + "type": "object" }, { - "type": "null" + "type": "string" } - ] + ], + "nullable": true }, "CommentReq": { "type": "object", @@ -10529,7 +10540,7 @@ "type": "object", "properties": { "active": { - "$ref": "#/components/schemas/NcBool" + "$ref": "#/components/schemas/Bool" }, "input": {} } From 1918d339b8e3738df83d73e1decb31b5209ee8db Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 26 Feb 2023 11:39:02 +0530 Subject: [PATCH 64/68] refactor: replace `"nullable"` with type Signed-off-by: Pranav C --- scripts/sdk/swagger.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 7e18c5fb92..9a93d7cd5c 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -10430,9 +10430,11 @@ }, { "type": "integer" + }, + { + "type": "null" } - ], - "nullable": true + ] }, "Meta": { "oneOf": [ @@ -10441,9 +10443,11 @@ }, { "type": "string" + }, + { + "type": "null" } - ], - "nullable": true + ] }, "CommentReq": { "type": "object", From ca7f8dca08602f577de51d8fb2481b31a1de8708 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 26 Feb 2023 12:01:32 +0530 Subject: [PATCH 65/68] refactor: generic type for string or null Signed-off-by: Pranav C --- packages/nocodb-sdk/src/lib/Api.ts | 75 +++--- .../nocodb/src/lib/meta/api/formViewApis.ts | 2 +- scripts/sdk/swagger.json | 234 +++++------------- 3 files changed, 106 insertions(+), 205 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index a885de1708..5569178391 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -203,8 +203,8 @@ export interface FilterType { project_id?: string; base_id?: string; fk_parent_id?: string; - fk_view_id?: string | null; - fk_hook_id?: string | null; + fk_view_id?: StringOrNullType; + fk_hook_id?: StringOrNullType; } export interface FilterReqType { @@ -219,8 +219,8 @@ export interface FilterReqType { project_id?: string; base_id?: string; fk_parent_id?: string; - fk_view_id?: string | null; - fk_hook_id?: string | null; + fk_view_id?: StringOrNullType; + fk_hook_id?: StringOrNullType; } export interface FilterListType { @@ -454,7 +454,7 @@ export interface KanbanType { alias?: string; columns?: KanbanColumnType[]; fk_model_id?: string; - fk_grp_col_id?: string | null; + fk_grp_col_id?: StringOrNullType; fk_cover_image_col_id?: string; meta?: MetaType; } @@ -473,7 +473,7 @@ export interface MapType { initial_geo_position?: GeoLocationType; fk_model_id?: string; fk_view_id?: string; - fk_geo_data_col_id?: string | null; + fk_geo_data_col_id?: StringOrNullType; columns?: MapColumnType[]; meta?: MetaType; } @@ -492,11 +492,11 @@ export interface LicenseReqType { export interface KanbanReqType { title: string; - fk_grp_col_id?: string | null; + fk_grp_col_id?: StringOrNullType; } export interface KanbanUpdateReqType { - fk_grp_col_id?: string | null; + fk_grp_col_id?: StringOrNullType; } export interface FormType { @@ -505,11 +505,11 @@ export interface FormType { heading?: string; subheading?: string; success_msg?: string; - redirect_url?: string; - redirect_after_secs?: string; - email?: string; - banner_image_url?: string; - logo_url?: string; + redirect_url?: StringOrNullType; + redirect_after_secs?: StringOrNullType; + email?: StringOrNullType; + banner_image_url?: StringOrNullType; + logo_url?: StringOrNullType; submit_another_form?: BoolType; show_blank_form?: BoolType; columns?: FormColumnType[]; @@ -519,22 +519,23 @@ export interface FormType { } export interface FormReqType { - title: string; + title?: string; heading?: string; subheading?: string; success_msg?: string; - redirect_url?: string; - redirect_after_secs?: string; - email?: string; - banner_image_url?: string; - logo_url?: string; + redirect_url?: StringOrNullType; + redirect_after_secs?: StringOrNullType; + email?: StringOrNullType; + banner_image_url?: StringOrNullType; + logo_url?: StringOrNullType; submit_another_form?: BoolType; show_blank_form?: BoolType; - fk_model_id?: string; lock_type?: 'collaborative' | 'locked' | 'personal'; meta?: MetaType; } +export type FormCreateReqType = FormReqType; + export interface FormColumnType { fk_column_id?: string; id?: string; @@ -645,7 +646,7 @@ export interface HookReqType { id?: string; fk_model_id?: string; title: string; - description?: string | null; + description?: StringOrNullType; env?: string; event: 'after' | 'before'; operation: 'insert' | 'delete' | 'update'; @@ -686,7 +687,7 @@ export interface PasswordChangeReqType { } export interface ApiTokenReqType { - description?: string | null; + description?: StringOrNullType; } export interface PluginType { @@ -704,7 +705,7 @@ export interface PluginType { tags?: string; category?: string; input_schema?: string; - input?: string | number | null; + input?: number | StringOrNullType; creator?: string; creator_website?: string; price?: string; @@ -733,7 +734,7 @@ export interface HookLogType { id?: string; base_id?: string; project_id?: string; - fk_hook_id?: string | null; + fk_hook_id?: StringOrNullType; type?: string; event?: string; operation?: string; @@ -789,22 +790,22 @@ export interface NormalColumnRequestType { fk_model_id?: string; title?: string; dt?: string; - np?: string | number | null; - ns?: string | number | null; + np?: number | StringOrNullType; + ns?: number | StringOrNullType; pk?: BoolType; pv?: BoolType; - rqd?: number | null | BoolType; + rqd?: BoolType; column_name?: string; un?: BoolType; ct?: string; ai?: BoolType; unique?: BoolType; - cdf?: string | null; + cdf?: StringOrNullType; cc?: string; csn?: string; dtx?: string; - dtxp?: string | number | null; - dtxs?: string | number | null; + dtxp?: number | StringOrNullType; + dtxs?: number | StringOrNullType; au?: BoolType; } @@ -881,6 +882,8 @@ export type VisibilityRuleReqType = { export type BoolType = boolean | number | null; +export type StringOrNullType = string | null; + export type MetaType = object | string | null; export interface CommentReqType { @@ -908,8 +911,8 @@ export interface ProjectUserReqType { } export interface SharedBaseReqType { - uuid?: string | null; - roles?: string | null; + uuid?: StringOrNullType; + roles?: StringOrNullType; } export interface PluginTestReqType { @@ -2652,7 +2655,7 @@ export class Api< */ formCreate: ( tableId: string, - data: FormReqType, + data: FormCreateReqType, params: RequestParams = {} ) => this.request({ @@ -2672,7 +2675,11 @@ export class Api< * @request PATCH:/api/v1/db/meta/forms/{formId} * @response `200` `void` OK */ - formUpdate: (formId: string, data: FormType, params: RequestParams = {}) => + formUpdate: ( + formId: string, + data: FormReqType, + params: RequestParams = {} + ) => this.request({ path: `/api/v1/db/meta/forms/${formId}`, method: 'PATCH', diff --git a/packages/nocodb/src/lib/meta/api/formViewApis.ts b/packages/nocodb/src/lib/meta/api/formViewApis.ts index fda614c803..beadf3cded 100644 --- a/packages/nocodb/src/lib/meta/api/formViewApis.ts +++ b/packages/nocodb/src/lib/meta/api/formViewApis.ts @@ -44,7 +44,7 @@ const router = Router({ mergeParams: true }); router.post( '/api/v1/db/meta/tables/:tableId/forms', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/FormReq'), + getAjvValidatorMw('swagger.json#/components/schemas/FormCreateReq'), ncMetaAclMw(formViewCreate, 'formViewCreate') ); router.get( diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 9a93d7cd5c..34a1deb383 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -2892,7 +2892,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FormReq" + "$ref": "#/components/schemas/FormCreateReq" } } } @@ -2925,7 +2925,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Form" + "$ref": "#/components/schemas/FormReq" } } } @@ -7538,7 +7538,7 @@ "type": "string" }, "enabled": { - "$ref" : "#/components/schemas/Bool" + "$ref": "#/components/schemas/Bool" }, "parent_id": { "type": "string" @@ -7550,10 +7550,10 @@ "type": "string" }, "pinned": { - "$ref" : "#/components/schemas/Bool" + "$ref": "#/components/schemas/Bool" }, "deleted": { - "$ref" : "#/components/schemas/Bool" + "$ref": "#/components/schemas/Bool" }, "order": { "type": "number" @@ -7999,7 +7999,7 @@ "comparison_op": { "type": "string" }, - "value": { }, + "value": {}, "is_group": { "oneOf": [ { @@ -8031,24 +8031,10 @@ "type": "string" }, "fk_view_id": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/StringOrNull" }, "fk_hook_id": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/StringOrNull" } }, "readOnly": true @@ -8072,7 +8058,7 @@ "comparison_op": { "type": "string" }, - "value": { }, + "value": {}, "is_group": { "oneOf": [ { @@ -8104,24 +8090,10 @@ "type": "string" }, "fk_view_id": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/StringOrNull" }, "fk_hook_id": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/StringOrNull" } }, "readOnly": true @@ -8983,14 +8955,7 @@ "type": "string" }, "fk_grp_col_id": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/StringOrNull" }, "fk_cover_image_col_id": { "type": "string" @@ -9040,14 +9005,7 @@ "minLength": 1 }, "fk_geo_data_col_id": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/StringOrNull" }, "columns": { "type": "array", @@ -9055,7 +9013,7 @@ "$ref": "#/components/schemas/MapColumn" } }, - "meta":{ + "meta": { "$ref": "#/components/schemas/Meta" } } @@ -9101,14 +9059,7 @@ "type": "string" }, "fk_grp_col_id": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/StringOrNull" } }, "required": [ @@ -9121,14 +9072,7 @@ "description": "", "properties": { "fk_grp_col_id": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/StringOrNull" } } }, @@ -9153,19 +9097,19 @@ "type": "string" }, "redirect_url": { - "type": "string" + "$ref": "#/components/schemas/StringOrNull" }, "redirect_after_secs": { - "type": "string" + "$ref": "#/components/schemas/StringOrNull" }, "email": { - "type": "string" + "$ref": "#/components/schemas/StringOrNull" }, "banner_image_url": { - "type": "string" + "$ref": "#/components/schemas/StringOrNull" }, "logo_url": { - "type": "string" + "$ref": "#/components/schemas/StringOrNull" }, "submit_another_form": { "$ref": "#/components/schemas/Bool" @@ -9212,20 +9156,21 @@ "success_msg": { "type": "string" }, + "redirect_url": { - "type": "string" + "$ref": "#/components/schemas/StringOrNull" }, "redirect_after_secs": { - "type": "string" + "$ref": "#/components/schemas/StringOrNull" }, "email": { - "type": "string" + "$ref": "#/components/schemas/StringOrNull" }, "banner_image_url": { - "type": "string" + "$ref": "#/components/schemas/StringOrNull" }, "logo_url": { - "type": "string" + "$ref": "#/components/schemas/StringOrNull" }, "submit_another_form": { "$ref": "#/components/schemas/Bool" @@ -9233,9 +9178,6 @@ "show_blank_form": { "$ref": "#/components/schemas/Bool" }, - "fk_model_id": { - "type": "string" - }, "lock_type": { "type": "string", "enum": [ @@ -9247,9 +9189,18 @@ "meta": { "$ref": "#/components/schemas/Meta" } - }, - "required": [ - "title" + } + }, + "FormCreateReq": { + "allOf": [ + { + "$ref": "#/components/schemas/FormReq" + }, + { + "required": [ + "title" + ] + } ] }, "FormColumn": { @@ -9709,14 +9660,7 @@ "type": "string" }, "description": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/StringOrNull" }, "env": { "type": "string" @@ -9910,14 +9854,11 @@ }, "input": { "oneOf": [ - { - "type": "string" - }, { "type": "integer" }, { - "type": "null" + "$ref": "#/components/schemas/StringOrNull" } ] }, @@ -9984,14 +9925,7 @@ "type": "object", "properties": { "description": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/StringOrNull" } } }, @@ -10009,14 +9943,7 @@ "type": "string" }, "fk_hook_id": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/StringOrNull" }, "type": { "type": "string" @@ -10118,27 +10045,21 @@ }, "np": { "oneOf": [ - { - "type": "string" - }, { "type": "integer" }, { - "type": "null" + "$ref": "#/components/schemas/StringOrNull" } ] }, "ns": { "oneOf": [ - { - "type": "string" - }, { "type": "integer" }, { - "type": "null" + "$ref": "#/components/schemas/StringOrNull" } ] }, @@ -10149,17 +10070,7 @@ "$ref": "#/components/schemas/Bool" }, "rqd": { - "oneOf": [ - { - "type": "integer" - }, - { - "type": "null" - }, - { - "$ref": "#/components/schemas/Bool" - } - ] + "$ref": "#/components/schemas/Bool" }, "column_name": { "type": "string" @@ -10177,14 +10088,7 @@ "$ref": "#/components/schemas/Bool" }, "cdf": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/StringOrNull" }, "cc": { "type": "string" @@ -10197,27 +10101,21 @@ }, "dtxp": { "oneOf": [ - { - "type": "string" - }, { "type": "number" }, { - "type": "null" + "$ref": "#/components/schemas/StringOrNull" } ] }, "dtxs": { "oneOf": [ - { - "type": "string" - }, { "type": "number" }, { - "type": "null" + "$ref": "#/components/schemas/StringOrNull" } ] }, @@ -10436,6 +10334,16 @@ } ] }, + "StringOrNull": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, "Meta": { "oneOf": [ { @@ -10480,8 +10388,8 @@ "row_id": { "type": "string" }, - "value": { }, - "prev_value": { } + "value": {}, + "prev_value": {} } }, "OrgUserReq": { @@ -10510,24 +10418,10 @@ "type": "object", "properties": { "uuid": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/StringOrNull" }, "roles": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + "$ref": "#/components/schemas/StringOrNull" } } }, @@ -10555,7 +10449,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SignUpReq" + "$ref": "#/components/schemas/SignUpReq" } } } From adb1dcfddfcf674403e45a140370050713416a14 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 26 Feb 2023 13:20:40 +0530 Subject: [PATCH 66/68] refactor: move swagger.json to nocodb package Signed-off-by: Pranav C --- .github/workflows/publish-api-docs.yml | 6 +++--- packages/nocodb-sdk/package.json | 4 ++-- packages/nocodb/src/lib/meta/api/helpers/apiHelpers.ts | 2 +- {scripts/sdk => packages/nocodb/src/schema}/swagger.json | 0 packages/nocodb/tsconfig.json | 3 +-- 5 files changed, 7 insertions(+), 8 deletions(-) rename {scripts/sdk => packages/nocodb/src/schema}/swagger.json (100%) diff --git a/.github/workflows/publish-api-docs.yml b/.github/workflows/publish-api-docs.yml index e54cd12976..47860cdd7f 100644 --- a/.github/workflows/publish-api-docs.yml +++ b/.github/workflows/publish-api-docs.yml @@ -4,7 +4,7 @@ on: push: branches: [ master ] paths: - - "scripts/sdk/swagger.json" + - "packages/nocodb/src/schema/swagger.json" release: types: [ published ] @@ -22,7 +22,7 @@ jobs: env: API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }} with: - source_file: 'scripts/sdk/swagger.json' + source_file: 'packages/nocodb/src/schema/swagger.json' destination_repo: 'nocodb/noco-apis-doc' destination_folder: 'src' user_email: 'oof1lab@gmail.com' @@ -34,7 +34,7 @@ jobs: env: API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }} with: - source_file: 'scripts/sdk/swagger.json' + source_file: 'packages/nocodb/src/schema/swagger.json' destination_repo: 'nocodb/noco-apis-doc' destination_folder: 'meta-src' user_email: 'oof1lab@gmail.com' diff --git a/packages/nocodb-sdk/package.json b/packages/nocodb-sdk/package.json index ec22d9e676..df6fab6c5e 100644 --- a/packages/nocodb-sdk/package.json +++ b/packages/nocodb-sdk/package.json @@ -31,7 +31,7 @@ "test:prettier": "prettier \"src/**/*.ts\" --list-different", "test:spelling": "cspell \"{README.md,.github/*.md,src/**/*.ts}\"", "watch:build": "tsc -p tsconfig.json -w", - "generate:sdk": "npx --yes swagger-typescript-api@10.0.3 -r -p ../../scripts/sdk/swagger.json -o ./src/lib/ --axios --unwrap-response-data --module-name-first-tag --type-suffix=Type --templates ../../scripts/sdk/templates" + "generate:sdk": "npx --yes swagger-typescript-api@10.0.3 -r -p ../../packages/nocodb/src/schema/swagger.json -o ./src/lib/ --axios --unwrap-response-data --module-name-first-tag --type-suffix=Type --templates ../../scripts/sdk/templates" }, "dependencies": { "axios": "^0.21.1", @@ -63,4 +63,4 @@ "prettier": { "singleQuote": true } -} \ No newline at end of file +} diff --git a/packages/nocodb/src/lib/meta/api/helpers/apiHelpers.ts b/packages/nocodb/src/lib/meta/api/helpers/apiHelpers.ts index fe4438b1f2..49d1fbc462 100644 --- a/packages/nocodb/src/lib/meta/api/helpers/apiHelpers.ts +++ b/packages/nocodb/src/lib/meta/api/helpers/apiHelpers.ts @@ -1,7 +1,7 @@ import { NextFunction, Request, Response } from 'express'; import Ajv, { ErrorObject } from 'ajv'; // @ts-ignore -import swagger from '../../../../../../../scripts/sdk/swagger.json'; +import swagger from '../../../../schema/swagger.json'; export function parseHrtimeToSeconds(hrtime) { const seconds = (hrtime[0] + hrtime[1] / 1e6).toFixed(3); diff --git a/scripts/sdk/swagger.json b/packages/nocodb/src/schema/swagger.json similarity index 100% rename from scripts/sdk/swagger.json rename to packages/nocodb/src/schema/swagger.json diff --git a/packages/nocodb/tsconfig.json b/packages/nocodb/tsconfig.json index ff49fbac9c..0a94f925a7 100644 --- a/packages/nocodb/tsconfig.json +++ b/packages/nocodb/tsconfig.json @@ -58,8 +58,7 @@ "include": [ "src/**/*.ts", // "src/lib/xgene/migrations/*.js", - "src/**/*.json", - "../../scripts/sdk/swagger.json" + "src/**/*.json" ], "exclude": [ "node_modules/**", From 8dbf966fdd5d5cb4981a87ec0884542d15f6c7f2 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 26 Feb 2023 14:35:34 +0530 Subject: [PATCH 67/68] chore: suggested changes Signed-off-by: Pranav C --- packages/nocodb-sdk/package.json | 2 +- packages/nocodb/src/lib/meta/api/formViewColumnApis.ts | 1 - packages/nocodb/src/lib/models/Filter.ts | 4 ++-- packages/nocodb/src/lib/models/Project.ts | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/nocodb-sdk/package.json b/packages/nocodb-sdk/package.json index df6fab6c5e..442f2c9033 100644 --- a/packages/nocodb-sdk/package.json +++ b/packages/nocodb-sdk/package.json @@ -31,7 +31,7 @@ "test:prettier": "prettier \"src/**/*.ts\" --list-different", "test:spelling": "cspell \"{README.md,.github/*.md,src/**/*.ts}\"", "watch:build": "tsc -p tsconfig.json -w", - "generate:sdk": "npx --yes swagger-typescript-api@10.0.3 -r -p ../../packages/nocodb/src/schema/swagger.json -o ./src/lib/ --axios --unwrap-response-data --module-name-first-tag --type-suffix=Type --templates ../../scripts/sdk/templates" + "generate:sdk": "npx --yes swagger-typescript-api@10.0.3 -r -p ../nocodb/src/schema/swagger.json -o ./src/lib/ --axios --unwrap-response-data --module-name-first-tag --type-suffix=Type --templates ../../scripts/sdk/templates" }, "dependencies": { "axios": "^0.21.1", diff --git a/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts b/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts index 9349b5ae68..bad2f91b0a 100644 --- a/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts +++ b/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts @@ -4,7 +4,6 @@ import { Tele } from 'nc-help'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { metaApiMetrics } from '../helpers/apiMetrics'; import { getAjvValidatorMw } from './helpers'; -// import { getAjvValidatorMw } from './helpers' export async function columnUpdate(req: Request, res: Response) { Tele.emit('evt', { evt_type: 'formViewColumn:updated' }); diff --git a/packages/nocodb/src/lib/models/Filter.ts b/packages/nocodb/src/lib/models/Filter.ts index 8bd2ef73b2..2df6ada287 100644 --- a/packages/nocodb/src/lib/models/Filter.ts +++ b/packages/nocodb/src/lib/models/Filter.ts @@ -9,7 +9,7 @@ import { MetaTable, } from '../utils/globals'; import View from './View'; -import { FilterType, UITypes } from 'nocodb-sdk'; +import { BoolType, FilterType, UITypes } from 'nocodb-sdk'; import NocoCache from '../cache/NocoCache'; import { NcError } from '../meta/helpers/catchError'; import { extractProps } from '../meta/helpers/extractProps'; @@ -55,7 +55,7 @@ export default class Filter { value?: string; logical_op?: string; - is_group?: boolean | number; + is_group?: BoolType; children?: Filter[]; project_id?: string; base_id?: string; diff --git a/packages/nocodb/src/lib/models/Project.ts b/packages/nocodb/src/lib/models/Project.ts index 3014f86877..5ee799d1ab 100644 --- a/packages/nocodb/src/lib/models/Project.ts +++ b/packages/nocodb/src/lib/models/Project.ts @@ -1,6 +1,6 @@ import Base from './/Base'; import Noco from '../Noco'; -import { BoolType, ProjectType } from 'nocodb-sdk'; +import { BoolType, MetaType, ProjectType } from 'nocodb-sdk'; import { CacheDelDirection, CacheGetType, @@ -16,7 +16,7 @@ export default class Project implements ProjectType { public prefix: string; public status: string; public description: string; - public meta: string; + public meta: MetaType; public color: string; public deleted: BoolType; public order: number; From 1f6f3b2234f9dd1a615eee1df00c10312d862162 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 27 Feb 2023 13:14:48 +0800 Subject: [PATCH 68/68] docs: remove comments breaking table in column-types.md --- packages/noco-docs/content/en/setup-and-usages/column-types.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/noco-docs/content/en/setup-and-usages/column-types.md b/packages/noco-docs/content/en/setup-and-usages/column-types.md index a6b11cca6d..182999b520 100644 --- a/packages/noco-docs/content/en/setup-and-usages/column-types.md +++ b/packages/noco-docs/content/en/setup-and-usages/column-types.md @@ -10,9 +10,7 @@ menuTitle: 'Column Types' | Type | Description | |---|---| - | [LinkToAnotherRecord](#linktoanotherrecord) | Has Many or Many To Many columns | - | [SingleLineText](#singlelinetext) | For short text | | [LongText](#longtext) | For lengthy string content | | [Attachment](#attachment) | File attachment column | @@ -36,7 +34,6 @@ menuTitle: 'Column Types' | [DateTime](#datetime)| Date & Time selector | | [QR Code](#qr-code)| QR Code visualization of another referenced column | | [Barcode](#barcode)| Barcode visualization of another referenced column | - | [Geometry](#geometry)| Geometry column | | [GeoData](#geodata)| GeoData column | | [Json](#json)| Json column |