@@ -11,6 +11,7 @@ import {
1111 DeleteTableResult ,
1212} from "../types" ;
1313import { withDefaults } from "../utils" ;
14+ import { deprecationWarning } from "../deprecation" ;
1415
1516/**
1617 * Table Management Interface (includes uploadCSV)
@@ -24,8 +25,10 @@ export class TableAPI extends Router {
2425 *
2526 * @param args UploadCSVParams relevant fields related to dataset upload.
2627 * @returns boolean representing if upload was successful.
28+ * @deprecated Use uploads.uploadCsv() instead. The /v1/table endpoints are deprecated in favor of /v1/uploads.
2729 */
2830 async uploadCsv ( args : UploadCSVArgs ) : Promise < boolean > {
31+ deprecationWarning ( "table.uploadCsv" , "uploads.uploadCsv" ) ;
2932 const response = await this . post < SuccessResponse > ( "table/upload/csv" , args ) ;
3033 try {
3134 return Boolean ( response . success ) ;
@@ -44,10 +47,12 @@ export class TableAPI extends Router {
4447 *
4548 * The only limitations are:
4649 * - If a table already exists with the same name, the request will fail.
47- * - Column names in the table can’ t start with a special character or a digit.
50+ * - Column names in the table can' t start with a special character or a digit.
4851 * @param args
52+ * @deprecated Use uploads.create() instead. The /v1/table endpoints are deprecated in favor of /v1/uploads.
4953 */
5054 async create ( args : CreateTableArgs ) : Promise < CreateTableResult > {
55+ deprecationWarning ( "table.create" , "uploads.create" ) ;
5156 return this . post < CreateTableResult > (
5257 "table/create" ,
5358 withDefaults < CreateTableArgs > ( args , { description : "" , is_private : false } ) ,
@@ -59,8 +64,10 @@ export class TableAPI extends Router {
5964 * Delete a Dune table with the specified name and namespace.
6065 *
6166 * To be able to delete a table, it must have been created with the /create endpoint.
67+ * @deprecated Use uploads.delete() instead. The /v1/table endpoints are deprecated in favor of /v1/uploads.
6268 */
6369 async delete ( args : DeleteTableArgs ) : Promise < DeleteTableResult > {
70+ deprecationWarning ( "table.delete" , "uploads.delete" ) ;
6471 const route = `table/${ args . namespace } /${ args . table_name } ` ;
6572 return this . _delete < DeleteTableResult > ( route ) ;
6673 }
@@ -73,8 +80,10 @@ export class TableAPI extends Router {
7380 * - The file has to have the same schema as the table
7481 * @param args
7582 * @returns
83+ * @deprecated Use uploads.insert() instead. The /v1/table endpoints are deprecated in favor of /v1/uploads.
7684 */
7785 async insert ( args : InsertTableArgs ) : Promise < InsertTableResult > {
86+ deprecationWarning ( "table.insert" , "uploads.insert" ) ;
7887 return this . post < InsertTableResult > (
7988 `table/${ args . namespace } /${ args . table_name } /insert` ,
8089 args . data ,
0 commit comments