@guardian/anghammarad
Advanced tools
Comparing version 1.0.2 to 1.8.0-SNAPSHOT
@@ -11,2 +11,3 @@ import { SNS } from "aws-sdk"; | ||
AwsAccount?: string; | ||
GithubTeamSlug?: string; | ||
} | ||
@@ -13,0 +14,0 @@ export declare enum RequestedChannel { |
{ | ||
"name": "@guardian/anghammarad", | ||
"version": "1.0.2", | ||
"version": "1.8.0-SNAPSHOT", | ||
"description": "Notification service for the Guardian's dev teams", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/main.js", |
@@ -24,6 +24,3 @@ # Anghammarad Node Client | ||
```js | ||
import { | ||
Anghammarad, | ||
RequestedChannel, | ||
} from "@guardian/anghammarad"; | ||
import { Anghammarad, RequestedChannel } from '@guardian/anghammarad'; | ||
@@ -33,10 +30,10 @@ const client = new Anghammarad(); | ||
client.notify({ | ||
subject: "Hello", | ||
message: "Hi there, something has happened which we'd like to tell you about", | ||
actions: [{url: "https://example.com"}], | ||
target: {Stack: "my-stack", Stage: "CODE", App: "my-app"}, | ||
channel: RequestedChannel.Email, | ||
sourceSystem: "my-monitoring-tool", | ||
topicArn: "arn:aws:123" | ||
}) | ||
subject: 'Hello', | ||
message: "Hi there, something has happened which we'd like to tell you about", | ||
actions: [{ url: 'https://example.com' }], | ||
target: { Stack: 'my-stack', Stage: 'CODE', App: 'my-app' }, | ||
channel: RequestedChannel.Email, | ||
sourceSystem: 'my-monitoring-tool', | ||
topicArn: 'arn:aws:123', | ||
}); | ||
``` | ||
@@ -47,7 +44,4 @@ | ||
```js | ||
import { | ||
Anghammarad, | ||
RequestedChannel, | ||
} from "@guardian/anghammarad"; | ||
import { credentialsProvider, snsClient } from "./aws"; | ||
import { Anghammarad, RequestedChannel } from '@guardian/anghammarad'; | ||
import { credentialsProvider, snsClient } from './aws'; | ||
@@ -57,11 +51,11 @@ const client = new Anghammarad(); | ||
client.notify({ | ||
subject: "Hello", | ||
message: "Hi there, something has happened which we'd like to tell you about", | ||
actions: [{url: "https://example.com"}], | ||
target: {Stack: "my-stack", Stage: "CODE", App: "my-app"}, | ||
channel: RequestedChannel.Email, | ||
sourceSystem: "my-monitoring-tool", | ||
topicArn: "arn:aws:123", | ||
client: snsClient(credentialsProvider()) | ||
}) | ||
subject: 'Hello', | ||
message: "Hi there, something has happened which we'd like to tell you about", | ||
actions: [{ url: 'https://example.com' }], | ||
target: { Stack: 'my-stack', Stage: 'CODE', App: 'my-app' }, | ||
channel: RequestedChannel.Email, | ||
sourceSystem: 'my-monitoring-tool', | ||
topicArn: 'arn:aws:123', | ||
client: snsClient(credentialsProvider()), | ||
}); | ||
``` | ||
@@ -80,3 +74,3 @@ | ||
| topicArn | The ARN of the topic to which the message should be send | Y | "arn:aws:..." | | ||
| client | An optional SNS client to send the message with. | N | https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SNS.html | | ||
| client | An optional SNS client to send the message with. | N | https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SNS.html | | ||
@@ -115,7 +109,4 @@ ### Channels | ||
// Custom client for Anghammarad client | ||
import { | ||
Anghammarad, | ||
RequestedChannel, | ||
} from "@guardian/anghammarad"; | ||
import { credentialsProvider, snsClient } from "./aws"; | ||
import { Anghammarad, RequestedChannel } from '@guardian/anghammarad'; | ||
import { credentialsProvider, snsClient } from './aws'; | ||
@@ -125,10 +116,10 @@ const client = new Anghammarad(snsClient(credentialsProvider())); | ||
client.notify({ | ||
subject: "Hello", | ||
message: "Hi there, something has happened which we'd like to tell you about", | ||
actions: [{url: "https://example.com"}], | ||
target: {Stack: "my-stack", Stage: "CODE", App: "my-app"}, | ||
channel: RequestedChannel.Email, | ||
sourceSystem: "my-monitoring-tool", | ||
topicArn: "arn:aws:123" | ||
}) | ||
subject: 'Hello', | ||
message: "Hi there, something has happened which we'd like to tell you about", | ||
actions: [{ url: 'https://example.com' }], | ||
target: { Stack: 'my-stack', Stage: 'CODE', App: 'my-app' }, | ||
channel: RequestedChannel.Email, | ||
sourceSystem: 'my-monitoring-tool', | ||
topicArn: 'arn:aws:123', | ||
}); | ||
``` | ||
@@ -138,2 +129,2 @@ | ||
The client is published to npm as `@guardian/anghammarad`. You must have an `npm` account with 2fa enabled and be part of the `guardian` organisation. You can then run `yarn publish` to publish the library, enterring your OTP when prompted. | ||
The client is published to npm as `@guardian/anghammarad`. You must have an `npm` account with 2fa enabled and be part of the `guardian` organisation. You can then run `npm version <patch|minor|major>` followed by `npm publish` to publish the library, enterring your OTP when prompted (issues have been encountered running `yarn publish` in the past so npm is recommended). |
@@ -13,2 +13,3 @@ import { SNS } from "aws-sdk"; | ||
AwsAccount?: string; | ||
GithubTeamSlug?: string; | ||
} | ||
@@ -15,0 +16,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
340
20531
16
2
123
1