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