Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
2 parents 89b5c83 + 76736ce commit cf01564
Show file tree
Hide file tree
Showing 257 changed files with 17,090 additions and 6,026 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ jobs:
matrix:
node: [18]
name: Test Cache on Node ${{ matrix.node }}
runs-on: macos-latest
runs-on: ubuntu-latest
env:
MOMENTO_API_KEY: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
TEST_SESSION_TOKEN: ${{ secrets.MOMENTO_PREPROD_SESSION_TOKEN }}
Expand Down Expand Up @@ -558,7 +558,7 @@ jobs:
node: [ 18 ]
fail-fast: true
name: Verify packages are installable on node ${{ matrix.node }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: Setup repo
Expand Down
2 changes: 1 addition & 1 deletion examples/cloudflare-workers/http-api/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class MomentoFetcher {
private readonly baseurl: string;
constructor(key: string, endpoint: string) {
this.apiKey = key;
if (!endpoint.startsWith('https://')) {
if ( !( endpoint.startsWith('https://') || endpoint.startsWith('http://') ) ) {
this.baseurl = `https://${endpoint}/cache`;
} else {
this.baseurl = `${endpoint}/cache`;
Expand Down
6 changes: 4 additions & 2 deletions examples/cloudflare-workers/http-api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
"noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
Expand All @@ -96,6 +96,8 @@

/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
// requires the `override` keyword to override a method/property from a parent class
"noImplicitOverride": true
}
}
16 changes: 8 additions & 8 deletions examples/cloudflare-workers/web-sdk/package-lock.json

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

2 changes: 1 addition & 1 deletion examples/cloudflare-workers/web-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@gomomento/sdk-core": "^1.40.0",
"@gomomento/sdk-web": "^1.86.0",
"@gomomento/sdk-web": "^1.87.0",
"xhr4sw": "^0.0.5"
}
}
6 changes: 4 additions & 2 deletions examples/cloudflare-workers/web-sdk/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
"noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
Expand All @@ -96,6 +96,8 @@

/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
// requires the `override` keyword to override a method/property from a parent class
"noImplicitOverride": true
}
}
3 changes: 2 additions & 1 deletion examples/fastly-compute/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
// async without await is often an error and in other uses it obfuscates
// the intent of the developer. Functions are async when they want to await.
"require-await": "error",
"import/no-duplicates": "error"
"import/no-duplicates": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error"
},
"settings": {
"import/resolver": {
Expand Down
5 changes: 4 additions & 1 deletion examples/fastly-compute/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
"isolatedModules": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
"skipLibCheck": true,
// requires the `override` keyword to override a method/property from a parent class
"noImplicitOverride": true,
"noFallthroughCasesInSwitch": true
},
"include": [
"./src/**/*.js",
Expand Down
3 changes: 2 additions & 1 deletion examples/nodejs/access-control/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
// async without await is often an error and in other uses it obfuscates
// the intent of the developer. Functions are async when they want to await.
"require-await": "error",
"import/no-duplicates": "error"
"import/no-duplicates": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error"
},
"settings": {
"import/resolver": {
Expand Down
41 changes: 22 additions & 19 deletions examples/nodejs/access-control/package-lock.json

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

4 changes: 2 additions & 2 deletions examples/nodejs/access-control/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"eslint-plugin-node": "11.1.0",
"eslint-plugin-prettier": "4.2.1",
"prettier": "2.7.1",
"typescript": "4.4.3"
"typescript": "4.9.5"
},
"dependencies": {
"@gomomento/sdk": "^1.86.0",
"@gomomento/sdk": "^1.87.0",
"uuidv4": "6.2.13"
}
}
4 changes: 3 additions & 1 deletion examples/nodejs/access-control/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
"noUnusedLocals": false,
"noUnusedParameters": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": false,
"noFallthroughCasesInSwitch": true,
"inlineSourceMap": true,
"inlineSources": true,
"experimentalDecorators": true,
"strictPropertyInitialization": false,
// requires the `override` keyword to override a method/property from a parent class
"noImplicitOverride": true,
"typeRoots": [
"./node_modules/@types"
],
Expand Down
52 changes: 52 additions & 0 deletions examples/nodejs/aws/eventbridge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Welcome to Momento <-> Eventbridge Integration Example Project

The project demonstrates a write-through cache pattern for DynamoDB using DynamoDB Streams, AWS EventBridge and Momento.
The app can be used to create, update and delete items in a DynamoDB table and the changes will be reflected in the cache/topic in real-time.

### **Prerequisites:**

- Momento Cache: momento-eventbridge-cache. If cache does not exists, can create one using the [momento console](https://console.gomomento.com/) .
- Momento API Key, can be created using [momento console](https://console.gomomento.com/) if you haven’t already created one
- HTTP API endpoint the same region as Momento API Key. You can copy the endpoint from the console after creating the API Key or refer to the [Regions Section here in the documentation](https://docs.momentohq.com/topics/develop/api-reference/http-api#regions)
- AWS Account AccessId, Aws Secret Key (and AWS Session Token if you are using temporary credentials)

### **Deploying the Demo App:**

The source code for the CDK application lives in the `infrastructure` directory. To build and deploy it you will first need to install the dependencies:

```bash
cd infrastructure
npm install
```

To deploy the CDK app you will need to have [configured your AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html#cli-chap-authentication-precedence).

You will also need a superuser API key generated from the [Momento Console](https://console.gomomento.com/), and the HTTP API endpoint URL for the region you are deploying to.


Then run:

```tsx
npm run deploy -- --parameters MomentoApiKey=<YOUR_MOMENTO_API_KEY> --parameters MomentoApiEndpoint=<YOUR_MOMENTO_API_ENDPOINT>
```

## **Running the Demo:**

First, edit the `.env.development` file with your token vending machine url and your cache name:

```bash
VITE_AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID>
VITE_AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY>
VITE_AWS_SESSION_TOKEN=<AWS_SESSION_TOKEN> (if you are using temporary credentials)
VITE_MOMENTO_API_KEY=<YOUR_MOMENTO_API_KEY>
```

Then,  install all dependencies and run the development server:

```bash
cd webapp
npm install
npm run dev
```

Open [http://localhost:5173](http://localhost:5173/) with your browser to explore the demo app.
8 changes: 8 additions & 0 deletions examples/nodejs/aws/eventbridge/infrastructure/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.js
!jest.config.js
*.d.ts
node_modules

# CDK asset staging directory
.cdk.staging
cdk.out
6 changes: 6 additions & 0 deletions examples/nodejs/aws/eventbridge/infrastructure/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.ts
!*.d.ts

# CDK asset staging directory
.cdk.staging
cdk.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env node
import 'source-map-support/register';
import * as cdk from 'aws-cdk-lib';
import { EventbridgeStack } from '../lib/eventbridge-stack';

const app = new cdk.App();
new EventbridgeStack(app, 'eventbridge-stack', {});
Loading

0 comments on commit cf01564

Please sign in to comment.