@notifiles/sdk 1.1.0 → 1.1.1

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.0",
4
+ "version": "1.1.1",
5
5
  "description": "",
6
6
  "author": {
7
7
  "name": "adoucoure",
@@ -116,6 +116,7 @@
116
116
  "twitter": "^1.7.1",
117
117
  "underscore": "^1.13.6",
118
118
  "unified": "^11.0.4",
119
+ "walk": "^2.3.15",
119
120
  "yaml": "^2.4.2"
120
121
  },
121
122
  "devDependencies": {
@@ -1,4 +1,5 @@
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'
3
4
  export { default as remove } from './remove.js'
4
5
  // export { default as uploadFolder } from './uploadFolder.js'
@@ -0,0 +1,72 @@
1
+ import * as Minio from 'minio'
2
+ import { walk } from 'walk'
3
+
4
+ export default async ({
5
+ sourceUrl,
6
+ destinationPath,
7
+ auth,
8
+ // contentType = 'image/png'
9
+ }) => {
10
+
11
+ try {
12
+ const {
13
+ endPoint,
14
+ accessKey,
15
+ secretKey,
16
+ bucketName
17
+ } = auth
18
+
19
+ const minioClient = new Minio.Client({
20
+ endPoint,
21
+ // port,
22
+ // useSSL,
23
+ accessKey,
24
+ secretKey,
25
+ })
26
+
27
+ const exists = await minioClient.bucketExists(bucketName)
28
+ if (!exists) {
29
+ return null
30
+ // await minioClient.makeBucket(bucketName, 'us-east-1')
31
+ // console.log('Bucket ' + bucketName + ' created in "us-east-1".')
32
+ }
33
+
34
+ const metaData = {
35
+ // 'Content-Type': contentType,
36
+ }
37
+
38
+ const walker = walk(sourceUrl)
39
+ const result = await new Promise((resolve, reject) => {
40
+ walker.on('file', (root, fileStats, next) => {
41
+ const filePath = `${root}/${fileStats.name}`
42
+ const postSourceURl = root.split(sourceUrl)[1]
43
+ let destination = `${destinationPath}/${postSourceURl}/${fileStats.name}`
44
+ destination = destination.replaceAll('//', '/')
45
+ console.log('Upload', filePath)
46
+
47
+ minioClient.fPutObject(
48
+ bucketName,
49
+ destination,
50
+ filePath,
51
+ err => {
52
+ console.log(filePath, 'uploaded')
53
+ if (err) {
54
+ console.error(err)
55
+ reject(err)
56
+ }
57
+ next()
58
+ })
59
+ })
60
+
61
+ walker.on('end', function () {
62
+ console.log('End upload')
63
+ resolve()
64
+ })
65
+ })
66
+
67
+ return {}
68
+ } catch (e) {
69
+ console.error(e)
70
+ }
71
+ return null
72
+ }
@@ -0,0 +1,21 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+
4
+ const walk = async (dir, filelist = []) => {
5
+ const files = await fs.promises.readdir(dir);
6
+
7
+ for (file of files) {
8
+ const filepath = path.join(dir, file)
9
+ const stat = await fs.promises.stat(filepath)
10
+
11
+ if (stat.isDirectory()) {
12
+ filelist = await walk(filepath, filelist)
13
+ } else {
14
+ filelist.push(file)
15
+ }
16
+ }
17
+
18
+ return filelist;
19
+ }
20
+
21
+ export default walk
@@ -0,0 +1,22 @@
1
+ import adaptSettings from '../../lib/adaptSettings.js'
2
+ import performEmail from './lib/email.js'
3
+ import performTextMessage from './lib/textMessage.js'
4
+ import performPushNotification from './lib/pushNotification.js'
5
+
6
+ export default async ({
7
+ entry,
8
+ settings,
9
+ }) => {
10
+ adaptSettings({ settings })
11
+ return {
12
+ entry: {
13
+ ...entry,
14
+ versions: await Promise.all(entry.versions.map(async _entry => {
15
+ let res = await performEmail({ entry: _entry, settings, })
16
+ res = await performTextMessage({ entry: res.entry, settings, })
17
+ res = await performPushNotification({ entry: res.entry, settings, })
18
+ return res.entry
19
+ }))
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,2 @@
1
+ export { default as processEntry } from './entry.js'
2
+ export { default as processPath } from './path.js'
@@ -0,0 +1,59 @@
1
+ import fs from 'fs'
2
+ import checkFileExists from '../../../lib/fs/checkFileExists.js'
3
+ import fsPath from 'path'
4
+
5
+ export default async (props) => {
6
+ const { entry, settings } = props
7
+ const {
8
+ path,
9
+ buildPaths,
10
+ code,
11
+ } = entry
12
+
13
+ const sharedItemsPath = `${path}/attachments`
14
+ let sharedItems = await fs.promises.readdir(sharedItemsPath)
15
+ let items = (await Promise.all(sharedItems.map(async item => {
16
+ const folderPath = fsPath.join(sharedItemsPath, item)
17
+ const folderPathStat = await fs.promises.stat(folderPath)
18
+ if (!folderPathStat) {
19
+ return null
20
+ }
21
+
22
+ const isDir = folderPathStat.isDirectory()
23
+ if (isDir) {
24
+ return null
25
+ }
26
+ return {
27
+ fileName: item,
28
+ path: `${sharedItemsPath}/${item}`
29
+ }
30
+ }))).filter(a => a)
31
+
32
+ const codeOwnItemsPath = `${path}/attachments/${entry.code}`
33
+
34
+ if ((await checkFileExists(codeOwnItemsPath))) {
35
+ let codeOwnItems = await fs.promises.readdir(codeOwnItemsPath)
36
+ items = [
37
+ ...items,
38
+ ...(codeOwnItems.map(fileName => ({
39
+ fileName,
40
+ path: `${codeOwnItemsPath}/${fileName}`
41
+ })))
42
+ ]
43
+ }
44
+
45
+ if (!items) {
46
+ return { entry }
47
+ }
48
+
49
+ await Promise.all(items.map(async ({ fileName, path: filePath }) => {
50
+ return fs.promises.cp(
51
+ filePath,
52
+ `${path}/.build/email/${code}/attachments/${fileName}`,
53
+ )
54
+ }))
55
+
56
+ return {
57
+ entry
58
+ }
59
+ }
@@ -0,0 +1,9 @@
1
+
2
+ export default async (props) => {
3
+
4
+ const { entry } = props
5
+
6
+ return {
7
+ entry
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+
2
+ export default async (props) => {
3
+
4
+ const { entry } = props
5
+
6
+ return {
7
+ entry
8
+ }
9
+ }
@@ -0,0 +1,20 @@
1
+ import perform from './lib/perform.js'
2
+ import getEntries from '../../lib/entries/getAtPath.js'
3
+ import adaptSettings from '../../lib/adaptSettings.js'
4
+
5
+ export default async ({
6
+ path,
7
+ settings
8
+ }) => {
9
+ adaptSettings({ settings })
10
+ let entries = await getEntries({
11
+ path,
12
+ })
13
+
14
+ for (var i in entries) {
15
+ const entry = entries[i]
16
+ await perform({ entry, settings })
17
+ }
18
+
19
+ return true
20
+ }
@@ -0,0 +1,24 @@
1
+
2
+ describe.skip('cloudify', () => {
3
+ it('cloudifies to minio', async () => {
4
+ const fsPath = (await import('path')).default
5
+ let path = fsPath.resolve(process.env.TEST_MOCK_FOLDER)
6
+ const operation = (await import('./path.js')).default
7
+
8
+ const result = await operation({
9
+ settings: {
10
+ clouds: [{
11
+ id: "minio",
12
+ auth: {
13
+ endPoint: process.env.TEST_MINIO_ENDPOINT,
14
+ accessKey: process.env.TEST_MINIO_ACCESS_KEY,
15
+ secretKey: process.env.TEST_MINIO_SECRET,
16
+ bucketName: process.env.TEST_MINIO_BUCKET_NAME
17
+ }
18
+ }]
19
+ },
20
+ path,
21
+ })
22
+ expect(result).toBeTruthy()
23
+ })
24
+ })
@@ -1,7 +1,6 @@
1
1
  import hastToHtml from '../../../../lib/remark/hastToHtml.js'
2
- import treatAttachments from './attachments/index.js'
3
2
  import treatImage from './image/index.js'
4
-
3
+ import fs from 'fs'
5
4
 
6
5
  export default async (props) => {
7
6
  const { entry, settings } = props
@@ -15,17 +14,14 @@ export default async (props) => {
15
14
  buildPaths
16
15
  })
17
16
 
18
- await treatAttachments({
19
- path,
20
- settings,
21
- buildPaths,
22
- entry
23
- })
24
-
25
17
  // let md = await mdastToMarkdown({ mdast })
26
18
  let body = hastToHtml({ data: _hast })
27
19
  // await fs.promises.writeFile(`${path}/.build/html/email.cloud.html`, html)
28
20
 
21
+ await fs.promises.writeFile(
22
+ buildPaths.email.body,
23
+ body
24
+ )
29
25
 
30
26
  return {
31
27
  entry: {
@@ -1,10 +1,11 @@
1
1
  import hastToHtml from '../../../lib/remark/hastToHtml.js';
2
2
  import treatImage from './image/index.js';
3
3
  import ensureDirectoryExists from '../../../lib/fs/ensureDirectoryExists.js';
4
+ import fs from 'fs';
4
5
 
5
6
  export default async (props) => {
6
7
  const { entry } = props
7
- const { path, email: { hast } } = entry
8
+ const { path, email: { hast }, buildPaths } = entry
8
9
 
9
10
  const destination = `${path}/.assets`
10
11
  await ensureDirectoryExists(destination, false)
@@ -17,6 +18,11 @@ export default async (props) => {
17
18
 
18
19
  let body = hastToHtml({ data: _hast })
19
20
 
21
+ await fs.promises.writeFile(
22
+ buildPaths.email.body,
23
+ body
24
+ )
25
+
20
26
  return {
21
27
  entry: {
22
28
  ...entry,
@@ -22,6 +22,7 @@ export default async ({
22
22
  buildPaths: {
23
23
  email: {
24
24
  container: `${path}/.build/email/${code}`,
25
+ containerRemote: `${entry.slug}/email/${code}`,
25
26
  body: `${path}/.build/email/${code}/body.html`,
26
27
  bodyFileName: `${entry.slug}/email/${code}/body.html`,
27
28
  text: `${path}/.build/email/${code}/text.txt`,
@@ -35,6 +36,7 @@ export default async ({
35
36
  },
36
37
  textMessage: {
37
38
  container: `${path}/.build/textmessage/${code}`,
39
+ containerRemote: `${entry.slug}/textmessage/${code}`,
38
40
  text: `${path}/.build/textmessage/${code}/textmessage.txt`,
39
41
  textFileName: `${entry.slug}/textmessage/${code}/textmessage.txt`,
40
42
  assetsContainer: `${entry.slug}/textmessage/${code}/assets`,
@@ -43,6 +45,7 @@ export default async ({
43
45
  },
44
46
  pushNotification: {
45
47
  container: `${path}/.build/pushnotification/${code}`,
48
+ containerRemote: `${entry.slug}/pushnotification/${code}`,
46
49
  text: `${path}/.build/pushnotification/${code}/pushnotification.txt`,
47
50
  textFileName: `${entry.slug}/pushnotification/${code}/pushnotification.txt`,
48
51
  assetsContainer: `${entry.slug}/pushnotification/${code}/assets`,
@@ -1,9 +1,10 @@
1
1
  import hastToHtml from '../../../lib/remark/hastToHtml.js'
2
2
  import treatImage from './image/index.js'
3
+ import fs from 'fs'
3
4
 
4
5
  export default async (props) => {
5
6
  const { entry } = props
6
- const { path, email: { hast } } = entry
7
+ const { path, email: { hast }, buildPaths } = entry
7
8
 
8
9
  let _hast = await perform({
9
10
  child: hast,
@@ -12,6 +13,11 @@ export default async (props) => {
12
13
 
13
14
  let body = hastToHtml({ data: _hast })
14
15
 
16
+ await fs.promises.writeFile(
17
+ buildPaths.email.body,
18
+ body
19
+ )
20
+
15
21
  return {
16
22
  entry: {
17
23
  ...entry,
@@ -1,4 +1,4 @@
1
- import upload from './upload.js'
1
+ import syncFolder from './syncFolder.js'
2
2
  import fs from 'fs'
3
3
  import updateActivity from '../../lib/activity/updateToFile.js'
4
4
  import getActivity from '../../lib/activity/get.js'
@@ -10,10 +10,10 @@ export default async (props) => {
10
10
  const { path, email, buildPaths, } = entry
11
11
  const { body, } = email
12
12
 
13
- await fs.promises.writeFile(
14
- buildPaths.email.body,
15
- body
16
- )
13
+ // await fs.promises.writeFile(
14
+ // buildPaths.email.body,
15
+ // body
16
+ // )
17
17
 
18
18
  let manifest = await importJSONAsync(
19
19
  buildPaths.manifestFileNameBuilt,
@@ -38,31 +38,10 @@ export default async (props) => {
38
38
  let uploadResult = null
39
39
  for (var i in clouds) {
40
40
  const cloud = clouds[i]
41
- uploadResult = await upload({
42
- id: cloud.id,
43
- sourceUrl: buildPaths.email.body,
44
- filename: buildPaths.email.bodyFileName,
45
- auth: cloud.auth,
46
- settings
47
- })
48
- uploadResult = await upload({
49
- id: cloud.id,
50
- sourceUrl: buildPaths.email.text,
51
- filename: buildPaths.email.textFileName,
52
- auth: cloud.auth,
53
- settings
54
- })
55
- uploadResult = await upload({
56
- id: cloud.id,
57
- sourceUrl: buildPaths.email.subject,
58
- filename: buildPaths.email.subjectFileName,
59
- auth: cloud.auth,
60
- settings
61
- })
62
- uploadResult = await upload({
41
+ uploadResult = await syncFolder({
63
42
  id: cloud.id,
64
- sourceUrl: buildPaths.email.manifestFileNameBuilt,
65
- filename: buildPaths.email.manifestFileName,
43
+ sourceUrl: buildPaths.email.container,
44
+ destinationPath: buildPaths.email.containerRemote,
66
45
  auth: cloud.auth,
67
46
  settings
68
47
  })
@@ -1,9 +1,9 @@
1
- import upload from './upload.js'
2
1
  import fs from 'fs'
3
2
  import updateActivity from '../../lib/activity/updateToFile.js'
4
3
  import getActivity from '../../lib/activity/get.js'
5
4
  import importJSONAsync from '../../../lib/fs/importJSONAsync.js'
6
5
  import checkFileExists from '../../../lib/fs/checkFileExists.js'
6
+ import syncFolder from './syncFolder.js'
7
7
 
8
8
  export default async (props) => {
9
9
 
@@ -46,17 +46,10 @@ export default async (props) => {
46
46
  let uploadResult = null
47
47
  for (var i in clouds) {
48
48
  const cloud = clouds[i]
49
- uploadResult = await upload({
49
+ uploadResult = await syncFolder({
50
50
  id: cloud.id,
51
- sourceUrl: buildPaths.pushNotification.text,
52
- filename: buildPaths.pushNotification.textFileName,
53
- auth: cloud.auth,
54
- settings
55
- })
56
- uploadResult = await upload({
57
- id: cloud.id,
58
- sourceUrl: buildPaths.pushNotification.manifestFileNameBuilt,
59
- filename: buildPaths.pushNotification.manifestFileName,
51
+ sourceUrl: buildPaths.pushNotification.container,
52
+ destinationPath: buildPaths.pushNotification.containerRemote,
60
53
  auth: cloud.auth,
61
54
  settings
62
55
  })
@@ -10,5 +10,5 @@ export default async (props) => {
10
10
  }
11
11
  }
12
12
 
13
- return cloudLibrary.remove(props)
13
+ return cloudLibrary.syncFolder(props)
14
14
  }
@@ -1,9 +1,9 @@
1
- import upload from './upload.js'
2
1
  import fs from 'fs'
3
2
  import updateActivity from '../../lib/activity/updateToFile.js'
4
3
  import getActivity from '../../lib/activity/get.js'
5
4
  import importJSONAsync from '../../../lib/fs/importJSONAsync.js'
6
5
  import checkFileExists from '../../../lib/fs/checkFileExists.js'
6
+ import syncFolder from './syncFolder.js'
7
7
 
8
8
  export default async (props) => {
9
9
 
@@ -46,17 +46,10 @@ export default async (props) => {
46
46
  let uploadResult = null
47
47
  for (var i in clouds) {
48
48
  const cloud = clouds[i]
49
- uploadResult = await upload({
49
+ uploadResult = await syncFolder({
50
50
  id: cloud.id,
51
- sourceUrl: buildPaths.textMessage.text,
52
- filename: buildPaths.textMessage.textFileName,
53
- auth: cloud.auth,
54
- settings
55
- })
56
- uploadResult = await upload({
57
- id: cloud.id,
58
- sourceUrl: buildPaths.textMessage.manifestFileNameBuilt,
59
- filename: buildPaths.textMessage.manifestFileName,
51
+ sourceUrl: buildPaths.textMessage.container,
52
+ destinationPath: buildPaths.textMessage.containerRemote,
60
53
  auth: cloud.auth,
61
54
  settings
62
55
  })
@@ -7,6 +7,7 @@ import optimize from '../optimize/entry.js'
7
7
  import version from '../version/entry.js'
8
8
  import cloudify from '../cloudify/entry.js'
9
9
  import adaptSettings from '../../lib/adaptSettings.js'
10
+ import attach from '../attach/entry.js'
10
11
 
11
12
  export default async ({
12
13
  path,
@@ -32,7 +33,11 @@ export default async ({
32
33
  entry = (await consolidate({ entry, settings })).entry
33
34
  entry = (await optimize({ entry, settings })).entry
34
35
  entry = (await cloudify({ entry, settings })).entry
35
- entry = (await sync({ entry, settings })).entry
36
+ entry = (await attach({ entry, settings })).entry
37
+ if (!settings.dryRun) {
38
+ entry = (await sync({ entry, settings })).entry
39
+ }
40
+
36
41
 
37
42
  await version({})
38
43
  }
@@ -1,24 +0,0 @@
1
- import getActivity from '../../../../lib/activity/get.js'
2
- import updateActivity from '../../../../lib/activity/updateToFile.js'
3
-
4
- export default async ({ path, entry, fileName, attachment }) => {
5
- let activity = await getActivity({ path })
6
- let attachments = [
7
- ...((activity[entry.code] && activity[entry.code].attachments)
8
- ? activity[entry.code].attachments
9
- : []),
10
- ]
11
-
12
- attachments = attachments.filter(a => a.id !== fileName)
13
- attachments.push(attachment)
14
-
15
- activity[entry.code] = {
16
- ...(activity[entry.code] ? activity[entry.code] : {}),
17
- attachments
18
- }
19
-
20
- await updateActivity({
21
- path,
22
- content: activity,
23
- })
24
- }
@@ -1,137 +0,0 @@
1
- import upload from '../../upload.js'
2
-
3
- import getActivity from '../../../../lib/activity/get.js'
4
- import updateActivity from '../../../../lib/activity/updateToFile.js'
5
- import fs from 'fs'
6
- import checkFileExists from '../../../../../lib/fs/checkFileExists.js'
7
- import _mimetype from 'mimetype'
8
- import remove from '../../remove.js'
9
- import addAttachment from './addAttachment.js'
10
-
11
- export default async ({ child,
12
- path,
13
- settings,
14
- buildPaths,
15
- entry
16
- }) => {
17
-
18
- let entries = await fs.promises.readdir(`${path}/attachments`)
19
- let items = entries.map(fileName => ({
20
- fileName,
21
- path: `${path}/attachments/${fileName}`
22
- }))
23
-
24
- let codeDestination = `${path}/attachments/${entry.code}`
25
- if ((await checkFileExists(codeDestination))) {
26
- entries = await fs.promises.readdir(codeDestination)
27
- items = [
28
- ...items,
29
- ...(entries.map(fileName => ({
30
- fileName,
31
- path: `${codeDestination}/${fileName}`
32
- })))
33
- ]
34
- }
35
-
36
- if (!items) {
37
- return {}
38
- }
39
-
40
- const { clouds } = settings
41
-
42
- let __activity = await getActivity({ path })
43
- let previousActivity = __activity[entry.code]
44
- __activity[entry.code] = {}
45
- await updateActivity({
46
- path,
47
- content: __activity,
48
- })
49
-
50
- const uploaded = []
51
- for (var i in items) {
52
- const { fileName, path: folderPath } = items[i]
53
- const fileNameRemote = encodeURI(fileName)
54
-
55
- const folderPathStat = await fs.promises.stat(folderPath)
56
- if (!folderPathStat) {
57
- continue
58
- }
59
-
60
- const isDir = folderPathStat.isDirectory()
61
- if (isDir) {
62
- continue
63
- }
64
-
65
- if (!settings.forceUploadAttachments) {
66
- if (previousActivity) {
67
- if (previousActivity.attachments) {
68
- const attachment = previousActivity.attachments.find(a => a.id === fileName)
69
- if (attachment) {
70
- uploaded.push(attachment)
71
- await addAttachment({ path, entry, fileName, attachment })
72
- continue
73
- }
74
- }
75
- }
76
- }
77
-
78
- const mimeType = _mimetype.lookup(folderPath)
79
- let uploadResult = null
80
-
81
- for (var i in clouds) {
82
- const cloud = clouds[i]
83
- uploadResult = await upload({
84
- id: cloud.id,
85
- sourceUrl: folderPath,
86
- filename: `${buildPaths.email.attachmentsContainer}/${fileNameRemote}`,
87
- auth: cloud.auth,
88
- settings
89
- })
90
- }
91
-
92
- if (!uploadResult || !uploadResult.url) {
93
- continue
94
- }
95
-
96
- const attachment = {
97
- id: fileName,
98
- fileName,
99
- url: uploadResult.url,
100
- mimeType,
101
- disposition: "attachment",
102
- relativeFileName: `${buildPaths.email.attachmentsContainer}/${fileNameRemote}`,
103
- }
104
- uploaded.push(attachment
105
- )
106
- await addAttachment({
107
- path, entry, fileName, attachment
108
- })
109
- }
110
-
111
-
112
- const removed = []
113
- for (var i in previousActivity.attachments) {
114
- const item = previousActivity.attachments[i]
115
- const eq = uploaded.find(a => a.id === item.id)
116
- if (!eq) {
117
- removed.push(item)
118
- }
119
- }
120
-
121
- for (var i in removed) {
122
- const item = removed[i]
123
- for (var i in clouds) {
124
- const cloud = clouds[i]
125
- await remove({
126
- id: cloud.id,
127
- filename: item.relativeFileName,
128
- auth: cloud.auth,
129
- settings
130
- })
131
- }
132
- }
133
- return {
134
-
135
- }
136
- }
137
-
@@ -1,13 +0,0 @@
1
- import fsPath from 'path'
2
- import isRelative from 'is-relative'
3
-
4
- export default async ({
5
- url, path, }) => {
6
- const sourceUrl = isRelative(url) ? fsPath.resolve(path, url) : url
7
- const filename = fsPath.basename(sourceUrl)
8
-
9
- return {
10
- filename,
11
- sourceUrl
12
- }
13
- }
@@ -1,26 +0,0 @@
1
- import fsPath from 'path'
2
- import downloadImage from 'image-downloader'
3
-
4
- export default async ({ url,
5
- destination
6
- }) => {
7
- try {
8
- const options = {
9
- url,
10
- dest: destination, // will be saved to /path/to/dest/photo
11
- extractFilename: true,
12
- }
13
-
14
- const item = await downloadImage.image(options)
15
- // const { filename } = item
16
- const filename = fsPath.basename(item.filename)
17
-
18
- return {
19
- filename,
20
- sourceUrl: destination
21
- }
22
- }
23
- catch (e) {
24
- console.error(e)
25
- }
26
- }
@@ -1,14 +0,0 @@
1
- export default async (props) => {
2
-
3
- const { id, settings } = props
4
-
5
- const cloudLibrary = settings.cloudLibrary({ id })
6
- if (!cloudLibrary) {
7
- return {
8
- isValid: false,
9
- error: new Error('Cloud not supported.')
10
- }
11
- }
12
-
13
- return cloudLibrary.upload(props)
14
- }