ac-sqs 2.0.0 → 2.0.2
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/CHANGELOG.md +35 -0
- package/README.md +1 -0
- package/index.js +10 -0
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
<a name="2.0.2"></a>
|
|
2
|
+
|
|
3
|
+
## [2.0.2](https://github.com/admiralcloud/ac-sqs/compare/v2.0.1..v2.0.2) (2023-08-26 14:18:17)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fix
|
|
7
|
+
|
|
8
|
+
* **App:** Don't create an error mapping a non existing result when receiving messages | MP | [f24ac7d20edff29e8ded7f2eb8728910046ce62e](https://github.com/admiralcloud/ac-sqs/commit/f24ac7d20edff29e8ded7f2eb8728910046ce62e)
|
|
9
|
+
My commit description
|
|
10
|
+
Related issues: [admiralcloud/ac-sqs#1](https://github.com/admiralcloud/ac-sqs/issues/1) [admiralcloud/ac-api-server#340](https://github.com/admiralcloud/ac-api-server/issues/340)
|
|
11
|
+
### Chores
|
|
12
|
+
|
|
13
|
+
* **App:** Updated packages | MP | [818c035b3375f2222d1b316d64273e48286b6aaf](https://github.com/admiralcloud/ac-sqs/commit/818c035b3375f2222d1b316d64273e48286b6aaf)
|
|
14
|
+
Updated packages
|
|
15
|
+
Related issues: [admiralcloud/ac-sqs#1](https://github.com/admiralcloud/ac-sqs/issues/1) [admiralcloud/ac-api-server#340](https://github.com/admiralcloud/ac-api-server/issues/340)
|
|
16
|
+
<a name="2.0.1"></a>
|
|
17
|
+
|
|
18
|
+
## [2.0.1](https://github.com/admiralcloud/ac-sqs/compare/v2.0.0..v2.0.1) (2023-07-02 13:28:31)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fix
|
|
22
|
+
|
|
23
|
+
* **App:** Add option to retrieve all available lists | MP | [3f6633cfad4b17f444373ca098831bd78bff51cc](https://github.com/admiralcloud/ac-sqs/commit/3f6633cfad4b17f444373ca098831bd78bff51cc)
|
|
24
|
+
Add option to retrieve all available lists
|
|
25
|
+
Related issues: [/issues#undefined](https://github.com//issues/undefined)
|
|
26
|
+
### Documentation
|
|
27
|
+
|
|
28
|
+
* **App:** Improved info about testing | MP | [d60cd85395e9a7cdd80fb31186913f5901c28daa](https://github.com/admiralcloud/ac-sqs/commit/d60cd85395e9a7cdd80fb31186913f5901c28daa)
|
|
29
|
+
Improved info about testing
|
|
30
|
+
Related issues: [admiralcloud/ac-sqs#1](https://github.com/admiralcloud/ac-sqs/issues/1) [admiralcloud/ac-api-server#340](https://github.com/admiralcloud/ac-api-server/issues/340)
|
|
31
|
+
### Chores
|
|
32
|
+
|
|
33
|
+
* **App:** Updated packages | MP | [f2a69c23c58099ae460a6e1df0fc22356a1a2c52](https://github.com/admiralcloud/ac-sqs/commit/f2a69c23c58099ae460a6e1df0fc22356a1a2c52)
|
|
34
|
+
Updated packages
|
|
35
|
+
Related issues: [/issues#undefined](https://github.com//issues/undefined)
|
|
1
36
|
<a name="2.0.0"></a>
|
|
2
37
|
|
|
3
38
|
# [2.0.0](https://github.com/admiralcloud/ac-sqs/compare/v0.1.0..v2.0.0) (2023-04-29 06:19:35)
|
package/README.md
CHANGED
|
@@ -120,6 +120,7 @@ Preparations you have to make before running the tests:
|
|
|
120
120
|
+ export the AWS account id using **export awsaccount=12345**
|
|
121
121
|
+ create a SQS list named "test_acsqs"
|
|
122
122
|
+ create a bucket and export the name using **export bucket=acsqs-test-bucket**
|
|
123
|
+
+ export the node test environment using **export NODE_ENV=test**
|
|
123
124
|
|
|
124
125
|
**ATTENTION**: Tests may fail when checking the SQS length. This is a by-design failure:
|
|
125
126
|
"ApproximateNumberOfMessages metrics may not achieve consistency until at least 1 minute after the producers stop sending messages."
|
package/index.js
CHANGED
|
@@ -39,6 +39,15 @@ class ACSQS {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
async getAllLists() {
|
|
43
|
+
let response = []
|
|
44
|
+
for (const list of this.availableLists) {
|
|
45
|
+
const attr = await this.getQueueAttributes({ name: list?.name, attributes: ['QueueArn'] })
|
|
46
|
+
response.push({ name: list?.name, value: attr?.Attributes?.QueueArn })
|
|
47
|
+
}
|
|
48
|
+
return response
|
|
49
|
+
}
|
|
50
|
+
|
|
42
51
|
async getQueueUrl({ name, fifo, localPrefix }) {
|
|
43
52
|
let queueUrl = `https://sqs.${this.region}.amazonaws.com/${this.account}/`
|
|
44
53
|
if (localPrefix) queueUrl += `local_${localPrefix}_`
|
|
@@ -122,6 +131,7 @@ class ACSQS {
|
|
|
122
131
|
const command = new ReceiveMessageCommand(sqsParams)
|
|
123
132
|
try {
|
|
124
133
|
const result = await this.sqs.send(command)
|
|
134
|
+
if (!_.size(result.Messages)) return
|
|
125
135
|
const messages = await Promise.all(result.Messages.map(async message => {
|
|
126
136
|
if (message.Body.startsWith('s3:')) {
|
|
127
137
|
const key = message.Body.replace('s3:', '')
|
package/package.json
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
"author": "Mark Poepping (https://www.admiralcloud.com)",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "admiralcloud/ac-sqs",
|
|
6
|
-
"version": "2.0.
|
|
6
|
+
"version": "2.0.2",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@aws-sdk/client-s3": "^3.
|
|
9
|
-
"@aws-sdk/client-sqs": "^3.
|
|
10
|
-
"@aws-sdk/credential-providers": "^3.
|
|
8
|
+
"@aws-sdk/client-s3": "^3.400.0",
|
|
9
|
+
"@aws-sdk/client-sqs": "^3.398.0",
|
|
10
|
+
"@aws-sdk/credential-providers": "^3.398.0",
|
|
11
11
|
"lodash": "^4.17.21",
|
|
12
12
|
"uuid": "^9.0.0"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"ac-semantic-release": "^0.4.
|
|
16
|
-
"chai": "^4.3.
|
|
17
|
-
"eslint": "^8.
|
|
15
|
+
"ac-semantic-release": "^0.4.2",
|
|
16
|
+
"chai": "^4.3.8",
|
|
17
|
+
"eslint": "^8.48.0",
|
|
18
18
|
"mocha": "^10.x"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|