connect

package
v0.1.0-alpha.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID              string      `json:"id,omitempty"`
	Name            string      `json:"name,omitempty"`
	ExternalID      string      `json:"external_id,omitempty"`
	Healthy         bool        `json:"healthy,omitempty"`
	Dead            bool        `json:"dead,omitempty"`
	App             App         `json:"app,omitzero"`
	CreatedAt       time.Time   `json:"created_at,omitzero"`
	UpdatedAt       time.Time   `json:"updated_at,omitzero"`
	Credentials     Credentials `json:"credentials,omitzero"`
	ExpiresAt       any         `json:"expires_at,omitempty"`
	Error           any         `json:"error,omitempty"`
	LastRefreshedAt time.Time   `json:"last_refreshed_at,omitzero"`
	NextRefreshAt   time.Time   `json:"next_refresh_at,omitzero"`
}

type App

type App struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	NameSlug    string `json:"name_slug,omitempty"`
	AuthType    string `json:"auth_type,omitempty"`
	Description string `json:"description,omitempty"`
	ImgSrc      string `json:"img_src,omitempty"`
}

type Client

type Client struct {
	*client.Client
}

func (*Client) AcquireUserToken

func (c *Client) AcquireUserToken(
	ctx context.Context,
	externalUserID string,
	webhookURI string,
) (*UserTokenResponse, error)

retrieve a short-lived token for that user

func (*Client) DeleteAccount

func (c *Client) DeleteAccount(
	ctx context.Context,
	accountId string,
) error

DeleteAccount Delete a specific connected account for an end user, and any deployed triggers

func (*Client) DeleteAccounts

func (c *Client) DeleteAccounts(
	ctx context.Context,
	appID string,
) error

DeleteAccounts Delete all connected accounts for a specific app

func (*Client) DeleteDeployedTrigger

func (c *Client) DeleteDeployedTrigger(
	ctx context.Context,
	deployedTriggerID string,
	externalUserID string,
) error

func (*Client) DeleteEndUser

func (c *Client) DeleteEndUser(
	ctx context.Context,
	externalUserID string,
) error

DeleteEndUser Delete an end user, all their connected accounts, and any deployed triggers.

func (*Client) DeployTrigger

func (c *Client) DeployTrigger(
	ctx context.Context,
	componentKey string,
	externalUserID string,
	configuredProps ConfiguredProps,
	webhookURL string,
	dynamicPropsID string,
	workflowID string,
) (*Trigger, error)

func (*Client) GetAccount

func (c *Client) GetAccount(
	ctx context.Context,
	externalUserID string,
	app string,
	includeCredentials bool,
	accountId string,
) (*GetAccountResponse, error)

GetAccount Retrieve the account details for a specific account based on the account ID

func (*Client) GetComponent

func (c *Client) GetComponent(
	ctx context.Context,
	componentKey string,
	componentType ComponentType,
) (*GetComponentResponse, error)

https://pipedream.com/docs/connect/api/#retrieve-a-component GetComponent retrieves a pipedream component and its configurable props

func (*Client) GetDeployedTrigger

func (c *Client) GetDeployedTrigger(
	ctx context.Context,
	deployedComponentID string,
	externalUserId string,
) (*Trigger, error)

func (*Client) GetPropOptions

func (c *Client) GetPropOptions(
	ctx context.Context,
	propName string,
	componentKey string,
	externalUserID string,
	configuredProps ConfiguredProps,
) (*PropOptions, error)

https://pipedream.com/docs/connect/api/#configure-a-component ConfigureComponent calls the configure endpoint for a component in pipedream externalUserID is the id defined by a third party or us component Key is the componentID propName is the key in the componentDetails

func (*Client) InvokeAction

func (c *Client) InvokeAction(
	ctx context.Context,
	componentKey string,
	externalUserID string,
	props ConfiguredProps,
) (map[string]any, error)

func (*Client) ListAccounts

func (c *Client) ListAccounts(
	ctx context.Context,
	externalUserID string,
	app string,
	oauthAppId string,
	includeCredentials bool,
) (*ListAccountsResponse, error)

ListAccounts lists all accounts related to the currently set projectID All the parameters are optional

func (*Client) ListComponents

func (c *Client) ListComponents(
	ctx context.Context,
	componentType ComponentType,
	appName string,
	searchTerm string,
	limit int,
) (*ListComponentResponse, error)

https://pipedream.com/docs/connect/api/#list-components ListComponents lists the components available in pipedream

func (*Client) ListDeployedTriggers

func (c *Client) ListDeployedTriggers(
	ctx context.Context,
	externalUserID string,
) (*TriggerList, error)

func (*Client) ListTriggerWebhooks

func (c *Client) ListTriggerWebhooks(
	ctx context.Context,
	deployedComponentID string,
	externalUserID string,
) (*TriggerWebhookURLs, error)

ListTriggerWebhooks Retrieve the list of webhook URLs listening to a deployed trigger

func (*Client) ReloadComponentProps

