@notifiles/sdk 1.1.4 → 1.1.6

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@notifiles/sdk",
3
3
  "type": "module",
4
- "version": "1.1.4",
4
+ "version": "1.1.6",
5
5
  "description": "",
6
6
  "author": {
7
7
  "name": "adoucoure",
@@ -1,2 +1,6 @@
1
1
  export { default as isValid } from './isValid.js'
2
2
  export { default as upload } from './upload.js'
3
+ export { default as syncFolder } from './syncFolder.js'
4
+ export { default as remove } from './remove.js'
5
+ export { default as previewRemoteUrl } from './previewRemoteUrl.js'
6
+ // export { default as uploadFolder } from './uploadFolder.js'
@@ -0,0 +1,21 @@
1
+ export default async ({
2
+ filename,
3
+ auth,
4
+ // contentType = 'image/png'
5
+ }) => {
6
+
7
+ try {
8
+ const {
9
+ accessKey,
10
+ storageZoneName,
11
+ pullZone
12
+ } = auth
13
+
14
+ const url = `https://${pullZone}.b-cdn.net/${filename}`
15
+ return url
16
+
17
+ } catch (e) {
18
+ console.error(e)
19
+ }
20
+ return null
21
+ }
@@ -0,0 +1,14 @@
1
+
2
+ export default async ({
3
+
4
+ }) => {
5
+
6
+ try {
7
+ //#TODO
8
+ return { success: false }
9
+
10
+ } catch (e) {
11
+ console.error(e)
12
+ }
13
+ return null
14
+ }
@@ -0,0 +1,14 @@
1
+
2
+ export default async ({
3
+
4
+ }) => {
5
+
6
+ try {
7
+ //#TODO
8
+ return { success: false }
9
+
10
+ } catch (e) {
11
+ console.error(e)
12
+ }
13
+ return null
14
+ }
@@ -0,0 +1,14 @@
1
+
2
+ export default async ({
3
+
4
+ }) => {
5
+
6
+ try {
7
+ //#TODO
8
+ return { success: false }
9
+
10
+ } catch (e) {
11
+ console.error(e)
12
+ }
13
+ return null
14
+ }
@@ -11,7 +11,7 @@ export default async ({
11
11
  } = auth
12
12
 
13
13
  const url = `https://${endPoint}/${bucketName}/${filename}`
14
- return { url }
14
+ return url
15
15
 
16
16
  } catch (e) {
17
17
  console.error(e)
@@ -1,4 +1,4 @@
1
- import perform from './lib/perform.js'
1
+ import perform from './entry.js'
2
2
  import getEntries from '../../lib/entries/getAtPath.js'
3
3
  import adaptSettings from '../../lib/adaptSettings.js'
4
4
 
@@ -1,4 +1,4 @@
1
- import perform from './lib/perform/email.js'
1
+ import perform from './entry.js'
2
2
  import getEntries from '../../lib/entries/getAtPath.js'
3
3
 
4
4
  export default async ({
@@ -1,4 +1,4 @@
1
- import perform from './lib/perform.js'
1
+ import perform from './entry.js'
2
2
  import getEntries from '../../lib/entries/getAtPath.js'
3
3
  import adaptSettings from '../../lib/adaptSettings.js'
4
4
 
@@ -1,4 +1,4 @@
1
- import perform from './lib/perform.js'
1
+ import perform from './entry.js'
2
2
  import getEntries from '../../lib/entries/getAtPath.js'
3
3
 
4
4
  export default async ({
@@ -1,4 +1,4 @@
1
- import perform from './lib/perform/email.js'
1
+ import perform from './entry.js'
2
2
  import getEntries from '../../lib/entries/getAtPath.js'
3
3
 
4
4
  export default async ({
@@ -1,8 +1,4 @@
1
-
2
1
  export * as build from './build/index.js'
3
- export * as cloudify from './cloudify/index.js'
4
- export * as consolidate from './consolidate/index.js'
5
- export * as contain from './consolidate/index.js'
6
2
  export * as sync from './sync/index.js'
7
3
  export * as update from './update/index.js'
8
4
  export { default as create } from './new/index.js'
@@ -9,6 +9,7 @@ import emailTemplateMaster from './templates/email.mastered.js'
9
9
  import textmessageTemplate from './templates/textmessage.js'
10
10
  import pushnotificationTemplate from './templates/pushnotification.js'
11
11
  import _slug from 'slug'
12
+ import ensureDirectoryExists from '../../lib/fs/ensureDirectoryExists.js'
12
13
 
13
14
  export default async ({
14
15
  path,
@@ -29,6 +30,8 @@ export default async ({
29
30
  await fs.promises.rmdir(folderPath, { recursive: true })
30
31
  }
31
32
 
33
+ await ensureDirectoryExists(folderPath)
34
+
32
35
  await fs.promises.mkdir(folderPath)
33
36
  await fs.promises.mkdir(`${folderPath}/attachments`)
34
37
  await fs.promises.mkdir(`${folderPath}/.cache`)
@@ -1,4 +1,4 @@
1
- import perform from './lib/perform.js'
1
+ import perform from './entry.js'
2
2
  import getEntries from '../../lib/entries/getAtPath.js'
3
3
 
4
4
  export default async ({
@@ -1,4 +1,4 @@
1
- import perform from './lib/email.js'
1
+ import perform from './entry.js'
2
2
  import getEntries from '../../lib/entries/getAtPath.js'
3
3
 
4
4
  export default async ({