Browse Source

refactor(nocodb): view create request type and response

pull/5269/head
Wing-Kam Wong 2 years ago
parent
commit
9609ea2d16
  1. 361
      packages/nocodb/src/schema/swagger.json

361
packages/nocodb/src/schema/swagger.json

@ -5837,7 +5837,29 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/Grid" "$ref": "#/components/schemas/View"
},
"examples": {
"Example 1": {
"value": {
"id": "vw_o50jiw9v2txktv",
"base_id": "ds_a95vextjl510z7",
"project_id": "p_slkm6i3v31q4bc",
"fk_model_id": "md_8hr3xndx8umuce",
"title": "Grid-1",
"type": 3,
"is_default": null,
"show_system_fields": null,
"lock_type": "collaborative",
"uuid": null,
"password": null,
"show": true,
"order": 2,
"created_at": "2023-03-13T07:29:16.610Z",
"updated_at": "2023-03-13T07:29:16.610Z",
"meta": {}
}
}
} }
} }
} }
@ -5851,15 +5873,16 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/GridReq" "$ref": "#/components/schemas/ViewCreateReq"
}, },
"examples": { "examples": {
"Example 1": { "Example 1": {
"value": { "value": {
"lock_type": "collaborative", "title": "My Grid View",
"order": 1, "type": 3,
"row_height": 1, "copy_from_id": null,
"title": "My Grid" "fk_grp_col_id": null,
"fk_geo_data_col_id": null
} }
} }
} }
@ -5897,7 +5920,29 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/Form" "$ref": "#/components/schemas/View"
},
"examples": {
"Example 1": {
"value": {
"id": "vw_a830n4bmwk8wlp",
"base_id": "ds_a95vextjl510z7",
"project_id": "p_slkm6i3v31q4bc",
"fk_model_id": "md_8hr3xndx8umuce",
"title": "Form-1",
"type": 1,
"is_default": null,
"show_system_fields": null,
"lock_type": "collaborative",
"uuid": null,
"password": null,
"show": true,
"order": 4,
"created_at": "2023-03-13T07:29:19.957Z",
"updated_at": "2023-03-13T07:29:19.957Z",
"meta": {}
}
}
} }
} }
} }
@ -5912,24 +5957,16 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/FormReq" "$ref": "#/components/schemas/ViewCreateReq"
}, },
"examples": { "examples": {
"Example 1": { "Example 1": {
"value": { "value": {
"banner_image_url": null, "title": "My Form View",
"email": "user@example.com", "type": 1,
"heading": "My Form", "copy_from_id": null,
"lock_type": "collaborative", "fk_grp_col_id": null,
"logo_url": null, "fk_geo_data_col_id": null
"meta": null,
"redirect_after_secs": null,
"redirect_url": null,
"show_blank_form": 0,
"subheading": "My Form Subheading",
"submit_another_form": 0,
"success_msg": "Thank you for the submission.",
"title": "Form View 1"
} }
} }
} }
@ -6311,7 +6348,14 @@
"description": "OK", "description": "OK",
"content": { "content": {
"application/json": { "application/json": {
"schema": {} "schema": {
"type": "number"
},
"examples": {
"Example 1": {
"value": 1
}
}
} }
} }
}, },
@ -6360,7 +6404,7 @@
} }
], ],
"post": { "post": {
"summary": "Gallery View", "summary": "Create Gallery View",
"operationId": "db-view-gallery-create", "operationId": "db-view-gallery-create",
"responses": { "responses": {
"200": { "200": {
@ -6368,8 +6412,29 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"type": "object", "$ref": "#/components/schemas/View"
"properties": {} },
"examples": {
"Example 1": {
"value": {
"id": "vw_qp94qfnvffgk5f",
"base_id": "ds_a95vextjl510z7",
"project_id": "p_slkm6i3v31q4bc",
"fk_model_id": "md_8hr3xndx8umuce",
"title": "Gallery-1",
"type": 2,
"is_default": null,
"show_system_fields": null,
"lock_type": "collaborative",
"uuid": null,
"password": null,
"show": true,
"order": 3,
"created_at": "2023-03-13T07:29:18.707Z",
"updated_at": "2023-03-13T07:29:18.707Z",
"meta": {}
}
}
} }
} }
} }
@ -6383,7 +6448,18 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/GalleryReq" "$ref": "#/components/schemas/ViewCreateReq"
},
"examples": {
"Example 1": {
"value": {
"title": "My Gallery View",
"type": 2,
"copy_from_id": null,
"fk_grp_col_id": null,
"fk_geo_data_col_id": null
}
}
} }
} }
} }
@ -6438,7 +6514,15 @@
"schema": { "schema": {
"$ref": "#/components/schemas/GalleryReq" "$ref": "#/components/schemas/GalleryReq"
}, },
"examples": {} "examples": {
"Example 1": {
"value": {
"fk_cover_image_col_id": "cl_g0a89q9xdry3lu",
"lock_type": "collaborative",
"title": "My Gallery"
}
}
}
} }
} }
}, },
@ -6499,8 +6583,29 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"type": "object", "$ref": "#/components/schemas/View"
"properties": {} },
"examples": {
"Example 1": {
"value": {
"id": "vw_569sqsrp2vuff4",
"base_id": "ds_a95vextjl510z7",
"project_id": "p_slkm6i3v31q4bc",
"fk_model_id": "md_8hr3xndx8umuce",
"title": "Kanban-1",
"type": 4,
"is_default": null,
"show_system_fields": null,
"lock_type": "collaborative",
"uuid": null,
"password": null,
"show": true,
"order": 5,
"created_at": "2023-03-13T07:29:21.387Z",
"updated_at": "2023-03-13T07:29:21.387Z",
"meta": {}
}
}
} }
} }
} }
@ -6514,13 +6619,16 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/KanbanReq" "$ref": "#/components/schemas/ViewCreateReq"
}, },
"examples": { "examples": {
"Example 1": { "Example 1": {
"value": { "value": {
"fk_grp_col_id": "cl_phvuuwjrzcdo0g", "title": "My Kanban View",
"title": "My Kanban" "type": 4,
"copy_from_id": null,
"fk_grp_col_id": "cl_g0a89q9xdry3lu",
"fk_geo_data_col_id": null
} }
} }
} }
@ -6578,7 +6686,13 @@
"schema": { "schema": {
"$ref": "#/components/schemas/KanbanUpdateReq" "$ref": "#/components/schemas/KanbanUpdateReq"
}, },
"examples": {} "examples": {
"Example 1": {
"value": {
"fk_grp_col_id": "cl_g0a89q9xdry3lu"
}
}
}
} }
} }
}, },
@ -6639,8 +6753,29 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"type": "object", "$ref": "#/components/schemas/View"
"properties": {} },
"examples": {
"Example 1": {
"value": {
"base_id": "ds_g4ccx6e77h1dmi",
"created_at": "2023-03-02 17:46:31",
"fk_model_id": "md_mhs9z4r2ak98x0",
"id": "vw_lg052cnc1c26kf",
"is_default": 1,
"lock_type": "collaborative",
"meta": {},
"order": 1,
"password": null,
"project_id": "p_xm3thidrblw4n7",
"show": 1,
"show_system_fields": null,
"title": "Sheet-1",
"type": 3,
"updated_at": "2023-03-02 17:46:31",
"uuid": null
}
}
} }
} }
} }
@ -6654,30 +6789,16 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/Map" "$ref": "#/components/schemas/ViewCreateReq"
}, },
"examples": { "examples": {
"Example 1": { "Example 1": {
"value": { "value": {
"base_id": "ds_g4ccx6e77h1dmi", "title": "My Map View",
"columns": [ "type": 5,
{ "copy_from_id": null,
"base_id": "ds_g4ccx6e77h1dmi", "fk_grp_col_id": null,
"fk_column_id": "cl_8iw2o4ejzvdyna", "fk_geo_data_col_id": "cl_uu1meolj00tlrq"
"fk_view_id": "vw_qjt7klod1p9kyv",
"id": "nc_46xcacqn4rc9xf",
"order": 1,
"project_id": "p_xm3thidrblw4n7",
"show": 1
}
],
"fk_geo_data_col_id": "cl_8iw2o4ejzvdyna",
"fk_view_id": "vw_qjt7klod1p9kyv",
"meta": {},
"order": 0,
"project_id": "p_xm3thidrblw4n7",
"show": true,
"title": "My Map"
} }
} }
} }
@ -14499,30 +14620,26 @@
"description": "Model for Gallery Request", "description": "Model for Gallery Request",
"examples": [ "examples": [
{ {
"cover_image": "string", "fk_cover_image_col_id": "cl_g0a89q9xdry3lu",
"cover_image_idx": 0,
"fk_cover_image_col_id": "string",
"lock_type": "collaborative", "lock_type": "collaborative",
"next_enabled": true,
"prev_enabled": true,
"restrict_number": "string",
"restrict_size": "string",
"restrict_types": "string",
"title": "My Gallery" "title": "My Gallery"
} }
], ],
"title": "Gallery Request Model",
"type": "object",
"properties": { "properties": {
"cover_image": { "cover_image": {
"type": "string" "type": "string",
"description": "Not in use currently"
}, },
"cover_image_idx": { "cover_image_idx": {
"minimum": 0, "minimum": 0,
"type": "integer" "type": "integer",
"description": "Not in use currently"
}, },
"fk_cover_image_col_id": { "fk_cover_image_col_id": {
"description": "The id of the column that contains the cover image", "$ref": "#/components/schemas/StringOrNull",
"maxLength": 20, "description": "The id of the column that contains the cover image"
"type": "string"
}, },
"lock_type": { "lock_type": {
"description": "The lock type of gallery", "description": "The lock type of gallery",
@ -14530,19 +14647,24 @@
"type": "string" "type": "string"
}, },
"next_enabled": { "next_enabled": {
"$ref": "#/components/schemas/Bool" "$ref": "#/components/schemas/Bool",
"description": "Not in use currently"
}, },
"prev_enabled": { "prev_enabled": {
"$ref": "#/components/schemas/Bool" "$ref": "#/components/schemas/Bool",
"description": "Not in use currently"
}, },
"restrict_number": { "restrict_number": {
"type": "string" "type": "string",
"description": "Not in use currently"
}, },
"restrict_size": { "restrict_size": {
"type": "string" "type": "string",
"description": "Not in use currently"
}, },
"restrict_types": { "restrict_types": {
"type": "string" "type": "string",
"description": "Not in use currently"
}, },
"title": { "title": {
"description": "The title of the gallery", "description": "The title of the gallery",
@ -14552,9 +14674,7 @@
"type": "string" "type": "string"
} }
}, },
"required": ["title"], "required": ["title"]
"title": "Gallery Request Model",
"type": "object"
}, },
"GeoLocation": { "GeoLocation": {
"description": "Model for Geo Location", "description": "Model for Geo Location",
@ -15412,16 +15532,17 @@
"description": "Model for Kanban Update Request", "description": "Model for Kanban Update Request",
"examples": [ "examples": [
{ {
"fk_grp_col_id": "string" "fk_grp_col_id": "cl_g0a89q9xdry3lu"
} }
], ],
"title": "Kanban Update Request Model",
"type": "object",
"properties": { "properties": {
"fk_grp_col_id": { "fk_grp_col_id": {
"$ref": "#/components/schemas/StringOrNull" "$ref": "#/components/schemas/StringOrNull",
"description": "Foreign Key to Grouping Field Column"
} }
}, }
"title": "Kanban Update Request Model",
"type": "object"
}, },
"LicenseReq": { "LicenseReq": {
"description": "Model for Kanban Request", "description": "Model for Kanban Request",
@ -18212,8 +18333,80 @@
}, },
"required": ["list", "pageInfo"] "required": ["list", "pageInfo"]
}, },
"ViewReq": { "ViewCreateReq": {
"description": "Model for View Request", "type": "object",
"x-stoplight": {
"id": "36edbe4aa5d24"
},
"title": "ViewCreateReq",
"description": "Model for View Create Request",
"examples": [
{
"title": "My Grid View",
"type": 3,
"copy_from_id": null,
"fk_grp_col_id": null,
"fk_geo_data_col_id": null
},
{
"title": "My Gallery View",
"type": 2,
"copy_from_id": null,
"fk_grp_col_id": null,
"fk_geo_data_col_id": null
},
{
"title": "My Form View",
"type": 1,
"copy_from_id": null,
"fk_grp_col_id": null,
"fk_geo_data_col_id": null
},
{
"title": "My Kanban View",
"type": 4,
"copy_from_id": null,
"fk_grp_col_id": "cl_g0a89q9xdry3lu",
"fk_geo_data_col_id": null
},
{
"title": "My Map View",
"type": 5,
"copy_from_id": null,
"fk_grp_col_id": null,
"fk_geo_data_col_id": "cl_uu1meolj00tlrq"
}
],
"properties": {
"title": {
"type": "string",
"description": "View Title",
"example": "My View"
},
"type": {
"type": "number",
"description": "View Type"
},
"copy_from_id": {
"$ref": "#/components/schemas/StringOrNull",
"description": "ID of view to be copied from. Used in Copy View."
},
"fk_grp_col_id": {
"$ref": "#/components/schemas/StringOrNull",
"description": "Foreign Key to Grouping Column. Used in creating Kanban View."
},
"fk_geo_data_col_id": {
"$ref": "#/components/schemas/StringOrNull",
"description": "Foreign Key to Geo Data Column. Used in creating Map View."
}
},
"required": ["title"]
},
"ViewUpdateReq": {
"description": "Model for View Update Request",
"x-stoplight": {
"id": "1f9fe53ec13a2"
},
"examples": [ "examples": [
{ {
"title": "Grid View 1", "title": "Grid View 1",
@ -18225,7 +18418,7 @@
"show_system_fields": 0 "show_system_fields": 0
} }
], ],
"title": "View Request Model", "title": "View Update Request Model",
"type": "object", "type": "object",
"properties": { "properties": {
"title": { "title": {

Loading…
Cancel
Save