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/iife/sdk.js CHANGED
@@ -14049,26 +14049,29 @@
14049
14049
  this._currentSchema = schema;
14050
14050
  const operations = [];
14051
14051
  const skippedBuiltIns = [];
14052
- // If databaseId is empty, create a database with id "default"
14052
+ // Auto-create database if it doesn't exist
14053
+ // If databaseId is empty, use "default" as the database id
14053
14054
  let databaseId = schema.databaseId;
14054
14055
  if (!databaseId || databaseId.trim() === '') {
14055
14056
  databaseId = 'default';
14056
- try {
14057
- yield this.databases.create({
14058
- databaseId: databaseId,
14059
- name: 'default',
14060
- enabled: true
14061
- });
14062
- }
14063
- catch (error) {
14064
- // If database already exists, that's fine
14065
- if (!(error instanceof AppwriteException && error.code === 409)) {
14066
- throw error;
14067
- }
14057
+ }
14058
+ // Try to create the database if it doesn't exist
14059
+ // If it already exists (409 error), that's fine - continue execution
14060
+ try {
14061
+ yield this.databases.create({
14062
+ databaseId: databaseId,
14063
+ name: databaseId,
14064
+ enabled: true
14065
+ });
14066
+ }
14067
+ catch (error) {
14068
+ // If database already exists, that's fine
14069
+ if (!(error instanceof AppwriteException && error.code === 409)) {
14070
+ throw error;
14068
14071
  }
14069
- // Update schema.databaseId for later use
14070
- schema.databaseId = databaseId;
14071
14072
  }
14073
+ // Update schema.databaseId for later use
14074
+ schema.databaseId = databaseId;
14072
14075
  // Get current tables
14073
14076
  const currentTables = yield this.databases.listTables({
14074
14077
  databaseId: databaseId,
@@ -16603,6 +16606,36 @@
16603
16606
  };
16604
16607
  return this.client.call('patch', uri, apiHeaders, payload);
16605
16608
  }
16609
+ updateAuthDatabaseStorageLimit(paramsOrFirst, ...rest) {
16610
+ let params;
16611
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
16612
+ params = (paramsOrFirst || {});
16613
+ }
16614
+ else {
16615
+ params = {
16616
+ projectId: paramsOrFirst,
16617
+ limit: rest[0]
16618
+ };
16619
+ }
16620
+ const projectId = params.projectId;
16621
+ const limit = params.limit;
16622
+ if (typeof projectId === 'undefined') {
16623
+ throw new AppwriteException('Missing required parameter: "projectId"');
16624
+ }
16625
+ if (typeof limit === 'undefined') {
16626
+ throw new AppwriteException('Missing required parameter: "limit"');
16627
+ }
16628
+ const apiPath = '/projects/{projectId}/auth/database-storage-limit'.replace('{projectId}', projectId);
16629
+ const payload = {};
16630
+ if (typeof limit !== 'undefined') {
16631
+ payload['limit'] = limit;
16632
+ }
16633
+ const uri = new URL(this.client.config.endpoint + apiPath);
16634
+ const apiHeaders = {
16635
+ 'content-type': 'application/json',
16636
+ };
16637
+ return this.client.call('patch', uri, apiHeaders, payload);
16638
+ }
16606
16639
  updateAuthSessionsLimit(paramsOrFirst, ...rest) {
16607
16640
  let params;
16608
16641
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "appbuild-oceanbase-console",
3
3
  "homepage": "https://appwrite.io/support",
4
4
  "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5
- "version": "1.12.0",
5
+ "version": "1.12.2",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
@@ -28,9 +28,14 @@
28
28
  "type": "git",
29
29
  "url": "git+https://github.com/appwrite/sdk-for-console.git"
30
30
  },
31
+ "scripts": {
32
+ "build": "npm run build:types && npm run build:libs",
33
+ "build:types": "tsc --declaration --emitDeclarationOnly --outDir types",
34
+ "build:libs": "rollup -c"
35
+ },
31
36
  "devDependencies": {
32
37
  "@rollup/plugin-typescript": "8.3.2",
33
- "playwright": "1.15.0",
38
+ "appwrite": "^21.5.0",
34
39
  "rollup": "2.79.2",
35
40
  "serve-handler": "6.1.0",
36
41
  "tslib": "2.4.0",
@@ -38,9 +43,5 @@
38
43
  },
39
44
  "jsdelivr": "dist/iife/sdk.js",
40
45
  "unpkg": "dist/iife/sdk.js",
41
- "scripts": {
42
- "build": "npm run build:types && npm run build:libs",
43
- "build:types": "tsc --declaration --emitDeclarationOnly --outDir types",
44
- "build:libs": "rollup -c"
45
- }
46
- }
46
+ "packageManager": "pnpm@9.15.4+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0"
47
+ }
package/types/models.d.ts CHANGED
@@ -3990,6 +3990,10 @@ export declare namespace Models {
3990
3990
  * Max allowed passwords in the history list per user. Max passwords limit allowed in history is 20. Use 0 for disabling password history.
3991
3991
  */
3992
3992
  authPasswordHistory: number;
3993
+ /**
3994
+ * Max database storage in bytes allowed for this project. 0 is unlimited. Default is 1GB (1073741824 bytes).
3995
+ */
3996
+ authDatabasesStorageLimit: number;
3993
3997
  /**
3994
3998
  * Whether or not to check user's password against most commonly used passwords.
3995
3999
  */
@@ -322,6 +322,28 @@ export declare class Projects {
322
322
  * @deprecated Use the object parameter style method for a better developer experience.
323
323
  */
324
324
  updateAuthLimit(projectId: string, limit: number): Promise<Models.Project>;
325
+ /**
326
+ * Update the maximum database storage in bytes allowed for this project. Set to 0 for unlimited. Default is 1GB (1073741824 bytes).
327
+ *
328
+ * @param {string} params.projectId - Project unique ID.
329
+ * @param {number} params.limit - Max database storage in bytes. Use 0 for unlimited. Must be non-negative integer.
330
+ * @throws {AppwriteException}
331
+ * @returns {Promise<Models.Project>}
332
+ */
333
+ updateAuthDatabaseStorageLimit(params: {
334
+ projectId: string;
335
+ limit: number;
336
+ }): Promise<Models.Project>;
337
+ /**
338
+ * Update the maximum database storage in bytes allowed for this project. Set to 0 for unlimited. Default is 1GB (1073741824 bytes).
339
+ *
340
+ * @param {string} projectId - Project unique ID.
341
+ * @param {number} limit - Max database storage in bytes. Use 0 for unlimited. Must be non-negative integer.
342
+ * @throws {AppwriteException}
343
+ * @returns {Promise<Models.Project>}
344
+ * @deprecated Use the object parameter style method for a better developer experience.
345
+ */
346
+ updateAuthDatabaseStorageLimit(projectId: string, limit: number): Promise<Models.Project>;
325
347
  /**
326
348
  * Update the maximum number of sessions allowed per user within the project, if the limit is hit the oldest session will be deleted to make room for new sessions.
327
349
  *