@boltic/sdk 0.1.0 → 0.1.2
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/README.md +1 -8
- package/dist/sdk.js +5 -34
- package/dist/sdk.js.map +1 -1
- package/dist/sdk.mjs +5 -34
- package/dist/sdk.mjs.map +1 -1
- package/dist/types/index.d.ts +1 -13
- package/package.json +1 -1
package/dist/sdk.mjs
CHANGED
|
@@ -2023,30 +2023,7 @@ class TableResource extends BaseResource {
|
|
|
2023
2023
|
*/
|
|
2024
2024
|
async rename(oldName, newName, dbId) {
|
|
2025
2025
|
try {
|
|
2026
|
-
const result = await this.update(
|
|
2027
|
-
oldName,
|
|
2028
|
-
{
|
|
2029
|
-
name: newName
|
|
2030
|
-
},
|
|
2031
|
-
dbId
|
|
2032
|
-
);
|
|
2033
|
-
return result;
|
|
2034
|
-
} catch (error) {
|
|
2035
|
-
throw error instanceof ApiError ? error : new ApiError(this.formatError(error), 500);
|
|
2036
|
-
}
|
|
2037
|
-
}
|
|
2038
|
-
/**
|
|
2039
|
-
* Set table access permissions
|
|
2040
|
-
*/
|
|
2041
|
-
async setAccess(request, dbId) {
|
|
2042
|
-
try {
|
|
2043
|
-
const result = await this.update(
|
|
2044
|
-
request.table_name,
|
|
2045
|
-
{
|
|
2046
|
-
is_shared: request.is_shared
|
|
2047
|
-
},
|
|
2048
|
-
dbId
|
|
2049
|
-
);
|
|
2026
|
+
const result = await this.update(oldName, { name: newName }, dbId);
|
|
2050
2027
|
return result;
|
|
2051
2028
|
} catch (error) {
|
|
2052
2029
|
throw error instanceof ApiError ? error : new ApiError(this.formatError(error), 500);
|
|
@@ -4506,7 +4483,6 @@ class SqlResource {
|
|
|
4506
4483
|
}
|
|
4507
4484
|
class TableBuilder {
|
|
4508
4485
|
constructor(options, tablesApiClient) {
|
|
4509
|
-
this.isPublic = false;
|
|
4510
4486
|
this.fields = [];
|
|
4511
4487
|
this.tableName = options.name;
|
|
4512
4488
|
this.description = options.description;
|
|
@@ -4526,13 +4502,6 @@ class TableBuilder {
|
|
|
4526
4502
|
this.description = description;
|
|
4527
4503
|
return this;
|
|
4528
4504
|
}
|
|
4529
|
-
/**
|
|
4530
|
-
* Set if table is public
|
|
4531
|
-
*/
|
|
4532
|
-
public(isPublic = true) {
|
|
4533
|
-
this.isPublic = isPublic;
|
|
4534
|
-
return this;
|
|
4535
|
-
}
|
|
4536
4505
|
/**
|
|
4537
4506
|
* Add a text field
|
|
4538
4507
|
*/
|
|
@@ -4873,12 +4842,15 @@ class BolticClient {
|
|
|
4873
4842
|
* ```
|
|
4874
4843
|
*/
|
|
4875
4844
|
async useDatabase(dbInternalName) {
|
|
4845
|
+
console.log(`Database internal name:${dbInternalName}`);
|
|
4876
4846
|
if (!dbInternalName || dbInternalName === "") {
|
|
4877
4847
|
this.currentDatabase = null;
|
|
4878
4848
|
return;
|
|
4879
4849
|
}
|
|
4880
4850
|
const result = await this.databaseResource.findOne(dbInternalName);
|
|
4851
|
+
console.log(`Result:${JSON.stringify(result, null, 2)}`);
|
|
4881
4852
|
if (isErrorResponse(result)) {
|
|
4853
|
+
console.log(`Error:${result.error.message}`);
|
|
4882
4854
|
throw new Error(
|
|
4883
4855
|
result.error.message || `Failed to switch database to internal name '${dbInternalName}'`
|
|
4884
4856
|
);
|
|
@@ -4913,8 +4885,7 @@ class BolticClient {
|
|
|
4913
4885
|
findOne: (options) => this.tableResource.findOne(options, dbId),
|
|
4914
4886
|
update: (name, data) => this.tableResource.update(name, data, dbId),
|
|
4915
4887
|
delete: (name) => this.tableResource.delete(name, dbId),
|
|
4916
|
-
rename: (oldName, newName) => this.tableResource.rename(oldName, newName, dbId)
|
|
4917
|
-
setAccess: (request) => this.tableResource.setAccess(request, dbId)
|
|
4888
|
+
rename: (oldName, newName) => this.tableResource.rename(oldName, newName, dbId)
|
|
4918
4889
|
};
|
|
4919
4890
|
}
|
|
4920
4891
|
// Direct column operations
|