Repository: amp-labs/connectors
Pull request #86 (2024-03-13 05:53:16)

[ENG-824] feat: Add Docusign connector
## Catalog variables
DocuSign Provider = "docuSign"

## Notes
Supports batching requests and pagination as well

## Testing 
### GET 
URL: http://localhost:4444/restapi/v2.1/accounts/ee1891e0-141f-45e4-85fd-72d564f247b2/brands
![GET](https://github.com/amp-labs/connectors/assets/163011126/0bda883a-6a3f-4e36-97b4-072401a9896b)


### POST
URL: http://localhost:4444/restapi/v2.1/accounts/ee1891e0-141f-45e4-85fd-72d564f247b2/brands
![POST](https://github.com/amp-labs/connectors/assets/163011126/b54592dd-2ffd-4641-b2b3-b5024bffa036)


### PUT
URL: http://localhost:4444/restapi/v2.1/accounts/ee1891e0-141f-45e4-85fd-72d564f247b2/brands/c4aef3d7-e039-4378-b761-a66e1197c80a
![PUT](https://github.com/amp-labs/connectors/assets/163011126/b34ac016-66fe-4157-8431-69237d7d7bda)


### DELETE
URL: http://localhost:4444/restapi/v2.1/accounts/ee1891e0-141f-45e4-85fd-72d564f247b2/brands/3234e8c9-1ba4-43aa-aad4-402c57c291f2
![DELETE](https://github.com/amp-labs/connectors/assets/163011126/8eb534d2-5a7f-4a4d-b1ed-aca80beb6547)



Patch:
diff --git a/providers/catalog.go b/providers/catalog.go
index 90df563b..cc7419cb 100644
--- a/providers/catalog.go
+++ b/providers/catalog.go
@@ -5,22 +5,24 @@ package providers
 // ================================================================================
 
 const (
-	Salesforce Provider = "salesforce"
-	Hubspot    Provider = "hubspot"
-	LinkedIn   Provider = "linkedIn"
-	Salesloft  Provider = "salesloft"
-	Outreach   Provider = "outreach"
-	Pipedrive  Provider = "pipedrive"
-	Sellsy     Provider = "sellsy"
-	Attio      Provider = "attio"
-	Close      Provider = "close"
-	Keap       Provider = "keap"
-	Asana      Provider = "asana"
-	Dropbox    Provider = "dropbox"
-	Notion     Provider = "notion"
-	Gong       Provider = "gong"
-	Zoom       Provider = "zoom"
-	Intercom   Provider = "intercom"
+	Salesforce        Provider = "salesforce"
+	Hubspot           Provider = "hubspot"
+	LinkedIn          Provider = "linkedIn"
+	Salesloft         Provider = "salesloft"
+	Outreach          Provider = "outreach"
+	Pipedrive         Provider = "pipedrive"
+	Sellsy            Provider = "sellsy"
+	Attio             Provider = "attio"
+	Close             Provider = "close"
+	Keap              Provider = "keap"
+	Asana             Provider = "asana"
+	Dropbox           Provider = "dropbox"
+	Notion            Provider = "notion"
+	Gong              Provider = "gong"
+	Zoom              Provider = "zoom"
+	Intercom          Provider = "intercom"
+	DocuSign          Provider = "docuSign"
+	DocuSignDeveloper Provider = "docuSignDeveloper"
 )
 
 // ================================================================================
@@ -347,4 +349,42 @@ var catalog = CatalogType{ // nolint:gochecknoglobals
 			Write:     false,
 		},
 	},
+
+	// DocuSign configuration
+	DocuSign: {
+		AuthType: Oauth2,
+		BaseURL:  "https://{{.workspace}}.docusign.net",
+		OauthOpts: OauthOpts{
+			AuthURL:                   "https://account.docusign.com/oauth/auth",
+			TokenURL:                  "https://account.docusign.com/oauth/token",
+			ExplicitScopesRequired:    true,
+			ExplicitWorkspaceRequired: true,
+		},
+		Support: Support{
+			BulkWrite: false,
+			Proxy:     false,
+			Read:      false,
+			Subscribe: false,
+			Write:     false,
+		},
+	},
+
+	// DocuSign Developer configuration
+	DocuSignDeveloper: {
+		AuthType: Oauth2,
+		BaseURL:  "https://demo.docusign.net",
+		OauthOpts: OauthOpts{
+			AuthURL:                   "https://account-d.docusign.com/oauth/auth",
+			TokenURL:                  "https://account-d.docusign.com/oauth/token",
+			ExplicitScopesRequired:    true,
+			ExplicitWorkspaceRequired: false,
+		},
+		Support: Support{
+			BulkWrite: false,
+			Proxy:     false,
+			Read:      false,
+			Subscribe: false,
+			Write:     false,
+		},
+	},
 }


Test patch:
diff --git a/providers/catalog_test.go b/providers/catalog_test.go
index 9bcc1910..dedf1b2a 100644
--- a/providers/catalog_test.go
+++ b/providers/catalog_test.go
@@ -413,6 +413,48 @@ var testCases = []struct { // nolint
 		},
 		expectedErr: nil,
 	},
+	{
+		provider: DocuSign,
+		expected: &ProviderInfo{
+			Support: Support{
+				Read:      false,
+				Write:     false,
+				BulkWrite: false,
+				Subscribe: false,
+				Proxy:     false,
+			},
+			AuthType: Oauth2,
+			OauthOpts: OauthOpts{
+				AuthURL:                   "https://account.docusign.com/oauth/auth",
+				TokenURL:                  "https://account.docusign.com/oauth/token",
+				ExplicitScopesRequired:    true,
+				ExplicitWorkspaceRequired: true,
+			},
+			BaseURL: "https://{{.workspace}}.docusign.net",
+		},
+		expectedErr: nil,
+	},
+	{
+		provider: DocuSignDeveloper,
+		expected: &ProviderInfo{
+			Support: Support{
+				Read:      false,
+				Write:     false,
+				BulkWrite: false,
+				Subscribe: false,
+				Proxy:     false,
+			},
+			AuthType: Oauth2,
+			OauthOpts: OauthOpts{
+				AuthURL:                   "https://account-d.docusign.com/oauth/auth",
+				TokenURL:                  "https://account-d.docusign.com/oauth/token",
+				ExplicitScopesRequired:    true,
+				ExplicitWorkspaceRequired: false,
+			},
+			BaseURL: "https://demo.docusign.net",
+		},
+		expectedErr: nil,
+	},
 }
 
 func TestReadInfo(t *testing.T) { // nolint