bajo-extra 1.1.3 → 1.1.5

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.
@@ -16,5 +16,6 @@
16
16
  "downloading": "Downloading...",
17
17
  "encryption type": "encryption type",
18
18
  "decryption type": "decryption type",
19
- "fetching%s": "Fetching %s"
19
+ "fetching%s": "Fetching %s",
20
+ "peerError%s": "Peer error: %s"
20
21
  }
package/bajo/intl/id.json CHANGED
@@ -16,5 +16,6 @@
16
16
  "downloading": "Pengunduhan...",
17
17
  "encryption type": "Tipe enkripsi",
18
18
  "decryption type": "Tipe dekripsi",
19
- "fetching%s": "Fetching %s"
19
+ "fetching%s": "Fetching %s",
20
+ "peerError%s": "Kesalahan dari peer: %s"
20
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo-extra",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "Extra package for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/plugin/factory.js CHANGED
@@ -9,7 +9,7 @@ import { ShortCrypt } from 'short-crypt'
9
9
 
10
10
  async function fetching ({ url, opts, bulk, spin }) {
11
11
  const { setImmediate, print } = this.app.bajo
12
- const { isEmpty, isFunction, has } = this.app.bajo.lib._
12
+ const { isEmpty, isFunction, has } = this.lib._
13
13
  const { validationErrorMessage } = this.app.bajoDb
14
14
  const resp = await this.fetch(url, opts ?? {})
15
15
  if (isEmpty(resp)) {
@@ -57,7 +57,7 @@ async function fetching ({ url, opts, bulk, spin }) {
57
57
  }
58
58
 
59
59
  async function handler (rec, bulk) {
60
- const { isFunction, set } = this.app.bajo.lib._
60
+ const { isFunction, set } = this.lib._
61
61
  const { recordCreate, recordFind, recordUpdate } = this.app.bajoDb
62
62
  const save = bulk.save ?? {}
63
63
  const current = save.current ?? {}
@@ -152,7 +152,7 @@ async function factory (pkgName) {
152
152
 
153
153
  // taken from: https://stackoverflow.com/a/41439945
154
154
  countFileLines = async (file) => {
155
- const { fs } = this.app.bajo.lib
155
+ const { fs } = this.lib
156
156
  return new Promise((resolve, reject) => {
157
157
  let lineCount = 0
158
158
  fs.createReadStream(file)
@@ -173,10 +173,10 @@ async function factory (pkgName) {
173
173
 
174
174
  download = async (url, opts = {}, extra = {}) => {
175
175
  const { getPluginDataDir, importPkg, generateId } = this.app.bajo
176
- const { fs } = this.app.bajo.lib
177
- const { isFunction, merge } = this.app.bajo.lib._
176
+ const { fs } = this.lib
177
+ const { isFunction, merge } = this.lib._
178
178
  if (typeof opts === 'string') extra = { dir: opts }
179
- const increment = await importPkg('add-filename-increment')
179
+ const increment = await importPkg('bajo:add-filename-increment')
180
180
  if (!extra.dir) {
181
181
  extra.dir = `${getPluginDataDir('bajoExtra')}/download`
182
182
  fs.ensureDirSync(extra.dir)
@@ -252,8 +252,8 @@ async function factory (pkgName) {
252
252
 
253
253
  fetchUrl = async (url, opts = {}, extra = {}) => {
254
254
  const { isSet } = this.app.bajo
255
- const { fs } = this.app.bajo.lib
256
- const { isEmpty, has, isArray, isPlainObject, isString, cloneDeep, merge } = this.app.bajo.lib._
255
+ const { fs } = this.lib
256
+ const { isEmpty, has, isArray, isPlainObject, isString, cloneDeep, merge } = this.lib._
257
257
  if (isPlainObject(url)) {
258
258
  extra = cloneDeep(opts)
259
259
  opts = cloneDeep(url)
@@ -305,7 +305,7 @@ async function factory (pkgName) {
305
305
  }
306
306
 
307
307
  gzip = async (file, deleteOld, expand) => {
308
- const { fs } = this.app.bajo.lib
308
+ const { fs } = this.lib
309
309
  return new Promise((resolve, reject) => {
310
310
  const newFile = expand ? file.slice(0, file.length - 3) : (file + '.gz')
311
311
  const reader = fs.createReadStream(file)