-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3348 from bcgov/dependabot/npm_and_yarn/app/aws-s…
…dk/client-s3-3.592.0 chore: bump @aws-sdk/client-s3 from 3.226.0 to 3.592.0 in /app
- Loading branch information
Showing
5 changed files
with
1,031 additions
and
528 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
import { SNSClient, PublishCommand } from "@aws-sdk/client-sns"; | ||
import { SNSClient, PublishCommand } from '@aws-sdk/client-sns'; | ||
|
||
import awsConfig from './awsCommon' | ||
import { awsSNSConfig } from './awsCommon'; | ||
|
||
export const snsClient = new SNSClient(awsConfig); | ||
export const snsClient = new SNSClient(awsSNSConfig); | ||
|
||
export const pushMessage = async (topic:string, uuid: string, body: string) => { | ||
export const pushMessage = async ( | ||
topic: string, | ||
uuid: string, | ||
body: string | ||
) => { | ||
const params = { | ||
Message: body, | ||
Subject: uuid, | ||
TopicArn: topic | ||
TopicArn: topic, | ||
}; | ||
|
||
const response = {result:''}; | ||
const response = { result: '' }; | ||
try { | ||
await snsClient.send(new PublishCommand(params)); | ||
response.result = 'Success'; | ||
} catch (e) { | ||
} catch (e) { | ||
response.result = `Error ${e.stack}`; | ||
} | ||
return Promise.resolve(response); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.