Browse Source

Merge pull request #1724 from nocodb/develop

0.90.1 Pre-Release
pull/1729/head
աɨռɢӄաօռɢ 3 years ago committed by GitHub
parent
commit
50c35dc148
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      .github/workflows/publish-api-docs.yml
  2. 3
      packages/noco-docs/content/en/developer-resources/rest-apis.md
  3. 205
      packages/nocodb-sdk/src/lib/Api.ts
  4. 14
      packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts
  5. 24
      packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectUpgraderV2_0090000.ts
  6. 264
      scripts/sdk/swagger.json

18
.github/workflows/publish-api-docs.yml

@ -5,6 +5,8 @@ on:
branches: [ master ]
paths:
- "scripts/sdk/swagger.json"
release:
types: [ published ]
jobs:
copy-file:
@ -13,7 +15,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Pushes generated output
- name: Pushes swagger file to src
uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658
env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }}
@ -23,4 +25,16 @@ jobs:
destination_folder: 'src'
user_email: 'oof1lab@gmail.com'
user_name: 'o1lab'
commit_message: 'Autorelease from github.com/nocodb/nc'
commit_message: 'Autorelease from github.com/nocodb/nocodb'
- name: Pushes swagger file to meta-src
uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658
env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }}
with:
source_file: 'scripts/sdk/swagger.json'
destination_repo: 'nocodb/noco-apis-doc'
destination_folder: 'meta-src'
user_email: 'oof1lab@gmail.com'
user_name: 'o1lab'
commit_message: 'Autorelease from github.com/nocodb/nocodb'

3
packages/noco-docs/content/en/developer-resources/rest-apis.md

@ -51,12 +51,13 @@ Here's the overview of all APIs. For the details, please check out <a href="http
| Data | Get | dbTableRow | read | /api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} |
| Data | Patch | dbTableRow | update | /api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} |
| Data | Delete| dbTableRow | modelDelete | /api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} |
| Data | Get | dbTableRow | count | /api/v1/db/data/{orgs}/{projectName}/{tableName}/count |
| Data | Get | dbViewRow | list | /api/v1/db/data/{orgs}/{projectName}/{tableName}/view/{viewName} |
| Data | Post | dbViewRow | create | /api/v1/db/data/{orgs}/{projectName}/{tableName}/view/{viewName} |
| Data | Get | dbViewRow | read | /api/v1/db/data/{orgs}/{projectName}/{tableName}/view/{viewName}/{rowId} |
| Data | Patch | dbViewRow | update | /api/v1/db/data/{orgs}/{projectName}/{tableName}/view/{viewName}/{rowId} |
| Data | Delete| dbViewRow | delete | /api/v1/db/data/{orgs}/{projectName}/{tableName}/view/{viewName}/{rowId} |
| Data | Get | dbViewRow | list | /api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/count |
| Data | Get | dbViewRow | count | /api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/count |
### Meta APIs

205
packages/nocodb-sdk/src/lib/Api.ts

