oblien 1.3.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +31 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +33 -0
- package/dist/client.js.map +1 -0
- package/dist/error.d.ts +29 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +52 -0
- package/dist/error.js.map +1 -0
- package/dist/http.d.ts +20 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +108 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/api-access.d.ts +21 -0
- package/dist/resources/api-access.d.ts.map +1 -0
- package/dist/resources/api-access.js +32 -0
- package/dist/resources/api-access.js.map +1 -0
- package/dist/resources/base.d.ts +17 -0
- package/dist/resources/base.d.ts.map +1 -0
- package/dist/resources/base.js +21 -0
- package/dist/resources/base.js.map +1 -0
- package/dist/resources/images.d.ts +11 -0
- package/dist/resources/images.d.ts.map +1 -0
- package/dist/resources/images.js +16 -0
- package/dist/resources/images.js.map +1 -0
- package/dist/resources/lifecycle.d.ts +23 -0
- package/dist/resources/lifecycle.d.ts.map +1 -0
- package/dist/resources/lifecycle.js +32 -0
- package/dist/resources/lifecycle.js.map +1 -0
- package/dist/resources/logs.d.ts +25 -0
- package/dist/resources/logs.d.ts.map +1 -0
- package/dist/resources/logs.js +51 -0
- package/dist/resources/logs.js.map +1 -0
- package/dist/resources/metadata.d.ts +15 -0
- package/dist/resources/metadata.d.ts.map +1 -0
- package/dist/resources/metadata.js +20 -0
- package/dist/resources/metadata.js.map +1 -0
- package/dist/resources/metrics.d.ts +17 -0
- package/dist/resources/metrics.d.ts.map +1 -0
- package/dist/resources/metrics.js +27 -0
- package/dist/resources/metrics.js.map +1 -0
- package/dist/resources/network.d.ts +17 -0
- package/dist/resources/network.d.ts.map +1 -0
- package/dist/resources/network.js +20 -0
- package/dist/resources/network.js.map +1 -0
- package/dist/resources/public-access.d.ts +15 -0
- package/dist/resources/public-access.d.ts.map +1 -0
- package/dist/resources/public-access.js +21 -0
- package/dist/resources/public-access.js.map +1 -0
- package/dist/resources/resources.d.ts +15 -0
- package/dist/resources/resources.d.ts.map +1 -0
- package/dist/resources/resources.js +20 -0
- package/dist/resources/resources.js.map +1 -0
- package/dist/resources/snapshots.d.ts +27 -0
- package/dist/resources/snapshots.d.ts.map +1 -0
- package/dist/resources/snapshots.js +45 -0
- package/dist/resources/snapshots.js.map +1 -0
- package/dist/resources/ssh.d.ts +19 -0
- package/dist/resources/ssh.d.ts.map +1 -0
- package/dist/resources/ssh.js +28 -0
- package/dist/resources/ssh.js.map +1 -0
- package/dist/resources/usage.d.ts +25 -0
- package/dist/resources/usage.d.ts.map +1 -0
- package/dist/resources/usage.js +44 -0
- package/dist/resources/usage.js.map +1 -0
- package/dist/resources/workloads.d.ts +39 -0
- package/dist/resources/workloads.d.ts.map +1 -0
- package/dist/resources/workloads.js +83 -0
- package/dist/resources/workloads.js.map +1 -0
- package/dist/runtime/exec.d.ts +71 -0
- package/dist/runtime/exec.d.ts.map +1 -0
- package/dist/runtime/exec.js +163 -0
- package/dist/runtime/exec.js.map +1 -0
- package/dist/runtime/files.d.ts +39 -0
- package/dist/runtime/files.d.ts.map +1 -0
- package/dist/runtime/files.js +143 -0
- package/dist/runtime/files.js.map +1 -0
- package/dist/runtime/search.d.ts +23 -0
- package/dist/runtime/search.d.ts.map +1 -0
- package/dist/runtime/search.js +65 -0
- package/dist/runtime/search.js.map +1 -0
- package/dist/runtime/terminal.d.ts +29 -0
- package/dist/runtime/terminal.d.ts.map +1 -0
- package/dist/runtime/terminal.js +58 -0
- package/dist/runtime/terminal.js.map +1 -0
- package/dist/runtime/watcher.d.ts +27 -0
- package/dist/runtime/watcher.d.ts.map +1 -0
- package/dist/runtime/watcher.js +53 -0
- package/dist/runtime/watcher.js.map +1 -0
- package/dist/runtime/ws.d.ts +92 -0
- package/dist/runtime/ws.d.ts.map +1 -0
- package/dist/runtime/ws.js +228 -0
- package/dist/runtime/ws.js.map +1 -0
- package/dist/runtime-http.d.ts +35 -0
- package/dist/runtime-http.d.ts.map +1 -0
- package/dist/runtime-http.js +99 -0
- package/dist/runtime-http.js.map +1 -0
- package/dist/runtime.d.ts +77 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +97 -0
- package/dist/runtime.js.map +1 -0
- package/dist/types/client.d.ts +7 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/client.js +3 -0
- package/dist/types/client.js.map +1 -0
- package/dist/types/common.d.ts +13 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +3 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/network.d.ts +15 -0
- package/dist/types/network.d.ts.map +1 -0
- package/dist/types/network.js +3 -0
- package/dist/types/network.js.map +1 -0
- package/dist/types/resources.d.ts +10 -0
- package/dist/types/resources.d.ts.map +1 -0
- package/dist/types/resources.js +3 -0
- package/dist/types/resources.js.map +1 -0
- package/dist/types/runtime.d.ts +302 -0
- package/dist/types/runtime.d.ts.map +1 -0
- package/dist/types/runtime.js +3 -0
- package/dist/types/runtime.js.map +1 -0
- package/dist/types/workspace-resources.d.ts +186 -0
- package/dist/types/workspace-resources.d.ts.map +1 -0
- package/dist/types/workspace-resources.js +3 -0
- package/dist/types/workspace-resources.js.map +1 -0
- package/dist/types/workspace.d.ts +41 -0
- package/dist/types/workspace.d.ts.map +1 -0
- package/dist/types/workspace.js +3 -0
- package/dist/types/workspace.js.map +1 -0
- package/dist/workspace.d.ts +135 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +194 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +30 -69
- package/LICENSE +0 -21
- package/README.md +0 -574
- package/agents.js +0 -14
- package/browser.js +0 -6
- package/cdn.js +0 -6
- package/chat.js +0 -21
- package/credits.js +0 -11
- package/icons.js +0 -11
- package/index.d.ts +0 -986
- package/index.js +0 -63
- package/namespaces.js +0 -12
- package/sandbox.js +0 -12
- package/search.js +0 -11
- package/src/agents/agent.js +0 -229
- package/src/agents/index.js +0 -227
- package/src/agents/settings.js +0 -100
- package/src/agents/tools.js +0 -155
- package/src/browser/index.js +0 -474
- package/src/cdn/index.js +0 -769
- package/src/chat/index.js +0 -724
- package/src/chat/session.js +0 -93
- package/src/client.js +0 -175
- package/src/credits/index.js +0 -492
- package/src/icons/index.js +0 -185
- package/src/namespaces/index.js +0 -236
- package/src/namespaces/namespace.js +0 -274
- package/src/sandbox/core/api/base.js +0 -89
- package/src/sandbox/core/api/database.js +0 -340
- package/src/sandbox/core/api/files.js +0 -141
- package/src/sandbox/core/api/git.js +0 -174
- package/src/sandbox/core/api/search.js +0 -29
- package/src/sandbox/core/api/snapshots.js +0 -132
- package/src/sandbox/core/api/terminal.js +0 -20
- package/src/sandbox/core/auth.js +0 -256
- package/src/sandbox/core/client.js +0 -197
- package/src/sandbox/core/index.js +0 -22
- package/src/sandbox/core/managers/terminal.js +0 -453
- package/src/sandbox/core/managers/watcher.js +0 -197
- package/src/sandbox/core/types.js +0 -92
- package/src/sandbox/core/utils/http.js +0 -89
- package/src/sandbox/core/websocket/connection.js +0 -479
- package/src/sandbox/index.d.ts +0 -542
- package/src/sandbox/index.js +0 -234
- package/src/sandbox/sandbox.js +0 -313
- package/src/search/index.js +0 -206
- package/src/utils/guest-manager.js +0 -454
|
@@ -1,340 +0,0 @@
|
|
|
1
|
-
import { BaseAPI } from './base.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Database API - Handle all database operations
|
|
5
|
-
*/
|
|
6
|
-
export class DatabaseAPI extends BaseAPI {
|
|
7
|
-
// ============ Database Operations ============
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* List all databases
|
|
11
|
-
* @returns {Promise<Object>} List of databases
|
|
12
|
-
*/
|
|
13
|
-
async listDatabases() {
|
|
14
|
-
return this.get('/database/list');
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Create a new database
|
|
19
|
-
* @param {Object} options - Create options
|
|
20
|
-
* @param {string} options.name - Database name
|
|
21
|
-
* @returns {Promise<Object>} Create result
|
|
22
|
-
*/
|
|
23
|
-
async createDatabase(options) {
|
|
24
|
-
return this.post('/database/create', options);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Delete a database
|
|
29
|
-
* @param {Object} options - Delete options
|
|
30
|
-
* @param {string} options.database - Database name
|
|
31
|
-
* @returns {Promise<Object>} Delete result
|
|
32
|
-
*/
|
|
33
|
-
async deleteDatabase(options) {
|
|
34
|
-
return this.post('/database/delete', options);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Get database information
|
|
39
|
-
* @param {string} database - Database name
|
|
40
|
-
* @returns {Promise<Object>} Database info
|
|
41
|
-
*/
|
|
42
|
-
async getDatabaseInfo(database) {
|
|
43
|
-
return this.get(`/database/${database}/info`);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// ============ Table Operations ============
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* List tables in a database
|
|
50
|
-
* @param {string} database - Database name
|
|
51
|
-
* @returns {Promise<Object>} List of tables
|
|
52
|
-
*/
|
|
53
|
-
async listTables(database) {
|
|
54
|
-
return this.get(`/database/${database}/tables`);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Get table schema
|
|
59
|
-
* @param {string} database - Database name
|
|
60
|
-
* @param {string} table - Table name
|
|
61
|
-
* @returns {Promise<Object>} Table schema
|
|
62
|
-
*/
|
|
63
|
-
async getTableSchema(database, table) {
|
|
64
|
-
return this.get(`/database/${database}/tables/${table}/schema`);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Create a new table
|
|
69
|
-
* @param {Object} options - Create options
|
|
70
|
-
* @param {string} options.database - Database name
|
|
71
|
-
* @param {string} options.tableName - Table name
|
|
72
|
-
* @param {Array<Object>} options.columns - Column definitions
|
|
73
|
-
* @returns {Promise<Object>} Create result
|
|
74
|
-
*/
|
|
75
|
-
async createTable(options) {
|
|
76
|
-
const { database, ...body } = options;
|
|
77
|
-
return this.post(`/database/${database}/tables/create`, body);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Drop a table
|
|
82
|
-
* @param {string} database - Database name
|
|
83
|
-
* @param {string} table - Table name
|
|
84
|
-
* @returns {Promise<Object>} Drop result
|
|
85
|
-
*/
|
|
86
|
-
async dropTable(database, table) {
|
|
87
|
-
return this.post(`/database/${database}/tables/${table}/drop`);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Rename a table
|
|
92
|
-
* @param {Object} options - Rename options
|
|
93
|
-
* @param {string} options.database - Database name
|
|
94
|
-
* @param {string} options.table - Current table name
|
|
95
|
-
* @param {string} options.newName - New table name
|
|
96
|
-
* @returns {Promise<Object>} Rename result
|
|
97
|
-
*/
|
|
98
|
-
async renameTable(options) {
|
|
99
|
-
const { database, table, newName } = options;
|
|
100
|
-
return this.post(`/database/${database}/tables/${table}/rename`, { newName });
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// ============ Data Operations ============
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Get table data with pagination and sorting
|
|
107
|
-
* @param {Object} options - Query options
|
|
108
|
-
* @param {string} options.database - Database name
|
|
109
|
-
* @param {string} options.table - Table name
|
|
110
|
-
* @param {number} [options.page] - Page number
|
|
111
|
-
* @param {number} [options.limit] - Results per page
|
|
112
|
-
* @param {string} [options.sortBy] - Column to sort by
|
|
113
|
-
* @param {string} [options.sortOrder] - Sort order (asc/desc)
|
|
114
|
-
* @param {Object} [options.where] - Where conditions
|
|
115
|
-
* @returns {Promise<Object>} Table data
|
|
116
|
-
*/
|
|
117
|
-
async getTableData(options) {
|
|
118
|
-
const { database, table, ...body } = options;
|
|
119
|
-
return this.post(`/database/${database}/tables/${table}/data`, body);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Insert a row into a table
|
|
124
|
-
* @param {Object} options - Insert options
|
|
125
|
-
* @param {string} options.database - Database name
|
|
126
|
-
* @param {string} options.table - Table name
|
|
127
|
-
* @param {Object} options.data - Row data
|
|
128
|
-
* @returns {Promise<Object>} Insert result
|
|
129
|
-
*/
|
|
130
|
-
async insertRow(options) {
|
|
131
|
-
const { database, table, data } = options;
|
|
132
|
-
return this.post(`/database/${database}/tables/${table}/insert`, { data });
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Update rows in a table
|
|
137
|
-
* @param {Object} options - Update options
|
|
138
|
-
* @param {string} options.database - Database name
|
|
139
|
-
* @param {string} options.table - Table name
|
|
140
|
-
* @param {Object} options.data - New data
|
|
141
|
-
* @param {Object} options.where - Where conditions
|
|
142
|
-
* @returns {Promise<Object>} Update result
|
|
143
|
-
*/
|
|
144
|
-
async updateRow(options) {
|
|
145
|
-
const { database, table, data, where } = options;
|
|
146
|
-
return this.post(`/database/${database}/tables/${table}/update`, { data, where });
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Delete rows from a table
|
|
151
|
-
* @param {Object} options - Delete options
|
|
152
|
-
* @param {string} options.database - Database name
|
|
153
|
-
* @param {string} options.table - Table name
|
|
154
|
-
* @param {Object} options.where - Where conditions
|
|
155
|
-
* @returns {Promise<Object>} Delete result
|
|
156
|
-
*/
|
|
157
|
-
async deleteRow(options) {
|
|
158
|
-
const { database, table, where } = options;
|
|
159
|
-
return this.post(`/database/${database}/tables/${table}/delete`, { where });
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// ============ Query Operations ============
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Execute a custom SQL query
|
|
166
|
-
* @param {Object} options - Query options
|
|
167
|
-
* @param {string} options.database - Database name
|
|
168
|
-
* @param {string} options.query - SQL query
|
|
169
|
-
* @param {Array} [options.params] - Query parameters
|
|
170
|
-
* @returns {Promise<Object>} Query result
|
|
171
|
-
*/
|
|
172
|
-
async executeQuery(options) {
|
|
173
|
-
const { database, query, params } = options;
|
|
174
|
-
return this.post(`/database/${database}/query`, { query, params });
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Execute a transaction with multiple queries
|
|
179
|
-
* @param {Object} options - Transaction options
|
|
180
|
-
* @param {string} options.database - Database name
|
|
181
|
-
* @param {Array<Object>} options.queries - Array of query objects
|
|
182
|
-
* @returns {Promise<Object>} Transaction result
|
|
183
|
-
*/
|
|
184
|
-
async executeTransaction(options) {
|
|
185
|
-
const { database, queries } = options;
|
|
186
|
-
return this.post(`/database/${database}/transaction`, { queries });
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// ============ Import/Export Operations ============
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Export table data to JSON
|
|
193
|
-
* @param {string} database - Database name
|
|
194
|
-
* @param {string} table - Table name
|
|
195
|
-
* @returns {Promise<Object>} JSON export result
|
|
196
|
-
*/
|
|
197
|
-
async exportTableToJSON(database, table) {
|
|
198
|
-
return this.get(`/database/${database}/tables/${table}/export/json`);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Export table data to CSV
|
|
203
|
-
* @param {string} database - Database name
|
|
204
|
-
* @param {string} table - Table name
|
|
205
|
-
* @returns {Promise<Object>} CSV export result
|
|
206
|
-
*/
|
|
207
|
-
async exportTableToCSV(database, table) {
|
|
208
|
-
return this.get(`/database/${database}/tables/${table}/export/csv`);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Import data from JSON
|
|
213
|
-
* @param {Object} options - Import options
|
|
214
|
-
* @param {string} options.database - Database name
|
|
215
|
-
* @param {string} options.table - Table name
|
|
216
|
-
* @param {Array<Object>} options.data - Data to import
|
|
217
|
-
* @param {Object} [options.options] - Import options
|
|
218
|
-
* @returns {Promise<Object>} Import result
|
|
219
|
-
*/
|
|
220
|
-
async importFromJSON(options) {
|
|
221
|
-
const { database, table, data, options: importOptions } = options;
|
|
222
|
-
return this.post(`/database/${database}/tables/${table}/import/json`, {
|
|
223
|
-
data,
|
|
224
|
-
options: importOptions
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Export entire database to SQL
|
|
230
|
-
* @param {string} database - Database name
|
|
231
|
-
* @returns {Promise<Object>} SQL export result
|
|
232
|
-
*/
|
|
233
|
-
async exportDatabaseToSQL(database) {
|
|
234
|
-
return this.get(`/database/${database}/export/sql`);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// ============ Schema Management Operations ============
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* Add a column to a table
|
|
241
|
-
* @param {Object} options - Column options
|
|
242
|
-
* @param {string} options.database - Database name
|
|
243
|
-
* @param {string} options.table - Table name
|
|
244
|
-
* @param {string} options.name - Column name
|
|
245
|
-
* @param {string} options.type - Column type
|
|
246
|
-
* @param {Object} [options.constraints] - Column constraints
|
|
247
|
-
* @returns {Promise<Object>} Add column result
|
|
248
|
-
*/
|
|
249
|
-
async addColumn(options) {
|
|
250
|
-
const { database, table, ...columnDef } = options;
|
|
251
|
-
return this.post(`/database/${database}/tables/${table}/columns/add`, columnDef);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* List indexes for a table
|
|
256
|
-
* @param {string} database - Database name
|
|
257
|
-
* @param {string} table - Table name
|
|
258
|
-
* @returns {Promise<Object>} List of indexes
|
|
259
|
-
*/
|
|
260
|
-
async listIndexes(database, table) {
|
|
261
|
-
return this.get(`/database/${database}/tables/${table}/indexes`);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Create an index on a table
|
|
266
|
-
* @param {Object} options - Index options
|
|
267
|
-
* @param {string} options.database - Database name
|
|
268
|
-
* @param {string} options.table - Table name
|
|
269
|
-
* @param {string} options.name - Index name
|
|
270
|
-
* @param {Array<string>} options.columns - Columns to index
|
|
271
|
-
* @param {boolean} [options.unique] - Whether index is unique
|
|
272
|
-
* @returns {Promise<Object>} Create index result
|
|
273
|
-
*/
|
|
274
|
-
async createIndex(options) {
|
|
275
|
-
const { database, table, ...indexDef } = options;
|
|
276
|
-
return this.post(`/database/${database}/tables/${table}/indexes/create`, indexDef);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Drop an index
|
|
281
|
-
* @param {string} database - Database name
|
|
282
|
-
* @param {string} indexName - Index name
|
|
283
|
-
* @returns {Promise<Object>} Drop index result
|
|
284
|
-
*/
|
|
285
|
-
async dropIndex(database, indexName) {
|
|
286
|
-
return this.post(`/database/${database}/indexes/${indexName}/drop`);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* List foreign keys for a table
|
|
291
|
-
* @param {string} database - Database name
|
|
292
|
-
* @param {string} table - Table name
|
|
293
|
-
* @returns {Promise<Object>} List of foreign keys
|
|
294
|
-
*/
|
|
295
|
-
async listForeignKeys(database, table) {
|
|
296
|
-
return this.get(`/database/${database}/tables/${table}/foreign-keys`);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Toggle foreign key constraints
|
|
301
|
-
* @param {Object} options - Toggle options
|
|
302
|
-
* @param {string} options.database - Database name
|
|
303
|
-
* @param {boolean} options.enabled - Enable or disable foreign keys
|
|
304
|
-
* @returns {Promise<Object>} Toggle result
|
|
305
|
-
*/
|
|
306
|
-
async setForeignKeyConstraints(options) {
|
|
307
|
-
const { database, enabled } = options;
|
|
308
|
-
return this.post(`/database/${database}/foreign-keys/toggle`, { enabled });
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* Get foreign key constraints status
|
|
313
|
-
* @param {string} database - Database name
|
|
314
|
-
* @returns {Promise<Object>} Foreign key status
|
|
315
|
-
*/
|
|
316
|
-
async getForeignKeyStatus(database) {
|
|
317
|
-
return this.get(`/database/${database}/foreign-keys/status`);
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* Get full table schema (columns, indexes, foreign keys)
|
|
322
|
-
* @param {string} database - Database name
|
|
323
|
-
* @param {string} table - Table name
|
|
324
|
-
* @returns {Promise<Object>} Full schema information
|
|
325
|
-
*/
|
|
326
|
-
async getTableSchemaFull(database, table) {
|
|
327
|
-
return this.get(`/database/${database}/tables/${table}/schema/full`);
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Analyze table for optimization
|
|
332
|
-
* @param {string} database - Database name
|
|
333
|
-
* @param {string} table - Table name
|
|
334
|
-
* @returns {Promise<Object>} Analysis result
|
|
335
|
-
*/
|
|
336
|
-
async analyzeTable(database, table) {
|
|
337
|
-
return this.post(`/database/${database}/tables/${table}/analyze`);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { BaseAPI } from './base.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Files API - Handle all file operations
|
|
5
|
-
*/
|
|
6
|
-
export class FilesAPI extends BaseAPI {
|
|
7
|
-
/**
|
|
8
|
-
* List files in a directory
|
|
9
|
-
* @param {Object} options - List options
|
|
10
|
-
* @param {string} options.dirPath - Directory path to list
|
|
11
|
-
* @param {boolean} [options.recursive] - List recursively
|
|
12
|
-
* @param {Array<string>} [options.ignorePatterns] - Patterns to ignore
|
|
13
|
-
* @param {boolean} [options.nested] - Return nested directory structure
|
|
14
|
-
* @param {boolean} [options.light] - Return minimal info (no names, dates)
|
|
15
|
-
* @param {boolean} [options.flattenResults] - Return flat array instead of nested structure
|
|
16
|
-
* @param {number} [options.maxDepth] - Maximum recursion depth for nested directories
|
|
17
|
-
* @param {Array<string>} [options.ignorePatterns] - Patterns to ignore
|
|
18
|
-
* @param {boolean} [options.useGitignore] - Whether to read and use .gitignore patterns
|
|
19
|
-
* @param {string} [options.pathFilter] - Only include files/dirs with paths containing this string
|
|
20
|
-
* @param {number} [options.currentDepth] - Current recursion depth
|
|
21
|
-
* @returns {Promise<Object>} List result
|
|
22
|
-
* @param {boolean} [options.includeHash] - Include file hash
|
|
23
|
-
* @param {boolean} [options.includeContent] - Include file content
|
|
24
|
-
* @param {number} [options.maxContentSize] - Maximum size in bytes for including file content (1MB default)
|
|
25
|
-
* @param {boolean} [options.enableChunking] - Enable chunking
|
|
26
|
-
* @param {number} [options.maxChunkSize] - Maximum size in bytes for each chunk
|
|
27
|
-
*/
|
|
28
|
-
async list(options) {
|
|
29
|
-
return this.post('/files/list', options);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Get file content
|
|
34
|
-
* @param {Object} options - Get options
|
|
35
|
-
* @param {string} options.filePath - File path to read
|
|
36
|
-
* @param {Object} [options.range] - Line range {start, end}
|
|
37
|
-
* @param {boolean} [options.withLineNumbers] - Include line numbers
|
|
38
|
-
* @returns {Promise<Object>} File content
|
|
39
|
-
*/
|
|
40
|
-
async get(options) {
|
|
41
|
-
return this.post('/files/get', options);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Create a new file or folder
|
|
46
|
-
* @param {Object} options - Create options
|
|
47
|
-
* @param {string} [options.parentPath] - Parent directory path
|
|
48
|
-
* @param {string} [options.fileName] - File name
|
|
49
|
-
* @param {string} [options.fullPath] - Full file path (alternative to parentPath + fileName)
|
|
50
|
-
* @param {string} [options.filePath] - File path (alternative)
|
|
51
|
-
* @param {string} [options.content] - File content
|
|
52
|
-
* @param {boolean} [options.isFolder] - Create as folder
|
|
53
|
-
* @param {boolean} [options.withWatcher=true] - Trigger file watcher
|
|
54
|
-
* @returns {Promise<Object>} Create result
|
|
55
|
-
*/
|
|
56
|
-
async create(options) {
|
|
57
|
-
return this.post('/files/create', options);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Delete a file or folder
|
|
62
|
-
* @param {Object} options - Delete options
|
|
63
|
-
* @param {string} options.filePath - Path to delete
|
|
64
|
-
* @param {boolean} [options.withWatcher=true] - Trigger file watcher
|
|
65
|
-
* @returns {Promise<Object>} Delete result
|
|
66
|
-
*/
|
|
67
|
-
async delete(options) {
|
|
68
|
-
return this.post('/files/delete', options);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Rename/move a file or folder
|
|
73
|
-
* @param {Object} options - Rename options
|
|
74
|
-
* @param {string} options.sourcePath - Source path
|
|
75
|
-
* @param {string} options.destinationPath - Destination path
|
|
76
|
-
* @param {boolean} [options.withWatcher=true] - Trigger file watcher
|
|
77
|
-
* @returns {Promise<Object>} Rename result
|
|
78
|
-
*/
|
|
79
|
-
async rename(options) {
|
|
80
|
-
return this.post('/files/rename', options);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Upload a file
|
|
85
|
-
* @param {Object} options - Upload options
|
|
86
|
-
* @param {string} options.filePath - File path
|
|
87
|
-
* @param {string} options.content - File content
|
|
88
|
-
* @param {boolean} [options.withWatcher=true] - Trigger file watcher
|
|
89
|
-
* @returns {Promise<Object>} Upload result
|
|
90
|
-
*/
|
|
91
|
-
async upload(options) {
|
|
92
|
-
return this.post('/files/upload', options);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Download a file
|
|
97
|
-
* @param {Object} options - Download options
|
|
98
|
-
* @param {string} options.filePath - File path to download
|
|
99
|
-
* @returns {Promise<Object>} Download result
|
|
100
|
-
*/
|
|
101
|
-
async download(options) {
|
|
102
|
-
return this.post('/files/download', options);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Check if file exists
|
|
107
|
-
* @param {Object} options - Check options
|
|
108
|
-
* @param {string} options.filePath - File path to check
|
|
109
|
-
* @returns {Promise<Object>} Exists result
|
|
110
|
-
*/
|
|
111
|
-
async exists(options) {
|
|
112
|
-
return this.post('/files/exists', options);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Edit a file
|
|
117
|
-
* @param {Object} options - Edit options
|
|
118
|
-
* @param {string} options.filePath - File path to edit
|
|
119
|
-
* @param {string} [options.content] - New content
|
|
120
|
-
* @param {Object} [options.edits] - Edit operations
|
|
121
|
-
* @param {boolean} [options.withWatcher=true] - Trigger file watcher
|
|
122
|
-
* @returns {Promise<Object>} Edit result
|
|
123
|
-
*/
|
|
124
|
-
async edit(options) {
|
|
125
|
-
return this.post('/files/edit', options);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Merge file edits
|
|
130
|
-
* @param {Object} options - Merge options
|
|
131
|
-
* @param {string} options.filePath - File path to merge
|
|
132
|
-
* @param {string} options.content - Content to merge
|
|
133
|
-
* @param {Object} [options.options] - Merge options {silent, etc}
|
|
134
|
-
* @param {boolean} [options.withWatcher=true] - Trigger file watcher
|
|
135
|
-
* @returns {Promise<Object>} Merge result
|
|
136
|
-
*/
|
|
137
|
-
async merge(options) {
|
|
138
|
-
return this.post('/files/merge', options);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { BaseAPI } from './base.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Git API - Handle all git operations
|
|
5
|
-
*/
|
|
6
|
-
export class GitAPI extends BaseAPI {
|
|
7
|
-
/**
|
|
8
|
-
* List available SSH keys
|
|
9
|
-
* @returns {Promise<Object>} SSH keys list
|
|
10
|
-
*/
|
|
11
|
-
async listKeys() {
|
|
12
|
-
return this.get('/git/keys');
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Configure git user for a repository
|
|
17
|
-
* @param {Object} options - Config options
|
|
18
|
-
* @param {string} options.repoPath - Repository path
|
|
19
|
-
* @param {string} options.name - User name
|
|
20
|
-
* @param {string} options.email - User email
|
|
21
|
-
* @returns {Promise<Object>} Config result
|
|
22
|
-
*/
|
|
23
|
-
async configUser(options) {
|
|
24
|
-
return this.post('/git/config/user', options);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Check if directory is a git repository
|
|
29
|
-
* @param {Object} options - Check options
|
|
30
|
-
* @param {string} options.repoPath - Path to check
|
|
31
|
-
* @returns {Promise<Object>} Check result
|
|
32
|
-
*/
|
|
33
|
-
async check(options) {
|
|
34
|
-
return this.post('/git/check', options);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Clone a repository
|
|
39
|
-
* @param {Object} options - Clone options
|
|
40
|
-
* @param {string} options.url - Repository URL
|
|
41
|
-
* @param {string} options.targetDir - Target directory
|
|
42
|
-
* @param {string} [options.branch] - Branch to clone
|
|
43
|
-
* @param {Object} [options.auth] - Authentication config
|
|
44
|
-
* @param {boolean} [options.root=true] - Clone at root
|
|
45
|
-
* @returns {Promise<Object>} Clone result
|
|
46
|
-
*/
|
|
47
|
-
async clone(options) {
|
|
48
|
-
return this.post('/git/clone', options);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Pull changes from remote
|
|
53
|
-
* @param {Object} options - Pull options
|
|
54
|
-
* @param {string} options.repoPath - Repository path
|
|
55
|
-
* @param {string} [options.branch] - Branch to pull
|
|
56
|
-
* @param {Object} [options.auth] - Authentication config
|
|
57
|
-
* @returns {Promise<Object>} Pull result
|
|
58
|
-
*/
|
|
59
|
-
async pull(options) {
|
|
60
|
-
return this.post('/git/pull', options);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Push changes to remote
|
|
65
|
-
* @param {Object} options - Push options
|
|
66
|
-
* @param {string} options.repoPath - Repository path
|
|
67
|
-
* @param {string} [options.branch] - Branch to push
|
|
68
|
-
* @param {boolean} [options.force] - Force push
|
|
69
|
-
* @param {Object} [options.auth] - Authentication config
|
|
70
|
-
* @returns {Promise<Object>} Push result
|
|
71
|
-
*/
|
|
72
|
-
async push(options) {
|
|
73
|
-
return this.post('/git/push', options);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Get repository status
|
|
78
|
-
* @param {Object} options - Status options
|
|
79
|
-
* @param {string} options.repoPath - Repository path
|
|
80
|
-
* @returns {Promise<Object>} Status result
|
|
81
|
-
*/
|
|
82
|
-
async status(options) {
|
|
83
|
-
return this.post('/git/status', options);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Get current branch
|
|
88
|
-
* @param {Object} options - Branch options
|
|
89
|
-
* @param {string} options.repoPath - Repository path
|
|
90
|
-
* @returns {Promise<Object>} Current branch
|
|
91
|
-
*/
|
|
92
|
-
async getCurrentBranch(options) {
|
|
93
|
-
return this.post('/git/branch/current', options);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* List branches
|
|
98
|
-
* @param {Object} options - List options
|
|
99
|
-
* @param {string} options.repoPath - Repository path
|
|
100
|
-
* @param {boolean} [options.includeRemote] - Include remote branches
|
|
101
|
-
* @returns {Promise<Object>} Branches list
|
|
102
|
-
*/
|
|
103
|
-
async listBranches(options) {
|
|
104
|
-
return this.post('/git/branch/list', options);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Create a new branch
|
|
109
|
-
* @param {Object} options - Create options
|
|
110
|
-
* @param {string} options.repoPath - Repository path
|
|
111
|
-
* @param {string} options.branchName - Branch name
|
|
112
|
-
* @param {boolean} [options.checkout] - Checkout after create
|
|
113
|
-
* @returns {Promise<Object>} Create result
|
|
114
|
-
*/
|
|
115
|
-
async createBranch(options) {
|
|
116
|
-
return this.post('/git/branch/create', options);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Checkout a branch
|
|
121
|
-
* @param {Object} options - Checkout options
|
|
122
|
-
* @param {string} options.repoPath - Repository path
|
|
123
|
-
* @param {string} options.branchName - Branch name
|
|
124
|
-
* @returns {Promise<Object>} Checkout result
|
|
125
|
-
*/
|
|
126
|
-
async checkoutBranch(options) {
|
|
127
|
-
return this.post('/git/branch/checkout', options);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Add files to staging
|
|
132
|
-
* @param {Object} options - Add options
|
|
133
|
-
* @param {string} options.repoPath - Repository path
|
|
134
|
-
* @param {Array<string>} options.files - Files to add
|
|
135
|
-
* @returns {Promise<Object>} Add result
|
|
136
|
-
*/
|
|
137
|
-
async add(options) {
|
|
138
|
-
return this.post('/git/add', options);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Commit changes
|
|
143
|
-
* @param {Object} options - Commit options
|
|
144
|
-
* @param {string} options.repoPath - Repository path
|
|
145
|
-
* @param {string} options.message - Commit message
|
|
146
|
-
* @param {Object} [options.author] - Author info {name, email}
|
|
147
|
-
* @returns {Promise<Object>} Commit result
|
|
148
|
-
*/
|
|
149
|
-
async commit(options) {
|
|
150
|
-
return this.post('/git/commit', options);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Initialize a new repository
|
|
155
|
-
* @param {Object} options - Init options
|
|
156
|
-
* @param {string} options.repoPath - Repository path
|
|
157
|
-
* @returns {Promise<Object>} Init result
|
|
158
|
-
*/
|
|
159
|
-
async init(options) {
|
|
160
|
-
return this.post('/git/init', options);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Get commit history
|
|
165
|
-
* @param {Object} options - History options
|
|
166
|
-
* @param {string} options.repoPath - Repository path
|
|
167
|
-
* @param {number} [options.limit] - Max number of commits
|
|
168
|
-
* @returns {Promise<Object>} Commit history
|
|
169
|
-
*/
|
|
170
|
-
async history(options) {
|
|
171
|
-
return this.post('/git/history', options);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { BaseAPI } from './base.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Search API - Handle search operations
|
|
5
|
-
*/
|
|
6
|
-
export class SearchAPI extends BaseAPI {
|
|
7
|
-
/**
|
|
8
|
-
* Search file contents
|
|
9
|
-
* @param {Object} options - Search options
|
|
10
|
-
* @param {string} options.query - Search query
|
|
11
|
-
* @param {Object} [options.options] - Search options (caseSensitive, regex, etc)
|
|
12
|
-
* @returns {Promise<Object>} Search results
|
|
13
|
-
*/
|
|
14
|
-
async search(options) {
|
|
15
|
-
return this.post('/search', options);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Search file names only
|
|
20
|
-
* @param {Object} options - Search options
|
|
21
|
-
* @param {string} options.query - Search query
|
|
22
|
-
* @param {Object} [options.options] - Search options
|
|
23
|
-
* @returns {Promise<Object>} Search results
|
|
24
|
-
*/
|
|
25
|
-
async searchFileNames(options) {
|
|
26
|
-
return this.post('/search/filenames', options);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|