Browse Source

fix: use newly added schema in swagger apis

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5174/head
Pranav C 2 years ago
parent
commit
eabaa635f3
  1. 84
      packages/nocodb-sdk/src/lib/Api.ts
  2. 137
      scripts/sdk/swagger.json

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

@ -1053,13 +1053,7 @@ export class Api<
* @response `401` `void` Unauthorized * @response `401` `void` Unauthorized
* @response `403` `void` Forbidden * @response `403` `void` Forbidden
*/ */
signup: ( signup: (data: SignUpReqType, params: RequestParams = {}) =>
data: {
email?: string;
password?: string;
},
params: RequestParams = {}
) =>
this.request< this.request<
{ {
token?: string; token?: string;
@ -1091,13 +1085,7 @@ export class Api<
}` Bad Request }` Bad Request
*/ */
signin: ( signin: (data: SignInReqType, params: RequestParams = {}) =>
data: {
email: string;
password: string;
},
params: RequestParams = {}
) =>
this.request< this.request<
{ {
token?: string; token?: string;
@ -1148,12 +1136,7 @@ export class Api<
* @response `200` `void` OK * @response `200` `void` OK
* @response `401` `void` Unauthorized * @response `401` `void` Unauthorized
*/ */
passwordForgot: ( passwordForgot: (data: ForgotPasswordReqType, params: RequestParams = {}) =>
data: {
email?: string;
},
params: RequestParams = {}
) =>
this.request<void, void>({ this.request<void, void>({
path: `/api/v1/auth/password/forgot`, path: `/api/v1/auth/password/forgot`,
method: 'POST', method: 'POST',
@ -1178,13 +1161,7 @@ export class Api<
}` Bad request }` Bad request
*/ */
passwordChange: ( passwordChange: (data: PasswordChangeReqType, params: RequestParams = {}) =>
data: {
currentPassword?: string;
newPassword?: string;
},
params: RequestParams = {}
) =>
this.request< this.request<
{ {
msg?: string; msg?: string;
@ -1244,9 +1221,7 @@ export class Api<
*/ */
passwordReset: ( passwordReset: (
token: string, token: string,
data: { data: PasswordResetReqType,
new_password?: string;
},
params: RequestParams = {} params: RequestParams = {}
) => ) =>
this.request<void, any>({ this.request<void, any>({
@ -1498,12 +1473,7 @@ export class Api<
* @request POST:/api/v1/license * @request POST:/api/v1/license
* @response `200` `void` OK * @response `200` `void` OK
*/ */
set: ( set: (data: LicenseReqType, params: RequestParams = {}) =>
data: {
key?: string;
},
params: RequestParams = {}
) =>
this.request<void, any>({ this.request<void, any>({
path: `/api/v1/license`, path: `/api/v1/license`,
method: 'POST', method: 'POST',
@ -1761,14 +1731,14 @@ export class Api<
* @tags Project * @tags Project
* @name ModelVisibilitySet * @name ModelVisibilitySet
* @request POST:/api/v1/db/meta/projects/{projectId}/visibility-rules * @request POST:/api/v1/db/meta/projects/{projectId}/visibility-rules
* @response `200` `any` OK * @response `200` `VisibilityRuleReqType` OK
*/ */
modelVisibilitySet: ( modelVisibilitySet: (
projectId: string, projectId: string,
data: any, data: any,
params: RequestParams = {} params: RequestParams = {}
) => ) =>
this.request<any, any>({ this.request<VisibilityRuleReqType, any>({
path: `/api/v1/db/meta/projects/${projectId}/visibility-rules`, path: `/api/v1/db/meta/projects/${projectId}/visibility-rules`,
method: 'POST', method: 'POST',
body: data, body: data,
@ -2612,7 +2582,11 @@ export class Api<
* @request POST:/api/v1/db/meta/tables/{tableId}/grids * @request POST:/api/v1/db/meta/tables/{tableId}/grids
* @response `200` `GridType` OK * @response `200` `GridType` OK
*/ */
gridCreate: (tableId: string, data: GridType, params: RequestParams = {}) => gridCreate: (
tableId: string,
data: GridReqType,
params: RequestParams = {}
) =>
this.request<GridType, any>({ this.request<GridType, any>({
path: `/api/v1/db/meta/tables/${tableId}/grids`, path: `/api/v1/db/meta/tables/${tableId}/grids`,
method: 'POST', method: 'POST',
@ -2630,7 +2604,11 @@ export class Api<
* @request POST:/api/v1/db/meta/tables/{tableId}/forms * @request POST:/api/v1/db/meta/tables/{tableId}/forms
* @response `200` `FormType` OK * @response `200` `FormType` OK
*/ */
formCreate: (tableId: string, data: FormType, params: RequestParams = {}) => formCreate: (
tableId: string,
data: FormReqType,
params: RequestParams = {}
) =>
this.request<FormType, any>({ this.request<FormType, any>({
path: `/api/v1/db/meta/tables/${tableId}/forms`, path: `/api/v1/db/meta/tables/${tableId}/forms`,
method: 'POST', method: 'POST',
@ -2761,7 +2739,7 @@ export class Api<
*/ */
galleryCreate: ( galleryCreate: (
tableId: string, tableId: string,
data: GalleryType, data: GalleryReqType,
params: RequestParams = {} params: RequestParams = {}
) => ) =>
this.request<object, any>({ this.request<object, any>({
@ -2783,7 +2761,7 @@ export class Api<
*/ */
galleryUpdate: ( galleryUpdate: (
galleryId: string, galleryId: string,
data: GalleryType, data: GalleryReqType,
params: RequestParams = {} params: RequestParams = {}
) => ) =>
this.request<void, any>({ this.request<void, any>({
@ -2820,7 +2798,7 @@ export class Api<
*/ */
kanbanCreate: ( kanbanCreate: (
tableId: string, tableId: string,
data: KanbanType, data: KanbanReqType,
params: RequestParams = {} params: RequestParams = {}
) => ) =>
this.request<object, any>({ this.request<object, any>({
@ -2842,7 +2820,7 @@ export class Api<
*/ */
kanbanUpdate: ( kanbanUpdate: (
kanbanId: string, kanbanId: string,
data: KanbanType, data: KanbanUpdateReqType,
params: RequestParams = {} params: RequestParams = {}
) => ) =>
this.request<void, any>({ this.request<void, any>({
@ -3182,7 +3160,7 @@ export class Api<
* @request POST:/api/v1/db/meta/views/{viewId}/filters * @request POST:/api/v1/db/meta/views/{viewId}/filters
* @response `200` `FilterType` OK * @response `200` `FilterType` OK
*/ */
create: (viewId: string, data: FilterType, params: RequestParams = {}) => create: (viewId: string, data: FilterReqType, params: RequestParams = {}) =>
this.request<FilterType, any>({ this.request<FilterType, any>({
path: `/api/v1/db/meta/views/${viewId}/filters`, path: `/api/v1/db/meta/views/${viewId}/filters`,
method: 'POST', method: 'POST',
@ -3216,7 +3194,11 @@ export class Api<
* @request PATCH:/api/v1/db/meta/filters/{filterId} * @request PATCH:/api/v1/db/meta/filters/{filterId}
* @response `200` `void` OK * @response `200` `void` OK
*/ */
update: (filterId: string, data: FilterType, params: RequestParams = {}) => update: (
filterId: string,
data: FilterReqType,
params: RequestParams = {}
) =>
this.request<void, any>({ this.request<void, any>({
path: `/api/v1/db/meta/filters/${filterId}`, path: `/api/v1/db/meta/filters/${filterId}`,
method: 'PATCH', method: 'PATCH',
@ -3280,7 +3262,7 @@ export class Api<
* @request POST:/api/v1/db/meta/hooks/{hookId}/filters * @request POST:/api/v1/db/meta/hooks/{hookId}/filters
* @response `200` `void` OK * @response `200` `void` OK
*/ */
create: (hookId: string, data: FilterType, params: RequestParams = {}) => create: (hookId: string, data: FilterReqType, params: RequestParams = {}) =>
this.request<void, any>({ this.request<void, any>({
path: `/api/v1/db/meta/hooks/${hookId}/filters`, path: `/api/v1/db/meta/hooks/${hookId}/filters`,
method: 'POST', method: 'POST',
@ -4705,13 +4687,7 @@ export class Api<
*/ */
test: ( test: (
tableId: string, tableId: string,
data: { data: HookTestReqType,
payload?: {
data?: any;
user?: any;
};
hook?: HookType;
},
params: RequestParams = {} params: RequestParams = {}
) => ) =>
this.request<any, any>({ this.request<any, any>({

137
scripts/sdk/swagger.json

@ -138,19 +138,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"type": "object", "$ref": "#/components/schemas/SignInReq"
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
}
},
"required": [
"email",
"password"
]
}, },
"examples": { "examples": {
"example-1": { "example-1": {
@ -234,12 +222,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"type": "object", "$ref": "#/components/schemas/ForgotPasswordReq"
"properties": {
"email": {
"type": "string"
}
}
} }
} }
}, },
@ -311,15 +294,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"type": "object", "$ref": "#/components/schemas/PasswordChangeReq"
"properties": {
"currentPassword": {
"type": "string"
},
"newPassword": {
"type": "string"
}
}
}, },
"examples": { "examples": {
"example-1": { "example-1": {
@ -403,12 +378,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"type": "object", "$ref": "#/components/schemas/PasswordResetReq"
"properties": {
"new_password": {
"type": "string"
}
}
} }
} }
} }
@ -557,12 +527,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"type": "object", "$ref": "#/components/schemas/LicenseReq"
"properties": {
"key": {
"type": "string"
}
}
} }
} }
} }
@ -1087,7 +1052,9 @@
"description": "OK", "description": "OK",
"content": { "content": {
"application/json": { "application/json": {
"schema": {} "schema": {
"$ref": "#/components/schemas/VisibilityRuleReq"
}
} }
} }
} }
@ -2701,7 +2668,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/Filter" "$ref": "#/components/schemas/FilterReq"
} }
} }
} }
@ -2746,7 +2713,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/Filter" "$ref": "#/components/schemas/FilterReq"
} }
} }
} }
@ -2798,7 +2765,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/Filter" "$ref": "#/components/schemas/FilterReq"
} }
} }
} }
@ -2884,7 +2851,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/Grid" "$ref": "#/components/schemas/GridReq"
} }
} }
} }
@ -2925,7 +2892,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/Form" "$ref": "#/components/schemas/FormReq"
} }
} }
} }
@ -3168,7 +3135,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/Gallery" "$ref": "#/components/schemas/GalleryReq"
} }
} }
} }
@ -3201,7 +3168,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/Gallery" "$ref": "#/components/schemas/GalleryReq"
} }
} }
} }
@ -3261,7 +3228,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/Kanban" "$ref": "#/components/schemas/KanbanReq"
} }
} }
} }
@ -3294,7 +3261,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/Kanban" "$ref": "#/components/schemas/KanbanUpdateReq"
} }
} }
} }
@ -6113,19 +6080,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"type": "object", "$ref": "#/components/schemas/HookTestReq"
"properties": {
"payload": {
"type": "object",
"properties": {
"data": {},
"user": {}
}
},
"hook": {
"$ref": "#/components/schemas/Hook"
}
}
} }
} }
} }
@ -9106,12 +9061,12 @@
}, },
"meta": { "meta": {
"oneOf": [ "oneOf": [
{ {
"type": "object" "type": "object"
}, },
{ {
"type": "null" "type": "null"
}, },
{ {
"type": "string" "type": "string"
} }
@ -9752,7 +9707,7 @@
"async": { "async": {
"type": "boolean" "type": "boolean"
}, },
"payload": { }, "payload": {},
"url": { "url": {
"type": "string" "type": "string"
}, },
@ -9821,7 +9776,7 @@
] ]
}, },
"async": { "async": {
"oneOf": [ "oneOf": [
{ {
"type": "string" "type": "string"
}, },
@ -10108,16 +10063,14 @@
"type": "string" "type": "string"
}, },
"fk_hook_id": { "fk_hook_id": {
"oneOf": [
"oneOf": [ {
{ "type": "string"
"type": "string" },
}, {
{ "type": "null"
"type": "null" }
} ]
]
}, },
"type": { "type": {
"type": "string" "type": "string"
@ -10540,27 +10493,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"description": "", "$ref": "#/components/schemas/SignUpReq"
"type": "object",
"x-examples": {
"example-1": {
"email": true
}
},
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
}
}
}
},
"application/xml": {
"schema": {
"type": "object",
"properties": {}
} }
} }
} }

Loading…
Cancel
Save