Repository: amp-labs/connectors
Pull request #1741 (2025-06-10 11:53:15)

fix: rename helpscout connector to helpscoutmailbox
Issue:
 helpscout connector has 2 APIs:
 - Mailbox API
 - Docs API
 
The two uses different auth schemes (and base urls). They can't be modules in a connector. So this updates the connnector name to `helpscoutMailbox` which aligns to what is in the providers.



Patch:
diff --git a/connector/new.go b/connector/new.go
index 9f2f759e..ae967a06 100644
--- a/connector/new.go
+++ b/connector/new.go
@@ -33,7 +33,7 @@ import (
 	"github.com/amp-labs/connectors/providers/gong"
 	"github.com/amp-labs/connectors/providers/gorgias"
 	"github.com/amp-labs/connectors/providers/groove"
-	"github.com/amp-labs/connectors/providers/helpscout"
+	"github.com/amp-labs/connectors/providers/helpscoutmailbox"
 	"github.com/amp-labs/connectors/providers/heyreach"
 	"github.com/amp-labs/connectors/providers/hubspot"
 	"github.com/amp-labs/connectors/providers/hunter"
@@ -101,7 +101,7 @@ var connectorConstructors = map[providers.Provider]outputConstructorFunc{ // nol
 	providers.Gong:                wrapper(newGongConnector),
 	providers.Gorgias:             wrapper(newGorgiasConnector),
 	providers.Groove:              wrapper(newGrooveConnector),
-	providers.HelpScoutMailbox:    wrapper(newHelpScoutConnector),
+	providers.HelpScoutMailbox:    wrapper(newHelpScoutMailboxConnector),
 	providers.HeyReach:            wrapper(newHeyReachConnector),
 	providers.Hubspot:             wrapper(newHubspotConnector),
 	providers.Hunter:              wrapper(newHunterConnector),
@@ -520,10 +520,10 @@ func newGitLabConnector(
 	return gitlab.NewConnector(params)
 }
 
-func newHelpScoutConnector(
+func newHelpScoutMailboxConnector(
 	params common.ConnectorParams,
-) (*helpscout.Connector, error) {
-	return helpscout.NewConnector(params)
+) (*helpscoutmailbox.Connector, error) {
+	return helpscoutmailbox.NewConnector(params)
 }
 
 func newGrooveConnector(
diff --git a/providers/helpscout/connector.go b/providers/helpscoutmailbox/connector.go
similarity index 98%
rename from providers/helpscout/connector.go
rename to providers/helpscoutmailbox/connector.go
index b24c9897..ddc5d1dd 100644
--- a/providers/helpscout/connector.go
+++ b/providers/helpscoutmailbox/connector.go
@@ -1,4 +1,4 @@
-package helpscout
+package helpscoutmailbox
 
 import (
 	"github.com/amp-labs/connectors/common"
diff --git a/providers/helpscout/handlers.go b/providers/helpscoutmailbox/handlers.go
similarity index 99%
rename from providers/helpscout/handlers.go
rename to providers/helpscoutmailbox/handlers.go
index a05c1257..23747ec6 100644
--- a/providers/helpscout/handlers.go
+++ b/providers/helpscoutmailbox/handlers.go
@@ -1,4 +1,4 @@
-package helpscout
+package helpscoutmailbox
 
 import (
 	"bytes"
diff --git a/providers/helpscout/parse.go b/providers/helpscoutmailbox/parse.go
similarity index 96%
rename from providers/helpscout/parse.go
rename to providers/helpscoutmailbox/parse.go
index 8a8b1570..aee6533d 100644
--- a/providers/helpscout/parse.go
+++ b/providers/helpscoutmailbox/parse.go
@@ -1,4 +1,4 @@
-package helpscout
+package helpscoutmailbox
 
 import (
 	"github.com/amp-labs/connectors/common"
diff --git a/providers/helpscout/supports.go b/providers/helpscoutmailbox/supports.go
similarity index 96%
rename from providers/helpscout/supports.go
rename to providers/helpscoutmailbox/supports.go
index 5cc82728..6c070f8c 100644
--- a/providers/helpscout/supports.go
+++ b/providers/helpscoutmailbox/supports.go
@@ -1,4 +1,4 @@
-package helpscout
+package helpscoutmailbox
 
 import (
 	"fmt"


Test patch:
diff --git a/test/helpscout/connector.go b/test/helpscoutmailbox/connector.go
similarity index 82%
rename from test/helpscout/connector.go
rename to test/helpscoutmailbox/connector.go
index 38d3fa9a..f1212589 100644
--- a/test/helpscout/connector.go
+++ b/test/helpscoutmailbox/connector.go
@@ -1,4 +1,4 @@
-package helpscout
+package helpscoutmailbox
 
 import (
 	"context"
@@ -7,12 +7,12 @@ import (
 	"github.com/amp-labs/connectors/common"
 	"github.com/amp-labs/connectors/common/scanning/credscanning"
 	"github.com/amp-labs/connectors/providers"
-	"github.com/amp-labs/connectors/providers/helpscout"
+	"github.com/amp-labs/connectors/providers/helpscoutmailbox"
 	"github.com/amp-labs/connectors/test/utils"
 	"golang.org/x/oauth2"
 )
 
-func GetHelpScoutConnector(ctx context.Context) *helpscout.Connector {
+func GetHelpScoutConnector(ctx context.Context) *helpscoutmailbox.Connector {
 	filePath := credscanning.LoadPath(providers.HelpScoutMailbox)
 	reader := utils.MustCreateProvCredJSON(filePath, true)
 
@@ -25,7 +25,7 @@ func GetHelpScoutConnector(ctx context.Context) *helpscout.Connector {
 		utils.Fail(err.Error())
 	}
 
-	conn, err := helpscout.NewConnector(common.ConnectorParams{
+	conn, err := helpscoutmailbox.NewConnector(common.ConnectorParams{
 		AuthenticatedClient: client,
 	})
 	if err != nil {
diff --git a/test/helpscout/metadata/main.go b/test/helpscoutmailbox/metadata/main.go
similarity index 80%
rename from test/helpscout/metadata/main.go
rename to test/helpscoutmailbox/metadata/main.go
index 6d392ffa..8a6e8665 100644
--- a/test/helpscout/metadata/main.go
+++ b/test/helpscoutmailbox/metadata/main.go
@@ -4,7 +4,7 @@ import (
 	"context"
 	"fmt"
 
-	"github.com/amp-labs/connectors/test/helpscout"
+	"github.com/amp-labs/connectors/test/helpscoutmailbox"
 	"github.com/amp-labs/connectors/test/utils"
 )
 
@@ -16,7 +16,7 @@ func main() {
 
 func run() error {
 	ctx := context.Background()
-	connector := helpscout.GetHelpScoutConnector(ctx)
+	connector := helpscoutmailbox.GetHelpScoutConnector(ctx)
 
 	m, err := connector.ListObjectMetadata(ctx, []string{"conversations", "customers", "mailboxes"})
 	if err != nil {
diff --git a/test/helpscout/read/main.go b/test/helpscoutmailbox/read/main.go
similarity index 89%
rename from test/helpscout/read/main.go
rename to test/helpscoutmailbox/read/main.go
index 196abe0e..b678cda8 100644
--- a/test/helpscout/read/main.go
+++ b/test/helpscoutmailbox/read/main.go
@@ -6,7 +6,7 @@ import (
 
 	"github.com/amp-labs/connectors/common"
 	"github.com/amp-labs/connectors/internal/datautils"
-	"github.com/amp-labs/connectors/test/helpscout"
+	"github.com/amp-labs/connectors/test/helpscoutmailbox"
 	"github.com/amp-labs/connectors/test/utils"
 )
 
@@ -18,7 +18,7 @@ func main() {
 
 func run() error {
 	ctx := context.Background()
-	connector := helpscout.GetHelpScoutConnector(ctx)
+	connector := helpscoutmailbox.GetHelpScoutConnector(ctx)
 
 	res, err := connector.Read(ctx, common.ReadParams{
 		ObjectName: "mailboxes",
diff --git a/test/helpscout/write/main.go b/test/helpscoutmailbox/write/main.go
similarity index 86%
rename from test/helpscout/write/main.go
rename to test/helpscoutmailbox/write/main.go
index cafe189f..e584711b 100644
--- a/test/helpscout/write/main.go
+++ b/test/helpscoutmailbox/write/main.go
@@ -9,8 +9,8 @@ import (
 	"syscall"
 
 	"github.com/amp-labs/connectors/common"
-	"github.com/amp-labs/connectors/providers/helpscout"
-	hs "github.com/amp-labs/connectors/test/helpscout"
+	hm "github.com/amp-labs/connectors/providers/helpscoutmailbox"
+	"github.com/amp-labs/connectors/test/helpscoutmailbox"
 	"github.com/amp-labs/connectors/test/utils"
 )
 
@@ -22,7 +22,7 @@ func main() {
 	// Set up slog logging.
 	utils.SetupLogging()
 
-	conn := hs.GetHelpScoutConnector(ctx)
+	conn := helpscoutmailbox.GetHelpScoutConnector(ctx)
 
 	if err := createConversations(ctx, conn); err != nil {
 		slog.Error(err.Error())
@@ -37,7 +37,7 @@ func main() {
 	}
 }
 
-func createConversations(ctx context.Context, conn *helpscout.Connector) error {
+func createConversations(ctx context.Context, conn *hm.Connector) error {
 	config := common.WriteParams{
 		ObjectName: "conversations",
 		RecordData: map[string]any{
@@ -76,7 +76,7 @@ func createConversations(ctx context.Context, conn *helpscout.Connector) error {
 	return nil
 }
 
-func createCustomers(ctx context.Context, conn *helpscout.Connector) error {
+func createCustomers(ctx context.Context, conn *hm.Connector) error {
 	config := common.WriteParams{
 		ObjectName: "customers",
 		RecordData: map[string]any{
@@ -109,7 +109,7 @@ func createCustomers(ctx context.Context, conn *helpscout.Connector) error {
 	return nil
 }
 
-func updateConversations(ctx context.Context, conn *helpscout.Connector) error {
+func updateConversations(ctx context.Context, conn *hm.Connector) error {
 	config := common.WriteParams{
 		ObjectName: "conversations",
 		RecordId:   "2855294683",