Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Complete MVP implementation of the Cast GHL Conversation Provider bridge: - Go module setup with chi router and mongo-driver dependencies - Config loading with env var validation and defaults - MongoDB token store with upsert, get, update, delete operations - Cast.ph SMS client with 429 retry logic and typed errors - Phone number normalization (E.164 ↔ Philippine local format) - GHL OAuth 2.0 install/callback/refresh flow - GHL webhook handler with ECDSA signature verification (async dispatch) - GHL API client for message status updates and inbound message stubs - Multi-stage Dockerfile, docker-compose with MongoDB, Woodpecker CI pipeline - Unit tests for phone normalization, Cast client, GHL webhook, and OAuth handlers Co-Authored-By: SideKx <sidekx.ai@sds.dev>
41 lines
1.2 KiB
Go
41 lines
1.2 KiB
Go
package ghl
|
|
|
|
type TokenResponse struct {
|
|
AccessToken string `json:"access_token"`
|
|
RefreshToken string `json:"refresh_token"`
|
|
ExpiresIn int `json:"expires_in"`
|
|
TokenType string `json:"token_type"`
|
|
LocationID string `json:"locationId"`
|
|
CompanyID string `json:"companyId"`
|
|
UserType string `json:"userType"`
|
|
}
|
|
|
|
type OutboundMessageWebhook struct {
|
|
ContactID string `json:"contactId"`
|
|
LocationID string `json:"locationId"`
|
|
MessageID string `json:"messageId"`
|
|
Type string `json:"type"`
|
|
Phone string `json:"phone"`
|
|
Message string `json:"message"`
|
|
Attachments []string `json:"attachments"`
|
|
UserID string `json:"userId"`
|
|
}
|
|
|
|
type MessageStatusUpdate struct {
|
|
Status string `json:"status"`
|
|
ErrorCode string `json:"error_code,omitempty"`
|
|
ErrorMessage string `json:"error_message,omitempty"`
|
|
}
|
|
|
|
type InboundMessage struct {
|
|
Type string `json:"type"`
|
|
Message string `json:"message"`
|
|
Phone string `json:"phone"`
|
|
ConversationProviderID string `json:"conversationProviderId,omitempty"`
|
|
}
|
|
|
|
type InboundMessageResponse struct {
|
|
ConversationID string `json:"conversationId"`
|
|
MessageID string `json:"messageId"`
|
|
}
|