bajo 2.22.0 → 2.23.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/class/bajo.js CHANGED
@@ -1021,6 +1021,17 @@ class Bajo extends Plugin {
1021
1021
  return results
1022
1022
  }
1023
1023
 
1024
+ /**
1025
+ * Get download directory. If doesn't exist, it will be created automatically.
1026
+ * @method
1027
+ * @returns {string} Absolute path to the download directory
1028
+ */
1029
+ getDownloadDir = () => {
1030
+ const dir = `${this.app.getPluginDataDir(this.ns)}/download`
1031
+ fs.ensureDirSync(dir)
1032
+ return dir
1033
+ }
1034
+
1024
1035
  /**
1025
1036
  * Save item as file in Bajo's download directory. That is a directory inside your
1026
1037
  * Bajo plugin's data directory.
@@ -1037,9 +1048,7 @@ class Bajo extends Plugin {
1037
1048
  */
1038
1049
  saveAsDownload = async (file, item, printSaved = true) => {
1039
1050
  const { print } = this.app.bajo
1040
- const fname = increment(`${this.app.getPluginDataDir(this.ns)}/download/${trim(file, '/')}`, { fs: true })
1041
- const dir = path.dirname(fname)
1042
- if (!fs.existsSync(dir)) fs.ensureDirSync(dir)
1051
+ const fname = increment(`${this.getDownloadDir()}/${trim(file, '/')}`, { fs: true })
1043
1052
  await fs.writeFile(fname, item, 'utf8')
1044
1053
  if (printSaved) print.succeed('savedAs%s', path.resolve(fname), { skipSilence: true })
1045
1054
  return fname
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo",
3
- "version": "2.22.0",
3
+ "version": "2.23.0",
4
4
  "description": "The ultimate framework for whipping up massive apps in no time",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changes
2
2
 
3
+
4
+ ## 2026-07-13
5
+
6
+ - [2.23.0] Add `getDownloadDir()`
7
+
3
8
  ## 2026-07-08
4
9
 
5
10
  - [2.22.0] Update documentations
package/wiki/ECOSYSTEM.md CHANGED
@@ -23,12 +23,12 @@
23
23
  | ------- | ---- | -- | ----- | ----------- |
24
24
  | [dobo](https://github.com/ardhi/dobo) | [Docs](https://ardhi.github.io/dobo) | dobo | db | Dobo DBMS |
25
25
  | [dobo-extra](https://github.com/ardhi/dobo-extra) | [Docs](https://ardhi.github.io/dobo-extra) | doboExtra | dbx | Dobo Extra Tools/Utility |
26
- | [dobo-couchdb](https://github.com/ardhi/dobo-couchdb) | [Docs](https://ardhi.github.io/dobo-couchdb) | doboCouchdb | dbcouch | CouchDB Driver |
27
- | [dobo-elasticsearch](https://github.com/ardhi/dobo-elasticsearch) | [Docs](https://ardhi.github.io/dobo-elasticsearch) | doboElasticsearch | dbes | Elasticsearch Driver |
28
- | [dobo-knex](https://github.com/ardhi/dobo-knex) | [Docs](https://ardhi.github.io/dobo-knex) | doboKnex | dbknex | Knex/SQL Driver |
29
- | [dobo-mongodb](https://github.com/ardhi/dobo-mongodb) | [Docs](https://ardhi.github.io/dobo-mongodb) | doboMongodb | dbmongo | MongoDB Driver |
30
- | [dobo-redis](https://github.com/ardhi/dobo-redis) | [Docs](https://ardhi.github.io/dobo-redis) | doboRedis | dbredis | Redis Driver |
31
- | [dobo-restproxy](https://github.com/ardhi/dobo-restproxy) | [Docs](https://ardhi.github.io/dobo-restproxy) | doboRestproxy | dbrpx | Restproxy Driver |
26
+ | [dobo-couchdb](https://github.com/ardhi/dobo-couchdb) | [Docs](https://ardhi.github.io/dobo-couchdb) | doboCouchdb | dbcouch | CouchDB Adapter |
27
+ | [dobo-elasticsearch](https://github.com/ardhi/dobo-elasticsearch) | [Docs](https://ardhi.github.io/dobo-elasticsearch) | doboElasticsearch | dbes | Elasticsearch Adapter |
28
+ | [dobo-knex](https://github.com/ardhi/dobo-knex) | [Docs](https://ardhi.github.io/dobo-knex) | doboKnex | dbknex | Knex/SQL Adapter |
29
+ | [dobo-mongodb](https://github.com/ardhi/dobo-mongodb) | [Docs](https://ardhi.github.io/dobo-mongodb) | doboMongodb | dbmongo | MongoDB Adapter |
30
+ | [dobo-redis](https://github.com/ardhi/dobo-redis) | [Docs](https://ardhi.github.io/dobo-redis) | doboRedis | dbredis | Redis Adapter |
31
+ | [dobo-restproxy](https://github.com/ardhi/dobo-restproxy) | [Docs](https://ardhi.github.io/dobo-restproxy) | doboRestproxy | dbrpx | Restproxy Adapter |
32
32
  | [dobo-restproxy-jsonserver](https://github.com/ardhi/dobo-restproxy-jsonserver) | [Docs](https://ardhi.github.io/dobo-restproxy-jsonserver) | doboResporoxyJsonserver | dbrpxjs |JsonServer Support for doboRestproxy |
33
33
  | [dobo-restproxy-ndut](https://github.com/ardhi/dobo-restproxy-ndut) | [Docs](https://ardhi.github.io/dobo-restproxy-ndut) | doboRestproxyNdut | dbrpxndut | NDUT Support for doboRestproxy |
34
34