Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
2 parents 3a4d470 + d440b98 commit 8767cf7
Show file tree
Hide file tree
Showing 54 changed files with 663 additions and 700 deletions.
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.77.1",
"@gomomento/sdk-web": "^1.79.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.77.1"
"@gomomento/sdk": "^1.79.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.77.1"
"@gomomento/sdk": "^1.79.0"
}
}
71 changes: 36 additions & 35 deletions examples/nodejs/cache/doc-example-files/doc-examples-js-apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ import {
PutWebhook,
RotateWebhookSecret,
GetWebhookSecret,
// GetBatch,
// SetBatch,
CacheGetBatch,
CacheSetBatch,
ReadConcern,
CacheSetSample,
CacheKeyExists,
Expand Down Expand Up @@ -385,37 +385,37 @@ async function example_API_SetIfAbsentOrEqual(cacheClient: CacheClient, cacheNam
}
}

// async function example_API_SetBatch(cacheClient: CacheClient, cacheName: string) {
// const values = new Map<string, string>([
// ['abc', '123'],
// ['xyz', '321'],
// ['123', 'xyz'],
// ['321', 'abc'],
// ]);
// const result = await cacheClient.setBatch(cacheName, values);
// if (result instanceof SetBatch.Success) {
// console.log('Keys and values stored successfully');
// } else if (result instanceof SetBatch.Error) {
// throw new Error(
// `An error occurred while attempting to batch set in cache '${cacheName}': ${result.errorCode()}: ${result.toString()}`
// );
// }
// }

// async function example_API_GetBatch(cacheClient: CacheClient, cacheName: string) {
// const keys = ['abc', 'xyz', '123', '321'];
// const result = await cacheClient.getBatch(cacheName, keys);
// if (result instanceof GetBatch.Success) {
// const values = result.values();
// for (const key of keys) {
// console.log(`Retrieved value for key '${key}': ${values[key]}`);
// }
// } else if (result instanceof GetBatch.Error) {
// throw new Error(
// `An error occurred while attempting to batch get in cache '${cacheName}': ${result.errorCode()}: ${result.toString()}`
// );
// }
// }
async function example_API_SetBatch(cacheClient: CacheClient, cacheName: string) {
const values = new Map<string, string>([
['abc', '123'],
['xyz', '321'],
['123', 'xyz'],
['321', 'abc'],
]);
const result = await cacheClient.setBatch(cacheName, values);
if (result instanceof CacheSetBatch.Success) {
console.log('Keys and values stored successfully');
} else if (result instanceof CacheSetBatch.Error) {
throw new Error(
`An error occurred while attempting to batch set in cache '${cacheName}': ${result.errorCode()}: ${result.toString()}`
);
}
}

async function example_API_GetBatch(cacheClient: CacheClient, cacheName: string) {
const keys = ['abc', 'xyz', '123', '321'];
const result = await cacheClient.getBatch(cacheName, keys);
if (result instanceof CacheGetBatch.Success) {
const values = result.values();
for (const key of keys) {
console.log(`Retrieved value for key '${key}': ${values[key]}`);
}
} else if (result instanceof CacheGetBatch.Error) {
throw new Error(
`An error occurred while attempting to batch get in cache '${cacheName}': ${result.errorCode()}: ${result.toString()}`
);
}
}

async function example_API_ListFetch(cacheClient: CacheClient, cacheName: string) {
await cacheClient.listConcatenateBack(cacheName, 'test-list', ['a', 'b', 'c']);
Expand Down Expand Up @@ -1568,8 +1568,8 @@ async function main() {
await example_API_SetIfNotEqual(cacheClient, cacheName);
await example_API_SetIfPresentAndNotEqual(cacheClient, cacheName);
await example_API_SetIfAbsentOrEqual(cacheClient, cacheName);
// await example_API_SetBatch(cacheClient, cacheName);
// await example_API_GetBatch(cacheClient, cacheName);
await example_API_SetBatch(cacheClient, cacheName);
await example_API_GetBatch(cacheClient, cacheName);

await example_API_ListFetch(cacheClient, cacheName);
await example_API_ListConcatenateBack(cacheClient, cacheName);
Expand Down Expand Up @@ -1663,6 +1663,7 @@ async function main() {
await example_API_LeaderboardUpsertPagination(leaderboard, 10);
} finally {
await example_API_DeleteCache(cacheClient, cacheName);
cacheClient.close();
}
}

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.

2 changes: 1 addition & 1 deletion examples/nodejs/cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"typescript": "4.4.3"
},
"dependencies": {
"@gomomento/sdk": "^1.77.1"
"@gomomento/sdk": "^1.79.0"
},
"engines": {
"node": ">=10.4.0"
Expand Down
Loading

0 comments on commit 8767cf7

Please sign in to comment.