Browse Source

fix: build

pull/9788/head
DarkPhoenix2704 2 weeks ago
parent
commit
d65d3d21eb
No known key found for this signature in database
GPG Key ID: 3F76B10622A07849
  1. 118
      packages/nocodb-sdk/src/lib/Api.ts
  2. 2
      packages/nocodb/src/db/BaseModelSqlv2.ts

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

@ -5480,6 +5480,54 @@ export class Api<
...params,
}),
/**
* @description Duplicate a shared base
*
* @tags Base
* @name DuplicateShared
* @summary Duplicate Shared Base
* @request POST:/api/v2/meta/duplicate/{workspaceId}/shared/{sharedBaseId}
* @response `200` `{
name?: string,
id?: string,
}` OK
* @response `400` `{
\** @example BadRequest [Error]: <ERROR MESSAGE> *\
msg: string,
}`
*/
duplicateShared: (
workspaceId: IdType,
sharedBaseId: any,
data: {
options?: {
excludeData?: boolean;
excludeViews?: boolean;
};
base?: object;
},
params: RequestParams = {}
) =>
this.request<
{
name?: string;
id?: string;
},
{
/** @example BadRequest [Error]: <ERROR MESSAGE> */
msg: string;
}
>({
path: `/api/v2/meta/duplicate/${workspaceId}/shared/${sharedBaseId}`,
method: 'POST',
body: data,
type: ContentType.Json,
format: 'json',
...params,
}),
/**
* @description Synchronise the meta data difference between NC_DB and external data sources
*
@ -8415,6 +8463,42 @@ export class Api<
...params,
}),
/**
* @description Bulk upsert table rows in one go.
*
* @tags DB Table Row
* @name BulkUpsert
* @summary Bulk Upsert Table Rows
* @request POST:/api/v1/db/data/bulk/{orgs}/{baseName}/{tableName}/upsert
* @response `200` `(any)[]` OK
* @response `400` `{
\** @example BadRequest [Error]: <ERROR MESSAGE> *\
msg: string,
}`
*/
bulkUpsert: (
orgs: string,
baseName: string,
tableName: string,
data: object[],
params: RequestParams = {}
) =>
this.request<
any[],
{
/** @example BadRequest [Error]: <ERROR MESSAGE> */
msg: string;
}
>({
path: `/api/v1/db/data/bulk/${orgs}/${baseName}/${tableName}/upsert`,
method: 'POST',
body: data,
type: ContentType.Json,
format: 'json',
...params,
}),
/**
* @description Bulk insert table rows in one go.
*
@ -9466,6 +9550,40 @@ export class Api<
...params,
}),
/**
* @description Count how many rows in the given Table View
*
* @tags Public
* @name DbViewRowCount
* @summary Count Table View Rows
* @request GET:/api/v2/public/shared-view/{sharedViewUuid}/count
* @response `200` `{
count?: number,
}` OK
*/
dbViewRowCount: (
sharedViewUuid: string,
query?: {
where?: string;
/** Query params for nested data */
nested?: any;
},
params: RequestParams = {}
) =>
this.request<
{
count?: number;
},
any
>({
path: `/api/v2/public/shared-view/${sharedViewUuid}/count`,
method: 'GET',
query: query,
format: 'json',
...params,
}),
/**
* @description Read bulk data from a given table with provided filters
*

2
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -5501,7 +5501,7 @@ class BaseModelSqlv2 {
) {
const { allowSystemColumn } = params;
const cols = columns || (await this.model.getColumns(this.context));
let insertObj;
let insertObj = {};
for (let i = 0; i < cols.length; ++i) {
const col = cols[i];

Loading…
Cancel
Save