ac-support-connector 1.0.1 → 1.0.3

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/index.js +9 -3
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ <a name="1.0.3"></a>
2
+
3
+ ## [1.0.3](https://github.com/admiralcloud/ac-support-connector/compare/v1.0.2..v1.0.3) (2024-08-28 07:31:10)
4
+
5
+
6
+ ### Bug Fix
7
+
8
+ * **Connector:** Return result from SQS | MP | [0f2b03016c7257d5884186093f25c179907e3a1f](https://github.com/admiralcloud/ac-support-connector/commit/0f2b03016c7257d5884186093f25c179907e3a1f)
9
+ Return return from SQS to calling function/platform
10
+ Related issues: [undefined/undefined#master](undefined/browse/master)
11
+ <a name="1.0.2"></a>
12
+
13
+ ## [1.0.2](https://github.com/admiralcloud/ac-support-connector/compare/v1.0.1..v1.0.2) (2024-08-28 06:57:59)
14
+
15
+
16
+ ### Bug Fix
17
+
18
+ * **Connector:** Add attachment option | MP | [4defb818fc5d0c70045967928b6a91e84e28d5d3](https://github.com/admiralcloud/ac-support-connector/commit/4defb818fc5d0c70045967928b6a91e84e28d5d3)
19
+ Add attachment option
20
+ Related issues: [undefined/undefined#master](undefined/browse/master)
1
21
  <a name="1.0.1"></a>
2
22
 
3
23
  ## [1.0.1](https://github.com/admiralcloud/ac-support-connector/compare/v1.0.0..v1.0.1) (2024-08-27 14:05:03)
package/index.js CHANGED
@@ -19,11 +19,14 @@ module.exports = {
19
19
  this.debugMode = debug
20
20
 
21
21
  if (!debug) {
22
- const client = new STSClient(awsConfig)
22
+ const client = new STSClient({
23
+ region
24
+ })
23
25
  const command = new GetCallerIdentityCommand()
24
26
  const response = await client.send(command)
25
27
  const accountId = response?.Account
26
28
  const sqsParams = {
29
+ region,
27
30
  account: accountId,
28
31
  availableLists: [{
29
32
  name: sqsQueue,
@@ -42,7 +45,7 @@ module.exports = {
42
45
  },
43
46
 
44
47
 
45
- createMessage: async function({ subject, text, message = [], block, platforms, reporter }) {
48
+ createMessage: async function({ subject, text, message = [], attachments = [], block, platforms, reporter, messageGroupId }) {
46
49
  // check block time in Redis, fallback to memory
47
50
  if (block) {
48
51
  if (block < 1) block = 1 // make sure to use reasonable value!
@@ -77,13 +80,16 @@ module.exports = {
77
80
  reporter,
78
81
  message,
79
82
  }
83
+ if (attachments.length > 0) messagePayload.attachments = attachments
84
+
80
85
 
81
86
  if (process.env.NODE_ENV === 'test') {
82
87
  return messagePayload
83
88
  }
84
89
  try {
85
- await this.acsqs.sendSQSMessage({ name: this.sqsQueue, message: JSON.stringify(messagePayload) })
90
+ const response = await this.acsqs.sendSQSMessage({ name: this.sqsQueue, message: JSON.stringify(messagePayload), messageGroupId: (messageGroupId || this.serviceName) })
86
91
  if (this.debugMode) console.warn(response)
92
+ return response
87
93
  }
88
94
  catch(e) {
89
95
  console.error('%s | Subject %s | Failed %j', functionName, subject, e?.message)
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "author": "Mark Poepping (https://www.admiralcloud.com)",
4
4
  "license": "MIT",
5
5
  "repository": "admiralcloud/ac-support-connector",
6
- "version": "1.0.1",
6
+ "version": "1.0.3",
7
7
  "dependencies": {
8
8
  "ac-sqs": "^2.0.4",
9
9
  "node-cache": "^5.1.2"