Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
2 parents 4a9d6ee + 99eaa36 commit 4c4bb94
Show file tree
Hide file tree
Showing 24 changed files with 4,365 additions and 6,375 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/update-example-deps.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Update example dependencies

on:
schedule:
- cron: '0 12 * * *'
Expand Down Expand Up @@ -26,4 +28,14 @@
id: validation
run: |
./scripts/update-all-examples-dependencies.sh
git status
- name: Open PR
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}
commit-message: "chore: update momento dependency in examples\n\nAutomated commit created by update-example-deps workflow"
title: "chore: update momento dependency in examples"
team-reviewers: "momentohq/dev-eco"


27 changes: 18 additions & 9 deletions examples/nodejs/aws/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions examples/nodejs/cache/doc-example-files/doc-examples-js-apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ import {
ListWebhooks,
DeleteWebhook,
PutWebhook,
RotateWebhookSecret,
GetWebhookSecret,
} from '@gomomento/sdk';

function retrieveApiKeyFromYourSecretsManager(): string {
Expand Down Expand Up @@ -1082,6 +1084,28 @@ async function example_API_PutWebhook(topicClient: TopicClient) {
}
}

async function example_API_RotateWebhookSecret(topicClient: TopicClient) {
const result = await topicClient.rotateWebhookSecret('test-cache', 'examples webhook');
if (result instanceof RotateWebhookSecret.Success) {
console.log('successfully rotated the webhook secret');
} else if (result instanceof RotateWebhookSecret.Error) {
throw new Error(
`An error occurred while attempting to rotate the secret for the webhook 'examples webhook' inside of cache 'test-cache': ${result.errorCode()}: ${result.toString()}`
);
}
}

async function example_API_GetWebhookSecret(topicClient: TopicClient) {
const result = await topicClient.getWebhookSecret('test-cache', 'examples webhook');
if (result instanceof GetWebhookSecret.Success) {
console.log('successfully retrieved the webhook secret');
} else if (result instanceof GetWebhookSecret.Error) {
throw new Error(
`An error occurred while attempting to fetch the secret for the webhook 'examples webhook' inside of cache 'test-cache': ${result.errorCode()}: ${result.toString()}`
);
}
}

function example_API_InstantiateLeaderboardClient() {
new PreviewLeaderboardClient({
configuration: LeaderboardConfigurations.Laptop.v1(),
Expand Down Expand Up @@ -1412,6 +1436,8 @@ async function main() {
await example_API_ListWebhooks(topicClient);
await example_API_DeleteWebhook(topicClient);
await example_API_PutWebhook(topicClient);
await example_API_RotateWebhookSecret(topicClient);
await example_API_GetWebhookSecret(topicClient);

example_API_InstantiateLeaderboardClient();
const leaderboardClient = new PreviewLeaderboardClient({
Expand Down
Loading

0 comments on commit 4c4bb94

Please sign in to comment.