@ -851,7 +851,7 @@ export class Api<
*
* @tags Auth
* @name Me
* @summary User Info
* @summary User info
* @request GET:/api/v1/db/auth/user/me
* @response `200` `UserInfoType` OK
*/
@ -869,7 +869,7 @@ export class Api<
*
* @tags Auth
* @name PasswordForgot
* @summary Password Forgot
* @summary Password forgot
* @request POST:/api/v1/db/auth/password/forgot
* @response `200` `void` OK
* @response `401` `void` Unauthorized
@ -888,7 +888,7 @@ export class Api<
*
* @tags Auth
* @name PasswordChange
* @summary Password Change
* @summary Password change
* @request POST:/api/v1/db/auth/password/change
* @response `200` `{ msg?: string }` OK
* @response `400` `{ msg?: string }` Bad request
@ -911,7 +911,7 @@ export class Api<
*
* @tags Auth
* @name PasswordResetTokenValidate
* @summary Reset Token Verify
* @summary Reset token verify
* @request POST:/api/v1/db/auth/token/validate/{token}
* @response `200` `void` OK
*/
@ -927,7 +927,7 @@ export class Api<
*
* @tags Auth
* @name EmailValidate
* @summary Verify Email
* @summary Verify email
* @request POST:/api/v1/db/auth/email/validate/{token}
* @response `200` `void` OK
*/
@ -943,7 +943,7 @@ export class Api<
*
* @tags Auth
* @name PasswordReset
* @summary Password Reset
* @summary Password reset
* @request POST:/api/v1/db/auth/password/reset/{token}
* @response `200` `void` OK
*/
@ -965,7 +965,7 @@ export class Api<
*
* @tags Auth
* @name TokenRefresh
* @summary Refresh Token
* @summary Refresh token
* @request POST:/api/v1/db/auth/token/refresh
* @response `200` `void` OK
*/
@ -981,7 +981,7 @@ export class Api<
*
* @tags Auth
* @name ProjectUserList
* @summary Project Users
* @summary Project users
* @request GET:/api/v1/db/meta/projects/{projectId}/users
* @response `200` `{ users?: { list: (UserType)[], pageInfo: PaginatedType } }` OK
*/
@ -1024,7 +1024,7 @@ export class Api<
*
* @tags Auth
* @name ProjectUserUpdate
* @summary Project User Update
* @summary Project user update
* @request PATCH:/api/v1/db/meta/projects/{projectId}/users/{userId}
* @response `200` `any` OK
*/
@ -1048,7 +1048,7 @@ export class Api<
*
* @tags Auth
* @name ProjectUserRemove
* @summary Project User Remove
* @summary Project user remove
* @request DELETE:/api/v1/db/meta/projects/{projectId}/users/{userId}
* @response `200` `any` OK
*/
@ -1070,7 +1070,7 @@ export class Api<
*
* @tags Project
* @name MetaGet
* @summary Project Info
* @summary Project info
* @request GET:/api/v1/db/meta/projects/{projectId}/info
* @response `200` `{ Node?: string, Arch?: string, Platform?: string, Docker?: boolean, Database?: string, ProjectOnRootDB?: string, RootDB?: string, PackageVersion?: string }` OK
*/
@ -1143,6 +1143,7 @@ export class Api<
*
* @tags Project
* @name List
* @summary Project list
* @request GET:/api/v1/db/meta/projects/
* @response `201` `ProjectListType`
*/
@ -1162,6 +1163,7 @@ export class Api<
*
* @tags Project
* @name Create
* @summary Project create
* @request POST:/api/v1/db/meta/projects/
* @response `200` `ProjectType` OK
*/
@ -1183,6 +1185,7 @@ export class Api<
*
* @tags Project
* @name Read
* @summary Project read
* @request GET:/api/v1/db/meta/projects/{projectId}
* @response `200` `object` OK
*/
@ -1199,6 +1202,7 @@ export class Api<
*
* @tags Project
* @name Delete
* @summary Project delete
* @request DELETE:/api/v1/db/meta/projects/{projectId}
* @response `200` `void` OK
*/
@ -1340,7 +1344,7 @@ export class Api<
/**
* No description
*
* @tags DB Table
* @tags DB table
* @name Create
* @request POST:/api/v1/db/meta/projects/{projectId}/tables
* @response `200` `TableType` OK
@ -1362,7 +1366,7 @@ export class Api<
/**
* No description
*
* @tags DB Table
* @tags DB table
* @name List
* @request GET:/api/v1/db/meta/projects/{projectId}/tables
* @response `200` `TableListType`
@ -1387,7 +1391,7 @@ export class Api<
/**
* No description
*
* @tags DB Table
* @tags DB table
* @name Read
* @request GET:/api/v1/db/meta/tables/{tableId}
* @response `200` `TableInfoType` OK
@ -1403,7 +1407,7 @@ export class Api<
/**
* No description
*
* @tags DB Table
* @tags DB table
* @name Update
* @request PATCH:/api/v1/db/meta/tables/{tableId}
* @response `200` `any` OK
@ -1425,7 +1429,7 @@ export class Api<
/**
* No description
*
* @tags DB Table
* @tags DB table
* @name Delete
* @request DELETE:/api/v1/db/meta/tables/{tableId}
* @response `200` `void` OK
@ -1440,7 +1444,7 @@ export class Api<
/**
* No description
*
* @tags DB Table
* @tags DB table
* @name Reorder
* @request POST:/api/v1/db/meta/tables/{tableId}/reorder
* @response `200` `void` OK
@ -1462,7 +1466,7 @@ export class Api<
/**
* No description
*
* @tags DB Table column
* @tags DB table column
* @name Create
* @summary Column create
* @request POST:/api/v1/db/meta/tables/{tableId}/columns
@ -1484,7 +1488,7 @@ export class Api<
/**
* No description
*
* @tags DB Table column
* @tags DB table column
* @name Update
* @summary Column Update
* @request PATCH:/api/v1/db/meta/columns/{columnId}
@ -1507,7 +1511,7 @@ export class Api<
/**
* No description
*
* @tags DB Table column
* @tags DB table column
* @name Delete
* @request DELETE:/api/v1/db/meta/columns/{columnId}
* @response `200` `void` OK
@ -1522,7 +1526,7 @@ export class Api<
/**
* No description
*
* @tags DB Table column
* @tags DB table column
* @name PrimaryColumnSet
* @request POST:/api/v1/db/meta/columns/{columnId}/primary
* @response `200` `void` OK
@ -1538,7 +1542,7 @@ export class Api<
/**
* No description
*
* @tags DB View
* @tags DB view
* @name List
* @request GET:/api/v1/db/meta/tables/{tableId}/views
* @response `200` `ViewListType`
@ -1553,7 +1557,7 @@ export class Api<
/**
* No description
*
* @tags DB View
* @tags DB view
* @name Update
* @request PATCH:/api/v1/db/meta/views/{viewId}
* @response `200` `void` OK
@ -1579,7 +1583,7 @@ export class Api<
/**
* No description
*
* @tags DB View
* @tags DB view
* @name Delete
* @request DELETE:/api/v1/db/meta/views/{viewId}
* @response `200` `void` OK
@ -1594,7 +1598,7 @@ export class Api<
/**
* No description
*
* @tags DB View
* @tags DB view
* @name ShowAllColumn
* @request POST:/api/v1/db/meta/views/{viewId}/show-all
* @response `200` `void` OK
@ -1614,7 +1618,7 @@ export class Api<
/**
* No description
*
* @tags DB View
* @tags DB view
* @name HideAllColumn
* @request POST:/api/v1/db/meta/views/{viewId}/hide-all
* @response `200` `void` OK
@ -1634,7 +1638,7 @@ export class Api<
/**
* No description
*
* @tags DB View
* @tags DB view
* @name GridCreate
* @request POST:/api/v1/db/meta/tables/{tableId}/grids
* @response `200` `GridType` OK
@ -1652,7 +1656,7 @@ export class Api<
/**
* No description
*
* @tags DB View
* @tags DB view
* @name FormCreate
* @request POST:/api/v1/db/meta/tables/{tableId}/forms
* @response `200` `FormType` OK
@ -1670,7 +1674,7 @@ export class Api<
/**
* No description
*
* @tags DB View
* @tags DB view
* @name FormUpdate
* @request PATCH:/api/v1/db/meta/forms/{formId}
* @response `200` `void` OK
@ -1687,7 +1691,7 @@ export class Api<
/**
* No description
*
* @tags DB View
* @tags DB view
* @name FormRead
* @request GET:/api/v1/db/meta/forms/{formId}
* @response `200` `FormType` OK
@ -1703,7 +1707,7 @@ export class Api<
/**
* No description
*
* @tags DB View
* @tags DB view
* @name FormColumnUpdate
* @request PATCH:/api/v1/db/meta/form-columns/{formViewColumnId}
* @response `200` `any` OK
@ -1725,7 +1729,7 @@ export class Api<
/**
* No description
*
* @tags DB View
* @tags DB view
* @name GridColumnsList
* @request GET:/api/v1/db/meta/grids/{gridId}/grid-columns
* @response `200` `(GridColumnType)[]` OK
@ -1741,7 +1745,7 @@ export class Api<
/**
* No description
*
* @tags DB View
* @tags DB view
* @name GridColumnUpdate
* @request PATCH:/api/v1/db/meta/grid-columns/{columnId}
* @response `200` `any` OK
@ -1763,7 +1767,7 @@ export class Api<
/**
* No description
*
* @tags DB View
* @tags DB view
* @name GalleryCreate
* @request POST:/api/v1/db/meta/tables/{tableId}/galleries
* @response `200` `object` OK
@ -1785,7 +1789,7 @@ export class Api<
/**
* No description
*
* @tags DB View
* @tags DB view
* @name GalleryUpdate
* @request PATCH:/api/v1/db/meta/galleries/{galleryId}
* @response `200` `void` OK
@ -1806,7 +1810,7 @@ export class Api<
/**
* No description
*
* @tags DB View
* @tags DB view
* @name GalleryRead
* @request GET:/api/v1/db/meta/galleries/{galleryId}
* @response `200` `GalleryType` OK
@ -1823,7 +1827,7 @@ export class Api<
/**
* No description
*
* @tags DB View Share
* @tags DB view share
* @name List
* @summary Shared view list
* @request GET:/api/v1/db/meta/tables/{tableId}/share
@ -1840,7 +1844,7 @@ export class Api<
/**
* No description
*
* @tags DB View Share
* @tags DB view share
* @name Create
* @request POST:/api/v1/db/meta/views/{viewId}/share
* @response `200` `{ uuid?: string }` OK
@ -1856,7 +1860,7 @@ export class Api<
/**
* No description
*
* @tags DB View Share
* @tags DB view share
* @name Update
* @request PATCH:/api/v1/db/meta/views/{viewId}/share
* @response `200` `SharedViewType` OK
@ -1878,7 +1882,7 @@ export class Api<
/**
* No description
*
* @tags DB View Share
* @tags DB view share
* @name Delete
* @request DELETE:/api/v1/db/meta/views/{viewId}/share
* @response `200` `void` OK
@ -1894,7 +1898,7 @@ export class Api<
/**
* No description
*
* @tags DB View Column
* @tags DB view column
* @name List
* @request GET:/api/v1/db/meta/views/{viewId}/columns
*/
@ -1908,7 +1912,7 @@ export class Api<
/**
* No description
*
* @tags DB View Column
* @tags DB view column
* @name Create
* @request POST:/api/v1/db/meta/views/{viewId}/columns
* @response `200` `void` OK
@ -1925,7 +1929,7 @@ export class Api<
/**
* No description
*
* @tags DB View Column
* @tags DB view column
* @name Update
* @request PATCH:/api/v1/db/meta/views/{viewId}/columns/{columnId}
* @response `200` `void` OK
@ -1948,7 +1952,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Sort
* @tags DB table sort
* @name List
* @request GET:/api/v1/db/meta/views/{viewId}/sorts
* @response `200` `{ uuid?: string, url?: string }` OK
@ -1964,7 +1968,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Sort
* @tags DB table sort
* @name Create
* @request POST:/api/v1/db/meta/views/{viewId}/sorts
* @response `200` `void` OK
@ -1981,7 +1985,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Sort
* @tags DB table sort
* @name Get
* @request GET:/api/v1/db/meta/sorts/{sortId}
* @response `200` `SortType` OK
@ -1997,7 +2001,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Sort
* @tags DB table sort
* @name Update
* @request PATCH:/api/v1/db/meta/sorts/{sortId}
* @response `200` `void` OK
@ -2014,7 +2018,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Sort
* @tags DB table sort
* @name Delete
* @request DELETE:/api/v1/db/meta/sorts/{sortId}
* @response `200` `void` OK
@ -2030,7 +2034,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Filter
* @tags DB table filter
* @name Read
* @request GET:/api/v1/db/meta/views/{viewId}/filters
* @response `200` `FilterListType`
@ -2045,7 +2049,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Filter
* @tags DB table filter
* @name Create
* @request POST:/api/v1/db/meta/views/{viewId}/filters
* @response `200` `void` OK
@ -2062,7 +2066,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Filter
* @tags DB table filter
* @name Get
* @request GET:/api/v1/db/meta/filters/{filterId}
* @response `200` `FilterType` OK
@ -2078,7 +2082,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Filter
* @tags DB table filter
* @name Update
* @request PATCH:/api/v1/db/meta/filters/{filterId}
* @response `200` `void` OK
@ -2095,7 +2099,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Filter
* @tags DB table filter
* @name Delete
* @request DELETE:/api/v1/db/meta/filters/{filterId}
* @response `200` `void` OK
@ -2110,7 +2114,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Filter
* @tags DB table filter
* @name ChildrenRead
* @request GET:/api/v1/db/meta/filters/{filterGroupId}/children
* @response `200` `FilterType` OK
@ -2127,7 +2131,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Webhook Filter
* @tags DB table webhook filter
* @name Read
* @request GET:/api/v1/db/meta/hooks/{hookId}/filters
* @response `200` `FilterListType`
@ -2142,7 +2146,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Webhook Filter
* @tags DB table webhook filter
* @name Create
* @request POST:/api/v1/db/meta/hooks/{hookId}/filters
* @response `200` `void` OK
@ -2160,8 +2164,9 @@ export class Api<
/**
* No description
*
* @tags DB Table Row
* @tags DB table row
* @name List
* @summary Table row list
* @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}
* @response `200` `any` OK
*/
@ -2183,8 +2188,9 @@ export class Api<
/**
* No description
*
* @tags DB Table Row
* @tags DB table row
* @name Create
* @summary Table row create
* @request POST:/api/v1/db/data/{orgs}/{projectName}/{tableName}
* @response `200` `any` OK
*/
@ -2207,8 +2213,33 @@ export class Api<
/**
* No description
*
* @tags DB Table Row
* @tags DB table row
* @name Count
* @summary table rows count
* @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/count
* @response `200` `any` OK
*/
count: (
orgs: string,
projectName: string,
tableName: string,
query?: { where?: string; nested?: any },
params: RequestParams = {}
) =>
this.request<any, any>({
path: `/api/v1/db/data/${orgs}/${projectName}/${tableName}/count`,
method: 'GET',
query: query,
format: 'json',
...params,
}),
/**
* No description
*
* @tags DB table row
* @name Read
* @summary Table row read
* @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId}
* @response `201` `any` Created
*/
@ -2229,8 +2260,9 @@ export class Api<
/**
* No description
*
* @tags DB Table Row
* @tags DB table row
* @name Update
* @summary Table row update
* @request PATCH:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId}
* @response `200` `any` OK
*/
@ -2254,12 +2286,13 @@ export class Api<
/**
* No description
*
* @tags DB Table Row
* @name ModelDelete
* @tags DB table row
* @name Delete
* @summary Table row delete
* @request DELETE:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId}
* @response `200` `void` OK
*/
modelDelete: (
delete: (
orgs: string,
projectName: string,
tableName: string,
@ -2275,7 +2308,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Row
* @tags DB table row
* @name BulkCreate
* @summary Bulk insert table rows
* @request POST:/api/v1/db/data/bulk/{orgs}/{projectName}/{tableName}
@ -2300,7 +2333,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Row
* @tags DB table row
* @name BulkUpdate
* @summary Bulk update all table rows by IDs
* @request PATCH:/api/v1/db/data/bulk/{orgs}/{projectName}/{tableName}
@ -2325,7 +2358,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Row
* @tags DB table row
* @name BulkDelete
* @summary Bulk delete all table rows by IDs
* @request DELETE:/api/v1/db/data/bulk/{orgs}/{projectName}/{tableName}
@ -2350,7 +2383,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Row
* @tags DB table row
* @name BulkUpdateAll
* @summary Bulk update all table rows with conditions
* @request PATCH:/api/v1/db/data/bulk/{orgs}/{projectName}/{tableName}/all
@ -2375,7 +2408,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Row
* @tags DB table row
* @name BulkDeleteAll
* @summary Bulk delete all table rows with conditions
* @request DELETE:/api/v1/db/data/bulk/{orgs}/{projectName}/{tableName}/all
@ -2402,6 +2435,7 @@ export class Api<
*
* @tags DB table row
* @name CsvExport
* @summary Tablerows export
* @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/export/{type}
* @response `200` `any` OK
*/
@ -2424,6 +2458,7 @@ export class Api<
*
* @tags DB table row
* @name NestedList
* @summary Nested relations row list
* @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId}/{relationType}/{columnName}
* @response `200` `any` OK
*/
@ -2450,6 +2485,7 @@ export class Api<
*
* @tags DB table row
* @name NestedAdd
* @summary Nested relations row add
* @request POST:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId}/{relationType}/{columnName}/{refRowId}
* @response `200` `any` OK
*/
@ -2477,6 +2513,7 @@ export class Api<
*
* @tags DB table row
* @name NestedRemove
* @summary Nested relations row remove
* @request DELETE:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId}/{relationType}/{columnName}/{refRowId}
* @response `200` `any` OK
*/
@ -2502,6 +2539,7 @@ export class Api<
*
* @tags DB table row
* @name NestedChildrenExcludedList
* @summary Referenced tables rows excluding current records children/parent
* @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId}/{relationType}/{columnName}/exclude
* @response `200` `any` OK
*/
@ -2527,8 +2565,9 @@ export class Api<
/**
* No description
*
* @tags DB View Row
* @tags DB view row
* @name List
* @summary Table view row list
* @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}
* @response `200` `any` OK
*/
@ -2551,8 +2590,9 @@ export class Api<
/**
* No description
*
* @tags DB View Row
* @tags DB view row
* @name Create
* @summary Table view row create
* @request POST:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}
* @response `200` `any` OK
*/
@ -2576,8 +2616,9 @@ export class Api<
/**
* No description
*
* @tags DB View Row
* @tags DB view row
* @name Count
* @summary Table view rows count
* @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/count
* @response `200` `any` OK
*/
@ -2600,8 +2641,9 @@ export class Api<
/**
* No description
*
* @tags DB View Row
* @tags DB view row
* @name Read
* @summary Table view row read
* @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/{rowId}
* @response `201` `any` Created
*/
@ -2623,8 +2665,9 @@ export class Api<
/**
* No description
*
* @tags DB View Row
* @tags DB view row
* @name Update
* @summary Table view row update
* @request PATCH:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/{rowId}
* @response `200` `any` OK
*/
@ -2649,8 +2692,9 @@ export class Api<
/**
* No description
*
* @tags DB View Row
* @tags DB view row
* @name Delete
* @summary Table view row delete
* @request DELETE:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/{rowId}
* @response `200` `void` OK
*/
@ -2673,6 +2717,7 @@ export class Api<
*
* @tags DB view row
* @name Export
* @summary Table view rows export
* @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/export/{type}
* @response `200` `any` OK
*/
@ -3005,7 +3050,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Webhook
* @tags DB table webhook
* @name List
* @request GET:/api/v1/db/meta/tables/{tableId}/hooks
* @response `200` `{ list: (HookType)[], pageInfo: PaginatedType }` OK
@ -3021,7 +3066,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Webhook
* @tags DB table webhook
* @name Create
* @request POST:/api/v1/db/meta/tables/{tableId}/hooks
* @response `200` `AuditType` OK
@ -3039,7 +3084,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Webhook
* @tags DB table webhook
* @name Test
* @request POST:/api/v1/db/meta/tables/{tableId}/hooks/test
* @response `200` `any` OK
@ -3061,7 +3106,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Webhook
* @tags DB table webhook
* @name SamplePayloadGet
* @request GET:/api/v1/db/meta/tables/{tableId}/hooks/samplePayload/{operation}
* @response `200` `{ plugins?: { list: (PluginType)[], pageInfo: PaginatedType } }` OK
@ -3084,7 +3129,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Webhook
* @tags DB table webhook
* @name Update
* @request PATCH:/api/v1/db/meta/hooks/{hookId}
* @response `200` `HookType` OK
@ -3102,7 +3147,7 @@ export class Api<
/**
* No description
*
* @tags DB Table Webhook
* @tags DB table webhook
* @name Delete
* @request DELETE:/api/v1/db/meta/hooks/{hookId}
* @response `200` `void` OK

14
packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts

@ -134,6 +134,16 @@ router.get(
'/api/v1/db/data/:orgs/:projectName/:tableName',
ncMetaAclMw(dataList, 'dataList')
);
router.get(
'/api/v1/db/data/:orgs/:projectName/:tableName/count',
ncMetaAclMw(dataCount, 'dataCount')
);
router.get(
'/api/v1/db/data/:orgs/:projectName/:tableName/views/:viewName/count',
ncMetaAclMw(dataCount, 'dataCount')
);
router.get(
'/api/v1/db/data/:orgs/:projectName/:tableName/:rowId',
ncMetaAclMw(dataRead, 'dataRead')
@ -157,10 +167,6 @@ router.get(
'/api/v1/db/data/:orgs/:projectName/:tableName/views/:viewName',
ncMetaAclMw(dataList, 'dataList')
);
router.get(
'/api/v1/db/data/:orgs/:projectName/:tableName/views/:viewName/count',
ncMetaAclMw(dataCount, 'dataCount')
);
router.post(
'/api/v1/db/data/:orgs/:projectName/:tableName',

24
packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectUpgraderV2_0090000.ts

@ -45,7 +45,7 @@ export default async function(ctx: NcUpgraderCtx) {
}
await migrateUsers(ncMeta);
await migrateProjects(ncMeta);
const projectsObj = await migrateProjects(ncMeta);
await migrateProjectUsers(ncMeta);
const migrationCtx = await migrateProjectModels(ncMeta);
@ -54,7 +54,7 @@ export default async function(ctx: NcUpgraderCtx) {
await migrateSharedBase(ncMeta);
await migratePlugins(ncMeta);
await migrateWebhooks(migrationCtx, ncMeta);
await migrateAutitLog(migrationCtx, ncMeta);
await migrateAutitLog(migrationCtx, projectsObj, ncMeta);
}
async function migrateUsers(ncMeta = Noco.ncMeta) {
@ -67,9 +67,11 @@ async function migrateUsers(ncMeta = Noco.ncMeta) {
return userList;
}
async function migrateProjects(ncMeta = Noco.ncMeta) {
async function migrateProjects(
ncMeta = Noco.ncMeta
): Promise<{ [projectId: string]: Project }> {
const projects = await ncMeta.projectList();
const projectList: Project[] = [];
const projectsObj: { [projectId: string]: Project } = {};
for (const project of projects) {
const projectConfig = JSON.parse(project.config);
@ -94,9 +96,10 @@ async function migrateProjects(ncMeta = Noco.ncMeta) {
created_at: project.created_at,
updated_at: project.updated_at
};
projectList.push(await Project.createProject(projectBody, ncMeta));
const p = await Project.createProject(projectBody, ncMeta);
projectsObj[p.id] = p;
}
return projectsObj;
}
async function migrateProjectUsers(ncMeta = Noco.ncMeta) {
@ -1239,7 +1242,11 @@ async function migrateWebhooks(ctx: MigrateCtxV1, ncMeta: any) {
}
}
async function migrateAutitLog(ctx: MigrateCtxV1, ncMeta: any) {
async function migrateAutitLog(
ctx: MigrateCtxV1,
projectsObj: { [projectId: string]: Project },
ncMeta: any
) {
const audits: Array<{
user: string;
ip: string;
@ -1257,6 +1264,9 @@ async function migrateAutitLog(ctx: MigrateCtxV1, ncMeta: any) {
}> = await ncMeta.metaList(null, null, 'nc_audit');
for (const audit of audits) {
// skip deleted projects audit
if (!(audit.project_id in projectsObj)) continue;
const insertObj: any = {
user: audit.user,
ip: audit.ip,

264
scripts/sdk/swagger.json

@ -170,7 +170,7 @@
"/api/v1/db/auth/user/me": {
"parameters": [],
"get": {
"summary": "User Info",
"summary": "User info",
"operationId": "auth-me",
"responses": {
"200": {
@ -216,7 +216,7 @@
},
"/api/v1/db/auth/password/forgot": {
"post": {
"summary": "Password Forgot",
"summary": "Password forgot",
"operationId": "auth-password-forgot",
"responses": {
"200": {
@ -250,7 +250,7 @@
},
"/api/v1/db/auth/password/change": {
"post": {
"summary": "Password Change",
"summary": "Password change",
"operationId": "auth-password-change",
"responses": {
"200": {
@ -338,7 +338,7 @@
},
"/api/v1/db/auth/token/validate/{token}": {
"post": {
"summary": "Reset Token Verify",
"summary": "Reset token verify",
"operationId": "auth-password-reset-token-validate",
"responses": {
"200": {
@ -363,7 +363,7 @@
},
"/api/v1/db/auth/email/validate/{token}": {
"post": {
"summary": "Verify Email",
"summary": "Verify email",
"operationId": "auth-email-validate",
"responses": {
"200": {
@ -388,7 +388,7 @@
},
"/api/v1/db/auth/password/reset/{token}": {
"post": {
"summary": "Password Reset",
"summary": "Password reset",
"operationId": "auth-password-reset",
"responses": {
"200": {
@ -427,7 +427,7 @@
},
"/api/v1/db/auth/token/refresh": {
"post": {
"summary": "Refresh Token",
"summary": "Refresh token",
"operationId": "auth-token-refresh",
"responses": {
"200": {
@ -443,7 +443,7 @@
},
"/api/v1/db/meta/projects/{projectId}/users": {
"get": {
"summary": "Project Users",
"summary": "Project users",
"operationId": "auth-project-user-list",
"responses": {
"200": {
@ -531,7 +531,7 @@
}
],
"get": {
"summary": "Project Info",
"summary": "Project info",
"operationId": "project-meta-get",
"responses": {
"200": {
@ -596,7 +596,7 @@
}
],
"patch": {
"summary": "Project User Update",
"summary": "Project user update",
"operationId": "auth-project-user-update",
"responses": {
"200": {
@ -620,7 +620,7 @@
]
},
"delete": {
"summary": "Project User Remove",
"summary": "Project user remove",
"operationId": "auth-project-user-remove",
"responses": {
"200": {
@ -706,7 +706,7 @@
"/api/v1/db/meta/projects/": {
"parameters": [],
"get": {
"summary": "",
"summary": "Project list",
"operationId": "project-list",
"responses": {
"201": {
@ -750,7 +750,7 @@
]
},
"post": {
"summary": "",
"summary": "Project create",
"operationId": "project-create",
"responses": {
"200": {
@ -803,7 +803,7 @@
}
],
"get": {
"summary": "",
"summary": "Project read",
"operationId": "project-read",
"description": "Read project details",
"parameters": [
@ -834,7 +834,7 @@
}
},
"delete": {
"summary": "",
"summary": "Project delete",
"operationId": "project-delete",
"responses": {
"200": {
@ -1018,7 +1018,7 @@
}
},
"tags": [
"DB Table"
"DB table"
]
},
"get": {
@ -1067,7 +1067,7 @@
}
],
"tags": [
"DB Table"
"DB table"
]
}
},
@ -1188,7 +1188,7 @@
}
},
"tags": [
"DB Table"
"DB table"
]
},
"patch": {
@ -1205,7 +1205,7 @@
}
},
"tags": [
"DB Table"
"DB table"
],
"requestBody": {
"content": {
@ -1231,7 +1231,7 @@
}
},
"tags": [
"DB Table"
"DB table"
],
"description": ""
}
@ -1270,7 +1270,7 @@
}
},
"tags": [
"DB Table"
"DB table"
]
}
},
@ -1303,7 +1303,7 @@
}
},
"tags": [
"DB Table column"
"DB table column"
]
}
},
@ -1343,7 +1343,7 @@
}
},
"tags": [
"DB Table column"
"DB table column"
]
},
"delete": {
@ -1355,7 +1355,7 @@
}
},
"tags": [
"DB Table column"
"DB table column"
]
}
},
@ -1379,7 +1379,7 @@
}
},
"tags": [
"DB Table column"
"DB table column"
]
}
},
@ -1403,7 +1403,7 @@
}
},
"tags": [
"DB View"
"DB view"
],
"description": ""
}
@ -1456,7 +1456,7 @@
}
},
"tags": [
"DB View"
"DB view"
]
},
"delete": {
@ -1468,7 +1468,7 @@
}
},
"tags": [
"DB View"
"DB view"
]
}
},
@ -1492,7 +1492,7 @@
}
},
"tags": [
"DB View"
"DB view"
],
"description": "",
"parameters": [
@ -1526,7 +1526,7 @@
}
},
"tags": [
"DB View"
"DB view"
],
"parameters": [
{
@ -1569,7 +1569,7 @@
},
"description": "",
"tags": [
"DB View Share"
"DB view share"
]
}
},
@ -1605,7 +1605,7 @@
}
},
"tags": [
"DB View Share"
"DB view share"
]
},
"patch": {
@ -1639,7 +1639,7 @@
"description": ""
},
"tags": [
"DB View Share"
"DB view share"
]
},
"delete": {
@ -1652,7 +1652,7 @@
},
"description": "",
"tags": [
"DB View Share"
"DB view share"
]
}
},
@ -1672,7 +1672,7 @@
"operationId": "db-view-column-list",
"responses": {},
"tags": [
"DB View Column"
"DB view column"
]
},
"post": {
@ -1684,7 +1684,7 @@
}
},
"tags": [
"DB View Column"
"DB view column"
],
"requestBody": {
"content": {
@ -1723,7 +1723,7 @@
}
},
"tags": [
"DB View Column"
"DB view column"
],
"requestBody": {
"content": {
@ -1769,7 +1769,7 @@
}
},
"tags": [
"DB Table Sort"
"DB table sort"
]
},
"post": {
@ -1781,7 +1781,7 @@
}
},
"tags": [
"DB Table Sort"
"DB table sort"
],
"requestBody": {
"content": {
@ -1821,7 +1821,7 @@
}
},
"tags": [
"DB Table Sort"
"DB table sort"
]
},
"patch": {
@ -1833,7 +1833,7 @@
}
},
"tags": [
"DB Table Sort"
"DB table sort"
],
"requestBody": {
"content": {
@ -1854,7 +1854,7 @@
}
},
"tags": [
"DB Table Sort"
"DB table sort"
]
}
},
@ -1878,7 +1878,7 @@
}
},
"tags": [
"DB Table Filter"
"DB table filter"
]
},
"post": {
@ -1890,7 +1890,7 @@
}
},
"tags": [
"DB Table Filter"
"DB table filter"
],
"requestBody": {
"content": {
@ -1923,7 +1923,7 @@
}
},
"tags": [
"DB Table Webhook Filter"
"DB table webhook filter"
]
},
"post": {
@ -1935,7 +1935,7 @@
}
},
"tags": [
"DB Table Webhook Filter"
"DB table webhook filter"
],
"requestBody": {
"content": {
@ -1975,7 +1975,7 @@
}
},
"tags": [
"DB Table Filter"
"DB table filter"
]
},
"patch": {
@ -1987,7 +1987,7 @@
}
},
"tags": [
"DB Table Filter"
"DB table filter"
],
"requestBody": {
"content": {
@ -2008,7 +2008,7 @@
}
},
"tags": [
"DB Table Filter"
"DB table filter"
]
}
},
@ -2039,7 +2039,7 @@
}
},
"tags": [
"DB Table Filter"
"DB table filter"
]
}
},
@ -2070,7 +2070,7 @@
}
},
"tags": [
"DB View"
"DB view"
],
"requestBody": {
"content": {
@ -2111,7 +2111,7 @@
},
"description": "",
"tags": [
"DB View"
"DB view"
],
"requestBody": {
"content": {
@ -2144,7 +2144,7 @@
}
},
"tags": [
"DB View"
"DB view"
],
"requestBody": {
"content": {
@ -2172,7 +2172,7 @@
}
},
"tags": [
"DB View"
"DB view"
]
}
},
@ -2203,7 +2203,7 @@
}
},
"tags": [
"DB View"
"DB view"
],
"requestBody": {
"content": {
@ -2246,7 +2246,7 @@
}
},
"tags": [
"DB View"
"DB view"
]
}
},
@ -2275,7 +2275,7 @@
}
},
"tags": [
"DB View"
"DB view"
],
"requestBody": {
"content": {
@ -2316,7 +2316,7 @@
}
},
"tags": [
"DB View"
"DB view"
],
"requestBody": {
"content": {
@ -2349,7 +2349,7 @@
}
},
"tags": [
"DB View"
"DB view"
],
"requestBody": {
"content": {
@ -2377,7 +2377,7 @@
}
},
"tags": [
"DB View"
"DB view"
]
}
},
@ -2456,11 +2456,11 @@
}
],
"get": {
"summary": "",
"summary": "Table row list",
"operationId": "db-table-row-list",
"description": "",
"tags": [
"DB Table Row"
"DB table row"
],
"parameters": [
{
@ -2497,7 +2497,7 @@
}
},
"post": {
"summary": "",
"summary": "Table row create",
"operationId": "db-table-row-create",
"responses": {
"200": {
@ -2510,7 +2510,7 @@
}
},
"tags": [
"DB Table Row"
"DB table row"
],
"requestBody": {
"content": {
@ -2521,6 +2521,67 @@
}
}
},
"/api/v1/db/data/{orgs}/{projectName}/{tableName}/count": {
"parameters": [
{
"schema": {
"type": "string"
},
"name": "orgs",
"in": "path",
"required": true
},
{
"schema": {
"type": "string"
},
"name": "projectName",
"in": "path",
"required": true
},
{
"schema": {
"type": "string"
},
"name": "tableName",
"in": "path",
"required": true
}
],
"get": {
"summary": "table rows count",
"operationId": "db-table-row-count",
"description": "",
"tags": [
"DB table row"
],
"parameters": [
{
"schema": {
"type": "string"
},
"in": "query",
"name": "where"
},
{
"schema": {},
"in": "query",
"name": "nested",
"description": "Query params for nested data"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {}
}
}
}
}
}
},
"/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}": {
"parameters": [
{
@ -2557,11 +2618,11 @@
}
],
"get": {
"summary": "",
"summary": "Table view row list",
"operationId": "db-view-row-list",
"description": "",
"tags": [
"DB View Row"
"DB view row"
],
"parameters": [
{
@ -2604,7 +2665,7 @@
}
},
"post": {
"summary": "",
"summary": "Table view row create",
"operationId": "db-view-row-create",
"responses": {
"200": {
@ -2617,7 +2678,7 @@
}
},
"tags": [
"DB View Row"
"DB view row"
],
"requestBody": {
"content": {
@ -2664,11 +2725,11 @@
}
],
"get": {
"summary": "",
"summary": "Table view rows count",
"operationId": "db-view-row-count",
"description": "",
"tags": [
"DB View Row"
"DB view row"
],
"parameters": [
{
@ -2741,7 +2802,7 @@
}
],
"get": {
"summary": "",
"summary": "Table view row read",
"operationId": "db-view-row-read",
"responses": {
"201": {
@ -2755,11 +2816,11 @@
},
"description": "",
"tags": [
"DB View Row"
"DB view row"
]
},
"patch": {
"summary": "",
"summary": "Table view row update",
"operationId": "db-view-row-update",
"responses": {
"200": {
@ -2772,7 +2833,7 @@
}
},
"tags": [
"DB View Row"
"DB view row"
],
"requestBody": {
"content": {
@ -2783,7 +2844,7 @@
}
},
"delete": {
"summary": "",
"summary": "Table view row delete",
"operationId": "db-view-row-delete",
"responses": {
"200": {
@ -2791,7 +2852,7 @@
}
},
"tags": [
"DB View Row"
"DB view row"
],
"description": ""
}
@ -2832,7 +2893,7 @@
}
],
"get": {
"summary": "",
"summary": "Table row read",
"operationId": "db-table-row-read",
"responses": {
"201": {
@ -2846,11 +2907,11 @@
},
"description": "",
"tags": [
"DB Table Row"
"DB table row"
]
},
"patch": {
"summary": "",
"summary": "Table row update",
"operationId": "db-table-row-update",
"responses": {
"200": {
@ -2863,7 +2924,7 @@
}
},
"tags": [
"DB Table Row"
"DB table row"
],
"requestBody": {
"content": {
@ -2874,15 +2935,15 @@
}
},
"delete": {
"summary": "",
"operationId": "db-table-row-model-delete",
"summary": "Table row delete",
"operationId": "db-table-row-delete",
"responses": {
"200": {
"description": "OK"
}
},
"tags": [
"DB Table Row"
"DB table row"
],
"description": ""
}
@ -2928,7 +2989,7 @@
}
},
"tags": [
"DB Table Row"
"DB table row"
],
"requestBody": {
"content": {
@ -2952,7 +3013,7 @@
}
},
"tags": [
"DB Table Row"
"DB table row"
],
"requestBody": {
"content": {
@ -2976,7 +3037,7 @@
}
},
"tags": [
"DB Table Row"
"DB table row"
],
"requestBody": {
"content": {
@ -3028,7 +3089,7 @@
}
},
"tags": [
"DB Table Row"
"DB table row"
],
"requestBody": {
"content": {
@ -3052,7 +3113,7 @@
}
},
"tags": [
"DB Table Row"
"DB table row"
],
"requestBody": {
"content": {
@ -3111,7 +3172,7 @@
}
],
"get": {
"summary": "",
"summary": "Table view rows export",
"operationId": "db-view-row-export",
"description": "CSV or Excel export",
"tags": [
@ -3178,7 +3239,7 @@
}
],
"get": {
"summary": "",
"summary": "Tablerows export",
"operationId": "db-table-row-csv-export",
"description": "CSV or Excel export",
"tags": [
@ -3261,7 +3322,7 @@
}
],
"get": {
"summary": "",
"summary": "Nested relations row list",
"operationId": "db-table-row-nested-list",
"responses": {
"200": {
@ -3358,7 +3419,7 @@
}
],
"post": {
"summary": "",
"summary": "Nested relations row add",
"operationId": "db-table-row-nested-add",
"responses": {
"200": {
@ -3388,10 +3449,11 @@
"in": "query",
"name": "offset"
}
]
],
"description": ""
},
"delete": {
"summary": "",
"summary": "Nested relations row remove",
"operationId": "db-table-row-nested-remove",
"responses": {
"200": {
@ -3464,7 +3526,7 @@
}
],
"get": {
"summary": "",
"summary": "Referenced tables rows excluding current records children/parent",
"operationId": "db-table-row-nested-children-excluded-list",
"responses": {
"200": {
@ -4136,7 +4198,7 @@
"description": "",
"parameters": [],
"tags": [
"DB Table Webhook"
"DB table webhook"
]
},
"post": {
@ -4165,7 +4227,7 @@
}
},
"tags": [
"DB Table Webhook"
"DB table webhook"
]
}
},
@ -4194,7 +4256,7 @@
}
},
"tags": [
"DB Table Webhook"
"DB table webhook"
],
"requestBody": {
"content": {
@ -4283,7 +4345,7 @@
"description": "",
"parameters": [],
"tags": [
"DB Table Webhook"
"DB table webhook"
]
}
},
@ -4314,7 +4376,7 @@
}
},
"tags": [
"DB Table Webhook"
"DB table webhook"
],
"requestBody": {
"content": {
@ -4335,7 +4397,7 @@
}
},
"tags": [
"DB Table Webhook"
"DB table webhook"
]
}
},

Loading…
Cancel
Save