Updating summaries, adding descriptions, wrapping responses with generic wrapper 'data'.

This commit is contained in:
mike12345567 2022-03-01 14:37:35 +00:00
parent c958e93aed
commit 8680faa3da
20 changed files with 239 additions and 293 deletions

View File

@ -75,7 +75,7 @@
"examples": { "examples": {
"application": { "application": {
"value": { "value": {
"application": { "data": {
"_id": "app_metadata", "_id": "app_metadata",
"appId": "app_dev_957b12f943d348faa61db7e18e088d0f", "appId": "app_dev_957b12f943d348faa61db7e18e088d0f",
"version": "1.0.58-alpha.0", "version": "1.0.58-alpha.0",
@ -84,38 +84,13 @@
"tenantId": "default", "tenantId": "default",
"updatedAt": "2022-02-22T13:00:54.035Z", "updatedAt": "2022-02-22T13:00:54.035Z",
"createdAt": "2022-02-11T18:02:26.961Z", "createdAt": "2022-02-11T18:02:26.961Z",
"status": "development", "status": "development"
"lockedBy": {
"_id": "us_693a73206518477283a8d5ae31103252",
"email": "test@test.com",
"roles": {
"app_957b12f943d348faa61db7e18e088d0f": "BASIC"
},
"builder": {
"global": false
},
"admin": {
"global": true
},
"tenantId": "default",
"status": "active",
"budibaseAccess": true,
"csrfToken": "9c70291d-7137-48f9-9166-99ab5473a3d4",
"userId": "us_693a73206518477283a8d5ae31103252",
"roleId": "ADMIN",
"role": {
"_id": "ADMIN",
"name": "Admin",
"permissionId": "admin",
"inherits": "POWER"
}
}
} }
} }
}, },
"applications": { "applications": {
"value": { "value": {
"applications": [ "data": [
{ {
"_id": "app_metadata", "_id": "app_metadata",
"appId": "app_dev_957b12f943d348faa61db7e18e088d0f", "appId": "app_dev_957b12f943d348faa61db7e18e088d0f",
@ -125,32 +100,7 @@
"tenantId": "default", "tenantId": "default",
"updatedAt": "2022-02-22T13:00:54.035Z", "updatedAt": "2022-02-22T13:00:54.035Z",
"createdAt": "2022-02-11T18:02:26.961Z", "createdAt": "2022-02-11T18:02:26.961Z",
"status": "development", "status": "development"
"lockedBy": {
"_id": "us_693a73206518477283a8d5ae31103252",
"email": "test@test.com",
"roles": {
"app_957b12f943d348faa61db7e18e088d0f": "BASIC"
},
"builder": {
"global": false
},
"admin": {
"global": true
},
"tenantId": "default",
"status": "active",
"budibaseAccess": true,
"csrfToken": "9c70291d-7137-48f9-9166-99ab5473a3d4",
"userId": "us_693a73206518477283a8d5ae31103252",
"roleId": "ADMIN",
"role": {
"_id": "ADMIN",
"name": "Admin",
"permissionId": "admin",
"inherits": "POWER"
}
}
} }
] ]
} }
@ -169,7 +119,7 @@
}, },
"row": { "row": {
"value": { "value": {
"row": { "data": {
"_id": "ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4", "_id": "ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4",
"type": "row", "type": "row",
"tableId": "ta_5b1649e42a5b41dea4ef7742a36a7a70", "tableId": "ta_5b1649e42a5b41dea4ef7742a36a7a70",
@ -186,7 +136,7 @@
}, },
"enrichedRow": { "enrichedRow": {
"value": { "value": {
"row": { "data": {
"_id": "ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4", "_id": "ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4",
"name": "eg", "name": "eg",
"tableId": "ta_5b1649e42a5b41dea4ef7742a36a7a70", "tableId": "ta_5b1649e42a5b41dea4ef7742a36a7a70",
@ -209,7 +159,7 @@
}, },
"rows": { "rows": {
"value": { "value": {
"rows": [ "data": [
{ {
"_id": "ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4", "_id": "ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4",
"type": "row", "type": "row",
@ -230,7 +180,7 @@
}, },
"table": { "table": {
"value": { "value": {
"table": { "data": {
"_id": "ta_5b1649e42a5b41dea4ef7742a36a7a70", "_id": "ta_5b1649e42a5b41dea4ef7742a36a7a70",
"name": "People", "name": "People",
"schema": { "schema": {
@ -255,7 +205,7 @@
}, },
"tables": { "tables": {
"value": { "value": {
"tables": [ "data": [
{ {
"_id": "ta_5b1649e42a5b41dea4ef7742a36a7a70", "_id": "ta_5b1649e42a5b41dea4ef7742a36a7a70",
"name": "People", "name": "People",
@ -282,7 +232,7 @@
}, },
"query": { "query": {
"value": { "value": {
"query": { "data": {
"_id": "query_datasource_plus_4d8be0c506b9465daf4bf84d890fdab6_454854487c574d45bc4029b1e153219e", "_id": "query_datasource_plus_4d8be0c506b9465daf4bf84d890fdab6_454854487c574d45bc4029b1e153219e",
"datasourceId": "datasource_plus_4d8be0c506b9465daf4bf84d890fdab6", "datasourceId": "datasource_plus_4d8be0c506b9465daf4bf84d890fdab6",
"parameters": [], "parameters": [],
@ -320,7 +270,7 @@
}, },
"queries": { "queries": {
"value": { "value": {
"queries": [ "data": [
{ {
"_id": "query_datasource_plus_4d8be0c506b9465daf4bf84d890fdab6_454854487c574d45bc4029b1e153219e", "_id": "query_datasource_plus_4d8be0c506b9465daf4bf84d890fdab6_454854487c574d45bc4029b1e153219e",
"datasourceId": "datasource_plus_4d8be0c506b9465daf4bf84d890fdab6", "datasourceId": "datasource_plus_4d8be0c506b9465daf4bf84d890fdab6",
@ -396,7 +346,7 @@
}, },
"user": { "user": {
"value": { "value": {
"user": { "data": {
"_id": "us_693a73206518477283a8d5ae31103252", "_id": "us_693a73206518477283a8d5ae31103252",
"email": "test@test.com", "email": "test@test.com",
"roles": { "roles": {
@ -425,7 +375,7 @@
}, },
"users": { "users": {
"value": { "value": {
"users": [ "data": [
{ {
"_id": "us_693a73206518477283a8d5ae31103252", "_id": "us_693a73206518477283a8d5ae31103252",
"email": "test@test.com", "email": "test@test.com",
@ -484,7 +434,7 @@
"applicationOutput": { "applicationOutput": {
"type": "object", "type": "object",
"properties": { "properties": {
"application": { "data": {
"type": "object", "type": "object",
"properties": { "properties": {
"name": { "name": {
@ -540,7 +490,7 @@
} }
}, },
"required": [ "required": [
"application" "data"
] ]
}, },
"row": { "row": {
@ -579,7 +529,7 @@
"rowOutput": { "rowOutput": {
"type": "object", "type": "object",
"properties": { "properties": {
"row": { "data": {
"description": "The row to be created/updated, based on the table schema.", "description": "The row to be created/updated, based on the table schema.",
"type": "object", "type": "object",
"properties": { "properties": {
@ -614,7 +564,7 @@
} }
}, },
"required": [ "required": [
"row" "data"
] ]
}, },
"table": { "table": {
@ -819,7 +769,7 @@
"tableOutput": { "tableOutput": {
"type": "object", "type": "object",
"properties": { "properties": {
"table": { "data": {
"description": "The table to be created/updated.", "description": "The table to be created/updated.",
"type": "object", "type": "object",
"required": [ "required": [
@ -1020,7 +970,7 @@
} }
}, },
"required": [ "required": [
"table" "data"
] ]
}, },
"query": { "query": {
@ -1113,7 +1063,7 @@
"userOutput": { "userOutput": {
"type": "object", "type": "object",
"properties": { "properties": {
"user": { "data": {
"type": "object", "type": "object",
"properties": { "properties": {
"email": { "email": {
@ -1179,7 +1129,7 @@
} }
}, },
"required": [ "required": [
"user" "data"
] ]
}, },
"nameSearch": { "nameSearch": {
@ -1204,7 +1154,7 @@
"paths": { "paths": {
"/applications": { "/applications": {
"post": { "post": {
"summary": "Create a new application.", "summary": "Create an application",
"tags": [ "tags": [
"applications" "applications"
], ],
@ -1244,7 +1194,7 @@
}, },
"/applications/{appId}": { "/applications/{appId}": {
"put": { "put": {
"summary": "Update an existing application by its ID.", "summary": "Update an application",
"tags": [ "tags": [
"applications" "applications"
], ],
@ -1282,7 +1232,7 @@
} }
}, },
"delete": { "delete": {
"summary": "Delete an existing application by its ID.", "summary": "Delete an application",
"tags": [ "tags": [
"applications" "applications"
], ],
@ -1310,7 +1260,7 @@
} }
}, },
"get": { "get": {
"summary": "Retrieve a single application by its ID.", "summary": "Retrieve an application",
"tags": [ "tags": [
"applications" "applications"
], ],
@ -1340,7 +1290,8 @@
}, },
"/applications/search": { "/applications/search": {
"post": { "post": {
"summary": "Search for an application based on its app name.", "summary": "Search for applications",
"description": "Based on application properties (currently only name) search for applications.",
"tags": [ "tags": [
"applications" "applications"
], ],
@ -1367,10 +1318,10 @@
"schema": { "schema": {
"type": "object", "type": "object",
"required": [ "required": [
"applications" "data"
], ],
"properties": { "properties": {
"applications": { "data": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/application" "$ref": "#/components/schemas/application"
@ -1391,10 +1342,8 @@
}, },
"/queries/{queryId}": { "/queries/{queryId}": {
"post": { "post": {
"summary": "Execute a query and retrieve its response.", "summary": "Execute a query",
"tags": [ "description": "Queries which have been created within a Budibase app can be executed using this, - queries",
"queries"
],
"parameters": [ "parameters": [
{ {
"$ref": "#/components/parameters/queryId" "$ref": "#/components/parameters/queryId"
@ -1455,7 +1404,8 @@
}, },
"/queries/search": { "/queries/search": {
"post": { "post": {
"summary": "Search for a query based on its name.", "summary": "Search for queries",
"description": "Based on query properties (currently only name) search for queries.",
"tags": [ "tags": [
"queries" "queries"
], ],
@ -1482,10 +1432,10 @@
"schema": { "schema": {
"type": "object", "type": "object",
"required": [ "required": [
"queries" "data"
], ],
"properties": { "properties": {
"queries": { "data": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/query" "$ref": "#/components/schemas/query"
@ -1506,7 +1456,8 @@
}, },
"/tables/{tableId}/rows": { "/tables/{tableId}/rows": {
"post": { "post": {
"summary": "Creates a new row within a specified table.", "summary": "Create a row",
"description": "Creates a row within the specified table.",
"tags": [ "tags": [
"rows" "rows"
], ],
@ -1554,7 +1505,8 @@
}, },
"/tables/{tableId}/rows/{rowId}": { "/tables/{tableId}/rows/{rowId}": {
"put": { "put": {
"summary": "Update a single row within a specified table.", "summary": "Update a row",
"description": "Updates a row within the specified table.",
"tags": [ "tags": [
"rows" "rows"
], ],
@ -1603,7 +1555,8 @@
} }
}, },
"delete": { "delete": {
"summary": "Delete a single row from the specified table.", "summary": "Delete a row",
"description": "Deletes a row within the specified table.",
"tags": [ "tags": [
"rows" "rows"
], ],
@ -1637,7 +1590,7 @@
} }
}, },
"get": { "get": {
"summary": "Get a single row from the specified table.", "summary": "Retrieve a row",
"description": "This gets a single row, it will be enriched with the full related rows, rather than the squashed \"primaryDisplay\" format returned by the search endpoint.", "description": "This gets a single row, it will be enriched with the full related rows, rather than the squashed \"primaryDisplay\" format returned by the search endpoint.",
"tags": [ "tags": [
"rows" "rows"
@ -1674,7 +1627,7 @@
}, },
"/tables/{tableId}/rows/search": { "/tables/{tableId}/rows/search": {
"post": { "post": {
"summary": "Used to search for rows within a table.", "summary": "Search for rows",
"tags": [ "tags": [
"rows" "rows"
], ],
@ -1808,10 +1761,10 @@
"schema": { "schema": {
"type": "object", "type": "object",
"required": [ "required": [
"rows" "data"
], ],
"properties": { "properties": {
"rows": { "data": {
"description": "An array of rows, these will each contain an _id field which can be used to update or delete them.", "description": "An array of rows, these will each contain an _id field which can be used to update or delete them.",
"type": "array", "type": "array",
"items": { "items": {
@ -1848,7 +1801,8 @@
}, },
"/tables": { "/tables": {
"post": { "post": {
"summary": "Create a new table.", "summary": "Create a table",
"description": "Create a table, this could be internal or external.",
"tags": [ "tags": [
"tables" "tables"
], ],
@ -1892,7 +1846,8 @@
}, },
"/tables/{tableId}": { "/tables/{tableId}": {
"put": { "put": {
"summary": "Update the specified table.", "summary": "Update a table",
"description": "Update a table, this could be internal or external.",
"tags": [ "tags": [
"tables" "tables"
], ],
@ -1937,7 +1892,8 @@
} }
}, },
"delete": { "delete": {
"summary": "Delete a single table and all of its data.", "summary": "Delete a table",
"description": "Delete a table, this could be internal or external.",
"tags": [ "tags": [
"tables" "tables"
], ],
@ -1968,7 +1924,8 @@
} }
}, },
"get": { "get": {
"summary": "Gets a single table by its ID.", "summary": "Retrieve a table",
"description": "Lookup a table, this could be internal or external.",
"tags": [ "tags": [
"tables" "tables"
], ],
@ -2001,7 +1958,8 @@
}, },
"/tables/search": { "/tables/search": {
"post": { "post": {
"summary": "Search internal and external tables based on their name.", "summary": "Search for tables",
"description": "Based on table properties (currently only name) search for tables. This could be an internal or an external table.",
"tags": [ "tags": [
"tables" "tables"
], ],
@ -2028,10 +1986,10 @@
"schema": { "schema": {
"type": "object", "type": "object",
"required": [ "required": [
"tables" "data"
], ],
"properties": { "properties": {
"tables": { "data": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/table" "$ref": "#/components/schemas/table"
@ -2052,7 +2010,7 @@
}, },
"/users": { "/users": {
"post": { "post": {
"summary": "Create a new user in the Budibase portal.", "summary": "Create a user",
"tags": [ "tags": [
"users" "users"
], ],
@ -2087,7 +2045,7 @@
}, },
"/users/{userId}": { "/users/{userId}": {
"put": { "put": {
"summary": "Update an existing user by their ID.", "summary": "Update a user",
"tags": [ "tags": [
"users" "users"
], ],
@ -2125,7 +2083,7 @@
} }
}, },
"delete": { "delete": {
"summary": "Delete an existing user by their ID.", "summary": "Delete a user",
"tags": [ "tags": [
"users" "users"
], ],
@ -2153,7 +2111,7 @@
} }
}, },
"get": { "get": {
"summary": "Retrieve a single user by their ID.", "summary": "Retrieve a user",
"tags": [ "tags": [
"users" "users"
], ],
@ -2183,7 +2141,8 @@
}, },
"/users/search": { "/users/search": {
"post": { "post": {
"summary": "Search for a user based on their email/username.", "summary": "Search for users",
"description": "Based on user properties (currently only name) search for users.",
"tags": [ "tags": [
"users" "users"
], ],
@ -2205,10 +2164,10 @@
"schema": { "schema": {
"type": "object", "type": "object",
"required": [ "required": [
"users" "data"
], ],
"properties": { "properties": {
"users": { "data": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/user" "$ref": "#/components/schemas/user"

View File

@ -55,7 +55,7 @@ components:
examples: examples:
application: application:
value: value:
application: data:
_id: app_metadata _id: app_metadata
appId: app_dev_957b12f943d348faa61db7e18e088d0f appId: app_dev_957b12f943d348faa61db7e18e088d0f
version: 1.0.58-alpha.0 version: 1.0.58-alpha.0
@ -65,29 +65,9 @@ components:
updatedAt: 2022-02-22T13:00:54.035Z updatedAt: 2022-02-22T13:00:54.035Z
createdAt: 2022-02-11T18:02:26.961Z createdAt: 2022-02-11T18:02:26.961Z
status: development status: development
lockedBy:
_id: us_693a73206518477283a8d5ae31103252
email: test@test.com
roles:
app_957b12f943d348faa61db7e18e088d0f: BASIC
builder:
global: false
admin:
global: true
tenantId: default
status: active
budibaseAccess: true
csrfToken: 9c70291d-7137-48f9-9166-99ab5473a3d4
userId: us_693a73206518477283a8d5ae31103252
roleId: ADMIN
role:
_id: ADMIN
name: Admin
permissionId: admin
inherits: POWER
applications: applications:
value: value:
applications: data:
- _id: app_metadata - _id: app_metadata
appId: app_dev_957b12f943d348faa61db7e18e088d0f appId: app_dev_957b12f943d348faa61db7e18e088d0f
version: 1.0.58-alpha.0 version: 1.0.58-alpha.0
@ -97,26 +77,6 @@ components:
updatedAt: 2022-02-22T13:00:54.035Z updatedAt: 2022-02-22T13:00:54.035Z
createdAt: 2022-02-11T18:02:26.961Z createdAt: 2022-02-11T18:02:26.961Z
status: development status: development
lockedBy:
_id: us_693a73206518477283a8d5ae31103252
email: test@test.com
roles:
app_957b12f943d348faa61db7e18e088d0f: BASIC
builder:
global: false
admin:
global: true
tenantId: default
status: active
budibaseAccess: true
csrfToken: 9c70291d-7137-48f9-9166-99ab5473a3d4
userId: us_693a73206518477283a8d5ae31103252
roleId: ADMIN
role:
_id: ADMIN
name: Admin
permissionId: admin
inherits: POWER
inputRow: inputRow:
value: value:
_id: ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4 _id: ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4
@ -128,7 +88,7 @@ components:
- ro_ta_... - ro_ta_...
row: row:
value: value:
row: data:
_id: ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4 _id: ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4
type: row type: row
tableId: ta_5b1649e42a5b41dea4ef7742a36a7a70 tableId: ta_5b1649e42a5b41dea4ef7742a36a7a70
@ -139,7 +99,7 @@ components:
_id: ro_ta_... _id: ro_ta_...
enrichedRow: enrichedRow:
value: value:
row: data:
_id: ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4 _id: ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4
name: eg name: eg
tableId: ta_5b1649e42a5b41dea4ef7742a36a7a70 tableId: ta_5b1649e42a5b41dea4ef7742a36a7a70
@ -153,7 +113,7 @@ components:
primaryDisplay: eg primaryDisplay: eg
rows: rows:
value: value:
rows: data:
- _id: ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4 - _id: ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4
type: row type: row
tableId: ta_5b1649e42a5b41dea4ef7742a36a7a70 tableId: ta_5b1649e42a5b41dea4ef7742a36a7a70
@ -166,7 +126,7 @@ components:
bookmark: 10 bookmark: 10
table: table:
value: value:
table: data:
_id: ta_5b1649e42a5b41dea4ef7742a36a7a70 _id: ta_5b1649e42a5b41dea4ef7742a36a7a70
name: People name: People
schema: schema:
@ -184,7 +144,7 @@ components:
relationshipType: many-to-many relationshipType: many-to-many
tables: tables:
value: value:
tables: data:
- _id: ta_5b1649e42a5b41dea4ef7742a36a7a70 - _id: ta_5b1649e42a5b41dea4ef7742a36a7a70
name: People name: People
schema: schema:
@ -202,7 +162,7 @@ components:
relationshipType: many-to-many relationshipType: many-to-many
query: query:
value: value:
query: data:
_id: query_datasource_plus_4d8be0c506b9465daf4bf84d890fdab6_454854487c574d45bc4029b1e153219e _id: query_datasource_plus_4d8be0c506b9465daf4bf84d890fdab6_454854487c574d45bc4029b1e153219e
datasourceId: datasource_plus_4d8be0c506b9465daf4bf84d890fdab6 datasourceId: datasource_plus_4d8be0c506b9465daf4bf84d890fdab6
parameters: [] parameters: []
@ -230,7 +190,7 @@ components:
readable: true readable: true
queries: queries:
value: value:
queries: data:
- _id: query_datasource_plus_4d8be0c506b9465daf4bf84d890fdab6_454854487c574d45bc4029b1e153219e - _id: query_datasource_plus_4d8be0c506b9465daf4bf84d890fdab6_454854487c574d45bc4029b1e153219e
datasourceId: datasource_plus_4d8be0c506b9465daf4bf84d890fdab6 datasourceId: datasource_plus_4d8be0c506b9465daf4bf84d890fdab6
parameters: [] parameters: []
@ -280,7 +240,7 @@ components:
city: Dublin city: Dublin
user: user:
value: value:
user: data:
_id: us_693a73206518477283a8d5ae31103252 _id: us_693a73206518477283a8d5ae31103252
email: test@test.com email: test@test.com
roles: roles:
@ -302,7 +262,7 @@ components:
inherits: POWER inherits: POWER
users: users:
value: value:
users: data:
- _id: us_693a73206518477283a8d5ae31103252 - _id: us_693a73206518477283a8d5ae31103252
email: test@test.com email: test@test.com
roles: roles:
@ -345,7 +305,7 @@ components:
applicationOutput: applicationOutput:
type: object type: object
properties: properties:
application: data:
type: object type: object
properties: properties:
name: name:
@ -391,7 +351,7 @@ components:
- version - version
- appId - appId
required: required:
- application - data
row: row:
description: The row to be created/updated, based on the table schema. description: The row to be created/updated, based on the table schema.
type: object type: object
@ -412,7 +372,7 @@ components:
rowOutput: rowOutput:
type: object type: object
properties: properties:
row: data:
description: The row to be created/updated, based on the table schema. description: The row to be created/updated, based on the table schema.
type: object type: object
properties: properties:
@ -430,7 +390,7 @@ components:
- type: array - type: array
- type: boolean - type: boolean
required: required:
- row - data
table: table:
description: The table to be created/updated. description: The table to be created/updated.
type: object type: object
@ -592,7 +552,7 @@ components:
tableOutput: tableOutput:
type: object type: object
properties: properties:
table: data:
description: The table to be created/updated. description: The table to be created/updated.
type: object type: object
required: required:
@ -751,7 +711,7 @@ components:
type: boolean type: boolean
description: Defines whether the column is automatically generated. description: Defines whether the column is automatically generated.
required: required:
- table - data
query: query:
description: The query body must contain the required parameters for the query, description: The query body must contain the required parameters for the query,
this depends on query type, setup and bindings. this depends on query type, setup and bindings.
@ -818,7 +778,7 @@ components:
userOutput: userOutput:
type: object type: object
properties: properties:
user: data:
type: object type: object
properties: properties:
email: email:
@ -871,7 +831,7 @@ components:
- email - email
- roles - roles
required: required:
- user - data
nameSearch: nameSearch:
type: object type: object
properties: properties:
@ -886,7 +846,7 @@ security:
paths: paths:
/applications: /applications:
post: post:
summary: Create a new application. summary: Create an application
tags: tags:
- applications - applications
parameters: parameters:
@ -909,7 +869,7 @@ paths:
$ref: "#/components/examples/application" $ref: "#/components/examples/application"
"/applications/{appId}": "/applications/{appId}":
put: put:
summary: Update an existing application by its ID. summary: Update an application
tags: tags:
- applications - applications
parameters: parameters:
@ -931,7 +891,7 @@ paths:
application: application:
$ref: "#/components/examples/application" $ref: "#/components/examples/application"
delete: delete:
summary: Delete an existing application by its ID. summary: Delete an application
tags: tags:
- applications - applications
parameters: parameters:
@ -947,7 +907,7 @@ paths:
application: application:
$ref: "#/components/examples/application" $ref: "#/components/examples/application"
get: get:
summary: Retrieve a single application by its ID. summary: Retrieve an application
tags: tags:
- applications - applications
parameters: parameters:
@ -964,7 +924,9 @@ paths:
$ref: "#/components/examples/application" $ref: "#/components/examples/application"
/applications/search: /applications/search:
post: post:
summary: Search for an application based on its app name. summary: Search for applications
description: Based on application properties (currently only name) search for
applications.
tags: tags:
- applications - applications
parameters: parameters:
@ -984,9 +946,9 @@ paths:
schema: schema:
type: object type: object
required: required:
- applications - data
properties: properties:
applications: data:
type: array type: array
items: items:
$ref: "#/components/schemas/application" $ref: "#/components/schemas/application"
@ -995,9 +957,9 @@ paths:
$ref: "#/components/examples/applications" $ref: "#/components/examples/applications"
"/queries/{queryId}": "/queries/{queryId}":
post: post:
summary: Execute a query and retrieve its response. summary: Execute a query
tags: description: Queries which have been created within a Budibase app can be
- queries executed using this, - queries
parameters: parameters:
- $ref: "#/components/parameters/queryId" - $ref: "#/components/parameters/queryId"
- $ref: "#/components/parameters/appId" - $ref: "#/components/parameters/appId"
@ -1036,7 +998,8 @@ paths:
$ref: "#/components/examples/sqlResponse" $ref: "#/components/examples/sqlResponse"
/queries/search: /queries/search:
post: post:
summary: Search for a query based on its name. summary: Search for queries
description: Based on query properties (currently only name) search for queries.
tags: tags:
- queries - queries
parameters: parameters:
@ -1055,9 +1018,9 @@ paths:
schema: schema:
type: object type: object
required: required:
- queries - data
properties: properties:
queries: data:
type: array type: array
items: items:
$ref: "#/components/schemas/query" $ref: "#/components/schemas/query"
@ -1066,7 +1029,8 @@ paths:
$ref: "#/components/examples/queries" $ref: "#/components/examples/queries"
"/tables/{tableId}/rows": "/tables/{tableId}/rows":
post: post:
summary: Creates a new row within a specified table. summary: Create a row
description: Creates a row within the specified table.
tags: tags:
- rows - rows
parameters: parameters:
@ -1095,7 +1059,8 @@ paths:
$ref: "#/components/examples/row" $ref: "#/components/examples/row"
"/tables/{tableId}/rows/{rowId}": "/tables/{tableId}/rows/{rowId}":
put: put:
summary: Update a single row within a specified table. summary: Update a row
description: Updates a row within the specified table.
tags: tags:
- rows - rows
parameters: parameters:
@ -1123,7 +1088,8 @@ paths:
row: row:
$ref: "#/components/examples/row" $ref: "#/components/examples/row"
delete: delete:
summary: Delete a single row from the specified table. summary: Delete a row
description: Deletes a row within the specified table.
tags: tags:
- rows - rows
parameters: parameters:
@ -1142,7 +1108,7 @@ paths:
row: row:
$ref: "#/components/examples/row" $ref: "#/components/examples/row"
get: get:
summary: Get a single row from the specified table. summary: Retrieve a row
description: This gets a single row, it will be enriched with the full related description: This gets a single row, it will be enriched with the full related
rows, rather than the squashed "primaryDisplay" format returned by the rows, rather than the squashed "primaryDisplay" format returned by the
search endpoint. search endpoint.
@ -1164,7 +1130,7 @@ paths:
$ref: "#/components/examples/enrichedRow" $ref: "#/components/examples/enrichedRow"
"/tables/{tableId}/rows/search": "/tables/{tableId}/rows/search":
post: post:
summary: Used to search for rows within a table. summary: Search for rows
tags: tags:
- rows - rows
parameters: parameters:
@ -1269,9 +1235,9 @@ paths:
schema: schema:
type: object type: object
required: required:
- rows - data
properties: properties:
rows: data:
description: An array of rows, these will each contain an _id field which can be description: An array of rows, these will each contain an _id field which can be
used to update or delete them. used to update or delete them.
type: array type: array
@ -1291,7 +1257,8 @@ paths:
$ref: "#/components/examples/rows" $ref: "#/components/examples/rows"
/tables: /tables:
post: post:
summary: Create a new table. summary: Create a table
description: Create a table, this could be internal or external.
tags: tags:
- tables - tables
parameters: parameters:
@ -1317,7 +1284,8 @@ paths:
$ref: "#/components/examples/table" $ref: "#/components/examples/table"
"/tables/{tableId}": "/tables/{tableId}":
put: put:
summary: Update the specified table. summary: Update a table
description: Update a table, this could be internal or external.
tags: tags:
- tables - tables
parameters: parameters:
@ -1342,7 +1310,8 @@ paths:
table: table:
$ref: "#/components/examples/table" $ref: "#/components/examples/table"
delete: delete:
summary: Delete a single table and all of its data. summary: Delete a table
description: Delete a table, this could be internal or external.
tags: tags:
- tables - tables
parameters: parameters:
@ -1359,7 +1328,8 @@ paths:
table: table:
$ref: "#/components/examples/table" $ref: "#/components/examples/table"
get: get:
summary: Gets a single table by its ID. summary: Retrieve a table
description: Lookup a table, this could be internal or external.
tags: tags:
- tables - tables
parameters: parameters:
@ -1377,7 +1347,9 @@ paths:
$ref: "#/components/examples/table" $ref: "#/components/examples/table"
/tables/search: /tables/search:
post: post:
summary: Search internal and external tables based on their name. summary: Search for tables
description: Based on table properties (currently only name) search for tables.
This could be an internal or an external table.
tags: tags:
- tables - tables
parameters: parameters:
@ -1396,9 +1368,9 @@ paths:
schema: schema:
type: object type: object
required: required:
- tables - data
properties: properties:
tables: data:
type: array type: array
items: items:
$ref: "#/components/schemas/table" $ref: "#/components/schemas/table"
@ -1407,7 +1379,7 @@ paths:
$ref: "#/components/examples/tables" $ref: "#/components/examples/tables"
/users: /users:
post: post:
summary: Create a new user in the Budibase portal. summary: Create a user
tags: tags:
- users - users
requestBody: requestBody:
@ -1428,7 +1400,7 @@ paths:
$ref: "#/components/examples/user" $ref: "#/components/examples/user"
"/users/{userId}": "/users/{userId}":
put: put:
summary: Update an existing user by their ID. summary: Update a user
tags: tags:
- users - users
parameters: parameters:
@ -1450,7 +1422,7 @@ paths:
user: user:
$ref: "#/components/examples/user" $ref: "#/components/examples/user"
delete: delete:
summary: Delete an existing user by their ID. summary: Delete a user
tags: tags:
- users - users
parameters: parameters:
@ -1466,7 +1438,7 @@ paths:
user: user:
$ref: "#/components/examples/user" $ref: "#/components/examples/user"
get: get:
summary: Retrieve a single user by their ID. summary: Retrieve a user
tags: tags:
- users - users
parameters: parameters:
@ -1483,7 +1455,8 @@ paths:
$ref: "#/components/examples/user" $ref: "#/components/examples/user"
/users/search: /users/search:
post: post:
summary: Search for a user based on their email/username. summary: Search for users
description: Based on user properties (currently only name) search for users.
tags: tags:
- users - users
requestBody: requestBody:
@ -1500,9 +1473,9 @@ paths:
schema: schema:
type: object type: object
required: required:
- users - data
properties: properties:
users: data:
type: array type: array
items: items:
$ref: "#/components/schemas/user" $ref: "#/components/schemas/user"

View File

@ -84,18 +84,18 @@ module.exports = new Resource()
.setExamples({ .setExamples({
application: { application: {
value: { value: {
application: application, data: application,
}, },
}, },
applications: { applications: {
value: { value: {
applications: [application], data: [application],
}, },
}, },
}) })
.setSchemas({ .setSchemas({
application: applicationSchema, application: applicationSchema,
applicationOutput: object({ applicationOutput: object({
application: applicationSchemaOutput, data: applicationSchemaOutput,
}), }),
}) })

View File

@ -92,12 +92,12 @@ module.exports = new Resource()
.setExamples({ .setExamples({
query: { query: {
value: { value: {
query: query, data: query,
}, },
}, },
queries: { queries: {
value: { value: {
queries: [query], data: [query],
}, },
}, },
restResponse, restResponse,

View File

@ -75,17 +75,17 @@ module.exports = new Resource()
}, },
row: { row: {
value: { value: {
row: row, data: row,
}, },
}, },
enrichedRow: { enrichedRow: {
value: { value: {
row: enrichedRow, data: enrichedRow,
}, },
}, },
rows: { rows: {
value: { value: {
rows: [row], data: [row],
hasNextPage: true, hasNextPage: true,
bookmark: 10, bookmark: 10,
}, },
@ -94,6 +94,6 @@ module.exports = new Resource()
.setSchemas({ .setSchemas({
row: rowSchema, row: rowSchema,
rowOutput: object({ rowOutput: object({
row: rowSchema, data: rowSchema,
}), }),
}) })

View File

@ -162,18 +162,18 @@ module.exports = new Resource()
.setExamples({ .setExamples({
table: { table: {
value: { value: {
table: table, data: table,
}, },
}, },
tables: { tables: {
value: { value: {
tables: [table], data: [table],
}, },
}, },
}) })
.setSchemas({ .setSchemas({
table: tableSchema, table: tableSchema,
tableOutput: object({ tableOutput: object({
table: tableSchema, data: tableSchema,
}), }),
}) })

View File

@ -97,18 +97,18 @@ module.exports = new Resource()
.setExamples({ .setExamples({
user: { user: {
value: { value: {
user: user, data: user,
}, },
}, },
users: { users: {
value: { value: {
users: [user], data: [user],
}, },
}, },
}) })
.setSchemas({ .setSchemas({
user: userSchema, user: userSchema,
userOutput: object({ userOutput: object({
user: userSchema, data: userSchema,
}), }),
}) })

View File

@ -1,6 +1,6 @@
const { getAllApps } = require("@budibase/backend-core/db") const { getAllApps } = require("@budibase/backend-core/db")
const { updateAppId } = require("@budibase/backend-core/context") const { updateAppId } = require("@budibase/backend-core/context")
import { search as stringSearch } from "./utils" import { search as stringSearch, wrapResponse } from "./utils"
import { default as controller } from "../application" import { default as controller } from "../application"
import { Application } from "../../../definitions/common" import { Application } from "../../../definitions/common"
@ -19,14 +19,15 @@ async function setResponseApp(ctx: any) {
ctx.params = { appId: ctx.body.appId } ctx.params = { appId: ctx.body.appId }
} }
await controller.fetchAppPackage(ctx) await controller.fetchAppPackage(ctx)
// for now remove everything else
wrapResponse(ctx, (input: any) => input.application)
} }
export async function search(ctx: any) { export async function search(ctx: any) {
const { name } = ctx.request.body const { name } = ctx.request.body
const apps = await getAllApps({ all: true }) const apps = await getAllApps({ all: true })
ctx.body = { ctx.body = stringSearch(apps, name)
applications: stringSearch(apps, name), wrapResponse(ctx)
}
} }
export async function create(ctx: any) { export async function create(ctx: any) {

View File

@ -1,16 +1,16 @@
import { search as stringSearch } from "./utils" import { search as stringSearch, wrapResponse } from "./utils"
import { default as queryController } from "../query" import { default as queryController } from "../query"
export async function search(ctx: any) { export async function search(ctx: any) {
await queryController.fetch(ctx) await queryController.fetch(ctx)
const { name } = ctx.request.body const { name } = ctx.request.body
ctx.body = { ctx.body = stringSearch(ctx.body, name)
queries: stringSearch(ctx.body, name), wrapResponse(ctx)
}
} }
export async function execute(ctx: any) { export async function execute(ctx: any) {
await queryController.executeV2(ctx) await queryController.executeV2(ctx)
wrapResponse(ctx)
} }
export default { export default {

View File

@ -1,5 +1,5 @@
import { default as rowController } from "../row" import { default as rowController } from "../row"
import { addRev } from "./utils" import { addRev, wrapResponse } from "./utils"
import { Row } from "../../../definitions/common" import { Row } from "../../../definitions/common"
// makes sure that the user doesn't need to pass in the type, tableId or _id params for // makes sure that the user doesn't need to pass in the type, tableId or _id params for
@ -36,23 +36,25 @@ export async function search(ctx: any) {
query, query,
} }
await rowController.search(ctx) await rowController.search(ctx)
ctx.body.data = ctx.body.rows
delete ctx.body.rows
} }
export async function create(ctx: any) { export async function create(ctx: any) {
ctx.request.body = fixRow(ctx.request.body, ctx.params) ctx.request.body = fixRow(ctx.request.body, ctx.params)
await rowController.save(ctx) await rowController.save(ctx)
ctx.body = { row: ctx.body } wrapResponse(ctx)
} }
export async function read(ctx: any) { export async function read(ctx: any) {
await rowController.fetchEnrichedRow(ctx) await rowController.fetchEnrichedRow(ctx)
ctx.body = { row: ctx.body } wrapResponse(ctx)
} }
export async function update(ctx: any) { export async function update(ctx: any) {
ctx.request.body = await addRev(fixRow(ctx.request.body, ctx.params.tableId)) ctx.request.body = await addRev(fixRow(ctx.request.body, ctx.params.tableId))
await rowController.save(ctx) await rowController.save(ctx)
ctx.body = { row: ctx.body } wrapResponse(ctx)
} }
export async function destroy(ctx: any) { export async function destroy(ctx: any) {
@ -63,7 +65,7 @@ export async function destroy(ctx: any) {
await rowController.destroy(ctx) await rowController.destroy(ctx)
// destroy controller doesn't currently return the row as the body, need to adjust this // destroy controller doesn't currently return the row as the body, need to adjust this
// in the public API to be correct // in the public API to be correct
ctx.body = { row: ctx.row } wrapResponse(ctx)
} }
export default { export default {

View File

@ -1,4 +1,4 @@
import { search as stringSearch, addRev } from "./utils" import { search as stringSearch, addRev, wrapResponse } from "./utils"
import { default as controller } from "../table" import { default as controller } from "../table"
import { Table } from "../../../definitions/common" import { Table } from "../../../definitions/common"
@ -15,19 +15,18 @@ function fixTable(table: Table, params: any) {
export async function search(ctx: any) { export async function search(ctx: any) {
const { name } = ctx.request.body const { name } = ctx.request.body
await controller.fetch(ctx) await controller.fetch(ctx)
ctx.body = { ctx.body = stringSearch(ctx.body, name)
tables: stringSearch(ctx.body, name), wrapResponse(ctx)
}
} }
export async function create(ctx: any) { export async function create(ctx: any) {
await controller.save(ctx) await controller.save(ctx)
ctx.body = { table: ctx.body } wrapResponse(ctx)
} }
export async function read(ctx: any) { export async function read(ctx: any) {
await controller.find(ctx) await controller.find(ctx)
ctx.body = { table: ctx.body } wrapResponse(ctx)
} }
export async function update(ctx: any) { export async function update(ctx: any) {
@ -36,12 +35,13 @@ export async function update(ctx: any) {
ctx.params.tableId ctx.params.tableId
) )
await controller.save(ctx) await controller.save(ctx)
ctx.body = { table: ctx.body } wrapResponse(ctx)
} }
export async function destroy(ctx: any) { export async function destroy(ctx: any) {
await controller.destroy(ctx) await controller.destroy(ctx)
ctx.body = { table: ctx.table } ctx.body = ctx.table
wrapResponse(ctx)
} }
export default { export default {

View File

@ -1,10 +1,11 @@
import { import {
allGlobalUsers, allGlobalUsers,
deleteGlobalUser,
readGlobalUser, readGlobalUser,
saveGlobalUser, saveGlobalUser,
deleteGlobalUser,
} from "../../../utilities/workerRequests" } from "../../../utilities/workerRequests"
import { search as stringSearch } from "./utils" import { search as stringSearch, wrapResponse } from "./utils"
const { getProdAppID } = require("@budibase/backend-core/db") const { getProdAppID } = require("@budibase/backend-core/db")
function fixUser(ctx: any) { function fixUser(ctx: any) {
@ -37,29 +38,21 @@ function getUser(ctx: any, userId?: string) {
} }
export async function search(ctx: any) { export async function search(ctx: any) {
try { const { name } = ctx.request.body
const { name } = ctx.request.body const users = await allGlobalUsers(ctx)
const users = await allGlobalUsers(ctx) ctx.body = stringSearch(users, name, "email")
ctx.body = { wrapResponse(ctx)
users: stringSearch(users, name, "email"),
}
} catch (err) {
console.log(err)
}
} }
export async function create(ctx: any) { export async function create(ctx: any) {
const response = await saveGlobalUser(fixUser(ctx)) const response = await saveGlobalUser(fixUser(ctx))
ctx.body = { ctx.body = await getUser(ctx, response._id)
user: await getUser(ctx, response._id), wrapResponse(ctx)
}
} }
export async function read(ctx: any) { export async function read(ctx: any) {
const response = await readGlobalUser(ctx) ctx.body = await readGlobalUser(ctx)
ctx.body = { wrapResponse(ctx)
user: response,
}
} }
export async function update(ctx: any) { export async function update(ctx: any) {
@ -69,17 +62,15 @@ export async function update(ctx: any) {
_rev: user._rev, _rev: user._rev,
} }
const response = await saveGlobalUser(fixUser(ctx)) const response = await saveGlobalUser(fixUser(ctx))
ctx.body = { ctx.body = await getUser(ctx, response._id)
user: await getUser(ctx, response._id), wrapResponse(ctx)
}
} }
export async function destroy(ctx: any) { export async function destroy(ctx: any) {
const user = await getUser(ctx) const user = await getUser(ctx)
await deleteGlobalUser(ctx) await deleteGlobalUser(ctx)
ctx.body = { ctx.body = user
user, wrapResponse(ctx)
}
} }
export default { export default {

View File

@ -36,3 +36,11 @@ export function search(docs: any[], value: any, key = "name") {
} }
return filtered return filtered
} }
export function wrapResponse(ctx: any, map?: (input: any) => object) {
let data = ctx.body
if (map) {
data = map(data)
}
ctx.body = { data }
}

View File

@ -9,7 +9,7 @@ const read = [],
* @openapi * @openapi
* /applications: * /applications:
* post: * post:
* summary: Create a new application. * summary: Create an application
* tags: * tags:
* - applications * - applications
* parameters: * parameters:
@ -41,7 +41,7 @@ write.push(
* @openapi * @openapi
* /applications/{appId}: * /applications/{appId}:
* put: * put:
* summary: Update an existing application by its ID. * summary: Update an application
* tags: * tags:
* - applications * - applications
* parameters: * parameters:
@ -73,7 +73,7 @@ write.push(
* @openapi * @openapi
* /applications/{appId}: * /applications/{appId}:
* delete: * delete:
* summary: Delete an existing application by its ID. * summary: Delete an application
* tags: * tags:
* - applications * - applications
* parameters: * parameters:
@ -95,7 +95,7 @@ write.push(new Endpoint("delete", "/applications/:appId", controller.destroy))
* @openapi * @openapi
* /applications/{appId}: * /applications/{appId}:
* get: * get:
* summary: Retrieve a single application by its ID. * summary: Retrieve an application
* tags: * tags:
* - applications * - applications
* parameters: * parameters:
@ -117,7 +117,8 @@ read.push(new Endpoint("get", "/applications/:appId", controller.read))
* @openapi * @openapi
* /applications/search: * /applications/search:
* post: * post:
* summary: Search for an application based on its app name. * summary: Search for applications
* description: Based on application properties (currently only name) search for applications.
* tags: * tags:
* - applications * - applications
* parameters: * parameters:
@ -136,9 +137,9 @@ read.push(new Endpoint("get", "/applications/:appId", controller.read))
* schema: * schema:
* type: object * type: object
* required: * required:
* - applications * - data
* properties: * properties:
* applications: * data:
* type: array * type: array
* items: * items:
* $ref: '#/components/schemas/application' * $ref: '#/components/schemas/application'

View File

@ -9,8 +9,8 @@ const read = [],
* @openapi * @openapi
* /queries/{queryId}: * /queries/{queryId}:
* post: * post:
* summary: Execute a query and retrieve its response. * summary: Execute a query
* tags: * description: Queries which have been created within a Budibase app can be executed using this,
* - queries * - queries
* parameters: * parameters:
* - $ref: '#/components/parameters/queryId' * - $ref: '#/components/parameters/queryId'
@ -56,7 +56,8 @@ write.push(new Endpoint("post", "/queries/:queryId", controller.execute))
* @openapi * @openapi
* /queries/search: * /queries/search:
* post: * post:
* summary: Search for a query based on its name. * summary: Search for queries
* description: Based on query properties (currently only name) search for queries.
* tags: * tags:
* - queries * - queries
* parameters: * parameters:
@ -75,9 +76,9 @@ write.push(new Endpoint("post", "/queries/:queryId", controller.execute))
* schema: * schema:
* type: object * type: object
* required: * required:
* - queries * - data
* properties: * properties:
* queries: * data:
* type: array * type: array
* items: * items:
* $ref: '#/components/schemas/query' * $ref: '#/components/schemas/query'

View File

@ -9,7 +9,8 @@ const read = [],
* @openapi * @openapi
* /tables/{tableId}/rows: * /tables/{tableId}/rows:
* post: * post:
* summary: Creates a new row within a specified table. * summary: Create a row
* description: Creates a row within the specified table.
* tags: * tags:
* - rows * - rows
* parameters: * parameters:
@ -42,7 +43,8 @@ write.push(new Endpoint("post", "/tables/:tableId/rows", controller.create))
* @openapi * @openapi
* /tables/{tableId}/rows/{rowId}: * /tables/{tableId}/rows/{rowId}:
* put: * put:
* summary: Update a single row within a specified table. * summary: Update a row
* description: Updates a row within the specified table.
* tags: * tags:
* - rows * - rows
* parameters: * parameters:
@ -77,7 +79,8 @@ write.push(
* @openapi * @openapi
* /tables/{tableId}/rows/{rowId}: * /tables/{tableId}/rows/{rowId}:
* delete: * delete:
* summary: Delete a single row from the specified table. * summary: Delete a row
* description: Deletes a row within the specified table.
* tags: * tags:
* - rows * - rows
* parameters: * parameters:
@ -103,7 +106,7 @@ write.push(
* @openapi * @openapi
* /tables/{tableId}/rows/{rowId}: * /tables/{tableId}/rows/{rowId}:
* get: * get:
* summary: Get a single row from the specified table. * summary: Retrieve a row
* description: This gets a single row, it will be enriched with the full related rows, rather than * description: This gets a single row, it will be enriched with the full related rows, rather than
* the squashed "primaryDisplay" format returned by the search endpoint. * the squashed "primaryDisplay" format returned by the search endpoint.
* tags: * tags:
@ -129,7 +132,7 @@ read.push(new Endpoint("get", "/tables/:tableId/rows/:rowId", controller.read))
* @openapi * @openapi
* /tables/{tableId}/rows/search: * /tables/{tableId}/rows/search:
* post: * post:
* summary: Used to search for rows within a table. * summary: Search for rows
* tags: * tags:
* - rows * - rows
* parameters: * parameters:
@ -225,9 +228,9 @@ read.push(new Endpoint("get", "/tables/:tableId/rows/:rowId", controller.read))
* schema: * schema:
* type: object * type: object
* required: * required:
* - rows * - data
* properties: * properties:
* rows: * data:
* description: An array of rows, these will each contain an _id field which can be used * description: An array of rows, these will each contain an _id field which can be used
* to update or delete them. * to update or delete them.
* type: array * type: array

View File

@ -9,7 +9,8 @@ const read = [],
* @openapi * @openapi
* /tables: * /tables:
* post: * post:
* summary: Create a new table. * summary: Create a table
* description: Create a table, this could be internal or external.
* tags: * tags:
* - tables * - tables
* parameters: * parameters:
@ -44,7 +45,8 @@ write.push(
* @openapi * @openapi
* /tables/{tableId}: * /tables/{tableId}:
* put: * put:
* summary: Update the specified table. * summary: Update a table
* description: Update a table, this could be internal or external.
* tags: * tags:
* - tables * - tables
* parameters: * parameters:
@ -79,7 +81,8 @@ write.push(
* @openapi * @openapi
* /tables/{tableId}: * /tables/{tableId}:
* delete: * delete:
* summary: Delete a single table and all of its data. * summary: Delete a table
* description: Delete a table, this could be internal or external.
* tags: * tags:
* - tables * - tables
* parameters: * parameters:
@ -102,7 +105,8 @@ write.push(new Endpoint("delete", "/tables/:tableId", controller.destroy))
* @openapi * @openapi
* /tables/{tableId}: * /tables/{tableId}:
* get: * get:
* summary: Gets a single table by its ID. * summary: Retrieve a table
* description: Lookup a table, this could be internal or external.
* tags: * tags:
* - tables * - tables
* parameters: * parameters:
@ -125,7 +129,9 @@ read.push(new Endpoint("get", "/tables/:tableId", controller.read))
* @openapi * @openapi
* /tables/search: * /tables/search:
* post: * post:
* summary: Search internal and external tables based on their name. * summary: Search for tables
* description: Based on table properties (currently only name) search for tables. This could be
* an internal or an external table.
* tags: * tags:
* - tables * - tables
* parameters: * parameters:
@ -144,9 +150,9 @@ read.push(new Endpoint("get", "/tables/:tableId", controller.read))
* schema: * schema:
* type: object * type: object
* required: * required:
* - tables * - data
* properties: * properties:
* tables: * data:
* type: array * type: array
* items: * items:
* $ref: '#/components/schemas/table' * $ref: '#/components/schemas/table'

View File

@ -125,7 +125,7 @@ describe("check the rows endpoints", () => {
name: "test row", name: "test row",
}) })
expect(res).toSatisfyApiSpec() expect(res).toSatisfyApiSpec()
row = res.body.row row = res.body.data
}) })
it("should allow updating a row", async () => { it("should allow updating a row", async () => {

View File

@ -9,7 +9,7 @@ const read = [],
* @openapi * @openapi
* /users: * /users:
* post: * post:
* summary: Create a new user in the Budibase portal. * summary: Create a user
* tags: * tags:
* - users * - users
* requestBody: * requestBody:
@ -35,7 +35,7 @@ write.push(new Endpoint("post", "/users", controller.create))
* @openapi * @openapi
* /users/{userId}: * /users/{userId}:
* put: * put:
* summary: Update an existing user by their ID. * summary: Update a user
* tags: * tags:
* - users * - users
* parameters: * parameters:
@ -63,7 +63,7 @@ write.push(new Endpoint("put", "/users/:userId", controller.update))
* @openapi * @openapi
* /users/{userId}: * /users/{userId}:
* delete: * delete:
* summary: Delete an existing user by their ID. * summary: Delete a user
* tags: * tags:
* - users * - users
* parameters: * parameters:
@ -85,7 +85,7 @@ write.push(new Endpoint("delete", "/users/:userId", controller.destroy))
* @openapi * @openapi
* /users/{userId}: * /users/{userId}:
* get: * get:
* summary: Retrieve a single user by their ID. * summary: Retrieve a user
* tags: * tags:
* - users * - users
* parameters: * parameters:
@ -107,7 +107,8 @@ read.push(new Endpoint("get", "/users/:userId", controller.read))
* @openapi * @openapi
* /users/search: * /users/search:
* post: * post:
* summary: Search for a user based on their email/username. * summary: Search for users
* description: Based on user properties (currently only name) search for users.
* tags: * tags:
* - users * - users
* requestBody: * requestBody:
@ -124,9 +125,9 @@ read.push(new Endpoint("get", "/users/:userId", controller.read))
* schema: * schema:
* type: object * type: object
* required: * required:
* - users * - data
* properties: * properties:
* users: * data:
* type: array * type: array
* items: * items:
* $ref: '#/components/schemas/user' * $ref: '#/components/schemas/user'

View File