(id: string, name: string, payload: any)
| 126 | } |
| 127 | |
| 128 | async sendEvent(id: string, name: string, payload: any) { |
| 129 | const response = await fetch(`${this.baseUrl}/api/v1/events`, { |
| 130 | method: "POST", |
| 131 | headers: { |
| 132 | Accept: "application/json", |
| 133 | Authorization: `Bearer ${this.apiKey}`, |
| 134 | }, |
| 135 | body: JSON.stringify({ |
| 136 | event: { |
| 137 | id, |
| 138 | name, |
| 139 | payload, |
| 140 | }, |
| 141 | }), |
| 142 | }); |
| 143 | |
| 144 | return response.ok; |
| 145 | } |
| 146 | |
| 147 | async registerEndpoint(options: CreateEndpointOptions): Promise<EndpointResponse> { |
| 148 | const response = await fetch(`${this.baseUrl}/api/v1/endpoints`, { |
no test coverage detected