Package Exports
- @gomomento/generated-types-webtext
- @gomomento/generated-types-webtext/dist/CachepubsubServiceClientPb
- @gomomento/generated-types-webtext/dist/CachepubsubServiceClientPb.js
- @gomomento/generated-types-webtext/dist/VectorindexServiceClientPb
- @gomomento/generated-types-webtext/dist/VectorindexServiceClientPb.js
- @gomomento/generated-types-webtext/dist/WebhookServiceClientPb
- @gomomento/generated-types-webtext/dist/WebhookServiceClientPb.js
- @gomomento/generated-types-webtext/dist/auth_pb
- @gomomento/generated-types-webtext/dist/auth_pb.js
- @gomomento/generated-types-webtext/dist/cacheclient_pb
- @gomomento/generated-types-webtext/dist/cacheclient_pb.js
- @gomomento/generated-types-webtext/dist/cacheping_pb
- @gomomento/generated-types-webtext/dist/cacheping_pb.js
- @gomomento/generated-types-webtext/dist/cachepubsub_pb
- @gomomento/generated-types-webtext/dist/cachepubsub_pb.js
- @gomomento/generated-types-webtext/dist/controlclient_pb
- @gomomento/generated-types-webtext/dist/controlclient_pb.js
- @gomomento/generated-types-webtext/dist/index.js
- @gomomento/generated-types-webtext/dist/leaderboard_pb
- @gomomento/generated-types-webtext/dist/leaderboard_pb.js
- @gomomento/generated-types-webtext/dist/permissionmessages_pb
- @gomomento/generated-types-webtext/dist/permissionmessages_pb.js
- @gomomento/generated-types-webtext/dist/token_pb
- @gomomento/generated-types-webtext/dist/token_pb.js
- @gomomento/generated-types-webtext/dist/vectorindex_pb
- @gomomento/generated-types-webtext/dist/vectorindex_pb.js
- @gomomento/generated-types-webtext/dist/webhook_pb
- @gomomento/generated-types-webtext/dist/webhook_pb.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@gomomento/generated-types-webtext) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Usage
package.json
dependencies: {
"@gomomento/generated-types-webtext": "$current_version",
"grpc-web": "1.3.1",
"google-protobuf": "3.21.0"
}Basic usage shape
const authToken = getClientAuthToken_never_harcode_server_api_keys();
const cacheName = 'your_cool_cache';
const momento = new cache.ScsClient('https://cache.cell-us-east-1-1.prod.a.momentohq.com', null, {})
function getMetadata(cacheName: string): grpcWeb.Metadata {
return {
'authorization': authToken,
'cache': cacheName,
};
}
const request = new _GetRequest();
request.setCacheKey(Buffer.from('some cache key'));
const getResult = await momento.get(request, getMetadata(props.cache));
if (getResult.getResult() === ECacheResult.HIT) {
const body = Buffer.from(getResult.getCacheBody()).toString('utf-8')
console.log('hit:', body);
} else {
console.log('miss:', getResult.getMessage());
}
Generating definitions
./generate_protos.sh