From faa53f7ee5a1e695190b4ee8b16e3fbf8c5450f8 Mon Sep 17 00:00:00 2001 From: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com> Date: Sat, 29 Aug 2026 23:50:29 +0530 Subject: [PATCH] feat: add Calendly service configuration Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com> --- config/services.yaml | 12 ++++++++ configs/services.yaml | 11 +++++++ configs/services/calendly.yaml | 12 ++++++++ internal/registry/production_config_test.go | 33 ++++++++++++++++++++- 4 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 configs/services/calendly.yaml diff --git a/config/services.yaml b/config/services.yaml index 6f98be9..050e9a2 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -94,3 +94,15 @@ services: list_labels: method: GET path: /gmail/v1/users/me/labels + + calendly: + base_url: https://api.calendly.com + auth: + type: bearer + actions: + list_scheduled_events: + method: GET + path: /scheduled_events + params: + user: string + count: "int?" diff --git a/configs/services.yaml b/configs/services.yaml index c9d4319..9879341 100644 --- a/configs/services.yaml +++ b/configs/services.yaml @@ -102,3 +102,14 @@ services: list_labels: method: GET path: /gmail/v1/users/me/labels + calendly: + base_url: https://api.calendly.com + auth: + type: bearer + actions: + list_scheduled_events: + method: GET + path: /scheduled_events + params: + user: string + count: "int?" diff --git a/configs/services/calendly.yaml b/configs/services/calendly.yaml new file mode 100644 index 0000000..7070dda --- /dev/null +++ b/configs/services/calendly.yaml @@ -0,0 +1,12 @@ +services: + calendly: + base_url: https://api.calendly.com + auth: + type: bearer + actions: + list_scheduled_events: + method: GET + path: /scheduled_events + params: + user: string + count: "int?" \ No newline at end of file diff --git a/internal/registry/production_config_test.go b/internal/registry/production_config_test.go index 69324c9..3fc9b87 100644 --- a/internal/registry/production_config_test.go +++ b/internal/registry/production_config_test.go @@ -63,6 +63,37 @@ func TestProductionConfig_GoogleWorkspaceRequestsNarrowScope(t *testing.T) { } } +func TestProductionConfig_CalendlyListsScheduledEvents(t *testing.T) { + t.Parallel() + for _, configPath := range []string{ + "../../configs/services.yaml", + "../../config/services.yaml", + "../../configs/services/calendly.yaml", + } { + r := New() + if err := r.LoadFile(configPath); err != nil { + t.Fatalf("load %s: %v", configPath, err) + } + svc, err := r.Get("calendly") + if err != nil { + t.Fatalf("get calendly from %s: %v", configPath, err) + } + if svc.BaseURL != "https://api.calendly.com" || svc.Auth.Type != "bearer" { + t.Fatalf("calendly service from %s = %+v, want Calendly bearer API", configPath, svc) + } + _, action, err := r.GetAction("calendly", "list_scheduled_events") + if err != nil { + t.Fatalf("get list_scheduled_events action from %s: %v", configPath, err) + } + if action.Method != "GET" || action.Path != "/scheduled_events" { + t.Fatalf("action from %s = %+v, want GET /scheduled_events", configPath, action) + } + if action.Params["user"] != "string" || action.Params["count"] != "int?" { + t.Fatalf("params from %s = %+v, want required user and optional count", configPath, action.Params) + } + } +} + // TestProductionConfig_LocalDevDefaultMatches guards against config/ // services.yaml (the local, non-Docker dev default) silently drifting // out of sync with configs/services.yaml (the file Docker and the @@ -73,7 +104,7 @@ func TestProductionConfig_LocalDevDefaultMatches(t *testing.T) { if err := r.LoadFile("../../config/services.yaml"); err != nil { t.Fatalf("load ../../config/services.yaml: %v", err) } - for _, name := range []string{"github", "slack", "google_workspace", "stripe"} { + for _, name := range []string{"github", "slack", "google_workspace", "stripe", "calendly"} { if _, err := r.Get(name); err != nil { t.Errorf("config/services.yaml missing %q: %v", name, err) }