refactor: update devbox configuration and scripts

This commit is contained in:
Prad Nukala
2024-11-25 13:54:33 -05:00
parent 1568844255
commit e04d071ca7
63 changed files with 1069 additions and 202 deletions
+26
View File
@@ -0,0 +1,26 @@
import { DurableObject } from "cloudflare:workers";
/** A Durable Object's behavior is defined in an exported Javascript class */
export class NobleDurableClient extends DurableObject {
/**
* The constructor is invoked once upon creation of the Durable Object, i.e. the first call to
* `DurableObjectStub::get` for a given identifier (no-op constructors can be omitted)
*
* @param {DurableObjectState} ctx - The interface for interacting with Durable Object state
* @param {Env} env - The interface to reference bindings declared in wrangler.toml
*/
constructor(ctx, env) {
super(ctx, env);
}
/**
* The Durable Object exposes an RPC method sayHello which will be invoked when when a Durable
* Object instance receives a request from a Worker via the same method invocation on the stub
*
* @param {string} name - The name provided to a Durable Object instance from a Worker
* @returns {Promise<string>} The greeting to be sent back to the Worker
*/
async sayHello(name) {
return `Hello, ${name}!`;
}
}