|
|
@ -25,7 +25,7 @@ export const getModelPaths = async (ctx: { |
|
|
|
columns: SwaggerColumn[]; |
|
|
|
columns: SwaggerColumn[]; |
|
|
|
baseName: string; |
|
|
|
baseName: string; |
|
|
|
}): Promise<{ [path: string]: any }> => ({ |
|
|
|
}): Promise<{ [path: string]: any }> => ({ |
|
|
|
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}`]: { |
|
|
|
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}`]: { |
|
|
|
get: { |
|
|
|
get: { |
|
|
|
summary: `${ctx.tableName} list`, |
|
|
|
summary: `${ctx.tableName} list`, |
|
|
|
operationId: `${ctx.tableName.toLowerCase()}-db-table-row-list`, |
|
|
|
operationId: `${ctx.tableName.toLowerCase()}-db-table-row-list`, |
|
|
@ -84,7 +84,7 @@ export const getModelPaths = async (ctx: { |
|
|
|
} |
|
|
|
} |
|
|
|
: {}), |
|
|
|
: {}), |
|
|
|
}, |
|
|
|
}, |
|
|
|
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}`]: { |
|
|
|
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}`]: { |
|
|
|
parameters: [rowIdParam], |
|
|
|
parameters: [rowIdParam], |
|
|
|
...(ctx.type === ModelTypes.TABLE |
|
|
|
...(ctx.type === ModelTypes.TABLE |
|
|
|
? { |
|
|
|
? { |
|
|
@ -149,7 +149,7 @@ export const getModelPaths = async (ctx: { |
|
|
|
} |
|
|
|
} |
|
|
|
: {}), |
|
|
|
: {}), |
|
|
|
}, |
|
|
|
}, |
|
|
|
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/count`]: { |
|
|
|
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/count`]: { |
|
|
|
get: { |
|
|
|
get: { |
|
|
|
summary: `${ctx.tableName} count`, |
|
|
|
summary: `${ctx.tableName} count`, |
|
|
|
operationId: `${ctx.tableName.toLowerCase()}-count`, |
|
|
|
operationId: `${ctx.tableName.toLowerCase()}-count`, |
|
|
@ -168,7 +168,7 @@ export const getModelPaths = async (ctx: { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/find-one`]: { |
|
|
|
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/find-one`]: { |
|
|
|
get: { |
|
|
|
get: { |
|
|
|
summary: `${ctx.tableName} find-one`, |
|
|
|
summary: `${ctx.tableName} find-one`, |
|
|
|
operationId: `${ctx.tableName.toLowerCase()}-db-table-row-find-one`, |
|
|
|
operationId: `${ctx.tableName.toLowerCase()}-db-table-row-find-one`, |
|
|
@ -189,7 +189,7 @@ export const getModelPaths = async (ctx: { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/groupby`]: { |
|
|
|
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/groupby`]: { |
|
|
|
get: { |
|
|
|
get: { |
|
|
|
summary: `${ctx.tableName} groupby`, |
|
|
|
summary: `${ctx.tableName} groupby`, |
|
|
|
operationId: `${ctx.tableName.toLowerCase()}-groupby`, |
|
|
|
operationId: `${ctx.tableName.toLowerCase()}-groupby`, |
|
|
@ -230,7 +230,7 @@ export const getModelPaths = async (ctx: { |
|
|
|
}, |
|
|
|
}, |
|
|
|
...(ctx.type === ModelTypes.TABLE |
|
|
|
...(ctx.type === ModelTypes.TABLE |
|
|
|
? { |
|
|
|
? { |
|
|
|
[`/api/v1/data/bulk/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}`]: { |
|
|
|
[`/api/v1/db/data/bulk/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}`]: { |
|
|
|
post: { |
|
|
|
post: { |
|
|
|
summary: `${ctx.tableName} bulk insert`, |
|
|
|
summary: `${ctx.tableName} bulk insert`, |
|
|
|
description: |
|
|
|
description: |
|
|
@ -304,7 +304,7 @@ export const getModelPaths = async (ctx: { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
[`/api/v1/data/bulk/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/all`]: |
|
|
|
[`/api/v1/db/data/bulk/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/all`]: |
|
|
|
{ |
|
|
|
{ |
|
|
|
parameters: [whereParam], |
|
|
|
parameters: [whereParam], |
|
|
|
patch: { |
|
|
|
patch: { |
|
|
@ -352,7 +352,7 @@ export const getModelPaths = async (ctx: { |
|
|
|
|
|
|
|
|
|
|
|
...(isRelationExist(ctx.columns) |
|
|
|
...(isRelationExist(ctx.columns) |
|
|
|
? { |
|
|
|
? { |
|
|
|
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}/{relationType}/{columnName}`]: |
|
|
|
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}/{relationType}/{columnName}`]: |
|
|
|
{ |
|
|
|
{ |
|
|
|
parameters: [ |
|
|
|
parameters: [ |
|
|
|
rowIdParam, |
|
|
|
rowIdParam, |
|
|
@ -376,7 +376,7 @@ export const getModelPaths = async (ctx: { |
|
|
|
parameters: [limitParam, offsetParam], |
|
|
|
parameters: [limitParam, offsetParam], |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}/{relationType}/{columnName}/{refRowId}`]: |
|
|
|
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}/{relationType}/{columnName}/{refRowId}`]: |
|
|
|
{ |
|
|
|
{ |
|
|
|
parameters: [ |
|
|
|
parameters: [ |
|
|
|
rowIdParam, |
|
|
|
rowIdParam, |
|
|
@ -417,7 +417,7 @@ export const getModelPaths = async (ctx: { |
|
|
|
tags: [ctx.tableName], |
|
|
|
tags: [ctx.tableName], |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}/{relationType}/{columnName}/exclude`]: |
|
|
|
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/{rowId}/{relationType}/{columnName}/exclude`]: |
|
|
|
{ |
|
|
|
{ |
|
|
|
parameters: [ |
|
|
|
parameters: [ |
|
|
|
rowIdParam, |
|
|
|
rowIdParam, |
|
|
@ -446,7 +446,7 @@ export const getModelPaths = async (ctx: { |
|
|
|
: {}), |
|
|
|
: {}), |
|
|
|
} |
|
|
|
} |
|
|
|
: {}), |
|
|
|
: {}), |
|
|
|
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/export/{type}`]: { |
|
|
|
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/export/{type}`]: { |
|
|
|
parameters: [exportTypeParam], |
|
|
|
parameters: [exportTypeParam], |
|
|
|
get: { |
|
|
|
get: { |
|
|
|
summary: 'Rows export', |
|
|
|
summary: 'Rows export', |
|
|
@ -478,7 +478,7 @@ export const getViewPaths = async (ctx: { |
|
|
|
baseName: string; |
|
|
|
baseName: string; |
|
|
|
columns: SwaggerColumn[]; |
|
|
|
columns: SwaggerColumn[]; |
|
|
|
}): Promise<any> => ({ |
|
|
|
}): Promise<any> => ({ |
|
|
|
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}`]: |
|
|
|
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}`]: |
|
|
|
{ |
|
|
|
{ |
|
|
|
get: { |
|
|
|
get: { |
|
|
|
summary: `${ctx.viewName} list`, |
|
|
|
summary: `${ctx.viewName} list`, |
|
|
@ -535,7 +535,7 @@ export const getViewPaths = async (ctx: { |
|
|
|
} |
|
|
|
} |
|
|
|
: {}), |
|
|
|
: {}), |
|
|
|
}, |
|
|
|
}, |
|
|
|
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}/count`]: |
|
|
|
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}/count`]: |
|
|
|
{ |
|
|
|
{ |
|
|
|
get: { |
|
|
|
get: { |
|
|
|
summary: `${ctx.viewName} count`, |
|
|
|
summary: `${ctx.viewName} count`, |
|
|
@ -562,7 +562,7 @@ export const getViewPaths = async (ctx: { |
|
|
|
}, |
|
|
|
}, |
|
|
|
...(ctx.type === ModelTypes.TABLE |
|
|
|
...(ctx.type === ModelTypes.TABLE |
|
|
|
? { |
|
|
|
? { |
|
|
|
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}/{rowId}`]: |
|
|
|
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}/{rowId}`]: |
|
|
|
{ |
|
|
|
{ |
|
|
|
parameters: [rowIdParam], |
|
|
|
parameters: [rowIdParam], |
|
|
|
get: { |
|
|
|
get: { |
|
|
@ -625,7 +625,7 @@ export const getViewPaths = async (ctx: { |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
: {}), |
|
|
|
: {}), |
|
|
|
[`/api/v1/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}/export/{type}`]: |
|
|
|
[`/api/v1/db/data/${ctx.orgs}/${ctx.baseName}/${ctx.tableName}/views/${ctx.viewName}/export/{type}`]: |
|
|
|
{ |
|
|
|
{ |
|
|
|
parameters: [exportTypeParam], |
|
|
|
parameters: [exportTypeParam], |
|
|
|
get: { |
|
|
|
get: { |
|
|
|