Skip to content

Commit 8384832

Browse files
authored
Merge pull request #2 from gptscript-ai/hubspot
2 parents 20a19b9 + 54cfa04 commit 8384832

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

main.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ type cliConfig struct {
4040
}
4141

4242
var (
43-
integration = os.Getenv("INTEGRATION")
44-
env = os.Getenv("ENV")
45-
scope = os.Getenv("SCOPE")
43+
integration = os.Getenv("INTEGRATION")
44+
env = os.Getenv("ENV")
45+
scope = os.Getenv("SCOPE")
46+
optionalScope = os.Getenv("OPTIONAL_SCOPE")
4647
)
4748

4849
func main() {
@@ -100,6 +101,9 @@ func main() {
100101
if scope != "" {
101102
q.Set("scope", scope)
102103
}
104+
if optionalScope != "" {
105+
q.Set("optional_scope", optionalScope)
106+
}
103107
u.RawQuery = q.Encode()
104108

105109
req, err := http.NewRequest("GET", u.String(), nil)
@@ -179,6 +183,9 @@ func main() {
179183
if scope != "" {
180184
q.Set("scope", scope)
181185
}
186+
if optionalScope != "" {
187+
q.Set("optional_scope", optionalScope)
188+
}
182189
u.RawQuery = q.Encode()
183190

184191
gs, err := gptscript.NewGPTScript(gptscript.GlobalOptions{})

tool.gpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ Name: oauth2
22
Param: integration: Name of the integration to use
33
Param: env: Name of the environment variable to set with the token
44
Param: scope: Space-separated list of scopes to request
5+
Param: optional_scope: (optional) Space-separated list of scopes to request (HubSpot-specific)
56

67
#!${GPTSCRIPT_TOOL_DIR}/bin/gptscript-go-tool

0 commit comments

Comments
 (0)