func (c *Client) ReloadComponentProps(
	ctx context.Context,
	componentType ComponentType,
	configuredProps ConfiguredProps,
	externalUserID string,
	ComponentKey string,
	dynamicPropsID string,
) (*ReloadComponentPropsResponse, error)

ReloadComponentProps Reload the component’s props after configuring a dynamic prop, based on the current component’s configuration will use the component’s configuration to retrieve a new list of props depending on the value of the props that were configured so far

func (*Client) RetrieveTriggerEvents

func (c *Client) RetrieveTriggerEvents(
	ctx context.Context,
	deployedComponentID string,
	externalUserID string,
	numberOfEvents int,
) (*TriggerEventList, error)

func (*Client) RetrieveTriggerWorkflows

func (c *Client) RetrieveTriggerWorkflows(
	ctx context.Context,
	deployedComponentID string,
	externalUserID string,
) (*TriggerWorkflowIDs, error)

RetrieveTriggerWorkflows Retrieve the workflows listening to a deployed trigger

func (*Client) UpdateTriggerWebhooks

func (c *Client) UpdateTriggerWebhooks(
	ctx context.Context,
	deployedComponentID string,
	externalUserID string,
	webhookURLs []string,
) (*TriggerWebhookURLs, error)

UpdateTriggerWebhooks Updates the list of webhook URLs that will listen to a deployed trigger

func (*Client) UpdateTriggerWorkflows

func (c *Client) UpdateTriggerWorkflows(
	ctx context.Context,
	deployedComponentID string,
	externalUserID string,
	workflowIDs []string,
) (*TriggerWorkflowIDs, error)

UpdateTriggerWorkflows UUpdate the list of workflows that will listen to a deployed trigger

type Component

type Component struct {
	Key         string        `json:"key,omitempty"`
	Name        string        `json:"name,omitempty"`
	Version     string        `json:"version,omitempty"`
	Type        ComponentType `json:"type,omitempty"`
	Description string        `json:"description,omitempty"`
}

func (Component) String

func (c Component) String() string

type ComponentDetails

type ComponentDetails struct {
	Component
	ConfigurableProps []*ConfigurableProp `json:"configurable_props,omitempty"`
}

func (ComponentDetails) String

func (c ComponentDetails) String() string

type ComponentType

type ComponentType string
const (
	Triggers   ComponentType = "triggers"
	Actions    ComponentType = "actions"
	Components ComponentType = "components"
)

type ConfigurableProp

type ConfigurableProp struct {
	Name           string `json:"name,omitempty"`
	Type           string `json:"type"`
	App            string `json:"app,omitempty"`
	CustomResponse bool   `json:"custom_response,omitempty"`
	Label          string `json:"label,omitempty"`
	Description    string `json:"description,omitempty"`
	RemoteOptions  *bool  `json:"remoteOptions,omitempty"`
	Options        []any  `json:"options,omitempty"` // this can be a string array or an object array of Value
	UseQuery       bool   `json:"use_query,omitempty"`
	Default        any    `json:"default,omitempty"`
	Min            int    `json:"min,omitempty"`
	Max            int    `json:"max,omitempty"`
	Disabled       bool   `json:"disabled,omitempty"`
	Secret         bool   `json:"secret,omitempty"`
	Optional       bool   `json:"optional,omitempty"`
	ReloadProps    bool   `json:"reloadProps,omitempty"`
}

func (ConfigurableProp) String

func (c ConfigurableProp) String() string

type ConfiguredProps

type ConfiguredProps map[string]any

func (ConfiguredProps) String

func (c ConfiguredProps) String() string

type Credentials

type Credentials struct {
	OauthClientId    string `json:"oauth_client_id,omitempty"`
	OauthAccessToken string `json:"oauth_access_token,omitempty"`
	OauthUid         string `json:"oauth_uid,omitempty"`
}

type DeployTriggerRequest

type DeployTriggerRequest struct {
	ComponentKey    string          `json:"id"`
	ConfiguredProps ConfiguredProps `json:"configured_props"`
	ExternalUserID  string          `json:"external_user_id"`
	WebhookURL      string          `json:"webhook_url,omitempty"`
	WorkflowID      string          `json:"workflow_id,omitempty"`
	DynamicPropsID  string          `json:"dynamic_props_id,omitempty"`
}

OPTIONAL: WorkflowID, DynamicPropsID and WebhookURL

type DeployTriggerResponse

type DeployTriggerResponse struct {
	Data Trigger `json:"data"`
}

type DynamicProps

type DynamicProps struct {
	ID                string             `json:"id,omitempty"`
	ConfigurableProps []ConfigurableProp `json:"configurableProps,omitempty"`
}

type Event

type Event struct {
	Method   string            `json:"method,omitempty"`
	Path     string            `json:"path,omitempty"`
	Query    []string          `json:"query,omitempty"`
	ClientIP string            `json:"client_ip,omitempty"`
	URL      string            `json:"url,omitempty"`
	Headers  map[string]string `json:"headers,omitempty"`
}

type GetAccountResponse

type GetAccountResponse struct {
	Data Account `json:"data"`
}

type GetComponentResponse

type GetComponentResponse struct {
	Data *ComponentDetails `json:"data,omitempty"`
}

