appbuild-oceanbase-console 1.12.0 → 1.12.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/dist/esm/sdk.js CHANGED
@@ -14046,26 +14046,29 @@ class SchemaMigration {
14046
14046
  this._currentSchema = schema;
14047
14047
  const operations = [];
14048
14048
  const skippedBuiltIns = [];
14049
- // If databaseId is empty, create a database with id "default"
14049
+ // Auto-create database if it doesn't exist
14050
+ // If databaseId is empty, use "default" as the database id
14050
14051
  let databaseId = schema.databaseId;
14051
14052
  if (!databaseId || databaseId.trim() === '') {
14052
14053
  databaseId = 'default';
14053
- try {
14054
- yield this.databases.create({
14055
- databaseId: databaseId,
14056
- name: 'default',
14057
- enabled: true
14058
- });
14059
- }
14060
- catch (error) {
14061
- // If database already exists, that's fine
14062
- if (!(error instanceof AppwriteException && error.code === 409)) {
14063
- throw error;
14064
- }
14054
+ }
14055
+ // Try to create the database if it doesn't exist
14056
+ // If it already exists (409 error), that's fine - continue execution
14057
+ try {
14058
+ yield this.databases.create({
14059
+ databaseId: databaseId,
14060
+ name: databaseId,
14061
+ enabled: true
14062
+ });
14063
+ }
14064
+ catch (error) {
14065
+ // If database already exists, that's fine
14066
+ if (!(error instanceof AppwriteException && error.code === 409)) {
14067
+ throw error;
14065
14068
  }
14066
- // Update schema.databaseId for later use
14067
- schema.databaseId = databaseId;
14068
14069
  }
14070
+ // Update schema.databaseId for later use
14071
+ schema.databaseId = databaseId;
14069
14072
  // Get current tables
14070
14073
  const currentTables = yield this.databases.listTables({
14071
14074
  databaseId: databaseId,
@@ -16600,6 +16603,36 @@ class Projects {
16600
16603
  };
16601
16604
  return this.client.call('patch', uri, apiHeaders, payload);
16602
16605
  }
16606
+ updateAuthDatabaseStorageLimit(paramsOrFirst, ...rest) {
16607
+ let params;
16608
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
16609
+ params = (paramsOrFirst || {});
16610
+ }
16611
+ else {
16612
+ params = {
16613
+ projectId: paramsOrFirst,
16614
+ limit: rest[0]
16615
+ };
16616
+ }
16617
+ const projectId = params.projectId;
16618
+ const limit = params.limit;
16619
+ if (typeof projectId === 'undefined') {
16620
+ throw new AppwriteException('Missing required parameter: "projectId"');
16621
+ }
16622
+ if (typeof limit === 'undefined') {
16623
+ throw new AppwriteException('Missing required parameter: "limit"');
16624
+ }
16625
+ const apiPath = '/projects/{projectId}/auth/database-storage-limit'.replace('{projectId}', projectId);
16626
+ const payload = {};
16627
+ if (typeof limit !== 'undefined') {
16628
+ payload['limit'] = limit;
16629
+ }
16630
+ const uri = new URL(this.client.config.endpoint + apiPath);
16631
+ const apiHeaders = {
16632
+ 'content-type': 'application/json',
16633
+ };
16634
+ return this.client.call('patch', uri, apiHeaders, payload);
16635
+ }
16603
16636
  updateAuthSessionsLimit(paramsOrFirst, ...rest) {
16604
16637
  let params;
16605
16638
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {