Browse Source

test: /db path correction

pull/6644/head
Raju Udava 1 year ago
parent
commit
231b0132fd
  1. 26
      packages/nocodb/tests/unit/rest/tests/attachment.test.ts
  2. 28
      packages/nocodb/tests/unit/rest/tests/auth.test.ts
  3. 40
      packages/nocodb/tests/unit/rest/tests/base.test.ts
  4. 4
      packages/nocodb/tests/unit/rest/tests/columnTypeSpecific.test.ts
  5. 4
      packages/nocodb/tests/unit/rest/tests/filter.test.ts
  6. 32
      packages/nocodb/tests/unit/rest/tests/groupby.test.ts
  7. 40
      packages/nocodb/tests/unit/rest/tests/org.test.ts
  8. 34
      packages/nocodb/tests/unit/rest/tests/table.test.ts
  9. 162
      packages/nocodb/tests/unit/rest/tests/tableRow.test.ts
  10. 66
      packages/nocodb/tests/unit/rest/tests/viewRow.test.ts

26
packages/nocodb/tests/unit/rest/tests/attachment.test.ts

@ -25,7 +25,7 @@ function attachmentTests() {
it('Upload file - Super admin', async () => { it('Upload file - Super admin', async () => {
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/storage/upload') .post('/api/v1/db/storage/upload')
.attach('files', FILE_PATH) .attach('files', FILE_PATH)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -37,7 +37,7 @@ function attachmentTests() {
it('Upload file - Without token', async () => { it('Upload file - Without token', async () => {
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/storage/upload') .post('/api/v1/db/storage/upload')
.attach('files', FILE_PATH) .attach('files', FILE_PATH)
.expect(401); .expect(401);
@ -53,12 +53,12 @@ function attachmentTests() {
}; };
const signupResponse = await request(context.app) const signupResponse = await request(context.app)
.post('/api/v1/auth/user/signup') .post('/api/v1/db/auth/user/signup')
.send(args) .send(args)
.expect(200); .expect(200);
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/storage/upload') .post('/api/v1/db/storage/upload')
.attach('files', FILE_PATH) .attach('files', FILE_PATH)
.set('xc-auth', signupResponse.body.token) .set('xc-auth', signupResponse.body.token)
.expect(400); .expect(400);
@ -75,13 +75,13 @@ function attachmentTests() {
}; };
await request(context.app) await request(context.app)
.post('/api/v1/auth/user/signup') .post('/api/v1/db/auth/user/signup')
.send(args) .send(args)
.expect(200); .expect(200);
// update user role to creator // update user role to creator
const usersListResponse = await request(context.app) const usersListResponse = await request(context.app)
.get('/api/v1/users') .get('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -92,19 +92,19 @@ function attachmentTests() {
expect(user).to.have.property('roles').to.be.equal(OrgUserRoles.VIEWER); expect(user).to.have.property('roles').to.be.equal(OrgUserRoles.VIEWER);
await request(context.app) await request(context.app)
.patch('/api/v1/users/' + user.id) .patch('/api/v1/db/users/' + user.id)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ roles: OrgUserRoles.CREATOR }) .send({ roles: OrgUserRoles.CREATOR })
.expect(200); .expect(200);
const signinResponse = await request(context.app) const signinResponse = await request(context.app)
.post('/api/v1/auth/user/signin') .post('/api/v1/db/auth/user/signin')
// pass empty data in await request // pass empty data in await request
.send(args) .send(args)
.expect(200); .expect(200);
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/storage/upload') .post('/api/v1/db/storage/upload')
.attach('files', FILE_PATH) .attach('files', FILE_PATH)
.set('xc-auth', signinResponse.body.token) .set('xc-auth', signinResponse.body.token)
.expect(200); .expect(200);
@ -124,7 +124,7 @@ function attachmentTests() {
}; };
await request(context.app) await request(context.app)
.post('/api/v1/auth/user/signup') .post('/api/v1/db/auth/user/signup')
.send(args) .send(args)
.expect(200); .expect(200);
@ -134,7 +134,7 @@ function attachmentTests() {
// invite user to base with editor role // invite user to base with editor role
await request(context.app) await request(context.app)
.post(`/api/v1/meta/bases/${newProject.id}/users`) .post(`/api/v1/db/meta/bases/${newProject.id}/users`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
roles: ProjectRoles.EDITOR, roles: ProjectRoles.EDITOR,
@ -146,13 +146,13 @@ function attachmentTests() {
// signin to get user token // signin to get user token
const signinResponse = await request(context.app) const signinResponse = await request(context.app)
.post('/api/v1/auth/user/signin') .post('/api/v1/db/auth/user/signin')
// pass empty data in await request // pass empty data in await request
.send(args) .send(args)
.expect(200); .expect(200);
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/storage/upload') .post('/api/v1/db/storage/upload')
.attach('files', FILE_PATH) .attach('files', FILE_PATH)
.set('xc-auth', signinResponse.body.token) .set('xc-auth', signinResponse.body.token)
.expect(200); .expect(200);

28
packages/nocodb/tests/unit/rest/tests/auth.test.ts

@ -36,7 +36,7 @@ function authTests() {
it('Signup with valid email', async () => { it('Signup with valid email', async () => {
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/auth/user/signup') .post('/api/v1/db/auth/user/signup')
.send({ email: 'new@example.com', password: defaultUserArgs.password }) .send({ email: 'new@example.com', password: defaultUserArgs.password })
.expect(200); .expect(200);
@ -46,21 +46,21 @@ function authTests() {
it('Signup with invalid email', async () => { it('Signup with invalid email', async () => {
await request(context.app) await request(context.app)
.post('/api/v1/auth/user/signup') .post('/api/v1/db/auth/user/signup')
.send({ email: 'test', password: defaultUserArgs.password }) .send({ email: 'test', password: defaultUserArgs.password })
.expect(400); .expect(400);
}); });
it('Signup with invalid passsword', async () => { it('Signup with invalid passsword', async () => {
await request(context.app) await request(context.app)
.post('/api/v1/auth/user/signup') .post('/api/v1/db/auth/user/signup')
.send({ email: defaultUserArgs.email, password: 'weakpass' }) .send({ email: defaultUserArgs.email, password: 'weakpass' })
.expect(400); .expect(400);
}); });
it('Signin with valid credentials', async () => { it('Signin with valid credentials', async () => {
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/auth/user/signin') .post('/api/v1/db/auth/user/signin')
.send({ .send({
email: defaultUserArgs.email, email: defaultUserArgs.email,
password: defaultUserArgs.password, password: defaultUserArgs.password,
@ -72,7 +72,7 @@ function authTests() {
it('Signin without email and password', async () => { it('Signin without email and password', async () => {
await request(context.app) await request(context.app)
.post('/api/v1/auth/user/signin') .post('/api/v1/db/auth/user/signin')
// pass empty data in await request // pass empty data in await request
.send({}) .send({})
.expect(401); .expect(401);
@ -80,21 +80,21 @@ function authTests() {
it('Signin with invalid credentials', async () => { it('Signin with invalid credentials', async () => {
await request(context.app) await request(context.app)
.post('/api/v1/auth/user/signin') .post('/api/v1/db/auth/user/signin')
.send({ email: 'abc@abc.com', password: defaultUserArgs.password }) .send({ email: 'abc@abc.com', password: defaultUserArgs.password })
.expect(400); .expect(400);
}); });
it('Signin with invalid password', async () => { it('Signin with invalid password', async () => {
await request(context.app) await request(context.app)
.post('/api/v1/auth/user/signin') .post('/api/v1/db/auth/user/signin')
.send({ email: defaultUserArgs.email, password: 'wrongPassword' }) .send({ email: defaultUserArgs.email, password: 'wrongPassword' })
.expect(400); .expect(400);
}); });
it('me without token', async () => { it('me without token', async () => {
const response = await request(context.app) const response = await request(context.app)
.get('/api/v1/auth/user/me') .get('/api/v1/db/auth/user/me')
.unset('xc-auth') .unset('xc-auth')
.expect(200); .expect(200);
@ -105,7 +105,7 @@ function authTests() {
it('me with token', async () => { it('me with token', async () => {
const response = await request(context.app) const response = await request(context.app)
.get('/api/v1/auth/user/me') .get('/api/v1/db/auth/user/me')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -115,7 +115,7 @@ function authTests() {
it('Forgot password with a non-existing email id', async () => { it('Forgot password with a non-existing email id', async () => {
await request(context.app) await request(context.app)
.post('/api/v1/auth/password/forgot') .post('/api/v1/db/auth/password/forgot')
.send({ email: 'nonexisting@email.com' }) .send({ email: 'nonexisting@email.com' })
.expect(400); .expect(400);
}); });
@ -125,7 +125,7 @@ function authTests() {
it('Change password', async () => { it('Change password', async () => {
await request(context.app) await request(context.app)
.post('/api/v1/auth/password/change') .post('/api/v1/db/auth/password/change')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
currentPassword: defaultUserArgs.password, currentPassword: defaultUserArgs.password,
@ -136,7 +136,7 @@ function authTests() {
it('Change password - after logout', async () => { it('Change password - after logout', async () => {
await request(context.app) await request(context.app)
.post('/api/v1/auth/password/change') .post('/api/v1/db/auth/password/change')
.unset('xc-auth') .unset('xc-auth')
.send({ .send({
currentPassword: defaultUserArgs.password, currentPassword: defaultUserArgs.password,
@ -148,14 +148,14 @@ function authTests() {
// todo: // todo:
it('Reset Password with an invalid token', async () => { it('Reset Password with an invalid token', async () => {
await request(context.app) await request(context.app)
.post('/api/v1/auth/password/reset/someRandomValue') .post('/api/v1/db/auth/password/reset/someRandomValue')
.send({ email: defaultUserArgs.email }) .send({ email: defaultUserArgs.email })
.expect(400); .expect(400);
}); });
it('Email validate with an invalid token', async () => { it('Email validate with an invalid token', async () => {
await request(context.app) await request(context.app)
.post('/api/v1/auth/email/validate/someRandomValue') .post('/api/v1/db/auth/email/validate/someRandomValue')
.send({ email: defaultUserArgs.email }) .send({ email: defaultUserArgs.email })
.expect(400); .expect(400);
}); });

40
packages/nocodb/tests/unit/rest/tests/base.test.ts

@ -39,7 +39,7 @@ function baseTest() {
it('Get base info', async () => { it('Get base info', async () => {
await request(context.app) await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/info`) .get(`/api/v1/db/meta/bases/${base.id}/info`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -48,7 +48,7 @@ function baseTest() {
// todo: Test by creating models under base and check if the UCL is working // todo: Test by creating models under base and check if the UCL is working
it('UI ACL', async () => { it('UI ACL', async () => {
await request(context.app) await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/visibility-rules`) .get(`/api/v1/db/meta/bases/${base.id}/visibility-rules`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -59,7 +59,7 @@ function baseTest() {
let response; let response;
if (process.env.EE !== 'true') { if (process.env.EE !== 'true') {
response = await request(context.app) response = await request(context.app)
.get('/api/v1/meta/bases/') .get('/api/v1/db/meta/bases/')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -71,14 +71,13 @@ function baseTest() {
.expect(200); .expect(200);
} }
if (response.body.list.length !== 1) if (response.body.list.length !== 1) new Error('Should list only 1 base');
new Error('Should list only 1 base');
if (!response.body.pageInfo) new Error('Should have pagination info'); if (!response.body.pageInfo) new Error('Should have pagination info');
}); });
it('Create base', async () => { it('Create base', async () => {
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/meta/bases/') .post('/api/v1/db/meta/bases/')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: 'Title1', title: 'Title1',
@ -94,7 +93,7 @@ function baseTest() {
it('Create bases with existing title', async () => { it('Create bases with existing title', async () => {
await request(context.app) await request(context.app)
.post(`/api/v1/meta/bases/`) .post(`/api/v1/db/meta/bases/`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: base.title, title: base.title,
@ -131,18 +130,17 @@ function baseTest() {
it('Read base', async () => { it('Read base', async () => {
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}`) .get(`/api/v1/db/meta/bases/${base.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send() .send()
.expect(200); .expect(200);
if (response.body.id !== base.id) if (response.body.id !== base.id) return new Error('Got the wrong base');
return new Error('Got the wrong base');
}); });
it('Update bases', async () => { it('Update bases', async () => {
await request(context.app) await request(context.app)
.patch(`/api/v1/meta/bases/${base.id}`) .patch(`/api/v1/db/meta/bases/${base.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: 'NewTitle', title: 'NewTitle',
@ -163,7 +161,7 @@ function baseTest() {
// Allow base rename to be replaced with same title // Allow base rename to be replaced with same title
await request(context.app) await request(context.app)
.patch(`/api/v1/meta/bases/${base.id}`) .patch(`/api/v1/db/meta/bases/${base.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: newProject.title, title: newProject.title,
@ -174,7 +172,7 @@ function baseTest() {
it('Create base shared base', async () => { it('Create base shared base', async () => {
await request(context.app) await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/shared`) .post(`/api/v1/db/meta/bases/${base.id}/shared`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
roles: 'viewer', roles: 'viewer',
@ -195,7 +193,7 @@ function baseTest() {
it('Created base shared base should have only editor or viewer role', async () => { it('Created base shared base should have only editor or viewer role', async () => {
await request(context.app) await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/shared`) .post(`/api/v1/db/meta/bases/${base.id}/shared`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
roles: 'commenter', roles: 'commenter',
@ -214,7 +212,7 @@ function baseTest() {
await createSharedBase(context.app, context.token, base); await createSharedBase(context.app, context.token, base);
await request(context.app) await request(context.app)
.patch(`/api/v1/meta/bases/${base.id}/shared`) .patch(`/api/v1/db/meta/bases/${base.id}/shared`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
roles: 'commenter', roles: 'commenter',
@ -233,7 +231,7 @@ function baseTest() {
await createSharedBase(context.app, context.token, base); await createSharedBase(context.app, context.token, base);
await request(context.app) await request(context.app)
.patch(`/api/v1/meta/bases/${base.id}/shared`) .patch(`/api/v1/db/meta/bases/${base.id}/shared`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
roles: 'editor', roles: 'editor',
@ -251,7 +249,7 @@ function baseTest() {
await createSharedBase(context.app, context.token, base); await createSharedBase(context.app, context.token, base);
await request(context.app) await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/shared`) .get(`/api/v1/db/meta/bases/${base.id}/shared`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send() .send()
.expect(200); .expect(200);
@ -266,7 +264,7 @@ function baseTest() {
await createSharedBase(context.app, context.token, base); await createSharedBase(context.app, context.token, base);
await request(context.app) await request(context.app)
.delete(`/api/v1/meta/bases/${base.id}/shared`) .delete(`/api/v1/db/meta/bases/${base.id}/shared`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send() .send()
.expect(200); .expect(200);
@ -280,7 +278,7 @@ function baseTest() {
it('Meta diff sync', async () => { it('Meta diff sync', async () => {
await request(context.app) await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/meta-diff`) .get(`/api/v1/db/meta/bases/${base.id}/meta-diff`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send() .send()
.expect(200); .expect(200);
@ -288,7 +286,7 @@ function baseTest() {
it('Meta diff sync', async () => { it('Meta diff sync', async () => {
await request(context.app) await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/meta-diff`) .post(`/api/v1/db/meta/bases/${base.id}/meta-diff`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send() .send()
.expect(200); .expect(200);
@ -297,7 +295,7 @@ function baseTest() {
// todo: improve test. Check whether the all the actions are present in the response and correct as well // todo: improve test. Check whether the all the actions are present in the response and correct as well
it('Meta diff sync', async () => { it('Meta diff sync', async () => {
await request(context.app) await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/audits`) .get(`/api/v1/db/meta/bases/${base.id}/audits`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send() .send()
.expect(200); .expect(200);

4
packages/nocodb/tests/unit/rest/tests/columnTypeSpecific.test.ts

@ -57,7 +57,7 @@ function columnTypeSpecificTests() {
describe('Qr Code Column', () => { describe('Qr Code Column', () => {
it('delivers the same cell values as the referenced column', async () => { it('delivers the same cell values as the referenced column', async () => {
const resp = await request(context.app) const resp = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
expect(resp.body.list[0][qrValueReferenceColumnTitle]).to.eql( expect(resp.body.list[0][qrValueReferenceColumnTitle]).to.eql(
@ -80,7 +80,7 @@ function columnTypeSpecificTests() {
).to.eq(true); ).to.eq(true);
const response = await request(context.app) const response = await request(context.app)
.delete(`/api/v1/meta/columns/${qrValueReferenceColumn.id}`) .delete(`/api/v1/db/meta/columns/${qrValueReferenceColumn.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}); .send({});

4
packages/nocodb/tests/unit/rest/tests/filter.test.ts

@ -147,7 +147,7 @@ async function retrieveRecordsAndValidate(
// retrieve filtered records // retrieve filtered records
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${base.id}/${table.id}`) .get(`/api/v1/db/data/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([filter]), filterArrJson: JSON.stringify([filter]),
@ -586,7 +586,7 @@ function filterSelectBased() {
async function applyDateFilter(filterParams, expectedRecords) { async function applyDateFilter(filterParams, expectedRecords) {
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${base.id}/${table.id}`) .get(`/api/v1/db/data/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([filterParams]), filterArrJson: JSON.stringify([filterParams]),

32
packages/nocodb/tests/unit/rest/tests/groupby.test.ts

@ -34,7 +34,7 @@ function groupByTests() {
const columns = ( const columns = (
await request(context.app) await request(context.app)
.get(`/api/v1/meta/views/${filmView.id}/columns`) .get(`/api/v1/db/meta/views/${filmView.id}/columns`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200) .expect(200)
).body.list; ).body.list;
@ -45,7 +45,7 @@ function groupByTests() {
it('Check One GroupBy Column Ascending', async function () { it('Check One GroupBy Column Ascending', async function () {
const lengthColumn = filmColumns.find((c) => c.column_name === 'length'); const lengthColumn = filmColumns.find((c) => c.column_name === 'length');
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: lengthColumn.column_name, column_name: lengthColumn.column_name,
@ -65,7 +65,7 @@ function groupByTests() {
); );
const filterCondition = '(Length,eq,46)'; const filterCondition = '(Length,eq,46)';
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: rentalDurationColumn.column_name, column_name: rentalDurationColumn.column_name,
@ -84,7 +84,7 @@ function groupByTests() {
const titleColumn = filmColumns.find((c) => c.column_name === 'title'); const titleColumn = filmColumns.find((c) => c.column_name === 'title');
const filterCondition = '(Length,eq,46)~and(RentalDuration,eq,5)'; const filterCondition = '(Length,eq,46)~and(RentalDuration,eq,5)';
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: titleColumn.column_name, column_name: titleColumn.column_name,
@ -102,7 +102,7 @@ function groupByTests() {
it('Check One GroupBy Column With Descending', async function () { it('Check One GroupBy Column With Descending', async function () {
const lengthColumn = filmColumns.find((c) => c.column_name === 'length'); const lengthColumn = filmColumns.find((c) => c.column_name === 'length');
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: lengthColumn.column_name, column_name: lengthColumn.column_name,
@ -122,7 +122,7 @@ function groupByTests() {
); );
const filterCondition = '(Length,eq,46)'; const filterCondition = '(Length,eq,46)';
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: rentalDurationColumn.column_name, column_name: rentalDurationColumn.column_name,
@ -141,7 +141,7 @@ function groupByTests() {
const titleColumn = filmColumns.find((c) => c.column_name === 'title'); const titleColumn = filmColumns.find((c) => c.column_name === 'title');
const filterCondition = '(Length,eq,46)~and(RentalDuration,eq,5)'; const filterCondition = '(Length,eq,46)~and(RentalDuration,eq,5)';
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: titleColumn.column_name, column_name: titleColumn.column_name,
@ -172,7 +172,7 @@ function groupByTests() {
// Group By Length Column Ascending Order // Group By Length Column Ascending Order
await request(context.app) await request(context.app)
.patch(`/api/v1/meta/grid-columns/${lengthColumn.id}`) .patch(`/api/v1/db/meta/grid-columns/${lengthColumn.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
group_by: true, group_by: true,
@ -182,7 +182,7 @@ function groupByTests() {
.expect(200); .expect(200);
// Group By RentalDuration Column Descending // Group By RentalDuration Column Descending
await request(context.app) await request(context.app)
.patch(`/api/v1/meta/grid-columns/${rentalColumn.id}`) .patch(`/api/v1/db/meta/grid-columns/${rentalColumn.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
group_by: true, group_by: true,
@ -192,7 +192,7 @@ function groupByTests() {
.expect(200); .expect(200);
const columns = ( const columns = (
await request(context.app) await request(context.app)
.get(`/api/v1/meta/views/${filmView.id}/columns`) .get(`/api/v1/db/meta/views/${filmView.id}/columns`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200) .expect(200)
).body.list; ).body.list;
@ -226,7 +226,7 @@ function groupByTests() {
], ],
}); });
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: _lengthColumn.column_name, column_name: _lengthColumn.column_name,
@ -243,7 +243,7 @@ function groupByTests() {
it('Check One GroupBy Column with Links/Rollup', async function () { it('Check One GroupBy Column with Links/Rollup', async function () {
const actorsColumn = filmColumns.find((c) => c.title === 'Actors'); const actorsColumn = filmColumns.find((c) => c.title === 'Actors');
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: actorsColumn.title, column_name: actorsColumn.title,
@ -285,7 +285,7 @@ function groupByTests() {
}); });
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: 'LanguageName', column_name: 'LanguageName',
@ -307,7 +307,7 @@ function groupByTests() {
}); });
const res = await request(context.app) const res = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: 'ActorNames', column_name: 'ActorNames',
@ -326,7 +326,7 @@ function groupByTests() {
}); });
const res = await request(context.app) const res = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: formulaColumnTitle, column_name: formulaColumnTitle,
@ -349,7 +349,7 @@ function groupByTests() {
}); });
const res1 = await request(context.app) const res1 = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/groupby`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
column_name: nestedFormulaColumnTitle, column_name: nestedFormulaColumnTitle,

40
packages/nocodb/tests/unit/rest/tests/org.test.ts

@ -25,7 +25,7 @@ function authTests() {
it('Get users list', async () => { it('Get users list', async () => {
const response = await request(context.app) const response = await request(context.app)
.get('/api/v1/users') .get('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -35,7 +35,7 @@ function authTests() {
it('Invite a new user', async () => { it('Invite a new user', async () => {
const response = await request(context.app) const response = await request(context.app)
.post('/api/v1/users') .post('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ email: 'a@nocodb.com' }) .send({ email: 'a@nocodb.com' })
.expect(200); .expect(200);
@ -50,12 +50,12 @@ function authTests() {
const email = 'a@nocodb.com'; const email = 'a@nocodb.com';
// invite a user // invite a user
await request(context.app) await request(context.app)
.post('/api/v1/users') .post('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ email }) .send({ email })
.expect(200); .expect(200);
const response = await request(context.app) const response = await request(context.app)
.get('/api/v1/users') .get('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
expect(response.body.list).to.have.length(2); expect(response.body.list).to.have.length(2);
@ -65,13 +65,13 @@ function authTests() {
expect(user).to.have.property('roles').to.be.equal(OrgUserRoles.VIEWER); expect(user).to.have.property('roles').to.be.equal(OrgUserRoles.VIEWER);
await request(context.app) await request(context.app)
.patch('/api/v1/users/' + user.id) .patch('/api/v1/db/users/' + user.id)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ roles: OrgUserRoles.CREATOR }) .send({ roles: OrgUserRoles.CREATOR })
.expect(200); .expect(200);
const response2 = await request(context.app) const response2 = await request(context.app)
.get('/api/v1/users') .get('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
expect(response2.body.list).to.have.length(2); expect(response2.body.list).to.have.length(2);
@ -85,13 +85,13 @@ function authTests() {
const email = 'a@nocodb.com'; const email = 'a@nocodb.com';
// invite a user // invite a user
await request(context.app) await request(context.app)
.post('/api/v1/users') .post('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ email }) .send({ email })
.expect(200); .expect(200);
const response = await request(context.app) const response = await request(context.app)
.get('/api/v1/users') .get('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
expect(response.body.list).to.have.length(2); expect(response.body.list).to.have.length(2);
@ -101,12 +101,12 @@ function authTests() {
expect(user).to.have.property('roles').to.be.equal(OrgUserRoles.VIEWER); expect(user).to.have.property('roles').to.be.equal(OrgUserRoles.VIEWER);
await request(context.app) await request(context.app)
.delete('/api/v1/users/' + user.id) .delete('/api/v1/db/users/' + user.id)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
const response2 = await request(context.app) const response2 = await request(context.app)
.get('/api/v1/users') .get('/api/v1/db/users')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
expect(response2.body.list).to.have.length(1); expect(response2.body.list).to.have.length(1);
@ -114,7 +114,7 @@ function authTests() {
it('Get token list', async () => { it('Get token list', async () => {
const response = await request(context.app) const response = await request(context.app)
.get('/api/v1/tokens') .get('/api/v1/db/tokens')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -124,13 +124,13 @@ function authTests() {
it('Generate token', async () => { it('Generate token', async () => {
const r = await request(context.app) const r = await request(context.app)
.post('/api/v1/tokens') .post('/api/v1/db/tokens')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ description: 'test' }) .send({ description: 'test' })
.expect(200); .expect(200);
const response = await request(context.app) const response = await request(context.app)
.get('/api/v1/tokens') .get('/api/v1/db/tokens')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -145,13 +145,13 @@ function authTests() {
it('Delete token', async () => { it('Delete token', async () => {
const r = await request(context.app) const r = await request(context.app)
.post('/api/v1/tokens') .post('/api/v1/db/tokens')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ description: 'test' }) .send({ description: 'test' })
.expect(200); .expect(200);
let response = await request(context.app) let response = await request(context.app)
.get('/api/v1/tokens') .get('/api/v1/db/tokens')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -159,12 +159,12 @@ function authTests() {
expect(response.body.list).to.have.length(1); expect(response.body.list).to.have.length(1);
await request(context.app) await request(context.app)
.delete('/api/v1/tokens/' + r.body.token) .delete('/api/v1/db/tokens/' + r.body.token)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
response = await request(context.app) response = await request(context.app)
.get('/api/v1/tokens') .get('/api/v1/db/tokens')
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -185,7 +185,7 @@ function authTests() {
.expect(200); .expect(200);
const failedRes = await request(context.app) const failedRes = await request(context.app)
.post('/api/v1/auth/user/signup') .post('/api/v1/db/auth/user/signup')
.send(args) .send(args)
.expect(400); .expect(400);
@ -201,7 +201,7 @@ function authTests() {
.expect(200); .expect(200);
const successRes = await request(context.app) const successRes = await request(context.app)
.post('/api/v1/auth/user/signup') .post('/api/v1/db/auth/user/signup')
.send(args) .send(args)
.expect(200); .expect(200);
@ -211,7 +211,7 @@ function authTests() {
.to.be.a('string'); .to.be.a('string');
const userMeRes = await request(context.app) const userMeRes = await request(context.app)
.get('/api/v1/auth/user/me') .get('/api/v1/db/auth/user/me')
.set('xc-auth', successRes.body.token) .set('xc-auth', successRes.body.token)
.expect(200); .expect(200);

34
packages/nocodb/tests/unit/rest/tests/table.test.ts

@ -40,7 +40,7 @@ function tableStaticTests() {
it('Get table list', async function () { it('Get table list', async function () {
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/tables`) .get(`/api/v1/db/meta/bases/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -50,7 +50,7 @@ function tableStaticTests() {
it('Create table with no table name', async function () { it('Create table with no table name', async function () {
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/tables`) .post(`/api/v1/db/meta/bases/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
table_name: undefined, table_name: undefined,
@ -79,7 +79,7 @@ function tableStaticTests() {
it('Create table with same table name', async function () { it('Create table with same table name', async function () {
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/tables`) .post(`/api/v1/db/meta/bases/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
table_name: table.table_name, table_name: table.table_name,
@ -101,7 +101,7 @@ function tableStaticTests() {
it('Create table with same title', async function () { it('Create table with same title', async function () {
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/tables`) .post(`/api/v1/db/meta/bases/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
table_name: 'New_table_name', table_name: 'New_table_name',
@ -123,7 +123,7 @@ function tableStaticTests() {
it('Create table with title length more than the limit', async function () { it('Create table with title length more than the limit', async function () {
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/tables`) .post(`/api/v1/db/meta/bases/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
table_name: 'a'.repeat(256), table_name: 'a'.repeat(256),
@ -145,7 +145,7 @@ function tableStaticTests() {
it('Create table with title having leading white space', async function () { it('Create table with title having leading white space', async function () {
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/tables`) .post(`/api/v1/db/meta/bases/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
table_name: 'table_name_with_whitespace ', table_name: 'table_name_with_whitespace ',
@ -186,7 +186,7 @@ function tableTest() {
it('Create table', async function () { it('Create table', async function () {
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/bases/${base.id}/tables`) .post(`/api/v1/db/meta/bases/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
table_name: 'table2', table_name: 'table2',
@ -216,7 +216,7 @@ function tableTest() {
it('Update table', async function () { it('Update table', async function () {
const response = await request(context.app) const response = await request(context.app)
.patch(`/api/v1/meta/tables/${table.id}`) .patch(`/api/v1/db/meta/tables/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
base_id: base.id, base_id: base.id,
@ -232,7 +232,7 @@ function tableTest() {
it('Delete table', async function () { it('Delete table', async function () {
const response = await request(context.app) const response = await request(context.app)
.delete(`/api/v1/meta/tables/${table.id}`) .delete(`/api/v1/db/meta/tables/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -249,7 +249,7 @@ function tableTest() {
it('Get table', async function () { it('Get table', async function () {
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/meta/tables/${table.id}`) .get(`/api/v1/db/meta/tables/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -261,7 +261,7 @@ function tableTest() {
it('Reorder table', async function () { it('Reorder table', async function () {
const newOrder = table.order === 0 ? 1 : 0; const newOrder = table.order === 0 ? 1 : 0;
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/meta/tables/${table.id}/reorder`) .post(`/api/v1/db/meta/tables/${table.id}/reorder`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
order: newOrder, order: newOrder,
@ -282,7 +282,7 @@ function tableTest() {
it('Add and delete view should update hasNonDefaultViews', async () => { it('Add and delete view should update hasNonDefaultViews', async () => {
let response = await request(context.app) let response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/tables`) .get(`/api/v1/db/meta/bases/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -296,7 +296,7 @@ function tableTest() {
}); });
response = await request(context.app) response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/tables`) .get(`/api/v1/db/meta/bases/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -306,7 +306,7 @@ function tableTest() {
await deleteView(context, { viewId: view.id }); await deleteView(context, { viewId: view.id });
response = await request(context.app) response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/tables`) .get(`/api/v1/db/meta/bases/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -316,7 +316,7 @@ function tableTest() {
it('Project with empty meta should update hasNonDefaultViews', async () => { it('Project with empty meta should update hasNonDefaultViews', async () => {
let response = await request(context.app) let response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/tables`) .get(`/api/v1/db/meta/bases/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -337,7 +337,7 @@ function tableTest() {
}); });
response = await request(context.app) response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/tables`) .get(`/api/v1/db/meta/bases/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -347,7 +347,7 @@ function tableTest() {
await deleteView(context, { viewId: view.id }); await deleteView(context, { viewId: view.id });
response = await request(context.app) response = await request(context.app)
.get(`/api/v1/meta/bases/${base.id}/tables`) .get(`/api/v1/db/meta/bases/${base.id}/tables`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);

162
packages/nocodb/tests/unit/rest/tests/tableRow.test.ts

@ -60,7 +60,7 @@ function tableStaticTest() {
it('Get table data list', async function () { it('Get table data list', async function () {
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({}) .send({})
.expect(200); .expect(200);
@ -79,7 +79,7 @@ function tableStaticTest() {
const requiredColumns = customerColumns.filter((_, index) => index < 3); const requiredColumns = customerColumns.filter((_, index) => index < 3);
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
fields: requiredColumns.map((c) => c.title), fields: requiredColumns.map((c) => c.title),
@ -104,7 +104,7 @@ function tableStaticTest() {
const sortInfo = [{ fk_column_id: firstNameColumn.id, direction: 'desc' }]; const sortInfo = [{ fk_column_id: firstNameColumn.id, direction: 'desc' }];
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
fields: visibleColumns.map((c) => c.title), fields: visibleColumns.map((c) => c.title),
@ -131,7 +131,7 @@ function tableStaticTest() {
const lastPageOffset = const lastPageOffset =
Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize; Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize;
const lastPageResponse = await request(context.app) const lastPageResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
fields: visibleColumns.map((c) => c.title), fields: visibleColumns.map((c) => c.title),
@ -157,7 +157,7 @@ function tableStaticTest() {
const sortInfo = [{ fk_column_id: firstNameColumn.id, direction: 'asc' }]; const sortInfo = [{ fk_column_id: firstNameColumn.id, direction: 'asc' }];
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
fields: visibleColumns.map((c) => c.title), fields: visibleColumns.map((c) => c.title),
@ -184,7 +184,7 @@ function tableStaticTest() {
const lastPageOffset = const lastPageOffset =
Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize; Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize;
const lastPageResponse = await request(context.app) const lastPageResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
fields: visibleColumns.map((c) => c.title), fields: visibleColumns.map((c) => c.title),
@ -204,7 +204,7 @@ function tableStaticTest() {
}); });
it('Create table row with wrong table id', async function () { it('Create table row with wrong table id', async function () {
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/data/noco/${base.id}/wrong-table-id`) .post(`/api/v1/db/data/noco/${base.id}/wrong-table-id`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: 'Test', title: 'Test',
@ -222,7 +222,7 @@ function tableStaticTest() {
let response = await request(context.app) let response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -243,7 +243,7 @@ function tableStaticTest() {
response = await request(context.app) response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -264,7 +264,7 @@ function tableStaticTest() {
}); });
it('Read table row', async function () { it('Read table row', async function () {
const listResponse = await request(context.app) const listResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -272,7 +272,7 @@ function tableStaticTest() {
const readResponse = await request(context.app) const readResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${row['CustomerId']}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${row['CustomerId']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -292,7 +292,7 @@ function tableStaticTest() {
}); });
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -311,7 +311,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${row['CustomerId']}/exist`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${row['CustomerId']}/exist`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -323,7 +323,7 @@ function tableStaticTest() {
it('Exist should be false table row when it does not exists', async function () { it('Exist should be false table row when it does not exists', async function () {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/998546/exist`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/998546/exist`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -336,7 +336,7 @@ function tableStaticTest() {
it('Export csv', async () => { it('Export csv', async () => {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.title}/export/csv`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.title}/export/csv`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -354,7 +354,7 @@ function tableStaticTest() {
it('Export excel', async () => { it('Export excel', async () => {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.title}/export/excel`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.title}/export/excel`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -378,7 +378,7 @@ function tableStaticTest() {
)!; )!;
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -396,7 +396,7 @@ function tableStaticTest() {
)!; )!;
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -421,7 +421,7 @@ function tableStaticTest() {
)!; )!;
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/wrong-id/${rowId}/hm/${rentalListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/wrong-id/${rowId}/hm/${rentalListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -442,7 +442,7 @@ function tableStaticTest() {
)!; )!;
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -465,7 +465,7 @@ function tableStaticTest() {
)!; )!;
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -495,7 +495,7 @@ function tableStaticTest() {
)!; )!;
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/mm/${filmListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/mm/${filmListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -513,7 +513,7 @@ function tableStaticTest() {
const refId = 1; const refId = 1;
const response = await request(context.app) const response = await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/hm/${rentalListColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/hm/${rentalListColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -530,7 +530,7 @@ function tableStaticTest() {
const refId = 1; const refId = 1;
const response = await request(context.app) const response = await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${firstNameColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${firstNameColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -546,7 +546,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/invalid-column/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/invalid-column/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -566,7 +566,7 @@ function tableStaticTest() {
await request(context.app) await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${firstNameColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${firstNameColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(400); .expect(400);
@ -579,7 +579,7 @@ function tableStaticTest() {
await request(context.app) await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/mm/${firstNameColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/mm/${firstNameColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(400); .expect(400);
@ -592,7 +592,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -610,7 +610,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -641,7 +641,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -663,7 +663,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -694,7 +694,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${addressTable.id}/${rowId}/bt/${cityColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/${addressTable.id}/${rowId}/bt/${cityColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -714,7 +714,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${addressTable.id}/${rowId}/bt/${cityColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/${addressTable.id}/${rowId}/bt/${cityColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -735,7 +735,7 @@ function tableStaticTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/Film/group/${ratingColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/Film/group/${ratingColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -792,7 +792,7 @@ function tableTest() {
}); });
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
sortArrJson: JSON.stringify([ sortArrJson: JSON.stringify([
@ -804,7 +804,7 @@ function tableTest() {
throw new Error('Wrong sort'); throw new Error('Wrong sort');
const descResponse = await request(context.app) const descResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
sortArrJson: JSON.stringify([ sortArrJson: JSON.stringify([
@ -831,7 +831,7 @@ function tableTest() {
}); });
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
sortArrJson: JSON.stringify([ sortArrJson: JSON.stringify([
@ -844,7 +844,7 @@ function tableTest() {
throw new Error('Wrong sort'); throw new Error('Wrong sort');
const descResponse = await request(context.app) const descResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
sortArrJson: JSON.stringify([ sortArrJson: JSON.stringify([
@ -879,7 +879,7 @@ function tableTest() {
}; };
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([filter]), filterArrJson: JSON.stringify([filter]),
@ -914,7 +914,7 @@ function tableTest() {
}; };
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([filter]), filterArrJson: JSON.stringify([filter]),
@ -957,7 +957,7 @@ function tableTest() {
}; };
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -967,7 +967,7 @@ function tableTest() {
expect(response.body.pageInfo.totalRows).equal(9558); expect(response.body.pageInfo.totalRows).equal(9558);
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -984,7 +984,7 @@ function tableTest() {
expect(ascResponse.body.list[0][lookupColumn.title]).equal('AARON'); expect(ascResponse.body.list[0][lookupColumn.title]).equal('AARON');
const descResponse = await request(context.app) const descResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -1051,7 +1051,7 @@ function tableTest() {
}; };
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -1067,7 +1067,7 @@ function tableTest() {
throw new Error('Wrong filter'); throw new Error('Wrong filter');
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -1091,7 +1091,7 @@ function tableTest() {
} }
const descResponse = await request(context.app) const descResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -1180,7 +1180,7 @@ function tableTest() {
]; ];
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -1198,7 +1198,7 @@ function tableTest() {
} }
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -1234,7 +1234,7 @@ function tableTest() {
} }
const descResponse = await request(context.app) const descResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
filterArrJson: JSON.stringify([nestedFilter]), filterArrJson: JSON.stringify([nestedFilter]),
@ -1327,7 +1327,7 @@ function tableTest() {
]; ];
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
nested: nestedFields, nested: nestedFields,
@ -1383,7 +1383,7 @@ function tableTest() {
}); });
const response = await request(context.app) const response = await request(context.app)
.get(`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}`) .get(`/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
sortArrJson: JSON.stringify([ sortArrJson: JSON.stringify([
@ -1459,7 +1459,7 @@ function tableTest() {
const table = await createTable(context, base); const table = await createTable(context, base);
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/data/noco/${base.id}/${table.id}`) .post(`/api/v1/db/data/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: 'Test', title: 'Test',
@ -1489,7 +1489,7 @@ function tableTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -1569,7 +1569,7 @@ function tableTest() {
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/find-one`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -1613,7 +1613,7 @@ function tableTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/groupby`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/groupby`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -1649,7 +1649,7 @@ function tableTest() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/groupby`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/groupby`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -1672,7 +1672,7 @@ function tableTest() {
const row = await createRow(context, { base, table }); const row = await createRow(context, { base, table });
const updateResponse = await request(context.app) const updateResponse = await request(context.app)
.patch(`/api/v1/data/noco/${base.id}/${table.id}/${row['Id']}`) .patch(`/api/v1/db/data/noco/${base.id}/${table.id}/${row['Id']}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: 'Updated', title: 'Updated',
@ -1697,7 +1697,7 @@ function tableTest() {
const row = await createRow(context, { base, table }); const row = await createRow(context, { base, table });
await request(context.app) await request(context.app)
.patch(`/api/v1/data/noco/${base.id}/${table.id}/${row['Id']}`) .patch(`/api/v1/db/data/noco/${base.id}/${table.id}/${row['Id']}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
[emailColumn.column_name]: 'invalidemail', [emailColumn.column_name]: 'invalidemail',
@ -1721,7 +1721,7 @@ function tableTest() {
const row = await createRow(context, { base, table }); const row = await createRow(context, { base, table });
const response = await request(context.app) const response = await request(context.app)
.patch(`/api/v1/data/noco/${base.id}/${table.id}/${row['Id']}`) .patch(`/api/v1/db/data/noco/${base.id}/${table.id}/${row['Id']}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
[emailColumn.column_name]: 'valid@example.com', [emailColumn.column_name]: 'valid@example.com',
@ -1743,7 +1743,7 @@ function tableTest() {
const row = await createRow(context, { base, table }); const row = await createRow(context, { base, table });
await request(context.app) await request(context.app)
.delete(`/api/v1/data/noco/${base.id}/${table.id}/${row['Id']}`) .delete(`/api/v1/db/data/noco/${base.id}/${table.id}/${row['Id']}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1779,7 +1779,7 @@ function tableTest() {
}); });
await request(context.app) await request(context.app)
.delete(`/api/v1/data/noco/${base.id}/${table.id}/${row['Id']}`) .delete(`/api/v1/db/data/noco/${base.id}/${table.id}/${row['Id']}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1798,7 +1798,7 @@ function tableTest() {
.map((index) => generateDefaultRowAttributes({ columns, index })); .map((index) => generateDefaultRowAttributes({ columns, index }));
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/data/bulk/noco/${base.id}/${table.id}`) .post(`/api/v1/db/data/bulk/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send(rowAttributes) .send(rowAttributes)
.expect(200); .expect(200);
@ -1835,7 +1835,7 @@ function tableTest() {
.map((index) => generateDefaultRowAttributes({ columns, index })); .map((index) => generateDefaultRowAttributes({ columns, index }));
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/data/bulk/noco/${base.id}/${table.id}`) .post(`/api/v1/db/data/bulk/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send(rowAttributes) .send(rowAttributes)
.expect(200); .expect(200);
@ -1883,7 +1883,7 @@ function tableTest() {
const rows = await listRow({ base, table }); const rows = await listRow({ base, table });
await request(context.app) await request(context.app)
.patch(`/api/v1/data/bulk/noco/${base.id}/${table.id}`) .patch(`/api/v1/db/data/bulk/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send( .send(
rows.map((row) => ({ title: `new-${row['Title']}`, id: row['Id'] })), rows.map((row) => ({ title: `new-${row['Title']}`, id: row['Id'] })),
@ -1912,7 +1912,7 @@ function tableTest() {
const rows = await listRow({ base, table }); const rows = await listRow({ base, table });
await request(context.app) await request(context.app)
.delete(`/api/v1/data/bulk/noco/${base.id}/${table.id}`) .delete(`/api/v1/db/data/bulk/noco/${base.id}/${table.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send(rows.map((row) => ({ id: row['Id'] }))) .send(rows.map((row) => ({ id: row['Id'] })))
.expect(200); .expect(200);
@ -2021,14 +2021,14 @@ function tableTest() {
const lisResponseBeforeUpdate = await request(context.app) const lisResponseBeforeUpdate = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
await request(context.app) await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -2036,7 +2036,7 @@ function tableTest() {
const lisResponseAfterUpdate = await request(context.app) const lisResponseAfterUpdate = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -2059,7 +2059,7 @@ function tableTest() {
const response = await request(context.app) const response = await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/invalid-column/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/invalid-column/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -2084,7 +2084,7 @@ function tableTest() {
const refId = 1; const refId = 1;
const response = await request(context.app) const response = await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${firstNameColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${firstNameColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -2108,7 +2108,7 @@ function tableTest() {
await request(context.app) await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(400); .expect(400);
@ -2130,14 +2130,14 @@ function tableTest() {
const lisResponseBeforeUpdate = await request(context.app) const lisResponseBeforeUpdate = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
await request(context.app) await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -2145,7 +2145,7 @@ function tableTest() {
const lisResponseAfterUpdate = await request(context.app) const lisResponseAfterUpdate = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -2171,14 +2171,14 @@ function tableTest() {
const lisResponseBeforeDelete = await request(context.app) const lisResponseBeforeDelete = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
await request(context.app) await request(context.app)
.delete( .delete(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -2186,7 +2186,7 @@ function tableTest() {
const lisResponseAfterDelete = await request(context.app) const lisResponseAfterDelete = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${actorTable.id}/${rowId}/mm/${filmListColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -2211,7 +2211,7 @@ function tableTest() {
const response = await request(context.app) const response = await request(context.app)
.delete( .delete(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/${refId}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/${rowId}/hm/${rentalListColumn.id}/${refId}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(400); .expect(400);
@ -2259,7 +2259,7 @@ function tableTest() {
const childRow = (await listRow({ base, table: relatedTable }))[0]; const childRow = (await listRow({ base, table: relatedTable }))[0];
const response = await request(context.app) const response = await request(context.app)
.delete( .delete(
`/api/v1/data/noco/${base.id}/${table.id}/${row['Id']}/hm/${ltarColumn.id}/${childRow['Id']}`, `/api/v1/db/data/noco/${base.id}/${table.id}/${row['Id']}/hm/${ltarColumn.id}/${childRow['Id']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -2286,7 +2286,7 @@ function tableTest() {
const response = await request(context.app) const response = await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/hm/${rentalListColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/hm/${rentalListColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);
@ -2308,7 +2308,7 @@ function tableTest() {
)!; )!;
const response = await request(context.app) const response = await request(context.app)
.post( .post(
`/api/v1/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/mm/${filmListColumn.id}/exclude`, `/api/v1/db/data/noco/${sakilaProject.id}/invalid-table-id/${rowId}/mm/${filmListColumn.id}/exclude`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(404); .expect(404);

66
packages/nocodb/tests/unit/rest/tests/viewRow.test.ts

@ -56,7 +56,7 @@ let filmKanbanView: View;
const testGetViewRowList = async (view: View) => { const testGetViewRowList = async (view: View) => {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -72,7 +72,7 @@ const testGetViewRowListKanban = async (view: View) => {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -155,7 +155,7 @@ function viewRowStaticTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -198,7 +198,7 @@ function viewRowStaticTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -230,7 +230,7 @@ function viewRowStaticTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -258,7 +258,7 @@ function viewRowStaticTests() {
Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize; Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize;
const lastPageResponse = await request(context.app) const lastPageResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -298,7 +298,7 @@ function viewRowStaticTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -329,7 +329,7 @@ function viewRowStaticTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -357,7 +357,7 @@ function viewRowStaticTests() {
Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize; Math.trunc(pageInfo.totalRows / pageInfo.pageSize) * pageInfo.pageSize;
const lastPageResponse = await request(context.app) const lastPageResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -397,7 +397,7 @@ function viewRowStaticTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${filmTable.id}/views/${view.id}/group/${ratingColumn.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -498,7 +498,7 @@ function viewRowTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -509,7 +509,7 @@ function viewRowTests() {
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -528,7 +528,7 @@ function viewRowTests() {
const descResponse = await request(context.app) const descResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${rentalTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${rentalTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -620,7 +620,7 @@ function viewRowTests() {
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -664,7 +664,7 @@ function viewRowTests() {
}); });
const response = await request(context.app) const response = await request(context.app)
.post(`/api/v1/data/noco/${base.id}/${table.id}/views/${view.id}`) .post(`/api/v1/db/data/noco/${base.id}/${table.id}/views/${view.id}`)
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
title: 'Test', title: 'Test',
@ -701,7 +701,7 @@ function viewRowTests() {
await request(context.app) await request(context.app)
.post( .post(
`/api/v1/data/noco/${base.id}/${table.id}/views/${nonRelatedView.id}`, `/api/v1/db/data/noco/${base.id}/${table.id}/views/${nonRelatedView.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
@ -743,7 +743,7 @@ function viewRowTests() {
let response = await request(context.app) let response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/find-one`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/find-one`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -764,7 +764,7 @@ function viewRowTests() {
response = await request(context.app) response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/find-one`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/find-one`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -867,7 +867,7 @@ function viewRowTests() {
const ascResponse = await request(context.app) const ascResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/find-one`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/find-one`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -929,7 +929,7 @@ function viewRowTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/groupby`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/groupby`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -980,7 +980,7 @@ function viewRowTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/groupby`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/groupby`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.query({ .query({
@ -1016,7 +1016,7 @@ function viewRowTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/count`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/count`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1040,7 +1040,7 @@ function viewRowTests() {
const listResponse = await request(context.app) const listResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1049,7 +1049,7 @@ function viewRowTests() {
const readResponse = await request(context.app) const readResponse = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/${row['CustomerId']}`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/${row['CustomerId']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1078,7 +1078,7 @@ function viewRowTests() {
const updateResponse = await request(context.app) const updateResponse = await request(context.app)
.patch( .patch(
`/api/v1/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`, `/api/v1/db/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
@ -1122,7 +1122,7 @@ function viewRowTests() {
await request(context.app) await request(context.app)
.patch( .patch(
`/api/v1/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`, `/api/v1/db/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
@ -1164,7 +1164,7 @@ function viewRowTests() {
const response = await request(context.app) const response = await request(context.app)
.patch( .patch(
`/api/v1/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`, `/api/v1/db/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.send({ .send({
@ -1202,7 +1202,7 @@ function viewRowTests() {
await request(context.app) await request(context.app)
.delete( .delete(
`/api/v1/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`, `/api/v1/db/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1256,7 +1256,7 @@ function viewRowTests() {
await request(context.app) await request(context.app)
.delete( .delete(
`/api/v1/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`, `/api/v1/db/data/noco/${base.id}/${table.id}/views/${view.id}/${row['Id']}`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1289,7 +1289,7 @@ function viewRowTests() {
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/${row['CustomerId']}/exist`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/${row['CustomerId']}/exist`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1312,7 +1312,7 @@ function viewRowTests() {
}); });
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/999999/exist`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.id}/views/${view.id}/999999/exist`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1335,7 +1335,7 @@ function viewRowTests() {
}); });
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.title}/views/${view.id}/export/csv`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.title}/views/${view.id}/export/csv`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);
@ -1359,7 +1359,7 @@ function viewRowTests() {
}); });
const response = await request(context.app) const response = await request(context.app)
.get( .get(
`/api/v1/data/noco/${sakilaProject.id}/${customerTable.title}/views/${view.id}/export/excel`, `/api/v1/db/data/noco/${sakilaProject.id}/${customerTable.title}/views/${view.id}/export/excel`,
) )
.set('xc-auth', context.token) .set('xc-auth', context.token)
.expect(200); .expect(200);

Loading…
Cancel
Save