Personal Telegram developer console for GitHub

feat(cp6): add incident store client

davoodmehraban89 committed Oct 5, 2026 at 06:19 UTC 6f47cfd896f1d66820ed857c9c9bdde8b5865c8a
1 file changed +1
src/core/incident-store.js new
+1
@@ -0,0 +1 @@
1 +export class DurableIncidentStoreClient { constructor({namespace,ownerId}){this.namespace=namespace;this.ownerId=String(ownerId||'');} stub(){if(!this.namespace||!this.ownerId)throw new Error('Incident store is not configured');return this.namespace.get(this.namespace.idFromName('owner:'+this.ownerId));} async request(path,body){const r=await this.stub().fetch('https://incident.local'+path+'?owner='+encodeURIComponent(this.ownerId),{method:body?'POST':'GET',headers:{'content-type':'application/json'},body:body?JSON.stringify(body):undefined});if(!r.ok)throw new Error('Incident store request failed');return r.json();} list(){return this.request('/');} upsert(e){return this.request('/upsert',e);} resolve(id){return this.request('/resolve',{id});} }