Browse Source

Merge pull request #1697 from nocodb/fix/ltar-bugs

Fix - LinkToAnotherRecord related bug fixes
pull/1700/head
Raju Udava 3 years ago committed by GitHub
parent
commit
8c24cf2fb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nc-gui/components/project/spreadsheet/components/virtualCell/belongsToCell.vue
  2. 27
      packages/nc-gui/components/project/spreadsheet/components/virtualCell/hasManyCell.vue
  3. 18
      packages/nc-gui/components/project/spreadsheet/components/virtualCell/manyToManyCell.vue
  4. 20
      packages/nc-gui/plugins/tele.js
  5. 12
      packages/nc-gui/store/users.js
  6. 42
      packages/nocodb-sdk/src/lib/Api.ts
  7. 14
      packages/nocodb/package-lock.json
  8. 4
      packages/nocodb/package.json
  9. 15
      packages/nocodb/src/lib/noco/meta/api/index.ts
  10. 3
      packages/nocodb/src/lib/utils/projectAcl.ts
  11. 206
      scripts/sdk/swagger.json

2
packages/nc-gui/components/project/spreadsheet/components/virtualCell/belongsToCell.vue

@ -281,7 +281,7 @@ export default {
const id = this.meta.columns.filter(c => c.pk).map(c => this.row[c.title]).join('___') const id = this.meta.columns.filter(c => c.pk).map(c => this.row[c.title]).join('___')
// todo: audit // todo: audit
await this.$api.dbTableRow.nestedDelete( await this.$api.dbTableRow.nestedRemove(
'noco', 'noco',
this.projectName, this.projectName,
this.meta.title, this.meta.title,

27
packages/nc-gui/components/project/spreadsheet/components/virtualCell/hasManyCell.vue

@ -342,11 +342,13 @@ export default {
return return
} }
const id = this.childMeta.columns.filter(c => c.pk).map(c => child[c.title]).join('___') const id = this.childMeta.columns.filter(c => c.pk).map(c => child[c.title]).join('___')
await this.$api.data.nestedDelete( await this.$api.dbTableRow.nestedRemove(
this.meta.id, 'noco',
this.projectName,
this.meta.title,
this.parentId, this.parentId,
this.column.id, RelationTypes.HAS_MANY,
'hm', this.column.title,
id id
) )
@ -440,15 +442,18 @@ export default {
// eslint-disable-next-line no-cond-assign // eslint-disable-next-line no-cond-assign
while (child = this.localState.pop()) { while (child = this.localState.pop()) {
if (row) { if (row) {
// todo: use common method
const pid = this.meta.columns.filter(c => c.pk).map(c => row[c.title]).join('___') const pid = this.meta.columns.filter(c => c.pk).map(c => row[c.title]).join('___')
const id = this.childMeta.columns.filter(c => c.pk).map(c => child[c.title]).join('___') const id = this.childMeta.columns.filter(c => c.pk).map(c => child[c.title]).join('___')
const title = this.childForeignKey
await this.childApi.update(id, { await this.$api.dbTableRow.nestedAdd(
[title]: parseIfInteger(pid) 'noco',
}, { this.projectName,
[title]: child[this.childForeignKey] this.meta.title,
}) pid,
'hm',
this.column.title,
id
)
} else { } else {
await this.addChildToParent(child) await this.addChildToParent(child)
} }

18
packages/nc-gui/components/project/spreadsheet/components/virtualCell/manyToManyCell.vue

@ -318,7 +318,7 @@ export default {
const cid = this.childMeta.columns.filter(c => c.pk).map(c => child[c.title]).join('___') const cid = this.childMeta.columns.filter(c => c.pk).map(c => child[c.title]).join('___')
const pid = this.meta.columns.filter(c => c.pk).map(c => this.row[c.title]).join('___') const pid = this.meta.columns.filter(c => c.pk).map(c => this.row[c.title]).join('___')
await this.$api.dbTableRow.nestedDelete( await this.$api.dbTableRow.nestedRemove(
'noco', 'noco',
this.projectName, this.projectName,
this.meta.title, this.meta.title,
@ -461,16 +461,18 @@ export default {
// eslint-disable-next-line no-cond-assign // eslint-disable-next-line no-cond-assign
while (child = this.localState.pop()) { while (child = this.localState.pop()) {
if (row) { if (row) {
// todo: use common method
const cid = this.childMeta.columns.filter(c => c.pk).map(c => child[c.title]).join('___') const cid = this.childMeta.columns.filter(c => c.pk).map(c => child[c.title]).join('___')
const pid = this.meta.columns.filter(c => c.pk).map(c => row[c.title]).join('___') const pid = this.meta.columns.filter(c => c.pk).map(c => row[c.title]).join('___')
const vcidCol = this.assocMeta.columns.find(c => c.id === this.column.colOptions.fk_mm_parent_column_id).title await this.$api.dbTableRow.nestedAdd(
const vpidCol = this.assocMeta.columns.find(c => c.id === this.column.colOptions.fk_mm_child_column_id).title 'noco',
await this.assocApi.insert({ this.projectName,
[vcidCol]: parseIfInteger(cid), this.meta.title,
[vpidCol]: parseIfInteger(pid) pid,
}) 'mm',
this.column.title,
cid
)
} else { } else {
await this.addChildToParent(child) await this.addChildToParent(child)
} }

20
packages/nc-gui/plugins/tele.js

@ -23,7 +23,8 @@ export default function({
socket.disconnect() socket.disconnect()
socket = null socket = null
}) })
} catch { } } catch {
}
} }
app.router.onReady(() => { app.router.onReady(() => {
@ -32,13 +33,11 @@ export default function({
return return
} }
socket.emit('page', { socket.emit('page', {
id: store.state.users.user && store.state.users.user.id,
path: to.matched[0].path + (to.query && to.query.type ? `?type=${to.query.type}` : '') path: to.matched[0].path + (to.query && to.query.type ? `?type=${to.query.type}` : '')
}) })
}) })
if (socket) { if (socket) {
socket.emit('page', { socket.emit('page', {
id: store.state.users.user && store.state.users.user.id,
path: route.matched[0].path + (route.query && route.query.type ? `?type=${route.query.type}` : '') path: route.matched[0].path + (route.query && route.query.type ? `?type=${route.query.type}` : '')
}) })
} }
@ -49,9 +48,8 @@ export default function({
if (socket) { if (socket) {
socket.emit('event', { socket.emit('event', {
event: evt, event: evt,
id: store.state.users.user && store.state.users.user.id,
...(data || {}), ...(data || {}),
$current_url: gatPath(app) path: gatPath(app)
}) })
} }
} }
@ -61,14 +59,14 @@ export default function({
function getListener(binding) { function getListener(binding) {
return function(e) { return function(e) {
if (!socket) { return } if (!socket) {
const cat = window.location.hash.replace(/\d+\/(?=dashboard)/, '') return
}
const event = binding.value && binding.value[0] const event = binding.value && binding.value[0]
const data = binding.value && binding.value[1] const data = binding.value && binding.value[1]
const extra = binding.value && binding.value.slice(2) const extra = binding.value && binding.value.slice(2)
tele.emit(event, tele.emit(event,
{ {
cat,
data, data,
extra extra
}) })
@ -87,14 +85,16 @@ export default function({
store.watch(state => state.project.projectInfo && state.project.projectInfo.teleEnabled && state.users.token, (token) => { store.watch(state => state.project.projectInfo && state.project.projectInfo.teleEnabled && state.users.token, (token) => {
if (token) { if (token) {
init(token).then(() => {}) init(token).then(() => {
})
} else if (socket) { } else if (socket) {
socket.disconnect() socket.disconnect()
socket = null socket = null
} }
}) })
if (store.state.project.projectInfo && store.state.project.projectInfo.teleEnabled && store.state.users.token) { if (store.state.project.projectInfo && store.state.project.projectInfo.teleEnabled && store.state.users.token) {
init(store.state.users.token).then(() => {}) init(store.state.users.token).then(() => {
})
} }
} }

12
packages/nc-gui/store/users.js

@ -153,7 +153,7 @@ export const actions = {
setInterval(async() => { setInterval(async() => {
if (getters.GtrUser) { if (getters.GtrUser) {
try { try {
const res = await this.$api.auth.me() // this.$axios.get('/user/me') const res = await this.$api.auth.me()
if (res === null || !res.email) { if (res === null || !res.email) {
commit('MutSetUser', null) commit('MutSetUser', null)
} else { } else {
@ -239,7 +239,6 @@ export const actions = {
// console.log('in action signin'); // console.log('in action signin');
let err = null let err = null
try { try {
const userPromise = await this.$api.auth.signin(data) const userPromise = await this.$api.auth.signin(data)
commit('MutSetToken', userPromise.token) commit('MutSetToken', userPromise.token)
@ -272,7 +271,7 @@ export const actions = {
async ActGetUserDetails({ commit, state }) { async ActGetUserDetails({ commit, state }) {
try { try {
const user = await this.$api.auth.me({ // await this.$axios.get('/user/me', { const user = await this.$api.auth.me({}, {
headers: { headers: {
'xc-auth': state.token 'xc-auth': state.token
} }
@ -285,11 +284,10 @@ export const actions = {
async ActGetProjectUserDetails({ commit, state }, projectId) { async ActGetProjectUserDetails({ commit, state }, projectId) {
try { try {
const user = await this.$api.auth.me({ // '/user/me?project_id=' + projectId, { const user = await this.$api.auth.me({ project_id: projectId }, {
headers: { headers: {
'xc-auth': state.token 'xc-auth': state.token
}, }
query: { project_id: projectId }
}) })
commit('MutProjectRole', user && user.roles) commit('MutProjectRole', user && user.roles)
} catch (e) { } catch (e) {
@ -299,7 +297,7 @@ export const actions = {
async ActGetBaseUserDetails({ commit, state }, sharedBaseId) { async ActGetBaseUserDetails({ commit, state }, sharedBaseId) {
try { try {
try { try {
const user = await this.$api.auth.me({ // '/user/me', { const user = await this.$api.auth.me({}, {
headers: { headers: {
'xc-shared-base-id': sharedBaseId 'xc-shared-base-id': sharedBaseId
} }

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

@ -620,6 +620,15 @@ export type ColumnReqType =
} }
| { uidt?: string; formula_raw?: string; formula?: string; title?: string }; | { uidt?: string; formula_raw?: string; formula?: string; title?: string };
export interface UserInfoType {
id?: string;
email?: string;
email_verified?: string;
firstname?: string;
lastname?: string;
roles?: any;
}
import axios, { AxiosInstance, AxiosRequestConfig, ResponseType } from 'axios'; import axios, { AxiosInstance, AxiosRequestConfig, ResponseType } from 'axios';
export type QueryParamsType = Record<string | number, any>; export type QueryParamsType = Record<string | number, any>;
@ -798,7 +807,7 @@ export class Api<
* @summary Signup * @summary Signup
* @request POST:/api/v1/db/auth/user/signup * @request POST:/api/v1/db/auth/user/signup
* @response `200` `{ token?: string }` OK * @response `200` `{ token?: string }` OK
* @response `400` `void` Bad Request * @response `400` `{ msg?: string }` Bad Request
* @response `401` `void` Unauthorized * @response `401` `void` Unauthorized
* @response `403` `void` Forbidden * @response `403` `void` Forbidden
*/ */
@ -806,7 +815,7 @@ export class Api<
data: { email?: string; password?: string }, data: { email?: string; password?: string },
params: RequestParams = {} params: RequestParams = {}
) => ) =>
this.request<{ token?: string }, void>({ this.request<{ token?: string }, { msg?: string } | void>({
path: `/api/v1/db/auth/user/signup`, path: `/api/v1/db/auth/user/signup`,
method: 'POST', method: 'POST',
body: data, body: data,
@ -822,12 +831,13 @@ export class Api<
* @summary Signin * @summary Signin
* @request POST:/api/v1/db/auth/user/signin * @request POST:/api/v1/db/auth/user/signin
* @response `200` `{ token?: string }` OK * @response `200` `{ token?: string }` OK
* @response `400` `{ msg?: string }` Bad Request
*/ */
signin: ( signin: (
data: { email: string; password: string }, data: { email: string; password: string },
params: RequestParams = {} params: RequestParams = {}
) => ) =>
this.request<{ token?: string }, any>({ this.request<{ token?: string }, { msg?: string }>({
path: `/api/v1/db/auth/user/signin`, path: `/api/v1/db/auth/user/signin`,
method: 'POST', method: 'POST',
body: data, body: data,
@ -843,12 +853,13 @@ export class Api<
* @name Me * @name Me
* @summary User Info * @summary User Info
* @request GET:/api/v1/db/auth/user/me * @request GET:/api/v1/db/auth/user/me
* @response `200` `UserType` OK * @response `200` `UserInfoType` OK
*/ */
me: (params: RequestParams = {}) => me: (query?: { project_id?: string }, params: RequestParams = {}) =>
this.request<UserType, any>({ this.request<UserInfoType, any>({
path: `/api/v1/db/auth/user/me`, path: `/api/v1/db/auth/user/me`,
method: 'GET', method: 'GET',
query: query,
format: 'json', format: 'json',
...params, ...params,
}), }),
@ -861,9 +872,10 @@ export class Api<
* @summary Password Forgot * @summary Password Forgot
* @request POST:/api/v1/db/auth/password/forgot * @request POST:/api/v1/db/auth/password/forgot
* @response `200` `void` OK * @response `200` `void` OK
* @response `401` `void` Unauthorized
*/ */
passwordForgot: (data: { email?: string }, params: RequestParams = {}) => passwordForgot: (data: { email?: string }, params: RequestParams = {}) =>
this.request<void, any>({ this.request<void, void>({
path: `/api/v1/db/auth/password/forgot`, path: `/api/v1/db/auth/password/forgot`,
method: 'POST', method: 'POST',
body: data, body: data,
@ -878,21 +890,19 @@ export class Api<
* @name PasswordChange * @name PasswordChange
* @summary Password Change * @summary Password Change
* @request POST:/api/v1/db/auth/password/change * @request POST:/api/v1/db/auth/password/change
* @response `200` `void` OK * @response `200` `{ msg?: string }` OK
* @response `400` `{ msg?: string }` Bad request
*/ */
passwordChange: ( passwordChange: (
data: { data: { currentPassword?: string; newPassword?: string },
currentPassword?: string;
newPassword?: string;
verifyPassword?: string;
},
params: RequestParams = {} params: RequestParams = {}
) => ) =>
this.request<void, any>({ this.request<{ msg?: string }, { msg?: string }>({
path: `/api/v1/db/auth/password/change`, path: `/api/v1/db/auth/password/change`,
method: 'POST', method: 'POST',
body: data, body: data,
type: ContentType.Json, type: ContentType.Json,
format: 'json',
...params, ...params,
}), }),
@ -2466,11 +2476,11 @@ export class Api<
* No description * No description
* *
* @tags DB table row * @tags DB table row
* @name NestedDelete * @name NestedRemove
* @request DELETE:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId}/{relationType}/{columnName}/{refRowId} * @request DELETE:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId}/{relationType}/{columnName}/{refRowId}
* @response `200` `any` OK * @response `200` `any` OK
*/ */
nestedDelete: ( nestedRemove: (
orgs: string, orgs: string,
projectName: string, projectName: string,
tableName: string, tableName: string,

14
packages/nocodb/package-lock.json generated

@ -68,7 +68,7 @@
"mysql2": "^2.2.5", "mysql2": "^2.2.5",
"nanoid": "^3.1.20", "nanoid": "^3.1.20",
"nc-common": "0.0.6", "nc-common": "0.0.6",
"nc-help": "^0.2.31", "nc-help": "^0.2.44",
"nc-lib-gui": "0.84.15", "nc-lib-gui": "0.84.15",
"nc-plugin": "^0.1.1", "nc-plugin": "^0.1.1",
"ncp": "^2.0.0", "ncp": "^2.0.0",
@ -16034,9 +16034,9 @@
} }
}, },
"node_modules/nc-help": { "node_modules/nc-help": {
"version": "0.2.42", "version": "0.2.44",
"resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.2.42.tgz", "resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.2.44.tgz",
"integrity": "sha512-qRQ9ijK3K5HfEp4LUJekk/EerNAa4YgM+jRtNLL1RMv+4IPAMO6NsXvdxNOW6h3robdY+xcWuaNqekXqGn1FXA==", "integrity": "sha512-AAcMIh2Nhzm7iFQSaTOu27W4KU5eOAbPrGQLND+VAmdQurXACuHMCN6y7IZR3cPZMM1H7GQ0JmxVYzZ+S49MzQ==",
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"boxen": "^4.2.0", "boxen": "^4.2.0",
@ -37473,9 +37473,9 @@
"integrity": "sha512-3AryS9uwa5NfISLxMciUonrH7YfXp+nlahB9T7girXIsLQrmwX4MdnuKs32akduCOGpKmjTJSWmATULbuMkbfw==" "integrity": "sha512-3AryS9uwa5NfISLxMciUonrH7YfXp+nlahB9T7girXIsLQrmwX4MdnuKs32akduCOGpKmjTJSWmATULbuMkbfw=="
}, },
"nc-help": { "nc-help": {
"version": "0.2.42", "version": "0.2.44",
"resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.2.42.tgz", "resolved": "https://registry.npmjs.org/nc-help/-/nc-help-0.2.44.tgz",
"integrity": "sha512-qRQ9ijK3K5HfEp4LUJekk/EerNAa4YgM+jRtNLL1RMv+4IPAMO6NsXvdxNOW6h3robdY+xcWuaNqekXqGn1FXA==", "integrity": "sha512-AAcMIh2Nhzm7iFQSaTOu27W4KU5eOAbPrGQLND+VAmdQurXACuHMCN6y7IZR3cPZMM1H7GQ0JmxVYzZ+S49MzQ==",
"requires": { "requires": {
"axios": "^0.21.1", "axios": "^0.21.1",
"boxen": "^4.2.0", "boxen": "^4.2.0",

4
packages/nocodb/package.json

@ -67,7 +67,7 @@
"help:c": "ts-node ./help/a", "help:c": "ts-node ./help/a",
"watch:build": "nodemon -e ts,js -w ./src -x npm run build", "watch:build": "nodemon -e ts,js -w ./src -x npm run build",
"watch:serve": "nodemon -e ts -w ./build -x npm run debug-local ", "watch:serve": "nodemon -e ts -w ./build -x npm run debug-local ",
"watch:run": "cross-env NC_DISABLE_TELE=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/docker --log-error --project tsconfig.json\"", "watch:run": "cross-env NC_DISABLE_TELE1=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/docker --log-error --project tsconfig.json\"",
"watch:run:cypress": "cross-env EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/docker --log-error --project tsconfig.json\"", "watch:run:cypress": "cross-env EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/docker --log-error --project tsconfig.json\"",
"watch:run:mysql": "cross-env NC_DISABLE_TELE=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/dockerRunMysql --log-error --project tsconfig.json\"", "watch:run:mysql": "cross-env NC_DISABLE_TELE=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/dockerRunMysql --log-error --project tsconfig.json\"",
"run": "ts-node src/example/docker", "run": "ts-node src/example/docker",
@ -150,7 +150,7 @@
"mysql2": "^2.2.5", "mysql2": "^2.2.5",
"nanoid": "^3.1.20", "nanoid": "^3.1.20",
"nc-common": "0.0.6", "nc-common": "0.0.6",
"nc-help": "^0.2.31", "nc-help": "^0.2.44",
"nc-lib-gui": "0.84.15", "nc-lib-gui": "0.84.15",
"nc-plugin": "^0.1.1", "nc-plugin": "^0.1.1",
"ncp": "^2.0.0", "ncp": "^2.0.0",

15
packages/nocodb/src/lib/noco/meta/api/index.ts

@ -44,6 +44,8 @@ import { Tele } from 'nc-help';
import { Server } from 'socket.io'; import { Server } from 'socket.io';
import passport from 'passport'; import passport from 'passport';
import crypto from 'crypto';
export default function(router: Router, server) { export default function(router: Router, server) {
initStrategies(router); initStrategies(router);
projectApis(router); projectApis(router);
@ -106,11 +108,20 @@ export default function(router: Router, server) {
} }
)(socket.handshake, {}, next); )(socket.handshake, {}, next);
}).on('connection', socket => { }).on('connection', socket => {
const id = getHash(Tele.id + (socket?.handshake as any)?.user?.id);
socket.on('page', args => { socket.on('page', args => {
Tele.page(args); Tele.page({ ...args, id });
}); });
socket.on('event', args => { socket.on('event', args => {
Tele.event(args); Tele.event({ ...args, id });
}); });
}); });
} }
function getHash(str) {
return crypto
.createHash('md5')
.update(str)
.digest('hex');
}

3
packages/nocodb/src/lib/utils/projectAcl.ts

@ -139,8 +139,10 @@ export default {
columnList: true, columnList: true,
mmList: true, mmList: true,
hmList: true,
commentList: true, commentList: true,
commentRow: true, commentRow: true,
projectInfoGet: true,
// data // data
dataList: true, dataList: true,
@ -184,6 +186,7 @@ export default {
// sort & filter // sort & filter
sortList: true, sortList: true,
projectInfoGet: true,
mmList: true, mmList: true,
hmList: true, hmList: true,

206
scripts/sdk/swagger.json

@ -26,12 +26,58 @@
"type": "string" "type": "string"
} }
} }
},
"examples": {
"Successful registration response": {
"value": {
"token": "string"
}
}
} }
} }
} }
}, },
"400": { "400": {
"description": "Bad Request" "description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
},
"examples": {
"Invalid email": {
"value": {
"msg": "Invalid email"
}
},
"Invalid invite url": {
"value": {
"msg": "Invalid invite url"
}
},
"Expired invite url": {
"value": {
"msg": "Expired invite url, Please contact super admin to get a new invite url"
}
},
"User already exist": {
"value": {
"msg": "User already exist"
}
},
"Invite only signup": {
"value": {
"msg": "Not allowed to signup, contact super admin"
}
}
}
}
}
}, },
"401": { "401": {
"description": "Unauthorized" "description": "Unauthorized"
@ -68,6 +114,21 @@
} }
} }
} }
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
} }
}, },
"tags": [ "tags": [
@ -90,6 +151,14 @@
"email", "email",
"password" "password"
] ]
},
"examples": {
"example-1": {
"value": {
"email": "user@nocodb.com",
"password": "Password"
}
}
} }
} }
} }
@ -109,7 +178,21 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/User" "$ref": "#/components/schemas/UserInfo"
},
"examples": {
"example-1": {
"value": {
"id": "string",
"email": "string",
"email_verified": "string",
"firstname": "string",
"lastname": "string",
"roles": {
"editor": true
}
}
}
} }
} }
} }
@ -118,7 +201,17 @@
"tags": [ "tags": [
"Auth" "Auth"
], ],
"description": "Returns authenticated user info" "description": "Returns authenticated user info",
"parameters": [
{
"schema": {
"type": "string"
},
"in": "query",
"name": "project_id",
"description": "Pass project id to get project specific roles along with user info"
}
]
} }
}, },
"/api/v1/db/auth/password/forgot": { "/api/v1/db/auth/password/forgot": {
@ -128,6 +221,9 @@
"responses": { "responses": {
"200": { "200": {
"description": "OK" "description": "OK"
},
"401": {
"description": "Unauthorized"
} }
}, },
"description": "Emails user with a reset url.", "description": "Emails user with a reset url.",
@ -146,7 +242,8 @@
} }
} }
} }
} },
"description": "Pass registered user email id in request body"
} }
}, },
"parameters": [] "parameters": []
@ -157,7 +254,53 @@
"operationId": "auth-password-change", "operationId": "auth-password-change",
"responses": { "responses": {
"200": { "200": {
"description": "OK" "description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
},
"examples": {
"Success response": {
"value": {
"msg": "Password updated successfully"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
},
"examples": {
"Missing params": {
"value": {
"msg": "Missing new/old password"
}
},
"Wrong password": {
"value": {
"msg": "Current password is wrong"
}
}
}
}
}
} }
}, },
"description": "Change password of authenticated user with a new one.", "description": "Change password of authenticated user with a new one.",
@ -175,16 +318,22 @@
}, },
"newPassword": { "newPassword": {
"type": "string" "type": "string"
},
"verifyPassword": {
"type": "string"
} }
} }
},
"examples": {
"example-1": {
"value": {
"currentPassword": "string",
"newPassword": "string"
} }
} }
} }
} }
}, },
"description": "Old password need to be passed along with new password for changing password."
}
},
"parameters": [] "parameters": []
}, },
"/api/v1/db/auth/token/validate/{token}": { "/api/v1/db/auth/token/validate/{token}": {
@ -292,7 +441,6 @@
}, },
"parameters": [] "parameters": []
}, },
"/api/v1/db/meta/projects/{projectId}/users": { "/api/v1/db/meta/projects/{projectId}/users": {
"get": { "get": {
"summary": "Project Users", "summary": "Project Users",
@ -1522,8 +1670,7 @@
"get": { "get": {
"summary": "", "summary": "",
"operationId": "db-view-column-list", "operationId": "db-view-column-list",
"responses": { "responses": {},
},
"tags": [ "tags": [
"DB View Column" "DB View Column"
] ]
@ -2281,7 +2428,6 @@
} }
} }
}, },
"/api/v1/db/data/{orgs}/{projectName}/{tableName}": { "/api/v1/db/data/{orgs}/{projectName}/{tableName}": {
"parameters": [ "parameters": [
{ {
@ -3104,7 +3250,8 @@
"name": "relationType", "name": "relationType",
"in": "path", "in": "path",
"required": true "required": true
},{ },
{
"schema": { "schema": {
"type": "string" "type": "string"
}, },
@ -3245,7 +3392,7 @@
}, },
"delete": { "delete": {
"summary": "", "summary": "",
"operationId": "db-table-row-nested-delete", "operationId": "db-table-row-nested-remove",
"responses": { "responses": {
"200": { "200": {
"description": "OK", "description": "OK",
@ -3350,7 +3497,6 @@
] ]
} }
}, },
"/api/v1/db/public/shared-view/{sharedViewUuid}/rows": { "/api/v1/db/public/shared-view/{sharedViewUuid}/rows": {
"parameters": [ "parameters": [
{ {
@ -3421,7 +3567,7 @@
"multipart/form-data": { "multipart/form-data": {
"schema": { "schema": {
"type": "object", "type": "object",
"properties": { } "properties": {}
} }
} }
} }
@ -3707,7 +3853,6 @@
] ]
} }
}, },
"/api/v1/db/meta/audits/comments": { "/api/v1/db/meta/audits/comments": {
"parameters": [], "parameters": [],
"get": { "get": {
@ -3945,7 +4090,6 @@
} }
} }
}, },
"/api/v1/db/meta/tables/{tableId}/hooks": { "/api/v1/db/meta/tables/{tableId}/hooks": {
"parameters": [ "parameters": [
{ {
@ -4195,7 +4339,6 @@
] ]
} }
}, },
"/api/v1/db/meta/plugins": { "/api/v1/db/meta/plugins": {
"parameters": [], "parameters": [],
"get": { "get": {
@ -4374,7 +4517,6 @@
] ]
} }
}, },
"/api/v1/db/meta/connection/test": { "/api/v1/db/meta/connection/test": {
"parameters": [], "parameters": [],
"post": { "post": {
@ -4480,7 +4622,6 @@
}, },
"parameters": [] "parameters": []
}, },
"/api/v1/db/meta/projects/{projectId}/api-tokens": { "/api/v1/db/meta/projects/{projectId}/api-tokens": {
"get": { "get": {
"summary": "Your GET endpoint", "summary": "Your GET endpoint",
@ -4583,7 +4724,6 @@
} }
] ]
}, },
"/api/v1/db/storage/upload": { "/api/v1/db/storage/upload": {
"post": { "post": {
"summary": "Attachment", "summary": "Attachment",
@ -7031,6 +7171,28 @@
], ],
"description": "", "description": "",
"type": "object" "type": "object"
},
"UserInfo": {
"title": "UserInfo",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"email": {
"type": "string"
},
"email_verified": {
"type": "string"
},
"firstname": {
"type": "string"
},
"lastname": {
"type": "string"
},
"roles": {}
}
} }
}, },
"requestBodies": { "requestBodies": {

Loading…
Cancel
Save