Deprecate legacy Login/Register, add admin events, members, webhooks
- Mark Register() and Login() as Deprecated (use Better Auth directly) - Add admin_events.go, members.go, webhooks.go to match backend API - Sync types with backend changes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
75c2095f30
commit
99b0948da9
7 files changed
+280
-18
No files matched your search
+29
@@ -0,0 +1,29 @@
|
||||
package elydora
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// ListWebhooks retrieves all registered webhooks for the organization.
|
||||
func (c *Client) ListWebhooks() (*ListWebhooksResponse, error) {
|
||||
var result ListWebhooksResponse
|
||||
if err := c.doGet("/v1/webhooks", &result); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
// RegisterWebhook registers a new webhook endpoint for the organization.
|
||||
func (c *Client) RegisterWebhook(req *RegisterWebhookRequest) (*RegisterWebhookResponse, error) {
|
||||
var result RegisterWebhookResponse
|
||||
if err := c.doPost("/v1/webhooks", req, &result); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
|
||||
// DeleteWebhook deletes a registered webhook by ID.
|
||||
func (c *Client) DeleteWebhook(webhookID string) error {
|
||||
return c.doRequest(http.MethodDelete, fmt.Sprintf("/v1/webhooks/%s", webhookID), nil, nil)
|
||||
}
|
||||
Reference in new issue
Block a user