@notifiles/sdk 1.1.10 → 1.1.12

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.10",
4
+ "version": "1.1.12",
5
5
  "description": "",
6
6
  "author": {
7
7
  "name": "adoucoure",
@@ -10,10 +10,10 @@ describe('project', () => {
10
10
  cloud: {
11
11
  id: "minio",
12
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
13
+ endPoint: process.env.MINIO_ENDPOINT,
14
+ accessKey: process.env.MINIO_ACCESS_KEY,
15
+ secretKey: process.env.MINIO_SECRET,
16
+ bucketName: process.env.MINIO_BUCKET_NAME
17
17
  }
18
18
  }
19
19
  })
@@ -10,10 +10,10 @@ describe.skip('cloudify', () => {
10
10
  clouds: [{
11
11
  id: "minio",
12
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
13
+ endPoint: process.env.MINIO_ENDPOINT,
14
+ accessKey: process.env.MINIO_ACCESS_KEY,
15
+ secretKey: process.env.MINIO_SECRET,
16
+ bucketName: process.env.MINIO_BUCKET_NAME
17
17
  }
18
18
  }]
19
19
  },
@@ -1,16 +1,25 @@
1
1
  export default ({ text, strings }) => {
2
- const replacer = (match, p1) => {
3
- const str = match.trim().replace('[[', '').replace(']]', '')
2
+ let _text = text
4
3
 
5
- if (!strings[str]) {
6
- return match
4
+ const firsts = _text.split('[[')
5
+ let matched = firsts.map(element => {
6
+ if (element.indexOf(']]') === -1) {
7
+ return element
7
8
  }
8
9
 
9
- const prefix = match[0] === " " ? " " : ""
10
- const suffix = match[match.length - 1] === " " ? " " : ""
11
- return prefix + strings[str] + suffix
12
- }
10
+ let seconds = element.split(']]')
11
+ const key = seconds[0]
12
+ const value = strings[key]
13
+ if (!value) {
14
+ return seconds.join('')
15
+ }
16
+ seconds = seconds.length > 1
17
+ ? seconds.slice(1, seconds.length)
18
+ : seconds
19
+ return [value, seconds].join('')
20
+ })
21
+
22
+ matched = matched.join('')
23
+ return matched
13
24
 
14
- const reg = new RegExp(/ *\[\[[^)]*\]\] */g)
15
- return text.replaceAll(reg, replacer)
16
25
  }
@@ -10,10 +10,10 @@ describe.skip('cloudify', () => {
10
10
  clouds: [{
11
11
  id: "minio",
12
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
13
+ endPoint: process.env.MINIO_ENDPOINT,
14
+ accessKey: process.env.MINIO_ACCESS_KEY,
15
+ secretKey: process.env.MINIO_SECRET,
16
+ bucketName: process.env.MINIO_BUCKET_NAME
17
17
  }
18
18
  }]
19
19
  },
@@ -11,10 +11,10 @@ describe('project', () => {
11
11
  clouds: [{
12
12
  id: "minio",
13
13
  auth: {
14
- endPoint: process.env.TEST_MINIO_ENDPOINT,
15
- accessKey: process.env.TEST_MINIO_ACCESS_KEY,
16
- secretKey: process.env.TEST_MINIO_SECRET,
17
- bucketName: process.env.TEST_MINIO_BUCKET_NAME
14
+ endPoint: process.env.MINIO_ENDPOINT,
15
+ accessKey: process.env.MINIO_ACCESS_KEY,
16
+ secretKey: process.env.MINIO_SECRET,
17
+ bucketName: process.env.MINIO_BUCKET_NAME
18
18
  }
19
19
  },],
20
20
  },
@@ -32,10 +32,10 @@ describe('project', () => {
32
32
  clouds: [{
33
33
  id: "minio",
34
34
  auth: {
35
- endPoint: process.env.TEST_MINIO_ENDPOINT,
36
- accessKey: process.env.TEST_MINIO_ACCESS_KEY,
37
- secretKey: process.env.TEST_MINIO_SECRET,
38
- bucketName: process.env.TEST_MINIO_BUCKET_NAME
35
+ endPoint: process.env.MINIO_ENDPOINT,
36
+ accessKey: process.env.MINIO_ACCESS_KEY,
37
+ secretKey: process.env.MINIO_SECRET,
38
+ bucketName: process.env.MINIO_BUCKET_NAME
39
39
  }
40
40
  },],
41
41
  },