Initial commit: Add project files
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
export interface IdempotentCommand<T> {
|
||||
readonly idempotencyKey: string
|
||||
readonly request: T
|
||||
}
|
||||
|
||||
/**
|
||||
* Create once per user intent. Retries must reuse the returned envelope rather than call this again.
|
||||
*/
|
||||
export function createIdempotentCommand<T>(request: T): IdempotentCommand<T> {
|
||||
return Object.freeze({ idempotencyKey: crypto.randomUUID(), request })
|
||||
}
|
||||
Reference in New Issue
Block a user