From 5fc0cac83cde31a3363694154f95753837e3e0a0 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 14 Oct 2023 05:12:35 +0000 Subject: [PATCH 1/2] fix: path correction --- packages/nocodb/src/schema/swagger-v2.json | 4834 ++++++++------------ 1 file changed, 1795 insertions(+), 3039 deletions(-) diff --git a/packages/nocodb/src/schema/swagger-v2.json b/packages/nocodb/src/schema/swagger-v2.json index f7ed563e74..f883032740 100644 --- a/packages/nocodb/src/schema/swagger-v2.json +++ b/packages/nocodb/src/schema/swagger-v2.json @@ -64,34 +64,10 @@ } ], "paths": { - "/api/v1/user/profile": { - "patch": { - "summary": "Update User Profile", - "operationId": "user-profile-update", - "responses": { - "200": { - "$ref": "#/components/schemas/User" - } - }, - "tags": [ - "User profile" - ], - "description": "Update User Profile", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/User" - } - } - } - } - } - }, - "/api/v1/auth/user/signup": { - "post": { - "summary": "Signup", - "operationId": "auth-signup", + "/api/v2/meta/bases/{baseId}/users": { + "get": { + "summary": "List Base Users", + "operationId": "auth-base-user-list", "responses": { "200": { "description": "OK", @@ -100,17 +76,50 @@ "schema": { "type": "object", "properties": { - "token": { - "type": "string", - "description": "The signed JWT token for information exchange", - "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6IndAbm9jb2RiLmNvbSIsImZpcnN0bmFtZSI6bnVsbCwibGFzdG5hbWUiOm51bGwsImlkIjoidXNfYjN4bzJpNDRueDV5OWwiLCJyb2xlcyI6Im9yZy1sZXZlbC1jcmVhdG9yLHN1cGVyIiwidG9rZW5fdmVyc2lvbiI6ImJmMTc3ZGUzYjk3YjAzMjY4YjU0NGZmMjMzNGU5YjFhMGUzYzgxM2NiYzliOTJkYWMwYmM5NTRiNmUzN2ZjMTJjYmFkNDM2NmIwYzExZTdjIiwiaWF0IjoxNjc4MDc4NDMyLCJleHAiOjE2NzgxMTQ0MzJ9.gzwp_svZlbA5PV_eawYV-9UFjZVjniy-tCDce16xrkI" + "users": { + "type": "object", + "properties": { + "list": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "#/components/schemas/User" + } + }, + "pageInfo": { + "$ref": "#/components/schemas/Paginated" + } + }, + "required": [ + "list", + "pageInfo" + ] } } }, "examples": { "Example 1": { "value": { - "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6IndAbm9jb2RiLmNvbSIsImZpcnN0bmFtZSI6bnVsbCwibGFzdG5hbWUiOm51bGwsImlkIjoidXNfYjN4bzJpNDRueDV5OWwiLCJyb2xlcyI6Im9yZy1sZXZlbC1jcmVhdG9yLHN1cGVyIiwidG9rZW5fdmVyc2lvbiI6ImJmMTc3ZGUzYjk3YjAzMjY4YjU0NGZmMjMzNGU5YjFhMGUzYzgxM2NiYzliOTJkYWMwYmM5NTRiNmUzN2ZjMTJjYmFkNDM2NmIwYzExZTdjIiwiaWF0IjoxNjc4MDc4NDMyLCJleHAiOjE2NzgxMTQ0MzJ9.gzwp_svZlbA5PV_eawYV-9UFjZVjniy-tCDce16xrkI" + "users": { + "list": [ + { + "email": "user@example.com", + "email_verified": true, + "firstname": "Alice", + "id": "us_8kugj628ebjngs", + "lastname": "Smith", + "roles": "org-level-viewer" + } + ], + "pageInfo": { + "isFirstPage": true, + "isLastPage": true, + "page": 1, + "pageSize": 10, + "totalRows": 1 + } + } } } } @@ -118,79 +127,171 @@ } }, "400": { - "description": "Bad Request", + "$ref": "#/components/responses/BadRequest" + } + }, + "description": "List all users in the given base.", + "tags": [ + "Auth" + ], + "parameters": [ + { + "$ref": "#/components/parameters/xc-auth" + } + ] + }, + "parameters": [ + { + "schema": { + "$ref": "#/components/schemas/Id", + "example": "p_124hhlkbeasewh", + "type": "string" + }, + "name": "baseId", + "in": "path", + "required": true, + "description": "Unique Base ID" + } + ], + "post": { + "summary": "Create Base User", + "operationId": "auth-base-user-add", + "responses": { + "200": { + "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "msg": { - "type": "string" + "type": "string", + "x-stoplight": { + "id": "waau9tvy75zsd" + }, + "description": "Success Message for inviting single email", + "example": "The user has been invited successfully" + }, + "invite_token": { + "type": "string", + "x-stoplight": { + "id": "yx0s35u8ds3p7" + }, + "example": "8354ddba-a769-4d64-8397-eccb2e2b3c06" + }, + "error": { + "type": "array", + "x-stoplight": { + "id": "yhfi6wzhr6zr1" + }, + "items": { + "x-stoplight": { + "id": "ce0hlv3d0f96j" + }, + "type": "object", + "properties": { + "email": { + "type": "string", + "x-stoplight": { + "id": "dgnh01j4lxvl1" + }, + "example": "w@nocodb.com" + }, + "error": { + "type": "string", + "x-stoplight": { + "id": "7dgttqiijg8no" + }, + "example": "" + } + } + } + }, + "email": { + "type": "string", + "x-stoplight": { + "id": "08pqst2q30vot" + }, + "example": "w@nocodb.com" } } }, "examples": { - "Invalid email": { - "value": { - "msg": "Invalid email" - } - }, - "Invalid invite url": { - "value": { - "msg": "Invalid invite url" - } - }, - "Expired invite url": { + "Inviting a user without any errors": { "value": { - "msg": "Expired invite url, Please contact super admin to get a new invite url" + "msg": "The user has been invited successfully" } }, - "User already exist": { + "Inviting a user but invitation email failed to send": { "value": { - "msg": "User already exist" + "invite_token": "8354ddba-a769-4d64-8397-eccb2e2b3c06", + "email": "w@nocodb.com" } }, - "Invite only signup": { + "Inviting multiple users": { "value": { - "msg": "Not allowed to signup, contact super admin" + "invite_token": "8354ddba-a769-4d64-8397-eccb2e2b3c06", + "error": [ + { + "email": "w@nocodb.com", + "error": "" + } + ] } } } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" } }, - "tags": [ - "Auth" - ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SignUpReq" + "$ref": "#/components/schemas/ProjectUserReq" }, "examples": { "Example 1": { "value": { "email": "user@example.com", - "password": "password123456789", - "firstname": "Alice", - "lastname": "Smith", - "token": null, - "ignore_subscribe": 0 + "roles": "owner" } } } } } }, - "description": "Create a new user with provided email and password and first user is marked as super admin. " + "tags": [ + "Auth" + ], + "description": "Create a user and add it to the given base", + "parameters": [ + { + "$ref": "#/components/parameters/xc-auth" + } + ] } }, - "/api/v1/auth/user/signout": { - "post": { - "summary": "Signout", - "operationId": "auth-signout", + "/api/v2/meta/bases/{baseId}/info": { + "parameters": [ + { + "schema": { + "$ref": "#/components/schemas/Id", + "example": "p_124hhlkbeasewh", + "type": "string" + }, + "name": "baseId", + "in": "path", + "required": true, + "description": "Unique Base ID" + } + ], + "get": { + "summary": "Get Base info", + "operationId": "base-meta-get", "responses": { "200": { "description": "OK", @@ -199,17 +300,59 @@ "schema": { "type": "object", "properties": { - "msg": { + "Node": { "type": "string", - "description": "Success Message", - "example": "Signed out successfully" + "description": "Node version", + "example": "v12.16.1" + }, + "Arch": { + "type": "string", + "description": "Architecture type", + "example": "x64" + }, + "Platform": { + "type": "string", + "description": "Platform type", + "example": "linux" + }, + "Docker": { + "type": "boolean", + "description": "Is docker", + "example": false + }, + "Database": { + "type": "string", + "description": "Database type", + "example": "postgres" + }, + "ProjectOnRootDB": { + "type": "boolean", + "description": "Is base on rootdb", + "example": false + }, + "RootDB": { + "type": "string", + "description": "Root database type", + "example": "postgres" + }, + "PackageVersion": { + "type": "string", + "description": "Package version", + "example": "1.0.0" } } }, "examples": { "Example 1": { "value": { - "msg": "Signed out successfully" + "Node": "v12.16.1", + "Arch": "x64", + "Platform": "linux", + "Docker": false, + "Database": "postgres", + "ProjectOnRootDB": false, + "RootDB": "postgres", + "PackageVersion": "1.0.0" } } } @@ -221,20 +364,43 @@ } }, "tags": [ - "Auth" + "Base" ], - "description": "Clear refresh token from the database and cookie." - }, + "description": "Get info such as node version, arch, platform, is docker, rootdb and package version of a given base", + "parameters": [ + { + "$ref": "#/components/parameters/xc-auth" + } + ] + } + }, + "/api/v2/meta/bases/{baseId}/users/{userId}": { "parameters": [ { - "$ref": "#/components/parameters/xc-auth" - } - ] - }, - "/api/v1/auth/user/signin": { - "post": { - "summary": "Signin", - "operationId": "auth-signin", + "schema": { + "$ref": "#/components/schemas/Id", + "example": "p_124hhlkbeasewh", + "type": "string" + }, + "name": "baseId", + "in": "path", + "required": true, + "description": "Unique Base ID" + }, + { + "schema": { + "$ref": "#/components/schemas/Id", + "example": "us_b3xo2i44nx5y9l" + }, + "name": "userId", + "in": "path", + "required": true, + "description": "Unique User ID" + } + ], + "patch": { + "summary": "Update Base User", + "operationId": "auth-base-user-update", "responses": { "200": { "description": "OK", @@ -243,17 +409,20 @@ "schema": { "type": "object", "properties": { - "token": { + "msg": { "type": "string", - "description": "The signed JWT token for information exchange", - "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6IndAbm9jb2RiLmNvbSIsImZpcnN0bmFtZSI6bnVsbCwibGFzdG5hbWUiOm51bGwsImlkIjoidXNfYjN4bzJpNDRueDV5OWwiLCJyb2xlcyI6Im9yZy1sZXZlbC1jcmVhdG9yLHN1cGVyIiwidG9rZW5fdmVyc2lvbiI6ImJmMTc3ZGUzYjk3YjAzMjY4YjU0NGZmMjMzNGU5YjFhMGUzYzgxM2NiYzliOTJkYWMwYmM5NTRiNmUzN2ZjMTJjYmFkNDM2NmIwYzExZTdjIiwiaWF0IjoxNjc4MDc4NDMyLCJleHAiOjE2NzgxMTQ0MzJ9.gzwp_svZlbA5PV_eawYV-9UFjZVjniy-tCDce16xrkI" + "x-stoplight": { + "id": "5a2q8as60daly" + }, + "description": "Success Message", + "example": "The user has been updated successfully" } } }, "examples": { "Example 1": { "value": { - "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6IndAbm9jb2RiLmNvbSIsImZpcnN0bmFtZSI6bnVsbCwibGFzdG5hbWUiOm51bGwsImlkIjoidXNfYjN4bzJpNDRueDV5OWwiLCJyb2xlcyI6Im9yZy1sZXZlbC1jcmVhdG9yLHN1cGVyIiwidG9rZW5fdmVyc2lvbiI6ImJmMTc3ZGUzYjk3YjAzMjY4YjU0NGZmMjMzNGU5YjFhMGUzYzgxM2NiYzliOTJkYWMwYmM5NTRiNmUzN2ZjMTJjYmFkNDM2NmIwYzExZTdjIiwiaWF0IjoxNjc4MDc4NDMyLCJleHAiOjE2NzgxMTQ0MzJ9.gzwp_svZlbA5PV_eawYV-9UFjZVjniy-tCDce16xrkI" + "msg": "The user has been updated successfully" } } } @@ -264,90 +433,36 @@ "$ref": "#/components/responses/BadRequest" } }, - "tags": [ - "Auth" - ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SignInReq" + "$ref": "#/components/schemas/ProjectUserReq" }, "examples": { - "example-1": { + "Example 1": { "value": { "email": "user@example.com", - "password": "Password" - } - } - } - } - } - }, - "description": "Authenticate existing user with their email and password. Successful login will return a JWT access-token. " - }, - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ] - }, - "/api/v1/auth/user/me": { - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ], - "get": { - "summary": "Get User Info", - "operationId": "auth-me", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserInfo" - }, - "examples": { - "example-1": { - "value": { - "id": "us_8kugj628ebjngs", - "email": "user@example.com", - "email_verified": true, - "firstname": "Alice", - "lastname": "Smith", - "roles": "org-level-viewer" - } + "roles": "owner" } } } } - }, - "400": { - "$ref": "#/components/responses/BadRequest" } }, "tags": [ "Auth" ], - "description": "Returns authenticated user info", + "description": "Update a given user in a given base. Exclusive for Super Admin. Access with API Tokens will be blocked.", "parameters": [ { - "schema": { - "$ref": "#/components/schemas/Id" - }, - "in": "query", - "name": "base_id", - "description": "Pass base id to get base specific roles along with user info" + "$ref": "#/components/parameters/xc-auth" } ] - } - }, - "/api/v1/auth/password/forgot": { - "post": { - "summary": "Forget Password", - "operationId": "auth-password-forgot", + }, + "delete": { + "summary": "Delete Base User", + "operationId": "auth-base-user-remove", "responses": { "200": { "description": "OK", @@ -359,9 +474,9 @@ "msg": { "type": "string", "x-stoplight": { - "id": "q9s5vh2i34x6c" + "id": "5h7c9lqh5ynve" }, - "example": "Please check your email to reset the password", + "example": "The user has been updated successfully", "description": "Success Message" } } @@ -369,7 +484,7 @@ "examples": { "Example 1": { "value": { - "msg": "Please check your email to reset the password" + "msg": "The user has been updated successfully" } } } @@ -380,57 +495,78 @@ "$ref": "#/components/responses/BadRequest" } }, - "description": "Emails user with a reset url.", "tags": [ "Auth" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PasswordForgotReq" - }, - "examples": { - "Example 1": { - "value": { - "email": "user@example.com" - } - } - } - } - }, - "description": "Pass registered user email id in request body" - } - }, - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ] + "description": "Delete a given user in a given base. Exclusive for Super Admin. Access with API Tokens will be blocked.", + "parameters": [ + { + "$ref": "#/components/parameters/xc-auth" + } + ] + } }, - "/api/v1/auth/password/change": { - "post": { - "summary": "Change Password", - "operationId": "auth-password-change", + "/api/v2/meta/bases/{baseId}/visibility-rules": { + "get": { + "summary": "Get UI ACL", + "operationId": "base-model-visibility-list", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "msg": { - "type": "string", - "description": "Success Message" - } - } + "type": "array", + "items": {} }, "examples": { - "Success response": { - "value": { - "msg": "Password has been updated successfully" - } + "Example 1": { + "value": [ + { + "ptn": "nc_09gt___Sheet-1", + "_ptn": "Sheet-1", + "ptype": "table", + "tn": "Sheet-1", + "_tn": "Sheet-1", + "table_meta": null, + "id": "vw_75neroyqdye94k", + "source_id": "ds_eol59jg2l4zwev", + "base_id": "p_63b4q0qengen1x", + "fk_model_id": "md_5mipbdg6ketmv8", + "title": "Sheet-1", + "type": 3, + "is_default": true, + "show_system_fields": null, + "lock_type": "collaborative", + "uuid": "24a6d0bb-e45d-4b1a-bfef-f492d870de9f", + "password": null, + "show": true, + "order": 1, + "created_at": "2023-03-08T10:44:55.253Z", + "updated_at": "2023-03-10T07:18:44.908Z", + "meta": { + "allowCSVDownload": true + }, + "view": { + "fk_view_id": "vw_75neroyqdye94k", + "source_id": "ds_eol59jg2l4zwev", + "base_id": "p_63b4q0qengen1x", + "uuid": null, + "created_at": "2023-03-08T10:44:55.288Z", + "updated_at": "2023-03-08T10:44:55.288Z", + "meta": null, + "row_height": null + }, + "disabled": { + "owner": false, + "creator": false, + "viewer": false, + "editor": false, + "commenter": false, + "guest": false + } + } + ] } } } @@ -440,39 +576,39 @@ "$ref": "#/components/responses/BadRequest" } }, - "description": "Change password of authenticated user with a new one.", + "description": "Hide / show views based on user role", "tags": [ - "Auth" + "Base" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PasswordChangeReq" - }, - "examples": { - "example-1": { - "value": { - "currentPassword": "currentPassword", - "newPassword": "newPassword" - } - } - } - } + "parameters": [ + { + "schema": { + "type": "boolean" + }, + "in": "query", + "name": "includeM2M" }, - "description": "Old password need to be passed along with new password for changing password." - } + { + "$ref": "#/components/parameters/xc-auth" + } + ] }, "parameters": [ { - "$ref": "#/components/parameters/xc-auth" + "schema": { + "$ref": "#/components/schemas/Id", + "example": "p_124hhlkbeasewh", + "type": "string" + }, + "name": "baseId", + "in": "path", + "required": true, + "description": "Unique Base ID" } - ] - }, - "/api/v1/auth/token/validate/{token}": { + ], "post": { - "summary": "Verify Reset Token", - "operationId": "auth-password-reset-token-validate", + "summary": "Create UI ACL", + "operationId": "base-model-visibility-set", "responses": { "200": { "description": "OK", @@ -484,17 +620,16 @@ "msg": { "type": "string", "x-stoplight": { - "id": "unxdsok22kg1y" + "id": "2txh071wsodys" }, - "example": "Token has been validated successfully", - "description": "Success Message" + "example": "UI ACL has been created successfully" } } }, "examples": { "Example 1": { "value": { - "msg": "Token has been validated successfully" + "msg": "UI ACL has been created successfully" } } } @@ -505,56 +640,85 @@ "$ref": "#/components/responses/BadRequest" } }, - "description": "Validate password reset url token.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VisibilityRuleReq" + } + } + } + }, "tags": [ - "Auth" + "Base" ], + "description": "Hide / show views based on user role", "parameters": [ { "$ref": "#/components/parameters/xc-auth" } ] - }, + } + }, + "/api/v2/meta/bases/": { "parameters": [ { - "schema": { - "type": "string", - "format": "uuid", - "example": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" - }, - "name": "token", - "in": "path", - "required": true, - "description": "Reset Token" + "$ref": "#/components/parameters/xc-auth" } - ] - }, - "/api/v1/auth/email/validate/{token}": { - "post": { - "summary": "Verify Email", - "operationId": "auth-email-validate", + ], + "get": { + "summary": "List Projects", + "operationId": "base-list", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "msg": { - "type": "string", - "x-stoplight": { - "id": "u49sbr20s9rgf" - }, - "description": "Success Message", - "example": "Email has been verified successfully" - } - } + "$ref": "#/components/schemas/ProjectList" }, "examples": { "Example 1": { "value": { - "msg": "Email has been verified successfully" + "list": [ + { + "sources": [ + { + "alias": "string", + "config": null, + "created_at": "2023-03-01 14:27:36", + "enabled": true, + "id": "string", + "inflection_column": "camelize", + "inflection_table": "camelize", + "is_meta": true, + "order": 1, + "base_id": "string", + "type": "mysql2", + "updated_at": "2023-03-01 14:27:36" + } + ], + "color": "#24716E", + "created_at": "2023-03-01 14:27:36", + "deleted": true, + "description": "This is my base description", + "id": "p_124hhlkbeasewh", + "is_meta": true, + "meta": {}, + "order": 0, + "prefix": "nc_vm5q__", + "status": "string", + "title": "my-base", + "updated_at": "2023-03-01 14:27:36" + } + ], + "pageInfo": { + "isFirstPage": true, + "isLastPage": true, + "page": 1, + "pageSize": 10, + "totalRows": 1 + } } } } @@ -565,58 +729,26 @@ "$ref": "#/components/responses/BadRequest" } }, - "description": "Api for verifying email where token need to be passed which is shared to user email.", - "tags": [ - "Auth" - ], + "description": "List all base meta data", "parameters": [ { "$ref": "#/components/parameters/xc-auth" } + ], + "tags": [ + "Base" ] }, - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid", - "example": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" - }, - "name": "token", - "in": "path", - "required": true, - "description": "Validation Token" - } - ] - }, - "/api/v1/auth/password/reset/{token}": { "post": { - "summary": "Reset Password", - "operationId": "auth-password-reset", + "summary": "Create Base", + "operationId": "base-create", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "msg": { - "type": "string", - "x-stoplight": { - "id": "2to6ro4121rfx" - }, - "description": "Success Message", - "example": "Password has been reset successfully" - } - } - }, - "examples": { - "Example 1": { - "value": { - "msg": "Password has been reset successfully" - } - } + "$ref": "#/components/schemas/Base" } } } @@ -625,50 +757,77 @@ "$ref": "#/components/responses/BadRequest" } }, - "description": "Update user password to new by using reset token.", - "tags": [ - "Auth" - ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PasswordResetReq" + "allOf": [ + { + "$ref": "#/components/schemas/ProjectReq" + }, + { + "type": "object", + "properties": { + "external": { + "type": "boolean", + "default": false, + "description": "If true, the base will us an external database else it will use the root database" + } + } + } + ] }, "examples": { "Example 1": { "value": { - "password": "newpassword" + "sources": [ + { + "alias": "string", + "config": null, + "enabled": true, + "id": "string", + "inflection_column": "camelize", + "inflection_table": "camelize", + "is_meta": true, + "order": 1, + "base_id": "string", + "type": "mysql2", + "updated_at": "2023-03-01 14:27:36" + } + ], + "color": "#24716E", + "created_at": "2023-03-01 14:27:36", + "deleted": true, + "description": "This is my base description", + "id": "p_124hhlkbeasewh", + "is_meta": true, + "meta": {}, + "order": 0, + "prefix": "nc_vm5q__", + "status": "string", + "title": "my-base", + "external": false } } } } } }, + "tags": [ + "Base" + ], + "description": "Create a new base", "parameters": [ { "$ref": "#/components/parameters/xc-auth" } ] - }, - "parameters": [ - { - "schema": { - "type": "string", - "format": "uuid", - "example": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" - }, - "name": "token", - "in": "path", - "required": true, - "description": "Reset Password Token" - } - ] + } }, - "/api/v1/auth/token/refresh": { + "/api/v2/meta/duplicate/{baseId}/{sourceId}": { "post": { - "summary": "Refresh Token", - "operationId": "auth-token-refresh", + "summary": "Duplicate Base Source", + "operationId": "base-source-duplicate", "responses": { "200": { "description": "OK", @@ -677,17 +836,14 @@ "schema": { "type": "object", "properties": { - "token": { - "type": "string", - "description": "New access token for user", - "example": "96751db2d53fb834382b682268874a2ea9ee610e4d904e688d1513f11d3c30d62d36d9e05dec0d63" - } - } - }, - "examples": { - "Example 1": { - "value": { - "token": "96751db2d53fb834382b682268874a2ea9ee610e4d904e688d1513f11d3c30d62d36d9e05dec0d63" + "name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "base_id": { + "type": "string" } } } @@ -698,26 +854,84 @@ "$ref": "#/components/responses/BadRequest" } }, - "description": "Regenerate user refresh token", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "options": { + "type": "object", + "properties": { + "excludeData": { + "type": "boolean", + "required": false + }, + "excludeViews": { + "type": "boolean", + "required": false + }, + "excludeHooks": { + "type": "boolean", + "required": false + } + } + }, + "base": { + "type": "object", + "required": false + } + } + }, + "examples": { + "Example 1": { + "value": { + "excludeData": true, + "excludeViews": true, + "excludeHooks": true + } + } + } + } + } + }, "tags": [ - "Auth" + "Base" ], + "description": "Duplicate a base", "parameters": [ { "$ref": "#/components/parameters/xc-auth" + }, + { + "schema": { + "$ref": "#/components/schemas/Id", + "example": "p_124hhlkbeasewh", + "type": "string" + }, + "name": "baseId", + "in": "path", + "required": true, + "description": "Unique Base ID" + }, + { + "schema": { + "$ref": "#/components/schemas/Id", + "example": "ds_124hhlkbeasewh", + "type": "string" + }, + "name": "sourceId", + "in": "path", + "required": false, + "description": "Unique Source ID" } ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ] + } }, - "/api/v2/meta/projects/{baseId}/users": { - "get": { - "summary": "List Base Users", - "operationId": "auth-base-user-list", + "/api/v2/meta/duplicate/{baseId}": { + "post": { + "summary": "Duplicate Base", + "operationId": "base-duplicate", "responses": { "200": { "description": "OK", @@ -726,50 +940,11 @@ "schema": { "type": "object", "properties": { - "users": { - "type": "object", - "properties": { - "list": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "#/components/schemas/User" - } - }, - "pageInfo": { - "$ref": "#/components/schemas/Paginated" - } - }, - "required": [ - "list", - "pageInfo" - ] - } - } - }, - "examples": { - "Example 1": { - "value": { - "users": { - "list": [ - { - "email": "user@example.com", - "email_verified": true, - "firstname": "Alice", - "id": "us_8kugj628ebjngs", - "lastname": "Smith", - "roles": "org-level-viewer" - } - ], - "pageInfo": { - "isFirstPage": true, - "isLastPage": true, - "page": 1, - "pageSize": 10, - "totalRows": 1 - } - } + "name": { + "type": "string" + }, + "id": { + "type": "string" } } } @@ -780,16 +955,70 @@ "$ref": "#/components/responses/BadRequest" } }, - "description": "List all users in the given base.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "options": { + "type": "object", + "properties": { + "excludeData": { + "type": "boolean", + "required": false + }, + "excludeViews": { + "type": "boolean", + "required": false + }, + "excludeHooks": { + "type": "boolean", + "required": false + } + } + }, + "base": { + "type": "object", + "required": false + } + } + }, + "examples": { + "Example 1": { + "value": { + "excludeData": true, + "excludeViews": true, + "excludeHooks": true + } + } + } + } + } + }, "tags": [ - "Auth" + "Base" ], + "description": "Duplicate a base", "parameters": [ { "$ref": "#/components/parameters/xc-auth" + }, + { + "schema": { + "$ref": "#/components/schemas/Id", + "example": "p_124hhlkbeasewh", + "type": "string" + }, + "name": "baseId", + "in": "path", + "required": true, + "description": "Unique Base ID" } ] - }, + } + }, + "/api/v2/meta/bases/{baseId}": { "parameters": [ { "schema": { @@ -803,90 +1032,55 @@ "description": "Unique Base ID" } ], - "post": { - "summary": "Create Base User", - "operationId": "auth-base-user-add", + "get": { + "summary": "Get Base", + "operationId": "base-read", + "description": "Get the info of a given base", + "parameters": [ + { + "$ref": "#/components/parameters/xc-auth" + } + ], + "tags": [ + "Base" + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "msg": { - "type": "string", - "x-stoplight": { - "id": "waau9tvy75zsd" - }, - "description": "Success Message for inviting single email", - "example": "The user has been invited successfully" - }, - "invite_token": { - "type": "string", - "x-stoplight": { - "id": "yx0s35u8ds3p7" - }, - "example": "8354ddba-a769-4d64-8397-eccb2e2b3c06" - }, - "error": { - "type": "array", - "x-stoplight": { - "id": "yhfi6wzhr6zr1" - }, - "items": { - "x-stoplight": { - "id": "ce0hlv3d0f96j" - }, - "type": "object", - "properties": { - "email": { - "type": "string", - "x-stoplight": { - "id": "dgnh01j4lxvl1" - }, - "example": "w@nocodb.com" - }, - "error": { - "type": "string", - "x-stoplight": { - "id": "7dgttqiijg8no" - }, - "example": "" - } - } - } - }, - "email": { - "type": "string", - "x-stoplight": { - "id": "08pqst2q30vot" - }, - "example": "w@nocodb.com" - } - } + "$ref": "#/components/schemas/Base" }, "examples": { - "Inviting a user without any errors": { - "value": { - "msg": "The user has been invited successfully" - } - }, - "Inviting a user but invitation email failed to send": { - "value": { - "invite_token": "8354ddba-a769-4d64-8397-eccb2e2b3c06", - "email": "w@nocodb.com" - } - }, - "Inviting multiple users": { + "Example 1": { "value": { - "invite_token": "8354ddba-a769-4d64-8397-eccb2e2b3c06", - "error": [ + "sources": [ { - "email": "w@nocodb.com", - "error": "" + "alias": "string", + "config": null, + "enabled": true, + "id": "string", + "inflection_column": "camelize", + "inflection_table": "camelize", + "is_meta": true, + "order": 1, + "base_id": "string", + "type": "mysql2", + "updated_at": "2023-03-01 14:27:36" } - ] + ], + "color": "#24716E", + "created_at": "2023-03-01 14:27:36", + "deleted": true, + "description": "This is my base description", + "id": "p_124hhlkbeasewh", + "is_meta": true, + "meta": {}, + "order": 0, + "prefix": "nc_vm5q__", + "status": "string", + "title": "my-base" } } } @@ -896,114 +1090,56 @@ "400": { "$ref": "#/components/responses/BadRequest" } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProjectUserReq" - }, - "examples": { - "Example 1": { - "value": { - "email": "user@example.com", - "roles": "owner" + } + }, + "delete": { + "summary": "Delete Base", + "operationId": "base-delete", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "boolean" + }, + "examples": { + "Example 1": { + "value": true } } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" } }, "tags": [ - "Auth" + "Base" ], - "description": "Create a user and add it to the given base", + "description": "Delete the given base", "parameters": [ { "$ref": "#/components/parameters/xc-auth" } ] - } - }, - "/api/v2/meta/projects/{baseId}/info": { - "parameters": [ - { - "schema": { - "$ref": "#/components/schemas/Id", - "example": "p_124hhlkbeasewh", - "type": "string" - }, - "name": "baseId", - "in": "path", - "required": true, - "description": "Unique Base ID" - } - ], - "get": { - "summary": "Get Base info", - "operationId": "base-meta-get", + }, + "patch": { + "summary": "Update Base", + "operationId": "base-update", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "Node": { - "type": "string", - "description": "Node version", - "example": "v12.16.1" - }, - "Arch": { - "type": "string", - "description": "Architecture type", - "example": "x64" - }, - "Platform": { - "type": "string", - "description": "Platform type", - "example": "linux" - }, - "Docker": { - "type": "boolean", - "description": "Is docker", - "example": false - }, - "Database": { - "type": "string", - "description": "Database type", - "example": "postgres" - }, - "ProjectOnRootDB": { - "type": "boolean", - "description": "Is base on rootdb", - "example": false - }, - "RootDB": { - "type": "string", - "description": "Root database type", - "example": "postgres" - }, - "PackageVersion": { - "type": "string", - "description": "Package version", - "example": "1.0.0" - } - } + "type": "number", + "example": 1 }, "examples": { "Example 1": { - "value": { - "Node": "v12.16.1", - "Arch": "x64", - "Platform": "linux", - "Docker": false, - "Database": "postgres", - "ProjectOnRootDB": false, - "RootDB": "postgres", - "PackageVersion": "1.0.0" - } + "value": 1 } } } @@ -1016,7 +1152,25 @@ "tags": [ "Base" ], - "description": "Get info such as node version, arch, platform, is docker, rootdb and package version of a given base", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectUpdateReq" + }, + "examples": { + "Example 1": { + "value": { + "color": "#24716E", + "meta": null, + "title": "My Base" + } + } + } + } + } + }, + "description": "Update the given base", "parameters": [ { "$ref": "#/components/parameters/xc-auth" @@ -1024,7 +1178,40 @@ ] } }, - "/api/v2/meta/projects/{baseId}/users/{userId}": { + "/api/v2/meta/bases/{baseId}/user": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "baseId", + "in": "path", + "required": true + } + ], + "patch": { + "summary": "Base user meta update", + "operationId": "base-user-meta-update", + "responses": { + "200": { + "description": "OK" + } + }, + "tags": [ + "Base" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectUserMetaReq" + } + } + } + } + } + }, + "/api/v2/meta/bases/{baseId}/sources/{sourceId}": { "parameters": [ { "schema": { @@ -1039,40 +1226,49 @@ }, { "schema": { - "$ref": "#/components/schemas/Id", - "example": "us_b3xo2i44nx5y9l" + "type": "string", + "pattern": "ds_j04jmxh5xg10lu" }, - "name": "userId", + "name": "sourceId", "in": "path", "required": true, - "description": "Unique User ID" + "description": "Unique Source ID" } ], - "patch": { - "summary": "Update Base User", - "operationId": "auth-base-user-update", + "get": { + "summary": "Get Source", + "operationId": "source-read", + "description": "Get the source details of a given base", + "parameters": [ + { + "$ref": "#/components/parameters/xc-auth" + } + ], + "tags": [ + "Source" + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "msg": { - "type": "string", - "x-stoplight": { - "id": "5a2q8as60daly" - }, - "description": "Success Message", - "example": "The user has been updated successfully" - } - } + "$ref": "#/components/schemas/Source" }, "examples": { "Example 1": { "value": { - "msg": "The user has been updated successfully" + "alias": null, + "config": "", + "enabled": 1, + "id": "ds_krsappzu9f8vmo", + "inflection_column": "camelize", + "inflection_table": "camelize", + "is_meta": 1, + "meta": null, + "order": 1, + "base_id": "p_01clqvzik3izk6", + "type": "mysql2" } } } @@ -1082,37 +1278,44 @@ "400": { "$ref": "#/components/responses/BadRequest" } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProjectUserReq" - }, - "examples": { - "Example 1": { - "value": { - "email": "user@example.com", - "roles": "owner" + } + }, + "delete": { + "summary": "Delete Source", + "operationId": "source-delete", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "boolean" + }, + "examples": { + "Example 1": { + "value": true } } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" } }, "tags": [ - "Auth" + "Source" ], - "description": "Update a given user in a given base. Exclusive for Super Admin. Access with API Tokens will be blocked.", + "description": "Delete the source details of a given base", "parameters": [ { "$ref": "#/components/parameters/xc-auth" } ] }, - "delete": { - "summary": "Delete Base User", - "operationId": "auth-base-user-remove", + "patch": { + "summary": "Update Source", + "operationId": "source-update", "responses": { "200": { "description": "OK", @@ -1120,21 +1323,23 @@ "application/json": { "schema": { "type": "object", - "properties": { - "msg": { - "type": "string", - "x-stoplight": { - "id": "5h7c9lqh5ynve" - }, - "example": "The user has been updated successfully", - "description": "Success Message" - } - } + "properties": {} }, "examples": { "Example 1": { "value": { - "msg": "The user has been updated successfully" + "id": "ds_rrplkgy0pq1f3c", + "base_id": "p_63b4q0qengen1x", + "alias": "sakila", + "meta": null, + "is_meta": null, + "type": "mysql2", + "inflection_column": "camelize", + "inflection_table": "camelize", + "created_at": "2023-03-11T10:31:15.341Z", + "updated_at": "2023-03-11T10:32:25.763Z", + "enabled": true, + "order": 2 } } } @@ -1146,119 +1351,67 @@ } }, "tags": [ - "Auth" + "Source" ], - "description": "Delete a given user in a given base. Exclusive for Super Admin. Access with API Tokens will be blocked.", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ] - } - }, - "/api/v2/meta/projects/{baseId}/visibility-rules": { - "get": { - "summary": "Get UI ACL", - "operationId": "base-model-visibility-list", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": {} - }, - "examples": { - "Example 1": { - "value": [ - { - "ptn": "nc_09gt___Sheet-1", - "_ptn": "Sheet-1", - "ptype": "table", - "tn": "Sheet-1", - "_tn": "Sheet-1", - "table_meta": null, - "id": "vw_75neroyqdye94k", - "source_id": "ds_eol59jg2l4zwev", - "base_id": "p_63b4q0qengen1x", - "fk_model_id": "md_5mipbdg6ketmv8", - "title": "Sheet-1", - "type": 3, - "is_default": true, - "show_system_fields": null, - "lock_type": "collaborative", - "uuid": "24a6d0bb-e45d-4b1a-bfef-f492d870de9f", - "password": null, - "show": true, - "order": 1, - "created_at": "2023-03-08T10:44:55.253Z", - "updated_at": "2023-03-10T07:18:44.908Z", - "meta": { - "allowCSVDownload": true - }, - "view": { - "fk_view_id": "vw_75neroyqdye94k", - "source_id": "ds_eol59jg2l4zwev", - "base_id": "p_63b4q0qengen1x", - "uuid": null, - "created_at": "2023-03-08T10:44:55.288Z", - "updated_at": "2023-03-08T10:44:55.288Z", - "meta": null, - "row_height": null - }, - "disabled": { - "owner": false, - "creator": false, - "viewer": false, - "editor": false, - "commenter": false, - "guest": false - } + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "examples": { + "Example 1": { + "value": { + "alias": "sakila", + "type": "mysql2", + "config": { + "client": "mysql2", + "connection": { + "host": "localhost", + "port": "3306", + "user": "root", + "password": "password", + "database": "sakila" } - ] + }, + "inflection_column": "camelize", + "inflection_table": "camelize" } } } } - }, - "400": { - "$ref": "#/components/responses/BadRequest" } }, - "description": "Hide / show views based on user role", - "tags": [ - "Base" - ], + "description": "Update the source details of a given base", "parameters": [ - { - "schema": { - "type": "boolean" - }, - "in": "query", - "name": "includeM2M" - }, { "$ref": "#/components/parameters/xc-auth" } ] - }, + } + }, + "/api/v2/meta/bases/:baseId/sources/:sourceId/sqlView": { "parameters": [ { "schema": { - "$ref": "#/components/schemas/Id", - "example": "p_124hhlkbeasewh", "type": "string" }, "name": "baseId", "in": "path", - "required": true, - "description": "Unique Base ID" + "required": true + }, + { + "schema": { + "type": "string" + }, + "name": "sourceId", + "in": "path", + "required": true } ], "post": { - "summary": "Create UI ACL", - "operationId": "base-model-visibility-set", + "summary": "Create sql view", + "operationId": "create-sql-view", "responses": { "200": { "description": "OK", @@ -1266,100 +1419,84 @@ "application/json": { "schema": { "type": "object", - "properties": { - "msg": { - "type": "string", - "x-stoplight": { - "id": "2txh071wsodys" - }, - "example": "UI ACL has been created successfully" - } - } - }, - "examples": { - "Example 1": { - "value": { - "msg": "UI ACL has been created successfully" - } - } + "properties": {} } } } - }, - "400": { - "$ref": "#/components/responses/BadRequest" } }, + "tags": [ + "Source" + ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/VisibilityRuleReq" + "type": "object", + "properties": { + "view_name": { + "type": "string" + }, + "view_definition": { + "type": "string" + } + } } } } - }, - "tags": [ - "Base" - ], - "description": "Hide / show views based on user role", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ] + } } }, - "/api/v2/meta/projects/": { + "/api/v2/meta/bases/{baseId}/sources/": { "parameters": [ { - "$ref": "#/components/parameters/xc-auth" + "schema": { + "$ref": "#/components/schemas/Id", + "example": "p_124hhlkbeasewh", + "type": "string" + }, + "name": "baseId", + "in": "path", + "required": true, + "description": "Unique Base ID" } ], "get": { - "summary": "List Projects", - "operationId": "base-list", + "summary": "List Sources", + "operationId": "source-list", + "description": "Get base source list", + "parameters": [ + { + "$ref": "#/components/parameters/xc-auth" + } + ], + "tags": [ + "Source" + ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProjectList" + "$ref": "#/components/schemas/SourceList" }, "examples": { "Example 1": { "value": { "list": [ { - "sources": [ - { - "alias": "string", - "config": null, - "created_at": "2023-03-01 14:27:36", - "enabled": true, - "id": "string", - "inflection_column": "camelize", - "inflection_table": "camelize", - "is_meta": true, - "order": 1, - "base_id": "string", - "type": "mysql2", - "updated_at": "2023-03-01 14:27:36" - } - ], - "color": "#24716E", - "created_at": "2023-03-01 14:27:36", - "deleted": true, - "description": "This is my base description", - "id": "p_124hhlkbeasewh", - "is_meta": true, - "meta": {}, - "order": 0, - "prefix": "nc_vm5q__", - "status": "string", - "title": "my-base", - "updated_at": "2023-03-01 14:27:36" + "alias": null, + "config": "", + "enabled": 1, + "id": "ds_krsappzu9f8vmo", + "inflection_column": "camelize", + "inflection_table": "camelize", + "is_meta": 1, + "meta": null, + "order": 1, + "base_id": "p_01clqvzik3izk6", + "type": "mysql2" } ], "pageInfo": { @@ -1378,27 +1515,18 @@ "400": { "$ref": "#/components/responses/BadRequest" } - }, - "description": "List all base meta data", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ], - "tags": [ - "Base" - ] + } }, "post": { - "summary": "Create Base", - "operationId": "base-create", + "summary": "Create Source", + "operationId": "source-create", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Base" + "$ref": "#/components/schemas/Source" } } } @@ -1413,15 +1541,14 @@ "schema": { "allOf": [ { - "$ref": "#/components/schemas/ProjectReq" + "$ref": "#/components/schemas/Source" }, { "type": "object", "properties": { "external": { "type": "boolean", - "default": false, - "description": "If true, the base will us an external database else it will use the root database" + "default": false } } } @@ -1430,43 +1557,28 @@ "examples": { "Example 1": { "value": { - "sources": [ - { - "alias": "string", - "config": null, - "enabled": true, - "id": "string", - "inflection_column": "camelize", - "inflection_table": "camelize", - "is_meta": true, - "order": 1, - "base_id": "string", - "type": "mysql2", - "updated_at": "2023-03-01 14:27:36" - } - ], - "color": "#24716E", - "created_at": "2023-03-01 14:27:36", - "deleted": true, - "description": "This is my base description", - "id": "p_124hhlkbeasewh", - "is_meta": true, - "meta": {}, - "order": 0, - "prefix": "nc_vm5q__", - "status": "string", - "title": "my-base", - "external": false - } + "alias": null, + "config": "", + "enabled": 1, + "id": "ds_krsappzu9f8vmo", + "inflection_column": "camelize", + "inflection_table": "camelize", + "is_meta": 1, + "meta": null, + "order": 1, + "base_id": "p_01clqvzik3izk6", + "type": "mysql2", + "external": false + } } } } } }, "tags": [ - "Base" + "Source" ], - "description": "Create a new base", + "description": "Create a new source on a given base", "parameters": [ { "$ref": "#/components/parameters/xc-auth" @@ -1474,10 +1586,83 @@ ] } }, - "/api/v2/meta/duplicate/{baseId}/{sourceId}": { + "/api/v2/meta/bases/{baseId}/sources/{sourceId}/share/erd": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "baseId", + "in": "path", + "required": true + }, + { + "schema": { + "type": "string" + }, + "name": "sourceId", + "in": "path", + "required": true + } + ], "post": { - "summary": "Duplicate Base Source", - "operationId": "base-source-duplicate", + "summary": "share ERD view", + "operationId": "source-share-erd", + "tags": [ + "Source" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Source" + } + } + } + } + } + }, + "delete": { + "summary": "", + "operationId": "source-disable-share-erd", + "responses": { + "200": { + "description": "OK" + } + }, + "tags": [ + "Source" + ] + } + }, + "/api/v2/meta/bases/{baseId}/shared": { + "parameters": [ + { + "schema": { + "$ref": "#/components/schemas/Id", + "example": "p_124hhlkbeasewh", + "type": "string" + }, + "name": "baseId", + "in": "path", + "required": true, + "description": "Unique Base ID" + } + ], + "get": { + "summary": "Get Base Shared Base", + "operationId": "base-shared-base-get", + "description": "Get Base Shared Base", + "parameters": [ + { + "$ref": "#/components/parameters/xc-auth" + } + ], + "tags": [ + "Base" + ], "responses": { "200": { "description": "OK", @@ -1486,14 +1671,27 @@ "schema": { "type": "object", "properties": { - "name": { - "type": "string" + "uuid": { + "type": "string", + "format": "uuid", + "example": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" }, - "id": { - "type": "string" + "url": { + "type": "string", + "format": "uri" }, - "base_id": { - "type": "string" + "roles": { + "type": "string", + "example": "viewer" + } + } + }, + "examples": { + "Example 1": { + "value": { + "uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", + "url": "http://example.com", + "roles": "viewer" } } } @@ -1503,85 +1701,44 @@ "400": { "$ref": "#/components/responses/BadRequest" } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "options": { - "type": "object", - "properties": { - "excludeData": { - "type": "boolean", - "required": false - }, - "excludeViews": { - "type": "boolean", - "required": false - }, - "excludeHooks": { - "type": "boolean", - "required": false - } - } - }, - "base": { - "type": "object", - "required": false - } - } - }, - "examples": { - "Example 1": { - "value": { - "excludeData": true, - "excludeViews": true, - "excludeHooks": true + } + }, + "delete": { + "summary": "Delete Base Shared Base", + "operationId": "base-shared-base-disable", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "boolean" + }, + "examples": { + "Example 1": { + "value": true } } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" } }, "tags": [ "Base" ], - "description": "Duplicate a base", + "description": "Delete Base Shared Base", "parameters": [ { "$ref": "#/components/parameters/xc-auth" - }, - { - "schema": { - "$ref": "#/components/schemas/Id", - "example": "p_124hhlkbeasewh", - "type": "string" - }, - "name": "baseId", - "in": "path", - "required": true, - "description": "Unique Base ID" - }, - { - "schema": { - "$ref": "#/components/schemas/Id", - "example": "ds_124hhlkbeasewh", - "type": "string" - }, - "name": "sourceId", - "in": "path", - "required": false, - "description": "Unique Source ID" } ] - } - }, - "/api/v2/meta/duplicate/{baseId}": { + }, "post": { - "summary": "Duplicate Base", - "operationId": "base-duplicate", + "summary": "Create Base Shared Base", + "operationId": "base-shared-base-create", "responses": { "200": { "description": "OK", @@ -1590,11 +1747,11 @@ "schema": { "type": "object", "properties": { - "name": { - "type": "string" + "uuid": { + "$ref": "#/components/schemas/StringOrNull" }, - "id": { - "type": "string" + "roles": { + "$ref": "#/components/schemas/StringOrNull" } } } @@ -1605,170 +1762,27 @@ "$ref": "#/components/responses/BadRequest" } }, + "tags": [ + "Base" + ], "requestBody": { "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "options": { - "type": "object", - "properties": { - "excludeData": { - "type": "boolean", - "required": false - }, - "excludeViews": { - "type": "boolean", - "required": false - }, - "excludeHooks": { - "type": "boolean", - "required": false - } - } - }, - "base": { - "type": "object", - "required": false - } - } + "$ref": "#/components/schemas/SharedBaseReq" }, "examples": { "Example 1": { "value": { - "excludeData": true, - "excludeViews": true, - "excludeHooks": true + "roles": "editor", + "password": "password123" } } } } } }, - "tags": [ - "Base" - ], - "description": "Duplicate a base", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - }, - { - "schema": { - "$ref": "#/components/schemas/Id", - "example": "p_124hhlkbeasewh", - "type": "string" - }, - "name": "baseId", - "in": "path", - "required": true, - "description": "Unique Base ID" - } - ] - } - }, - "/api/v2/meta/projects/{baseId}": { - "parameters": [ - { - "schema": { - "$ref": "#/components/schemas/Id", - "example": "p_124hhlkbeasewh", - "type": "string" - }, - "name": "baseId", - "in": "path", - "required": true, - "description": "Unique Base ID" - } - ], - "get": { - "summary": "Get Base", - "operationId": "base-read", - "description": "Get the info of a given base", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ], - "tags": [ - "Base" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Base" - }, - "examples": { - "Example 1": { - "value": { - "sources": [ - { - "alias": "string", - "config": null, - "enabled": true, - "id": "string", - "inflection_column": "camelize", - "inflection_table": "camelize", - "is_meta": true, - "order": 1, - "base_id": "string", - "type": "mysql2", - "updated_at": "2023-03-01 14:27:36" - } - ], - "color": "#24716E", - "created_at": "2023-03-01 14:27:36", - "deleted": true, - "description": "This is my base description", - "id": "p_124hhlkbeasewh", - "is_meta": true, - "meta": {}, - "order": 0, - "prefix": "nc_vm5q__", - "status": "string", - "title": "my-base" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - } - }, - "delete": { - "summary": "Delete Base", - "operationId": "base-delete", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "boolean" - }, - "examples": { - "Example 1": { - "value": true - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - }, - "tags": [ - "Base" - ], - "description": "Delete the given base", + "description": "Create Base Shared Base", "parameters": [ { "$ref": "#/components/parameters/xc-auth" @@ -1776,20 +1790,29 @@ ] }, "patch": { - "summary": "Update Base", - "operationId": "base-update", + "summary": "Update Base Shared Base", + "operationId": "base-shared-base-update", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "number", - "example": 1 - }, - "examples": { - "Example 1": { - "value": 1 + "type": "object", + "properties": { + "uuid": { + "type": "string", + "format": "uuid", + "example": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" + }, + "url": { + "type": "string", + "format": "uri" + }, + "roles": { + "type": "string", + "example": "viewer" + } } } } @@ -1799,28 +1822,27 @@ "$ref": "#/components/responses/BadRequest" } }, - "tags": [ - "Base" - ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProjectUpdateReq" + "$ref": "#/components/schemas/SharedBaseReq" }, "examples": { "Example 1": { "value": { - "color": "#24716E", - "meta": null, - "title": "My Base" + "password": "password123", + "roles": "editor" } } } } } }, - "description": "Update the given base", + "tags": [ + "Base" + ], + "description": "Update Base Shared Base", "parameters": [ { "$ref": "#/components/parameters/xc-auth" @@ -1828,40 +1850,7 @@ ] } }, - "/api/v2/meta/projects/{baseId}/user": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "baseId", - "in": "path", - "required": true - } - ], - "patch": { - "summary": "Base user meta update", - "operationId": "base-user-meta-update", - "responses": { - "200": { - "description": "OK" - } - }, - "tags": [ - "Base" - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProjectUserMetaReq" - } - } - } - } - } - }, - "/api/v2/meta/projects/{baseId}/bases/{sourceId}": { + "/api/v2/meta/bases/{baseId}/cost": { "parameters": [ { "schema": { @@ -1873,29 +1862,19 @@ "in": "path", "required": true, "description": "Unique Base ID" - }, - { - "schema": { - "type": "string", - "pattern": "ds_j04jmxh5xg10lu" - }, - "name": "sourceId", - "in": "path", - "required": true, - "description": "Unique Source ID" } ], "get": { - "summary": "Get Source", - "operationId": "source-read", - "description": "Get the source details of a given base", + "summary": "Base Cost", + "operationId": "base-cost", + "description": "Calculate the Base Cost", "parameters": [ { "$ref": "#/components/parameters/xc-auth" } ], "tags": [ - "Source" + "Base" ], "responses": { "200": { @@ -1903,24 +1882,8 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Source" - }, - "examples": { - "Example 1": { - "value": { - "alias": null, - "config": "", - "enabled": 1, - "id": "ds_krsappzu9f8vmo", - "inflection_column": "camelize", - "inflection_table": "camelize", - "is_meta": 1, - "meta": null, - "order": 1, - "base_id": "p_01clqvzik3izk6", - "type": "mysql2" - } - } + "type": "object", + "properties": {} } } } @@ -1928,647 +1891,34 @@ "400": { "$ref": "#/components/responses/BadRequest" } + }, + "x-internal": true + } + }, + "/api/v2/meta/bases/{baseId}/tables": { + "parameters": [ + { + "schema": { + "$ref": "#/components/schemas/Id", + "example": "p_124hhlkbeasewh", + "type": "string" + }, + "name": "baseId", + "in": "path", + "required": true, + "description": "Unique Base ID" } - }, - "delete": { - "summary": "Delete Source", - "operationId": "source-delete", + ], + "post": { + "summary": "Create Table", + "operationId": "db-table-create", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "boolean" - }, - "examples": { - "Example 1": { - "value": true - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - }, - "tags": [ - "Source" - ], - "description": "Delete the source details of a given base", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ] - }, - "patch": { - "summary": "Update Source", - "operationId": "source-update", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": {} - }, - "examples": { - "Example 1": { - "value": { - "id": "ds_rrplkgy0pq1f3c", - "base_id": "p_63b4q0qengen1x", - "alias": "sakila", - "meta": null, - "is_meta": null, - "type": "mysql2", - "inflection_column": "camelize", - "inflection_table": "camelize", - "created_at": "2023-03-11T10:31:15.341Z", - "updated_at": "2023-03-11T10:32:25.763Z", - "enabled": true, - "order": 2 - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - }, - "tags": [ - "Source" - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - }, - "examples": { - "Example 1": { - "value": { - "alias": "sakila", - "type": "mysql2", - "config": { - "client": "mysql2", - "connection": { - "host": "localhost", - "port": "3306", - "user": "root", - "password": "password", - "database": "sakila" - } - }, - "inflection_column": "camelize", - "inflection_table": "camelize" - } - } - } - } - } - }, - "description": "Update the source details of a given base", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ] - } - }, - "/api/v2/meta/projects/:baseId/bases/:sourceId/sqlView": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "baseId", - "in": "path", - "required": true - }, - { - "schema": { - "type": "string" - }, - "name": "sourceId", - "in": "path", - "required": true - } - ], - "post": { - "summary": "Create sql view", - "operationId": "create-sql-view", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": {} - } - } - } - } - }, - "tags": [ - "Source" - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "view_name": { - "type": "string" - }, - "view_definition": { - "type": "string" - } - } - } - } - } - } - } - }, - "/api/v2/meta/projects/{baseId}/bases/": { - "parameters": [ - { - "schema": { - "$ref": "#/components/schemas/Id", - "example": "p_124hhlkbeasewh", - "type": "string" - }, - "name": "baseId", - "in": "path", - "required": true, - "description": "Unique Base ID" - } - ], - "get": { - "summary": "List Sources", - "operationId": "source-list", - "description": "Get base source list", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ], - "tags": [ - "Source" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceList" - }, - "examples": { - "Example 1": { - "value": { - "list": [ - { - "alias": null, - "config": "", - "enabled": 1, - "id": "ds_krsappzu9f8vmo", - "inflection_column": "camelize", - "inflection_table": "camelize", - "is_meta": 1, - "meta": null, - "order": 1, - "base_id": "p_01clqvzik3izk6", - "type": "mysql2" - } - ], - "pageInfo": { - "isFirstPage": true, - "isLastPage": true, - "page": 1, - "pageSize": 10, - "totalRows": 1 - } - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - } - }, - "post": { - "summary": "Create Source", - "operationId": "source-create", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Source" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/Source" - }, - { - "type": "object", - "properties": { - "external": { - "type": "boolean", - "default": false - } - } - } - ] - }, - "examples": { - "Example 1": { - "value": { - "alias": null, - "config": "", - "enabled": 1, - "id": "ds_krsappzu9f8vmo", - "inflection_column": "camelize", - "inflection_table": "camelize", - "is_meta": 1, - "meta": null, - "order": 1, - "base_id": "p_01clqvzik3izk6", - "type": "mysql2", - "external": false - } - } - } - } - } - }, - "tags": [ - "Source" - ], - "description": "Create a new source on a given base", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ] - } - }, - "/api/v2/meta/projects/{baseId}/bases/{sourceId}/share/erd": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "baseId", - "in": "path", - "required": true - }, - { - "schema": { - "type": "string" - }, - "name": "sourceId", - "in": "path", - "required": true - } - ], - "post": { - "summary": "share ERD view", - "operationId": "source-share-erd", - "tags": [ - "Source" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Source" - } - } - } - } - } - }, - "delete": { - "summary": "", - "operationId": "source-disable-share-erd", - "responses": { - "200": { - "description": "OK" - } - }, - "tags": [ - "Source" - ] - } - }, - "/api/v2/meta/projects/{baseId}/shared": { - "parameters": [ - { - "schema": { - "$ref": "#/components/schemas/Id", - "example": "p_124hhlkbeasewh", - "type": "string" - }, - "name": "baseId", - "in": "path", - "required": true, - "description": "Unique Base ID" - } - ], - "get": { - "summary": "Get Base Shared Base", - "operationId": "base-shared-base-get", - "description": "Get Base Shared Base", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ], - "tags": [ - "Base" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "uuid": { - "type": "string", - "format": "uuid", - "example": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" - }, - "url": { - "type": "string", - "format": "uri" - }, - "roles": { - "type": "string", - "example": "viewer" - } - } - }, - "examples": { - "Example 1": { - "value": { - "uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11", - "url": "http://example.com", - "roles": "viewer" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - } - }, - "delete": { - "summary": "Delete Base Shared Base", - "operationId": "base-shared-base-disable", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "boolean" - }, - "examples": { - "Example 1": { - "value": true - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - }, - "tags": [ - "Base" - ], - "description": "Delete Base Shared Base", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ] - }, - "post": { - "summary": "Create Base Shared Base", - "operationId": "base-shared-base-create", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "uuid": { - "$ref": "#/components/schemas/StringOrNull" - }, - "roles": { - "$ref": "#/components/schemas/StringOrNull" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - }, - "tags": [ - "Base" - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SharedBaseReq" - }, - "examples": { - "Example 1": { - "value": { - "roles": "editor", - "password": "password123" - } - } - } - } - } - }, - "description": "Create Base Shared Base", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ] - }, - "patch": { - "summary": "Update Base Shared Base", - "operationId": "base-shared-base-update", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "uuid": { - "type": "string", - "format": "uuid", - "example": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" - }, - "url": { - "type": "string", - "format": "uri" - }, - "roles": { - "type": "string", - "example": "viewer" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SharedBaseReq" - }, - "examples": { - "Example 1": { - "value": { - "password": "password123", - "roles": "editor" - } - } - } - } - } - }, - "tags": [ - "Base" - ], - "description": "Update Base Shared Base", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ] - } - }, - "/api/v2/meta/projects/{baseId}/cost": { - "parameters": [ - { - "schema": { - "$ref": "#/components/schemas/Id", - "example": "p_124hhlkbeasewh", - "type": "string" - }, - "name": "baseId", - "in": "path", - "required": true, - "description": "Unique Base ID" - } - ], - "get": { - "summary": "Base Cost", - "operationId": "base-cost", - "description": "Calculate the Base Cost", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ], - "tags": [ - "Base" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": {} - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - }, - "x-internal": true - } - }, - "/api/v2/meta/projects/{baseId}/tables": { - "parameters": [ - { - "schema": { - "$ref": "#/components/schemas/Id", - "example": "p_124hhlkbeasewh", - "type": "string" - }, - "name": "baseId", - "in": "path", - "required": true, - "description": "Unique Base ID" - } - ], - "post": { - "summary": "Create Table", - "operationId": "db-table-create", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Table" + "$ref": "#/components/schemas/Table" }, "examples": { "Example 1": { @@ -3617,7 +2967,7 @@ ] } }, - "/api/v2/meta/projects/{baseId}/{sourceId}/tables": { + "/api/v2/meta/bases/{baseId}/{sourceId}/tables": { "parameters": [ { "schema": { @@ -7288,7 +6638,7 @@ ] } }, - "/api/v2/meta/projects/{baseId}/meta-diff": { + "/api/v2/meta/bases/{baseId}/meta-diff": { "parameters": [ { "schema": { @@ -7460,7 +6810,7 @@ "description": "Get the meta data difference between NC_DB and external data sources " } }, - "/api/v2/meta/projects/{baseId}/meta-diff/{sourceId}": { + "/api/v2/meta/bases/{baseId}/meta-diff/{sourceId}": { "parameters": [ { "schema": { @@ -7639,7 +6989,7 @@ "description": "Get the meta data difference between NC_DB and external data sources in a given Source" } }, - "/api/v2/meta/projects/{baseId}/has-empty-or-null-filters": { + "/api/v2/meta/bases/{baseId}/has-empty-or-null-filters": { "parameters": [ { "schema": { @@ -9147,7 +8497,7 @@ ] } }, - "/api/v2/meta/projects/{baseId}/audits": { + "/api/v2/meta/bases/{baseId}/audits": { "parameters": [ { "schema": { @@ -9165,248 +8515,29 @@ "summary": "List Audits in Base", "operationId": "base-audit-list", "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "list": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "#/components/schemas/Audit" - } - }, - "pageInfo": { - "$ref": "#/components/schemas/Paginated" - } - }, - "required": [ - "list", - "pageInfo" - ] - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - }, - "description": "List all audit data in the given base", - "parameters": [ - { - "schema": { - "type": "integer", - "minimum": 0 - }, - "in": "query", - "name": "offset" - }, - { - "schema": { - "type": "integer", - "maximum": 1 - }, - "in": "query", - "name": "limit" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "sourceId" - }, - { - "$ref": "#/components/parameters/xc-auth" - } - ], - "tags": [ - "Base" - ] - } - }, - "/api/v2/meta/audits/rows/{rowId}/update": { - "parameters": [ - { - "schema": { - "example": "1" - }, - "name": "rowId", - "in": "path", - "required": true, - "description": "Unique Row ID" - } - ], - "post": { - "summary": "Update Audit Row", - "operationId": "utils-audit-row-update", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Audit" - }, - "examples": { - "Example 1": { - "value": { - "user": "w@nocodb.com", - "row_id": "1", - "fk_model_id": "md_5mipbdg6ketmv8", - "op_type": "COMMENT", - "description": "Table Sheet-1 : field Column A got changed from foo to bar", - "base_id": "p_63b4q0qengen1x", - "id": "adt_vx58jpp0loo8qy" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - }, - "tags": [ - "Utils" - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AuditRowUpdateReq" - }, - "examples": { - "Example 1": { - "value": { - "column_name": "baz", - "fk_model_id": "md_ehn5izr99m7d45", - "row_id": "1", - "prev_value": "foo", - "value": "bar" - } - } - } - } - } - }, - "description": "Update Audit Row", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ] - } - }, - "/api/v2/meta/tables/{tableId}/hooks": { - "parameters": [ - { - "schema": { - "$ref": "#/components/schemas/Id", - "example": "md_w9gpnaousnfss1", - "type": "string" - }, - "name": "tableId", - "in": "path", - "required": true, - "description": "Unique Table ID" - } - ], - "get": { - "summary": "List Table Hooks", - "operationId": "db-table-webhook-list", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HookList" - }, - "examples": { - "Example 1": { - "value": { - "list": [ - { - "active": 0, - "async": 0, - "description": "This is my hook description", - "env": "all", - "event": "after", - "fk_model_id": "md_rsu68aqjsbyqtl", - "id": "string", - "notification": "{\"type\":\"URL\",\"payload\":{\"method\":\"POST\",\"body\":\"{{ json data }}\",\"headers\":[{}],\"parameters\":[{}],\"auth\":\"\",\"path\":\"http://example.com\"}}", - "null": null, - "operation": "insert", - "retries": 10, - "retry_interval": 60000, - "timeout": 60000, - "title": "My Webhook" - } - ], - "pageInfo": { - "isFirstPage": true, - "isLastPage": true, - "page": 1, - "pageSize": 10, - "totalRows": 1 - } - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - }, - "description": "List all hook records in the given Table", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ], - "tags": [ - "DB Table Webhook" - ] - }, - "post": { - "summary": "Create Table Hook", - "operationId": "db-table-webhook-create", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Hook" - }, - "examples": { - "Example 1": { - "value": { - "active": 0, - "async": 0, - "description": "This is my hook description", - "env": "all", - "event": "after", - "fk_model_id": "md_rsu68aqjsbyqtl", - "id": "string", - "notification": "{\"type\":\"URL\",\"payload\":{\"method\":\"POST\",\"body\":\"{{ json data }}\",\"headers\":[{}],\"parameters\":[{}],\"auth\":\"\",\"path\":\"http://example.com\"}}", - "null": null, - "operation": "insert", - "retries": 10, - "retry_interval": 60000, - "timeout": 60000, - "title": "My Webhook" + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "list": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "#/components/schemas/Audit" + } + }, + "pageInfo": { + "$ref": "#/components/schemas/Paginated" } - } + }, + "required": [ + "list", + "pageInfo" + ] } } } @@ -9415,80 +8546,73 @@ "$ref": "#/components/responses/BadRequest" } }, - "description": "Create a hook in the given table", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HookReq" - }, - "examples": { - "Example 1": { - "value": { - "active": 0, - "async": 0, - "description": "This is my hook description", - "env": "all", - "event": "after", - "fk_model_id": "md_rsu68aqjsbyqtl", - "id": "string", - "notification": "{\"type\":\"URL\",\"payload\":{\"method\":\"POST\",\"body\":\"{{ json data }}\",\"headers\":[{}],\"parameters\":[{}],\"auth\":\"\",\"path\":\"http://example.com\"}}", - "null": null, - "operation": "insert", - "retries": 10, - "retry_interval": 60000, - "timeout": 60000, - "title": "My Webhook", - "condition": false - } - } - } - } + "description": "List all audit data in the given base", + "parameters": [ + { + "schema": { + "type": "integer", + "minimum": 0 + }, + "in": "query", + "name": "offset" + }, + { + "schema": { + "type": "integer", + "maximum": 1 + }, + "in": "query", + "name": "limit" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "sourceId" + }, + { + "$ref": "#/components/parameters/xc-auth" } - }, + ], "tags": [ - "DB Table Webhook" + "Base" ] } }, - "/api/v2/meta/tables/{tableId}/hooks/test": { + "/api/v2/meta/audits/rows/{rowId}/update": { "parameters": [ { "schema": { - "$ref": "#/components/schemas/Id", - "example": "md_w9gpnaousnfss1", - "type": "string" + "example": "1" }, - "name": "tableId", + "name": "rowId", "in": "path", "required": true, - "description": "Unique Table ID" + "description": "Unique Row ID" } ], "post": { - "summary": "Test Hook", - "operationId": "db-table-webhook-test", + "summary": "Update Audit Row", + "operationId": "utils-audit-row-update", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "msg": { - "type": "string", - "x-stoplight": { - "id": "l5k90tzuvvv1g" - }, - "example": "The hook has been tested successfully" - } - } + "$ref": "#/components/schemas/Audit" }, "examples": { "Example 1": { "value": { - "msg": "The hook has been tested successfully" + "user": "w@nocodb.com", + "row_id": "1", + "fk_model_id": "md_5mipbdg6ketmv8", + "op_type": "COMMENT", + "description": "Table Sheet-1 : field Column A got changed from foo to bar", + "base_id": "p_63b4q0qengen1x", + "id": "adt_vx58jpp0loo8qy" } } } @@ -9500,57 +8624,29 @@ } }, "tags": [ - "DB Table Webhook" + "Utils" ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/HookTestReq" + "$ref": "#/components/schemas/AuditRowUpdateReq" }, "examples": { "Example 1": { "value": { - "hook": { - "active": 0, - "async": 0, - "description": "This is my hook description", - "env": "all", - "event": "after", - "fk_model_id": "md_rsu68aqjsbyqtl", - "id": "string", - "notification": "{\"type\":\"URL\",\"payload\":{\"method\":\"POST\",\"body\":\"{{ json data }}\",\"headers\":[{}],\"parameters\":[{}],\"auth\":\"\",\"path\":\"http://example.com\"}}", - "null": null, - "operation": "insert", - "retries": 10, - "retry_interval": 60000, - "timeout": 60000, - "title": "My Webhook" - }, - "payload": { - "data": { - "Id": 1, - "Title": "Sample Text", - "CreatedAt": "2023-03-03T10:03:06.484Z", - "UpdatedAt": "2023-03-03T10:03:06.484Z", - "attachment": [ - { - "url": "https://nocodb.com/dummy.png", - "title": "image.png", - "mimetype": "image/png", - "size": 0 - } - ], - "f": "Sample Output" - } - } + "column_name": "baz", + "fk_model_id": "md_ehn5izr99m7d45", + "row_id": "1", + "prev_value": "foo", + "value": "bar" } } } } } }, - "description": "Test the hook in the given Table", + "description": "Update Audit Row", "parameters": [ { "$ref": "#/components/parameters/xc-auth" @@ -9558,7 +8654,7 @@ ] } }, - "/api/v2/meta/tables/{tableId}/hooks/samplePayload/{operation}/{version}": { + "/api/v2/meta/tables/{tableId}/hooks": { "parameters": [ { "schema": { @@ -9570,66 +8666,46 @@ "in": "path", "required": true, "description": "Unique Table ID" - }, - { - "schema": { - "type": "string", - "enum": [ - "insert", - "update", - "delete", - "bulkInsert", - "bulkUpdate", - "bulkDelete" - ] - }, - "name": "operation", - "in": "path", - "required": true, - "description": "Hook Operation" - }, - { - "schema": { - "type": "string", - "enum": [ - "v1", - "v2" - ] - }, - "name": "version", - "in": "path", - "required": true, - "description": "Hook Version" } ], "get": { - "summary": "Get Sample Hook Payload", - "operationId": "db-table-webhook-sample-payload-get", + "summary": "List Table Hooks", + "operationId": "db-table-webhook-list", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "x-stoplight": { - "id": "qifsikf69hqbl" - }, - "description": "Sample Payload Data" - } - } + "$ref": "#/components/schemas/HookList" }, "examples": { "Example 1": { "value": { - "data": { - "Id": 1, - "Title": "Sample Text", - "CreatedAt": "2023-03-13T04:59:49.363Z", - "UpdatedAt": "2023-03-13T04:59:49.363Z" + "list": [ + { + "active": 0, + "async": 0, + "description": "This is my hook description", + "env": "all", + "event": "after", + "fk_model_id": "md_rsu68aqjsbyqtl", + "id": "string", + "notification": "{\"type\":\"URL\",\"payload\":{\"method\":\"POST\",\"body\":\"{{ json data }}\",\"headers\":[{}],\"parameters\":[{}],\"auth\":\"\",\"path\":\"http://example.com\"}}", + "null": null, + "operation": "insert", + "retries": 10, + "retry_interval": 60000, + "timeout": 60000, + "title": "My Webhook" + } + ], + "pageInfo": { + "isFirstPage": true, + "isLastPage": true, + "page": 1, + "pageSize": 10, + "totalRows": 1 } } } @@ -9641,7 +8717,7 @@ "$ref": "#/components/responses/BadRequest" } }, - "description": "Get the sample hook payload", + "description": "List all hook records in the given Table", "parameters": [ { "$ref": "#/components/parameters/xc-auth" @@ -9650,24 +8726,10 @@ "tags": [ "DB Table Webhook" ] - } - }, - "/api/v2/meta/hooks/{hookId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "hk_0063k4o1frnxbr" - }, - "name": "hookId", - "in": "path", - "required": true, - "description": "Unique Hook ID" - } - ], - "patch": { - "summary": "Update Hook", - "operationId": "db-table-webhook-update", + }, + "post": { + "summary": "Create Table Hook", + "operationId": "db-table-webhook-create", "responses": { "200": { "description": "OK", @@ -9703,14 +8765,12 @@ "$ref": "#/components/responses/BadRequest" } }, - "tags": [ - "DB Table Webhook" - ], + "description": "Create a hook in the given table", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Hook" + "$ref": "#/components/schemas/HookReq" }, "examples": { "Example 1": { @@ -9728,63 +8788,36 @@ "retries": 10, "retry_interval": 60000, "timeout": 60000, - "title": "My Webhook" - } - } - } - } - } - }, - "description": "Update the exsiting hook by its ID", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ] - }, - "delete": { - "summary": "Delete Hook", - "operationId": "db-table-webhook-delete", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "boolean" - }, - "examples": { - "Example 1": { - "value": true + "title": "My Webhook", + "condition": false } } } } - }, - "400": { - "$ref": "#/components/responses/BadRequest" } }, "tags": [ "DB Table Webhook" - ], - "description": "Delete the exsiting hook by its ID", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } ] } }, - "/api/v2/meta/plugins": { + "/api/v2/meta/tables/{tableId}/hooks/test": { "parameters": [ { - "$ref": "#/components/parameters/xc-auth" + "schema": { + "$ref": "#/components/schemas/Id", + "example": "md_w9gpnaousnfss1", + "type": "string" + }, + "name": "tableId", + "in": "path", + "required": true, + "description": "Unique Table ID" } ], - "get": { - "summary": "List Plugins", - "operationId": "plugin-list", + "post": { + "summary": "Test Hook", + "operationId": "db-table-webhook-test", "responses": { "200": { "description": "OK", @@ -9793,64 +8826,19 @@ "schema": { "type": "object", "properties": { - "list": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "#/components/schemas/Plugin" - } - }, - "pageInfo": { - "$ref": "#/components/schemas/Paginated" + "msg": { + "type": "string", + "x-stoplight": { + "id": "l5k90tzuvvv1g" + }, + "example": "The hook has been tested successfully" } } - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - }, - "description": "List all plugins", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ], - "tags": [ - "Plugin" - ] - } - }, - "/api/v2/meta/plugins/webhook": { - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ], - "get": { - "summary": "Webhook List Plugins", - "operationId": "plugin-webhook-list", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "list": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "#/components/schemas/Plugin" - } - }, - "pageInfo": { - "$ref": "#/components/schemas/Paginated" + }, + "examples": { + "Example 1": { + "value": { + "msg": "The hook has been tested successfully" } } } @@ -9861,131 +8849,141 @@ "$ref": "#/components/responses/BadRequest" } }, - "description": "List all webhook plugins", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ], - "tags": [ - "Plugin" - ] - } - }, - "/api/v2/meta/plugins/{pluginTitle}/status": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "pluginTitle", - "in": "path", - "required": true, - "description": "Plugin Title" - } - ], - "get": { - "summary": "Get Plugin Status", - "operationId": "plugin-status", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "boolean" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - }, - "description": "Check plugin is active or not", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ], - "tags": [ - "Plugin" - ], - "x-internal": false - } - }, - "/api/v2/meta/plugins/test": { - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ], - "post": { - "summary": "Test Plugin", - "operationId": "plugin-test", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": {} - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - }, - "description": "Test if the plugin is working with the given configurations", - "parameters": [ - { - "$ref": "#/components/parameters/xc-auth" - } - ], "tags": [ - "Plugin" + "DB Table Webhook" ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PluginTestReq" + "$ref": "#/components/schemas/HookTestReq" }, "examples": { "Example 1": { "value": { - "title": "Plugin Foo", - "input": "{\"bucket\":\"my-bucket\",\"region\":\"us-west-004\",\"access_key\":\"redacted\",\"access_secret\":\"redacted\"}", - "category": "Email" + "hook": { + "active": 0, + "async": 0, + "description": "This is my hook description", + "env": "all", + "event": "after", + "fk_model_id": "md_rsu68aqjsbyqtl", + "id": "string", + "notification": "{\"type\":\"URL\",\"payload\":{\"method\":\"POST\",\"body\":\"{{ json data }}\",\"headers\":[{}],\"parameters\":[{}],\"auth\":\"\",\"path\":\"http://example.com\"}}", + "null": null, + "operation": "insert", + "retries": 10, + "retry_interval": 60000, + "timeout": 60000, + "title": "My Webhook" + }, + "payload": { + "data": { + "Id": 1, + "Title": "Sample Text", + "CreatedAt": "2023-03-03T10:03:06.484Z", + "UpdatedAt": "2023-03-03T10:03:06.484Z", + "attachment": [ + { + "url": "https://nocodb.com/dummy.png", + "title": "image.png", + "mimetype": "image/png", + "size": 0 + } + ], + "f": "Sample Output" + } + } } } } } } - } + }, + "description": "Test the hook in the given Table", + "parameters": [ + { + "$ref": "#/components/parameters/xc-auth" + } + ] } }, - "/api/v2/meta/plugins/{pluginId}": { + "/api/v2/meta/tables/{tableId}/hooks/samplePayload/{operation}/{version}": { "parameters": [ { "schema": { + "$ref": "#/components/schemas/Id", + "example": "md_w9gpnaousnfss1", "type": "string" }, - "name": "pluginId", + "name": "tableId", "in": "path", "required": true, - "description": "Plugin ID" + "description": "Unique Table ID" + }, + { + "schema": { + "type": "string", + "enum": [ + "insert", + "update", + "delete", + "bulkInsert", + "bulkUpdate", + "bulkDelete" + ] + }, + "name": "operation", + "in": "path", + "required": true, + "description": "Hook Operation" + }, + { + "schema": { + "type": "string", + "enum": [ + "v1", + "v2" + ] + }, + "name": "version", + "in": "path", + "required": true, + "description": "Hook Version" } ], - "patch": { - "summary": "Update Plugin", - "operationId": "plugin-update", + "get": { + "summary": "Get Sample Hook Payload", + "operationId": "db-table-webhook-sample-payload-get", "responses": { "200": { "description": "OK", "content": { "application/json": { - "schema": {} + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "x-stoplight": { + "id": "qifsikf69hqbl" + }, + "description": "Sample Payload Data" + } + } + }, + "examples": { + "Example 1": { + "value": { + "data": { + "Id": 1, + "Title": "Sample Text", + "CreatedAt": "2023-03-13T04:59:49.363Z", + "UpdatedAt": "2023-03-13T04:59:49.363Z" + } + } + } + } } } }, @@ -9993,88 +8991,58 @@ "$ref": "#/components/responses/BadRequest" } }, - "tags": [ - "Plugin" - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PluginReq" - } - } - } - }, - "description": "Update the plugin data by ID", + "description": "Get the sample hook payload", "parameters": [ { "$ref": "#/components/parameters/xc-auth" } ], - "x-internal": false - }, - "get": { - "summary": "Get Plugin", - "operationId": "plugin-read", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Plugin" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest" - } - }, "tags": [ - "Plugin" - ], - "description": "Get the plugin data by ID", - "x-internal": false + "DB Table Webhook" + ] } }, - "/api/v2/meta/connection/test": { + "/api/v2/meta/hooks/{hookId}": { "parameters": [ { - "$ref": "#/components/parameters/xc-auth" + "schema": { + "type": "string", + "example": "hk_0063k4o1frnxbr" + }, + "name": "hookId", + "in": "path", + "required": true, + "description": "Unique Hook ID" } ], - "post": { - "summary": "Test DB Connection", - "operationId": "utils-test-connection", + "patch": { + "summary": "Update Hook", + "operationId": "db-table-webhook-update", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "code": { - "type": "number" - }, - "message": { - "type": "string" - }, - "data": { - "type": "object", - "x-stoplight": { - "id": "6orbk04w97ien" - } - } - } + "$ref": "#/components/schemas/Hook" }, "examples": { "Example 1": { "value": { - "code": 0, - "message": "", - "data": {} + "active": 0, + "async": 0, + "description": "This is my hook description", + "env": "all", + "event": "after", + "fk_model_id": "md_rsu68aqjsbyqtl", + "id": "string", + "notification": "{\"type\":\"URL\",\"payload\":{\"method\":\"POST\",\"body\":\"{{ json data }}\",\"headers\":[{}],\"parameters\":[{}],\"auth\":\"\",\"path\":\"http://example.com\"}}", + "null": null, + "operation": "insert", + "retries": 10, + "retry_interval": 60000, + "timeout": 60000, + "title": "My Webhook" } } } @@ -10086,151 +9054,87 @@ } }, "tags": [ - "Utils" + "DB Table Webhook" ], "requestBody": { "content": { "application/json": { "schema": { - "type": "object", - "x-examples": { - "Example 1": { - "client": "mysql2", - "connection": { - "host": "localhost", - "port": "3306", - "user": "root", - "password": "password", - "database": null - } - } - }, - "properties": { - "client": { - "description": "DB Type", - "enum": [ - "mssql", - "mysql", - "mysql2", - "oracledb", - "pg", - "snowflake", - "sqlite3" - ], - "example": "mysql2", - "type": "string" - }, - "connection": { - "type": "object", - "properties": { - "host": { - "type": "string" - }, - "port": { - "type": "string" - }, - "user": { - "type": "string" - }, - "password": { - "type": "string" - }, - "database": { - "$ref": "#/components/schemas/StringOrNull" - } - } - } - } + "$ref": "#/components/schemas/Hook" }, "examples": { "Example 1": { "value": { - "client": "mysql2", - "connection": { - "host": "localhost", - "port": "3306", - "user": "root", - "password": "password", - "database": null - } + "active": 0, + "async": 0, + "description": "This is my hook description", + "env": "all", + "event": "after", + "fk_model_id": "md_rsu68aqjsbyqtl", + "id": "string", + "notification": "{\"type\":\"URL\",\"payload\":{\"method\":\"POST\",\"body\":\"{{ json data }}\",\"headers\":[{}],\"parameters\":[{}],\"auth\":\"\",\"path\":\"http://example.com\"}}", + "null": null, + "operation": "insert", + "retries": 10, + "retry_interval": 60000, + "timeout": 60000, + "title": "My Webhook" } } } } } }, - "description": "Test the DB Connection", + "description": "Update the exsiting hook by its ID", "parameters": [ { "$ref": "#/components/parameters/xc-auth" } ] - } - }, - "/api/v2/meta/connection/select": { - "parameters": [], - "post": { - "summary": "", - "operationId": "utils-select-query", + }, + "delete": { + "summary": "Delete Hook", + "operationId": "db-table-webhook-delete", "responses": { "200": { "description": "OK", "content": { "application/json": { - "schema": {} + "schema": { + "type": "boolean" + }, + "examples": { + "Example 1": { + "value": true + } + } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" } }, "tags": [ - "Utils" + "DB Table Webhook" ], - "requestBody": { - "content": { - "application/json": {} + "description": "Delete the exsiting hook by its ID", + "parameters": [ + { + "$ref": "#/components/parameters/xc-auth" } - }, - "description": "" + ] } }, - "/api/v1/url_to_config": { + "/api/v2/meta/plugins": { "parameters": [ { "$ref": "#/components/parameters/xc-auth" } ], - "post": { - "summary": "Convert JDBC URL to Config", - "operationId": "utils-url-to-config", - "tags": [ - "Utils" - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "url": { - "type": "string", - "x-stoplight": { - "id": "fgdbmcjjtkky5" - }, - "description": "JDBC URL", - "example": "jdbc:mysql://username:password@localhost:3306/sakila" - } - } - }, - "examples": { - "Example 1": { - "value": { - "url": "jdbc:mysql://username:password@localhost:3306/sakila" - } - } - } - } - } - }, + "get": { + "summary": "List Plugins", + "operationId": "plugin-list", "responses": { "200": { "description": "OK", @@ -10238,72 +9142,17 @@ "application/json": { "schema": { "type": "object", - "x-examples": { - "Example 1": { - "client": "mysql2", - "connection": { - "user": "username", - "password": "password", - "database": "sakila", - "host": "localhost", - "port": "3306" - } - } - }, "properties": { - "client": { - "description": "DB Type", - "enum": [ - "mssql", - "mysql", - "mysql2", - "oracledb", - "pg", - "snowflake", - "sqlite3" - ], - "example": "mysql2", - "type": "string" - }, - "connection": { - "type": "object", - "description": "Connection Config", - "properties": { - "user": { - "type": "string", - "description": "DB User" - }, - "password": { - "type": "string", - "description": "DB Password" - }, - "database": { - "type": "string", - "description": "DB Name" - }, - "host": { - "type": "string", - "description": "DB Host" - }, - "port": { - "type": "string", - "description": "DB Host" - } - } - } - } - }, - "examples": { - "Example 1": { - "value": { - "client": "mysql2", - "connection": { - "user": "username", - "password": "password", - "database": "sakila", - "host": "localhost", - "port": "3306" + "list": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "#/components/schemas/Plugin" } + }, + "pageInfo": { + "$ref": "#/components/schemas/Paginated" } } } @@ -10314,23 +9163,26 @@ "$ref": "#/components/responses/BadRequest" } }, - "description": "Extract XC URL From JDBC and parse to connection config", + "description": "List all plugins", "parameters": [ { "$ref": "#/components/parameters/xc-auth" } + ], + "tags": [ + "Plugin" ] } }, - "/api/v2/meta/nocodb/info": { + "/api/v2/meta/plugins/webhook": { "parameters": [ { "$ref": "#/components/parameters/xc-auth" } ], "get": { - "summary": "Get App Info", - "operationId": "utils-app-info", + "summary": "Webhook List Plugins", + "operationId": "plugin-webhook-list", "responses": { "200": { "description": "OK", @@ -10338,121 +9190,17 @@ "application/json": { "schema": { "type": "object", - "x-examples": { - "Example 1": { - "authType": "jwt", - "baseHasAdmin": true, - "firstUser": false, - "type": "rest", - "googleAuthEnabled": false, - "githubAuthEnabled": false, - "oneClick": false, - "connectToExternalDB": true, - "version": "0.105.3", - "defaultLimit": 25, - "ncMin": false, - "teleEnabled": false, - "auditEnabled": true, - "ncSiteUrl": "http://localhost:8080", - "ee": false, - "ncAttachmentFieldSize": 20971520, - "ncMaxAttachmentsAllowed": 10 - } - }, "properties": { - "authType": { - "type": "string" - }, - "baseHasAdmin": { - "type": "boolean" - }, - "firstUser": { - "type": "boolean" - }, - "type": { - "type": "string" - }, - "googleAuthEnabled": { - "type": "boolean" - }, - "githubAuthEnabled": { - "type": "boolean" - }, - "oneClick": { - "type": "boolean" - }, - "connectToExternalDB": { - "type": "boolean" - }, - "version": { - "type": "string" - }, - "defaultLimit": { - "type": "number" - }, - "ncMin": { - "type": "boolean" - }, - "teleEnabled": { - "type": "boolean" - }, - "auditEnabled": { - "type": "boolean" - }, - "ncSiteUrl": { - "type": "string" - }, - "ee": { - "type": "boolean" - }, - "ncAttachmentFieldSize": { - "type": "number" - }, - "ncMaxAttachmentsAllowed": { - "type": "number" - }, - "isCloud": { - "type": "boolean", - "x-stoplight": { - "id": "bstdkpky2131f" + "list": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "$ref": "#/components/schemas/Plugin" } }, - "automationLogLevel": { - "type": "string", - "x-stoplight": { - "id": "uc3vaotye2eu8" - }, - "enum": [ - "OFF", - "ERROR", - "ALL" - ], - "example": "OFF" - } - } - }, - "examples": { - "Example 1": { - "value": { - "authType": "jwt", - "baseHasAdmin": true, - "firstUser": false, - "type": "rest", - "googleAuthEnabled": false, - "githubAuthEnabled": false, - "oneClick": false, - "connectToExternalDB": true, - "version": "0.105.3", - "defaultLimit": 25, - "ncMin": false, - "teleEnabled": false, - "auditEnabled": true, - "ncSiteUrl": "http://localhost:8080", - "ee": false, - "ncAttachmentFieldSize": 20971520, - "ncMaxAttachmentsAllowed": 10, - "isCloud": false, - "automationLogLevel": "OFF" + "pageInfo": { + "$ref": "#/components/schemas/Paginated" } } } @@ -10463,35 +9211,74 @@ "$ref": "#/components/responses/BadRequest" } }, - "tags": [ - "Utils" - ], - "description": "Get the application info such as authType, defaultLimit, version and etc.", + "description": "List all webhook plugins", + "parameters": [ + { + "$ref": "#/components/parameters/xc-auth" + } + ], + "tags": [ + "Plugin" + ] + } + }, + "/api/v2/meta/plugins/{pluginTitle}/status": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "pluginTitle", + "in": "path", + "required": true, + "description": "Plugin Title" + } + ], + "get": { + "summary": "Get Plugin Status", + "operationId": "plugin-status", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + } + }, + "description": "Check plugin is active or not", "parameters": [ { "$ref": "#/components/parameters/xc-auth" } - ] + ], + "tags": [ + "Plugin" + ], + "x-internal": false } }, - "/api/v2/meta/axiosRequestMake": { + "/api/v2/meta/plugins/test": { "parameters": [ { "$ref": "#/components/parameters/xc-auth" } ], "post": { - "summary": "Axios Request", - "operationId": "utils-axios-request-make", + "summary": "Test Plugin", + "operationId": "plugin-test", "responses": { "200": { "description": "OK", "content": { "application/json": { - "schema": { - "type": "object", - "properties": {} - } + "schema": {} } } }, @@ -10499,36 +9286,117 @@ "$ref": "#/components/responses/BadRequest" } }, - "description": "Generic Axios Call", + "description": "Test if the plugin is working with the given configurations", + "parameters": [ + { + "$ref": "#/components/parameters/xc-auth" + } + ], + "tags": [ + "Plugin" + ], "requestBody": { "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/PluginTestReq" + }, + "examples": { + "Example 1": { + "value": { + "title": "Plugin Foo", + "input": "{\"bucket\":\"my-bucket\",\"region\":\"us-west-004\",\"access_key\":\"redacted\",\"access_secret\":\"redacted\"}", + "category": "Email" + } + } + } + } + } + } + } + }, + "/api/v2/meta/plugins/{pluginId}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "pluginId", + "in": "path", + "required": true, + "description": "Plugin ID" + } + ], + "patch": { + "summary": "Update Plugin", + "operationId": "plugin-update", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": {} } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" } }, "tags": [ - "Utils" + "Plugin" ], - "x-internal": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PluginReq" + } + } + } + }, + "description": "Update the plugin data by ID", "parameters": [ { "$ref": "#/components/parameters/xc-auth" } - ] + ], + "x-internal": false + }, + "get": { + "summary": "Get Plugin", + "operationId": "plugin-read", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Plugin" + } + } + } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + } + }, + "tags": [ + "Plugin" + ], + "description": "Get the plugin data by ID", + "x-internal": false } }, - "/api/v1/version": { + "/api/v2/meta/connection/test": { "parameters": [ { "$ref": "#/components/parameters/xc-auth" } ], - "get": { - "summary": "Get App Version", - "operationId": "utils-app-version", + "post": { + "summary": "Test DB Connection", + "operationId": "utils-test-connection", "responses": { "200": { "description": "OK", @@ -10536,30 +9404,27 @@ "application/json": { "schema": { "type": "object", - "x-examples": { - "Example 1": { - "currentVersion": "0.105.3", - "releaseVersion": "0.105.3" - } - }, "properties": { - "currentVersion": { - "type": "string", - "description": "Current NocoDB Version", - "example": "0.104.0" + "code": { + "type": "number" }, - "releaseVersion": { - "type": "string", - "description": "Latest Release Version", - "example": "0.105.3" + "message": { + "type": "string" + }, + "data": { + "type": "object", + "x-stoplight": { + "id": "6orbk04w97ien" + } } } }, "examples": { "Example 1": { "value": { - "currentVersion": "0.104.0", - "releaseVersion": "0.105.3" + "code": 0, + "message": "", + "data": {} } } } @@ -10573,7 +9438,78 @@ "tags": [ "Utils" ], - "description": "Get the application version", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "x-examples": { + "Example 1": { + "client": "mysql2", + "connection": { + "host": "localhost", + "port": "3306", + "user": "root", + "password": "password", + "database": null + } + } + }, + "properties": { + "client": { + "description": "DB Type", + "enum": [ + "mssql", + "mysql", + "mysql2", + "oracledb", + "pg", + "snowflake", + "sqlite3" + ], + "example": "mysql2", + "type": "string" + }, + "connection": { + "type": "object", + "properties": { + "host": { + "type": "string" + }, + "port": { + "type": "string" + }, + "user": { + "type": "string" + }, + "password": { + "type": "string" + }, + "database": { + "$ref": "#/components/schemas/StringOrNull" + } + } + } + } + }, + "examples": { + "Example 1": { + "value": { + "client": "mysql2", + "connection": { + "host": "localhost", + "port": "3306", + "user": "root", + "password": "password", + "database": null + } + } + } + } + } + } + }, + "description": "Test the DB Connection", "parameters": [ { "$ref": "#/components/parameters/xc-auth" @@ -10581,15 +9517,41 @@ ] } }, - "/api/v1/health": { + "/api/v2/meta/connection/select": { + "parameters": [], + "post": { + "summary": "", + "operationId": "utils-select-query", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": {} + } + } + } + }, + "tags": [ + "Utils" + ], + "requestBody": { + "content": { + "application/json": {} + } + }, + "description": "" + } + }, + "/api/v2/meta/nocodb/info": { "parameters": [ { "$ref": "#/components/parameters/xc-auth" } ], "get": { - "summary": "Get Application Health Status", - "operationId": "utils-app-health", + "summary": "Get App Info", + "operationId": "utils-app-info", "responses": { "200": { "description": "OK", @@ -10599,32 +9561,119 @@ "type": "object", "x-examples": { "Example 1": { - "message": "OK", - "timestamp": 1678702175755, - "uptime": 1618.996877834 + "authType": "jwt", + "baseHasAdmin": true, + "firstUser": false, + "type": "rest", + "googleAuthEnabled": false, + "githubAuthEnabled": false, + "oneClick": false, + "connectToExternalDB": true, + "version": "0.105.3", + "defaultLimit": 25, + "ncMin": false, + "teleEnabled": false, + "auditEnabled": true, + "ncSiteUrl": "http://localhost:8080", + "ee": false, + "ncAttachmentFieldSize": 20971520, + "ncMaxAttachmentsAllowed": 10 } }, "properties": { - "message": { - "type": "string", - "example": "OK" + "authType": { + "type": "string" }, - "timestamp": { - "type": "string", - "example": "1678702175755" + "baseHasAdmin": { + "type": "boolean" + }, + "firstUser": { + "type": "boolean" + }, + "type": { + "type": "string" + }, + "googleAuthEnabled": { + "type": "boolean" + }, + "githubAuthEnabled": { + "type": "boolean" + }, + "oneClick": { + "type": "boolean" + }, + "connectToExternalDB": { + "type": "boolean" + }, + "version": { + "type": "string" + }, + "defaultLimit": { + "type": "number" + }, + "ncMin": { + "type": "boolean" + }, + "teleEnabled": { + "type": "boolean" + }, + "auditEnabled": { + "type": "boolean" + }, + "ncSiteUrl": { + "type": "string" }, - "uptime": { + "ee": { + "type": "boolean" + }, + "ncAttachmentFieldSize": { + "type": "number" + }, + "ncMaxAttachmentsAllowed": { + "type": "number" + }, + "isCloud": { + "type": "boolean", + "x-stoplight": { + "id": "bstdkpky2131f" + } + }, + "automationLogLevel": { "type": "string", - "example": "1618.996877834" + "x-stoplight": { + "id": "uc3vaotye2eu8" + }, + "enum": [ + "OFF", + "ERROR", + "ALL" + ], + "example": "OFF" } } }, "examples": { "Example 1": { "value": { - "message": "OK", - "timestamp": 1678702175755, - "uptime": 1618.996877834 + "authType": "jwt", + "baseHasAdmin": true, + "firstUser": false, + "type": "rest", + "googleAuthEnabled": false, + "githubAuthEnabled": false, + "oneClick": false, + "connectToExternalDB": true, + "version": "0.105.3", + "defaultLimit": 25, + "ncMin": false, + "teleEnabled": false, + "auditEnabled": true, + "ncSiteUrl": "http://localhost:8080", + "ee": false, + "ncAttachmentFieldSize": 20971520, + "ncMaxAttachmentsAllowed": 10, + "isCloud": false, + "automationLogLevel": "OFF" } } } @@ -10638,7 +9687,7 @@ "tags": [ "Utils" ], - "description": "Get Application Health Status", + "description": "Get the application info such as authType, defaultLimit, version and etc.", "parameters": [ { "$ref": "#/components/parameters/xc-auth" @@ -10646,15 +9695,15 @@ ] } }, - "/api/v1/aggregated-meta-info": { + "/api/v2/meta/axiosRequestMake": { "parameters": [ { "$ref": "#/components/parameters/xc-auth" } ], - "get": { - "summary": "Get Aggregated Meta Info", - "operationId": "utils-aggregated-meta-info", + "post": { + "summary": "Axios Request", + "operationId": "utils-axios-request-make", "responses": { "200": { "description": "OK", @@ -10662,200 +9711,7 @@ "application/json": { "schema": { "type": "object", - "properties": { - "baseCount": { - "type": "integer" - }, - "bases": { - "type": "array", - "items": { - "type": "object", - "properties": { - "tableCount": { - "type": "object", - "properties": { - "table": { - "type": "integer", - "description": "Table Count" - }, - "view": { - "type": "integer", - "description": "View Count" - } - } - }, - "external": { - "type": "boolean", - "description": "External Base", - "default": false - }, - "viewCount": { - "type": "object", - "properties": { - "formCount": { - "type": "integer", - "description": "Form Count" - }, - "gridCount": { - "type": "integer", - "description": "Grid Count" - }, - "galleryCount": { - "type": "integer", - "description": "Gallery Count" - }, - "kanbanCount": { - "type": "integer", - "description": "Kanban Count" - }, - "total": { - "type": "integer", - "description": "Total View Count" - }, - "sharedFormCount": { - "type": "integer", - "description": "Shared Form Count" - }, - "sharedGridCount": { - "type": "integer", - "description": "Shared Grid Count" - }, - "sharedGalleryCount": { - "type": "integer", - "description": "Shared Gallery Count" - }, - "sharedKanbanCount": { - "type": "integer", - "description": "Shared Kanban Count" - }, - "sharedTotal": { - "type": "integer", - "description": "Shared Total View Count" - }, - "sharedLockedCount": { - "type": "integer", - "description": "Shared Locked View Count" - } - } - }, - "webhookCount": { - "type": "integer", - "description": "Webhook Count" - }, - "filterCount": { - "type": "integer", - "description": "Filter Count" - }, - "sortCount": { - "type": "integer", - "description": "Sort Count" - }, - "rowCount": { - "type": "array", - "items": { - "type": "object", - "properties": { - "TotalRecords": { - "type": "string" - } - } - }, - "description": "Row Count" - }, - "userCount": { - "type": "integer", - "description": "Total base user Count" - } - } - } - }, - "userCount": { - "type": "integer", - "description": "Total user Count" - }, - "sharedBaseCount": { - "type": "integer", - "description": "Total shared base Count" - } - }, - "x-examples": { - "Example 1": { - "baseCount": 1, - "bases": [ - { - "tableCount": { - "table": 3, - "view": 0 - }, - "external": false, - "viewCount": { - "formCount": 0, - "gridCount": 3, - "galleryCount": 0, - "kanbanCount": 0, - "total": 3, - "sharedFormCount": 0, - "sharedGridCount": 0, - "sharedGalleryCount": 0, - "sharedKanbanCount": 0, - "sharedTotal": 0, - "sharedLockedCount": 0 - }, - "webhookCount": 0, - "filterCount": 0, - "sortCount": 0, - "rowCount": [ - { - "TotalRecords": "76" - } - ], - "userCount": 1 - } - ], - "userCount": 1, - "sharedBaseCount": 0 - } - } - }, - "examples": { - "example-1": { - "value": { - "baseCount": 1, - "bases": [ - { - "tableCount": { - "table": 3, - "view": 0 - }, - "external": false, - "viewCount": { - "formCount": 0, - "gridCount": 3, - "galleryCount": 0, - "kanbanCount": 0, - "total": 3, - "sharedFormCount": 0, - "sharedGridCount": 0, - "sharedGalleryCount": 0, - "sharedKanbanCount": 0, - "sharedTotal": 0, - "sharedLockedCount": 0 - }, - "webhookCount": 0, - "filterCount": 0, - "sortCount": 0, - "rowCount": [ - { - "TotalRecords": "76" - } - ], - "userCount": 1 - } - ], - "userCount": 1, - "sharedBaseCount": 0 - } - } + "properties": {} } } } @@ -10864,10 +9720,20 @@ "$ref": "#/components/responses/BadRequest" } }, + "description": "Generic Axios Call", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, "tags": [ "Utils" ], - "description": "Get Aggregated Meta Info such as tableCount, dbViewCount, viewCount and etc.", + "x-internal": true, "parameters": [ { "$ref": "#/components/parameters/xc-auth" @@ -10929,7 +9795,7 @@ } ] }, - "/api/v2/meta/projects/{baseId}/api-tokens": { + "/api/v2/meta/bases/{baseId}/api-tokens": { "get": { "summary": "List API Tokens in Base", "tags": [ @@ -11048,7 +9914,7 @@ } ] }, - "/api/v2/meta/projects/{baseId}/api-tokens/{token}": { + "/api/v2/meta/bases/{baseId}/api-tokens/{token}": { "delete": { "summary": "Delete API Token", "operationId": "api-token-delete", @@ -11192,7 +10058,7 @@ "description": "Upload attachment by URL. Used in Airtable Migration." } }, - "/api/v2/meta/projects/{baseId}/users/{userId}/resend-invite": { + "/api/v2/meta/bases/{baseId}/users/{userId}/resend-invite": { "parameters": [ { "schema": { @@ -11262,116 +10128,6 @@ ] } }, - "/api/v1/notifications": { - "get": { - "summary": "Notification list", - "operationId": "notification-list", - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotificationList" - } - } - } - } - }, - "tags": [ - "Notification" - ], - "description": "List notifications", - "parameters": [ - { - "schema": { - "type": "boolean" - }, - "name": "is_read", - "in": "query", - "required": false - }, - { - "schema": { - "type": "number" - }, - "name": "limit", - "in": "query", - "required": false - }, - { - "schema": { - "type": "number" - }, - "name": "offset", - "in": "query", - "required": false - } - ] - } - }, - "/api/v1/notifications/{notificationId}": { - "patch": { - "summary": "Notification update", - "operationId": "notification-update", - "responses": { - "200": { - "description": "OK" - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotificationUpdate" - } - } - } - }, - "tags": [ - "Notification" - ], - "description": "Notificattion update" - }, - "delete": { - "summary": "Delete notification", - "operationId": "notification-delete", - "responses": { - "200": { - "description": "OK" - } - }, - "tags": [ - "Notification" - ], - "description": "Delete notification" - }, - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "notificationId", - "in": "path", - "required": true - } - ] - }, - "/api/v1/notifications/mark-all-read": { - "post": { - "summary": "Mark all notifications as read", - "operationId": "notification-mark-all-as-read", - "responses": { - "200": { - "description": "OK" - } - }, - "tags": [ - "Notification" - ], - "description": "Mark all notifications as read" - } - }, "/api/v2/meta/tables/{tableId}/columns/hash": { "parameters": [ { From 6b1edaefe4e28e537a7244c3df802ee9d7e47c0e Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 14 Oct 2023 05:12:36 +0000 Subject: [PATCH 2/2] fix: swagger - summary correction --- packages/nocodb/src/schema/swagger-v2.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nocodb/src/schema/swagger-v2.json b/packages/nocodb/src/schema/swagger-v2.json index f883032740..92f32e3199 100644 --- a/packages/nocodb/src/schema/swagger-v2.json +++ b/packages/nocodb/src/schema/swagger-v2.json @@ -667,7 +667,7 @@ } ], "get": { - "summary": "List Projects", + "summary": "List Bases", "operationId": "base-list", "responses": { "200": {