GetComponentResponse is the response for the get component endpoint

type GetTriggerResponse

type GetTriggerResponse struct {
	Data Trigger `json:"data"`
}

type InvokeActionRequest

type InvokeActionRequest struct {
	// ID is the ComponentID
	ID              string          `json:"id,omitempty"`
	ExternalUserID  string          `json:"external_user_id"`
	ConfiguredProps ConfiguredProps `json:"configured_props,omitempty"`

	DynamicPropsID string `json:"dynamic_props_id,omitempty"`
}

type ListAccountsResponse

type ListAccountsResponse struct {
	PageInfo PageInfo   `json:"page_info"`
	Data     []*Account `json:"data"`
}

type ListComponentResponse

type ListComponentResponse struct {
	Data []*Component `json:"data,omitempty"`
}

ListComponentResponse is the response for the component list endpoint

type PageInfo

type PageInfo struct {
	TotalCount  int    `json:"total_count,omitempty"`
	Count       int    `json:"count,omitempty"`
	StartCursor string `json:"start_cursor,omitempty"`
	EndCursor   string `json:"end_cursor,omitempty"`
}

type PropOptions

type PropOptions struct {
	Observations  []any            `json:"observations,omitempty"`
	Context       any              `json:"context,omitempty"` // TODO
	Options       []Value          `json:"options,omitempty"`
	Errors        []string         `json:"errors,omitempty"`
	Timings       []map[string]any `json:"timings,omitempty"`
	StringOptions any              `json:"string_options,omitempty"`
}

func (PropOptions) String

func (p PropOptions) String() string

type ReloadComponentPropsRequest

type ReloadComponentPropsRequest struct {
	ExternalUserID  string          `json:"external_user_id,omitempty"`
	ConfiguredProps ConfiguredProps `json:"configured_props,omitempty"`
	ID              string          `json:"id,omitempty"`
	DynamicPropsID  string          `json:"dynamic_props_id,omitempty"`
}

type ReloadComponentPropsResponse

type ReloadComponentPropsResponse struct {
	Observations []any        `json:"observations,omitempty"`
	Errors       []string     `json:"errors,omitempty"`
	DynamicProps DynamicProps `json:"dynamicProps"`
}

type Trigger

type Trigger struct {
	ID                string             `json:"id"`
	OwnerID           string             `json:"owner_id"`
	ComponentID       string             `json:"component_id"`
	ConfigurableProps []ConfigurableProp `json:"configurable_props,omitempty"`
	ConfiguredProps   ConfiguredProps    `json:"configured_props,omitempty"`
	Active            bool               `json:"active,omitempty"`
	CreatedAt         int                `json:"created_at"`
	UpdatedAt         int                `json:"updated_at"`
	Name              string             `json:"name"`
	NameSlug          string             `json:"name_slug"`
	EmailAddress      string             `json:"email_address,omitempty"`
}

func (Trigger) String

func (t Trigger) String() string

type TriggerEvent

type TriggerEvent struct {
	E  Event  `json:"e,omitzero"`
	K  string `json:"k,omitempty"`
	TS int    `json:"ts,omitempty"`
	ID string `json:"id,omitempty"`
}

type TriggerEventList

type TriggerEventList struct {
	Data []TriggerEvent `json:"data,omitempty"`
}

type TriggerList

type TriggerList struct {
	PageInfo PageInfo  `json:"page_info,omitzero"`
	Data     []Trigger `json:"data,omitempty"`
}

type TriggerWebhookURLs

type TriggerWebhookURLs struct {
	WebhookURLs []string `json:"webhook_urls,omitempty"`
}

type TriggerWorkflowIDs

type TriggerWorkflowIDs struct {
	WorkflowIDs []string `json:"workflow_ids,omitempty"`
}

type UpdateTriggerWebhooksRequest

type UpdateTriggerWebhooksRequest struct {
	ExternalUserID string   `json:"external_user_id"`
	WebhookURLs    []string `json:"webhook_urls,omitempty"`
}

type UpdateTriggerWorkflowsRequest

type UpdateTriggerWorkflowsRequest struct {
	ExternalUserID string   `json:"external_user_id"`
	WorkflowIDs    []string `json:"workflow_ids,omitempty"`
}

type UserTokenRequest

type UserTokenRequest struct {
	ExternalUserID     string   `json:"external_user_id"`
	AllowedOrigins     []string `json:"allowed_origins"`
	SuccessRedirectURI string   `json:"success_redirect_uri,omitempty"`
	ErrorRedirectURI   string   `json:"error_redirect_uri,omitempty"`
	WebhookURI         string   `json:"webhook_uri,omitempty"`
}

type UserTokenResponse

type UserTokenResponse struct {
	ConnectLinkURL string    `json:"connect_link_url,omitempty"`
	ExpiresAt      time.Time `json:"expires_at,omitzero"`
	Token          string    `json:"token,omitempty"`
}

type Value

type Value struct {
	Label string `json:"label,omitempty"`
	Value any    `json:"value,omitempty"`
}

func (Value) String

func (v Value) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL