Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
2 parents 089b457 + 799a868 commit f972b6e
Show file tree
Hide file tree
Showing 71 changed files with 2,645 additions and 1,100 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
name: Test Cache on Node ${{ matrix.node }}
runs-on: macos-latest
env:
TEST_AUTH_TOKEN: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
TEST_API_KEY: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
TEST_SESSION_TOKEN: ${{ secrets.MOMENTO_PREPROD_SESSION_TOKEN }}
TEST_LEGACY_AUTH_TOKEN: ${{ secrets.ALPHA_LEGACY_TEST_AUTH_TOKEN }}

Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
name: Test MVI on Node ${{ matrix.node }}
runs-on: macos-latest
env:
TEST_AUTH_TOKEN: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
TEST_API_KEY: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
TEST_SESSION_TOKEN: ${{ secrets.MOMENTO_PREPROD_SESSION_TOKEN }}
TEST_LEGACY_AUTH_TOKEN: ${{ secrets.ALPHA_LEGACY_TEST_AUTH_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-push-to-main-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
test:
runs-on: macos-latest
env:
TEST_AUTH_TOKEN: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
TEST_API_KEY: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
TEST_SESSION_TOKEN: ${{ secrets.MOMENTO_PREPROD_SESSION_TOKEN }}
TEST_LEGACY_AUTH_TOKEN: ${{ secrets.ALPHA_LEGACY_TEST_AUTH_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-push-to-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# The type of runner that the job will run on
runs-on: macos-latest
env:
TEST_AUTH_TOKEN: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
TEST_API_KEY: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
TEST_SESSION_TOKEN: ${{ secrets.MOMENTO_PREPROD_SESSION_TOKEN }}
TEST_LEGACY_AUTH_TOKEN: ${{ secrets.ALPHA_LEGACY_TEST_AUTH_TOKEN }}
needs: release
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ Most packages.json files have script targets like `unit-test` and `integration-t
For example, you will probably need to limit Jest `maxWorkers` to avoid throttling errors due to concurrency, and you will want to skip the auth tests unless you have a session token, etc. So here is an example command you might use to run all the integration tests other than the auth tests:

```
TEST_AUTH_TOKEN=<your_token_here> npx jest integration --maxWorkers 1 --testPathIgnorePatterns auth-client-test.ts
TEST_API_KEY=<your_api_key_here> npx jest integration --maxWorkers 1 --testPathIgnorePatterns auth-client-test.ts
```

Or, if you only want to run the dictionary tests:

```
TEST_AUTH_TOKEN=<your_token_here> npx jest dictionary
TEST_API_KEY=<your_api_key_here> npx jest dictionary
```

**NOTE**: if you make changes in the `core` or `common-integration-tests` packages, you will need to build your changes before the SDK packages can pick them up. You can do this via `npm run build` in the shared package directory, or `./scripts/build-all-packages.sh` from the root dir.
Expand All @@ -72,7 +72,7 @@ TEST_AUTH_TOKEN=<your_token_here> npx jest dictionary
In either the `client-sdk-nodejs` or `client-sdk-web` directories:

```
export TEST_AUTH_TOKEN=<YOUR_AUTH_TOKEN>
export TEST_API_KEY=<YOUR_API_KEY>
export TEST_SESSION_TOKEN=<YOUR_SESSION_TOKEN>
npm run integration-test-auth
```
Expand All @@ -84,7 +84,7 @@ will hit Momento throttling limits. To limit the concurrency to ensure you don'
you can use jest's `--maxWorkers` flag:

```
export TEST_AUTH_TOKEN=<YOUR_AUTH_TOKEN>
export TEST_API_KEY=<YOUR_API_KEY>
npx jest --maxWorkers 1
```

Expand All @@ -98,7 +98,7 @@ to jest in order to limit the set of tests that you want to run.
e.g. to re-build and run the integration tests, and filter to only the dictionary tests:

```
export TEST_AUTH_TOKEN=<YOUR_AUTH_TOKEN>
export TEST_API_KEY=<YOUR_API_KEY>
npm run build-and-run-tests -- dictionary
```

Expand Down
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.72.0",
"@gomomento/sdk-web": "^1.75.0",
"xhr4sw": "^0.0.5"
}
}
30 changes: 15 additions & 15 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.

2 changes: 1 addition & 1 deletion examples/nodejs/access-control/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"typescript": "4.4.3"
},
"dependencies": {
"@gomomento/sdk": "^1.72.0"
"@gomomento/sdk": "^1.75.0"
}
}
30 changes: 15 additions & 15 deletions examples/nodejs/aws/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/nodejs/aws/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
},
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.370.0",
"@gomomento/sdk": "^1.72.0"
"@gomomento/sdk": "^1.75.0"
}
}
27 changes: 27 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 @@ -96,6 +96,8 @@ import {
SetBatch,
ReadConcern,
CacheSetSample,
CacheKeyExists,
CacheKeysExist,
} from '@gomomento/sdk';
import * as crypto from 'crypto';

Expand Down Expand Up @@ -940,6 +942,28 @@ async function example_API_SortedSetRemoveElements(cacheClient: CacheClient, cac
}
}

async function example_API_KeyExists(cacheClient: CacheClient, cacheName: string) {
const result = await cacheClient.keyExists(cacheName, 'test-key');
if (result instanceof CacheKeyExists.Success) {
console.log("Does 'test-key' exists in the cache?", result.exists());
} else if (result instanceof CacheKeyExists.Error) {
throw new Error(
`An error occurred while attempting to call keyExists on key 'test-key' in cache '${cacheName}': ${result.errorCode()}: ${result.toString()}`
);
}
}

async function example_API_KeysExist(cacheClient: CacheClient, cacheName: string) {
const result = await cacheClient.keysExist(cacheName, ['test-key1', 'test-key2']);
if (result instanceof CacheKeysExist.Success) {
console.log("Do 'test-key1' and 'test-key2' exist in the cache?", result.exists());
} else if (result instanceof CacheKeysExist.Error) {
throw new Error(
`An error occurred while attempting to call keysExist on keys 'test-key1' and 'test-key2' in cache '${cacheName}': ${result.errorCode()}: ${result.toString()}`
);
}
}

function example_API_InstantiateAuthClient() {
new AuthClient({
credentialProvider: CredentialProvider.fromEnvironmentVariable({
Expand Down Expand Up @@ -1585,6 +1609,9 @@ async function main() {
await example_API_SortedSetRemoveElement(cacheClient, cacheName);
await example_API_SortedSetRemoveElements(cacheClient, cacheName);

await example_API_KeyExists(cacheClient, cacheName);
await example_API_KeysExist(cacheClient, cacheName);

example_API_InstantiateAuthClient();
const authClient = new AuthClient({
credentialProvider: CredentialProvider.fromEnvironmentVariable({
Expand Down
30 changes: 15 additions & 15 deletions examples/nodejs/cache/package-lock.json

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

Loading

0 comments on commit f972b6e

Please sign in to comment.