types

package
v0.0.0-...-2b706d3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TriggerTypeShortcut        = "shortcut"
	TriggerTypeSlashCommand    = "slash_command"
	TriggerTypeMessageShortcut = "message_shortcut"
	TriggerTypeEvent           = "event"
	TriggerTypeWebhook         = "webhook"
	TriggerTypeScheduled       = "scheduled"
)

Supported trigger types

View Source
const AuthLevelEnterprise = "organization"

An authorization can be organization/enterprise level or workspace level depending on the Slack client instance the user is logging in with

View Source
const AuthLevelWorkspace = "workspace"
View Source
const GrantAllOrgWorkspaces = "all"
View Source
const SchemaVersion = 1

Variables

This section is empty.

Functions

func GetAccessTypeDescriptionForEveryone

func GetAccessTypeDescriptionForEveryone(app App) string

GetAccessTypeDescriptionForEveryone returns the user-friendly output for the "everyone" access type. It will clarify who everyone is given how the app has been installed to the team (workspace or org).

func IsAppFlagDeploy

func IsAppFlagDeploy(str string) bool

IsAppFlagDeploy returns if the flag represents the deployed app environment

func IsAppFlagEnvironment

func IsAppFlagEnvironment(str string) bool

IsAppFlagEnvironment returns if the flag denotes the local or deployed app

func IsAppFlagLocal

func IsAppFlagLocal(str string) bool

IsAppFlagLocal returns if the flag represents the local app environment

func IsAppFlagValid

func IsAppFlagValid(str string) bool

IsAppFlagValid returns if the flag matches an expected pattern for the app flag

Note: This pattern might be an app ID or the app environment

func IsAppID

func IsAppID(str string) bool

IsAppID returns true if the flag matches the pattern of an app ID

Note: Validation criteria is an estimate, and not directly related to server-side app_id scheme If needed this can be more strict

func IsEnterpriseTeamID

func IsEnterpriseTeamID(str string) bool

IsEnterpriseTeamID returns true if a string matches the pattern of an enterprise (E-prefixed) team ID Note: Validation criteria is an estimate, and not directly related to server-side team_id scheme

func IsNamedEntityFlag

func IsNamedEntityFlag(flags *pflag.FlagSet) bool

isNamedEntityFlag returns true if named entity flags are set

func IsTeamID

func IsTeamID(str string) bool

IsTeamID returns true if a string matches the pattern of a team id Note: Validation criteria is an estimate, and not directly related to server-side team_id scheme

func IsWorkspaceTeamID

func IsWorkspaceTeamID(str string) bool

IsTeamID returns true if matches the pattern of a workspace (T-prefixed) team ID Note: This criteria is an estimate, and not directly related to server-side team_id scheme

Types

type ActivityArgs

type ActivityArgs struct {
	TeamID            string
	AppID             string
	TailArg           bool
	Browser           bool
	PollingIntervalMS int
	IdleTimeoutM      int
	Limit             int
	MinDateCreated    int64
	MaxDateCreated    int64
	MinLevel          string
	EventType         string
	ComponentType     string
	ComponentID       string
	Source            string
	TraceID           string
}

type ActivityLevel

type ActivityLevel string
const (
	TRACE ActivityLevel = "trace"
	DEBUG ActivityLevel = "debug"
	INFO  ActivityLevel = "info"
	WARN  ActivityLevel = "warn"
	ERROR ActivityLevel = "error"
	FATAL ActivityLevel = "fatal"
)

type ActivityRequest

type ActivityRequest struct {
	AppID              string `json:"app_id"`
	NextCursor         string `json:"cursor,omitempty"`
	Limit              int    `json:"limit,omitempty"`
	MinimumDateCreated int64  `json:"min_date_created,omitempty"`
	MaximumDateCreated int64  `json:"max_date_created,omitempty"`
	MinimumLogLevel    string `json:"min_log_level,omitempty"`
	EventType          string `json:"log_event_type,omitempty"`
	ComponentType      string `json:"component_type,omitempty"`
	ComponentID        string `json:"component_id,omitempty"`
	Source             string `json:"source,omitempty"`
	TraceID            string `json:"trace_id,omitempty"`
}

type App

type App struct {
	AppID            string            `json:"app_id,omitempty"`
	EnterpriseID     string            `json:"enterprise_id,omitempty"`
	EnterpriseGrants []EnterpriseGrant `json:"-"`
	LegacyName       string            `json:"name,omitempty"` // Legacy "name". Do not use this field.

	InstallStatus AppInstallationStatus `json:"-"` // "-" will always omit when un-marshalled
	IsDev         bool                  `json:",omitempty"`
	TeamDomain    string                `json:"team_domain,omitempty"` // e.g. "arachnoid"
	TeamID        string                `json:"team_id,omitempty"`
	UserID        string                `json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

App models app metadata such as team domain, AppID, TeamID and UserID

func NewApp

func NewApp() App

NewApp returns an app with the internal 'new' property set to true

func (*App) Equals

func (app *App) Equals(otherApp App) bool

Equals returns true if the fields of the two App objects match

func (*App) IsEmpty

func (app *App) IsEmpty() bool

Equals returns true if the object is empty (all fields are their zero value)

func (*App) IsEnterpriseApp

func (app *App) IsEnterpriseApp() bool

IsEnterpriseApp returns true if an app was created on an enterprise/org

Note: Validation criteria is an estimate, and not directly related to server-side criteria

func (*App) IsEnterpriseWorkspaceApp

func (app *App) IsEnterpriseWorkspaceApp() bool

IsEnterpriseWorkspaceApp returns true if an app was created on a workspace which belongs to an org/enterprise

Note: Validation criteria is an estimate, and not directly related to server-side criteria

func (*App) IsInstalled

func (app *App) IsInstalled() bool

IsInstalled returns true if the app's installation status indicates that it is installed

func (*App) IsNew

func (app *App) IsNew() bool

IsNew returns whether the app hasn't been written to the file system yet (e.g. apps.json / apps.dev.json)

func (*App) IsUninstalled

func (app *App) IsUninstalled() bool

IsUninstalled returns true if the app's installation status indicates that it is uninstalled

type AppCollaboratorPermission

type AppCollaboratorPermission string
const (
	OWNER  AppCollaboratorPermission = "owner"
	READER AppCollaboratorPermission = "reader"
)

App collaborator permission types

func StringToAppCollaboratorPermission

func StringToAppCollaboratorPermission(input string) (AppCollaboratorPermission, error)

StringToAppCollaboratorPermission returns the human readable word of the app collaborator permission

func (AppCollaboratorPermission) AppCollaboratorPermissionF

func (acp AppCollaboratorPermission) AppCollaboratorPermissionF() string

AppCollaboratorPermissionF formats the permission for use in a sentence

type AppDatastoreBulkDelete

type AppDatastoreBulkDelete struct {
	Datastore string   `json:"datastore,omitempty"`
	App       string   `json:"app,omitempty"`
	IDs       []string `json:"ids,omitempty"`
}

func (*AppDatastoreBulkDelete) AppID

func (datastore *AppDatastoreBulkDelete) AppID() string

AppID returns the app ID for the datastore

func (*AppDatastoreBulkDelete) Name

func (datastore *AppDatastoreBulkDelete) Name() string

Name returns the name of the datastore

func (*AppDatastoreBulkDelete) SetName

func (datastore *AppDatastoreBulkDelete) SetName(name string)

SetName sets the name of the datastore

type AppDatastoreBulkDeleteResult

type AppDatastoreBulkDeleteResult struct {
	Datastore   string   `json:"datastore,omitempty"`
	FailedItems []string `json:"failed_items,omitempty"`
}

type AppDatastoreBulkGet

type AppDatastoreBulkGet struct {
	Datastore string   `json:"datastore,omitempty"`
	App       string   `json:"app,omitempty"`
	IDs       []string `json:"ids,omitempty"`
}

func (*AppDatastoreBulkGet) AppID

func (datastore *AppDatastoreBulkGet) AppID() string

AppID returns the app ID for the datastore

func (*AppDatastoreBulkGet) Name

func (datastore *AppDatastoreBulkGet) Name() string

Name returns the name of the datastore

func (*AppDatastoreBulkGet) SetName

func (datastore *AppDatastoreBulkGet) SetName(name string)

SetName sets the name of the datastore

type AppDatastoreBulkGetResult

type AppDatastoreBulkGetResult struct {
	Datastore   string                   `json:"datastore,omitempty"`
	Items       []map[string]interface{} `json:"items,omitempty"`
	FailedItems []string                 `json:"failed_items,omitempty"`
}

type AppDatastoreBulkPut

type AppDatastoreBulkPut struct {
	Datastore string                   `json:"datastore,omitempty"`
	App       string                   `json:"app,omitempty"`
	Items     []map[string]interface{} `json:"items,omitempty"`
}

func (*AppDatastoreBulkPut) AppID

func (datastore *AppDatastoreBulkPut) AppID() string

AppID returns the app ID for the datastore

func (*AppDatastoreBulkPut) Name

func (datastore *AppDatastoreBulkPut) Name() string

Name returns the name of the datastore

func (*AppDatastoreBulkPut) SetName

func (datastore *AppDatastoreBulkPut) SetName(name string)

SetName sets the name of the datastore

type AppDatastoreBulkPutResult

type AppDatastoreBulkPutResult struct {
	Datastore   string                   `json:"datastore,omitempty"`
	FailedItems []map[string]interface{} `json:"failed_items,omitempty"`
}

type AppDatastoreCount

type AppDatastoreCount struct {
	Datastore            string                 `json:"datastore,omitempty"`
	App                  string                 `json:"app,omitempty"`
	Expression           string                 `json:"expression,omitempty"`
	ExpressionAttributes map[string]interface{} `json:"expression_attributes,omitempty"`
	ExpressionValues     map[string]interface{} `json:"expression_values,omitempty"`
}

func (*AppDatastoreCount) AppID

func (datastore *AppDatastoreCount) AppID() string

AppID returns the app ID for the datastore

func (*AppDatastoreCount) Name

func (datastore *AppDatastoreCount) Name() string

Name returns the name of the datastore

func (*AppDatastoreCount) SetName

func (datastore *AppDatastoreCount) SetName(name string)

SetName sets the name of the datastore

type AppDatastoreCountResult

type AppDatastoreCountResult struct {
	Datastore string `json:"datastore,omitempty"`
	Count     int    `json:"count,omitempty"`
}

type AppDatastoreDelete

type AppDatastoreDelete struct {
	Datastore string `json:"datastore,omitempty"`
	App       string `json:"app,omitempty"`
	ID        string `json:"id,omitempty"`
}

func (*AppDatastoreDelete) AppID

func (datastore *AppDatastoreDelete) AppID() string

AppID returns the app ID for the datastore

func (*AppDatastoreDelete) Name

func (datastore *AppDatastoreDelete) Name() string

Name returns the name of the datastore

func (*AppDatastoreDelete) SetName

func (datastore *AppDatastoreDelete) SetName(name string)

SetName sets the name of the datastore

type AppDatastoreDeleteResult

type AppDatastoreDeleteResult struct {
	Datastore string `json:"datastore,omitempty"`
	ID        string `json:"id,omitempty"`
}

type AppDatastoreGet

type AppDatastoreGet struct {
	Datastore string `json:"datastore,omitempty"`
	App       string `json:"app,omitempty"`
	ID        string `json:"id,omitempty"`
}

func (*AppDatastoreGet) AppID

func (datastore *AppDatastoreGet) AppID() string

AppID returns the app ID for the datastore

func (*AppDatastoreGet) Name

func (datastore *AppDatastoreGet) Name() string

Name returns the name of the datastore

func (*AppDatastoreGet) SetName

func (datastore *AppDatastoreGet) SetName(name string)

SetName sets the name of the datastore

type AppDatastoreGetResult

type AppDatastoreGetResult struct {
	Datastore string                 `json:"datastore,omitempty"`
	Item      map[string]interface{} `json:"item,omitempty"`
}

type AppDatastorePut

type AppDatastorePut struct {
	Datastore string                 `json:"datastore,omitempty"`
	App       string                 `json:"app,omitempty"`
	Item      map[string]interface{} `json:"item,omitempty"`
}

func (*AppDatastorePut) AppID

func (datastore *AppDatastorePut) AppID() string

AppID returns the app ID for the datastore

func (*AppDatastorePut) Name

func (datastore *AppDatastorePut) Name() string

Name returns the name of the datastore

func (*AppDatastorePut) SetName

func (datastore *AppDatastorePut) SetName(name string)

SetName sets the name of the datastore

type AppDatastorePutResult

type AppDatastorePutResult struct {
	Datastore string                 `json:"datastore,omitempty"`
	Item      map[string]interface{} `json:"item,omitempty"`
}

type AppDatastoreQuery

type AppDatastoreQuery struct {
	Datastore            string                 `json:"datastore,omitempty"`
	App                  string                 `json:"app,omitempty"`
	Expression           string                 `json:"expression,omitempty"`
	ExpressionAttributes map[string]interface{} `json:"expression_attributes,omitempty"`
	ExpressionValues     map[string]interface{} `json:"expression_values,omitempty"`
	Limit                int                    `json:"limit,omitempty"`
	Cursor               string                 `json:"cursor,omitempty"`
}

func (*AppDatastoreQuery) AppID

func (datastore *AppDatastoreQuery) AppID() string

AppID returns the app ID for the datastore

func (*AppDatastoreQuery) Name

func (datastore *AppDatastoreQuery) Name() string

Name returns the name of the datastore

func (*AppDatastoreQuery) SetName

func (datastore *AppDatastoreQuery) SetName(name string)

SetName sets the name of the datastore

type AppDatastoreQueryResult

type AppDatastoreQueryResult struct {
	Datastore  string                   `json:"datastore,omitempty"`
	Items      []map[string]interface{} `json:"items,omitempty"`
	NextCursor string                   `json:"next_cursor,omitempty"`
}

type AppDatastoreUpdate

type AppDatastoreUpdate struct {
	Datastore string                 `json:"datastore,omitempty"`
	App       string                 `json:"app,omitempty"`
	Item      map[string]interface{} `json:"item,omitempty"`
}

func (*AppDatastoreUpdate) AppID

func (datastore *AppDatastoreUpdate) AppID() string

AppID returns the app ID for the datastore

func (*AppDatastoreUpdate) Name

func (datastore *AppDatastoreUpdate) Name() string

Name returns the name of the datastore

func (*AppDatastoreUpdate) SetName

func (datastore *AppDatastoreUpdate) SetName(name string)

SetName sets the name of the datastore

type AppDatastoreUpdateResult

type AppDatastoreUpdateResult struct {
	Datastore string                 `json:"datastore,omitempty"`
	Item      map[string]interface{} `json:"item,omitempty"`
}

type AppDirectory

type AppDirectory struct {
	Categories              []string `json:"app_directory_categories,omitempty" yaml:"app_directory_categories,flow,omitempty"`
	UseDirectInstall        *bool    `json:"use_direct_install,omitempty" yaml:"use_direct_install,omitempty"`
	DirectInstallURL        string   `json:"direct_install_url,omitempty" yaml:"direct_install_url,omitempty"`
	InstallationLandingPage string   `json:"installation_landing_page" yaml:"installation_landing_page"`
	PrivacyPolicyURL        string   `json:"privacy_policy_url" yaml:"privacy_policy_url"`
	SupportURL              string   `json:"support_url" yaml:"support_url"`
	SupportEmail            string   `json:"support_email" yaml:"support_email"`
	SupportedLanguages      []string `json:"supported_languages" yaml:"supported_languages,flow"`
	Pricing                 string   `json:"pricing" yaml:"pricing"`
}

type AppFeatures

type AppFeatures struct {
	AppHome                    ManifestAppHome             `json:"app_home,omitempty" yaml:"app_home,flow,omitempty"`
	AssistantView              *AssistantView              `json:"assistant_view,omitempty" yaml:"assistant_view,omitempty"`
	BotUser                    BotUser                     `json:"bot_user,omitempty" yaml:"bot_user,flow,omitempty"`
	WorkflowSteps              []WorkflowStep              `json:"workflow_steps,omitempty" yaml:"workflow_steps,flow,omitempty"`
	UnfurlDomains              []string                    `json:"unfurl_domains,omitempty" yaml:"unfurl_domains,flow,omitempty"`
	ManifestShortcutsItems     []ManifestShortcutsItem     `json:"shortcuts,omitempty" yaml:"shortcuts,flow,omitempty"`
	ManifestSlashCommandsItems []ManifestSlashCommandsItem `json:"slash_commands,omitempty" yaml:"slash_commands,flow,omitempty"`
	Search                     *Search                     `json:"search,omitempty" yaml:"search,flow,omitempty"`
	RichPreviews               *RichPreviews               `json:"rich_previews,omitempty" yaml:"rich_previews,flow,omitempty"`
}

type AppInstallationStatus

type AppInstallationStatus int
const (
	AppInstallationStatusUnknown AppInstallationStatus = iota
	AppStatusInstalled
	AppStatusUninstalled
)

func (AppInstallationStatus) String

func (s AppInstallationStatus) String() string

type AppManifest

type AppManifest struct {
	Metadata           *ManifestMetadata  `json:"_metadata,omitempty" yaml:"_metadata,flow,omitempty"`
	DisplayInformation DisplayInformation `json:"display_information" yaml:"display_information,flow"`
	Directory          *AppDirectory      `json:"app_directory,omitempty" yaml:"app_directory,omitempty"`
	Features           *AppFeatures       `json:"features,omitempty" yaml:"features,omitempty"`
	OAuthConfig        *OAuthConfig       `json:"oauth_config,omitempty" yaml:"oauth_config,omitempty"`
	Settings           *AppSettings       `json:"settings,omitempty" yaml:"settings,omitempty"`

	Functions             map[string]ManifestFunction  `json:"functions,omitempty" yaml:"functions,flow,omitempty"`
	Datastores            map[string]ManifestDatastore `json:"datastores,omitempty" yaml:"datastores,flow,omitempty"`
	Types                 *RawJSON                     `json:"types,omitempty" yaml:"types,flow,omitempty"`
	Events                *RawJSON                     `json:"events,omitempty" yaml:"events,flow,omitempty"`
	TriggerTypes          *RawJSON                     `json:"trigger_types,omitempty" yaml:"trigger_types,flow,omitempty"`
	Workflows             map[string]Workflow          `json:"workflows,omitempty" yaml:"workflows,flow,omitempty"`
	OutgoingDomains       *[]string                    `json:"outgoing_domains,omitempty" yaml:"outgoing_domains,flow,omitempty"`
	ExternalAuthProviders *ManifestAuthProviders       `json:"external_auth_providers,omitempty" yaml:"external_auth_providers,flow,omitempty"`
}

func (*AppManifest) FunctionRuntime

func (manifest *AppManifest) FunctionRuntime() FunctionRuntime

FunctionRuntime returns the FunctionRuntime of an app manifest if exists

func (*AppManifest) IsFunctionRuntimeSlackHosted

func (manifest *AppManifest) IsFunctionRuntimeSlackHosted() bool

IsFunctionRuntimeSlackHosted returns true when the function runtime setting is slack hosted

type AppSettings

type AppSettings struct {
	SocketModeEnabled      *bool                       `json:"socket_mode_enabled,omitempty" yaml:"socket_mode_enabled,omitempty"`
	OrgDeployEnabled       *bool                       `json:"org_deploy_enabled,omitempty" yaml:"org_deploy_enabled,omitempty"`
	Interactivity          *ManifestInteractivity      `json:"interactivity,omitempty" yaml:"interactivity,omitempty"`
	IncomingWebhooks       *IncomingWebhooks           `json:"incoming_webhooks,omitempty" yaml:"incoming_webhooks,flow,omitempty"`
	EventSubscriptions     *ManifestEventSubscriptions `json:"event_subscriptions,omitempty" yaml:"event_subscriptions,flow,omitempty"`
	AllowedIPAddressRanges []string                    `json:"allowed_ip_address_ranges,omitempty" yaml:"allowed_ip_address_ranges,flow,omitempty"`
	FunctionRuntime        FunctionRuntime             `json:"function_runtime,omitempty" yaml:"function_runtime,flow,omitempty"`
	TokenRotationEnabled   *bool                       `json:"token_rotation_enabled,omitempty" yaml:"token_rotation_enabled,omitempty"`
	SiwsLinks              *SiwsLinks                  `json:"siws_links,omitempty" yaml:"siws_links,flow,omitempty"`
}

type Apps

type Apps struct {
	DeployedApps map[string]App `json:"apps,omitempty"`

	// IMPORTANT: Legacy property! Please do not use DefaultAppTeamDomain.
	DefaultAppTeamDomain string         `json:"default,omitempty"`
	LocalApps            map[string]App `json:"dev,omitempty"`
}

Apps tracks all deployed and development instances of the app associated with project

func (*Apps) GetAllDeployedApps

func (a *Apps) GetAllDeployedApps() ([]App, string)

GetAllDeployedApps returns all deployed Apps

func (*Apps) GetAllLocalApps

func (a *Apps) GetAllLocalApps() []App

GetAllLocalApps returns all local Apps in apps.dev.json

func (*Apps) GetDeployedByTeamDomain

func (a *Apps) GetDeployedByTeamDomain(teamDomain string) App

GetDeployedByTeamDomain returns an existing deployed App by teamDomain, otherwise, returns a new instance of App

IMPORTANT: This is a legacy function that is unsafe. Please use GetDeployedByTeamID instead

func (*Apps) GetDeployedByTeamID

func (a *Apps) GetDeployedByTeamID(teamID string) App

GetDeployedByTeamID returns an existing deployed App by teamID, otherwise, returns a new instance of App

func (*Apps) GetLocalByTeamID

func (a *Apps) GetLocalByTeamID(teamID string) App

GetLocalByTeamID returns a dev App based on the provided teamID; if it doesn't exist, returns a new App

func (*Apps) IsEmpty

func (a *Apps) IsEmpty() bool

IsEmpty returns whether there are any deployed or local apps

func (*Apps) MapByTeamID

func (a *Apps) MapByTeamID(apps map[string]App) (appsByTeamID map[string]App, err error)

MapByTeamID takes a map of apps and returns a map guaranteed to be keyed by team_ids Historically we have keyed by team_domain, which is not guaranteed to be unique

func (*Apps) RemoveDeployedByTeamID

func (a *Apps) RemoveDeployedByTeamID(teamID string)

RemoveDeployedByTeamID removes the deployed App that corresponds to the provided teamID

func (*Apps) RemoveLocalByTeamID

func (a *Apps) RemoveLocalByTeamID(teamID string)

RemoveLocalByTeamID removes the local App associated with the provided teamID

func (*Apps) Set

func (a *Apps) Set(app App) error

Set assigns the provided App to either the dev or deployed App

func (*Apps) SetLocal

func (a *Apps) SetLocal(app App) error

SetLocal assigns the provided local App to the provided teamID

type AssistantView

type AssistantView struct {
	AssistantDescription string             `json:"assistant_description,omitempty" yaml:"assistant_description,omitempty"`
	SuggestedPrompts     []SuggestedPrompts `json:"suggested_prompts,omitempty" yaml:"suggested_prompts,flow,omitempty"`
}

type AuthByTeamDomain

type AuthByTeamDomain map[string]SlackAuth

AuthByTeamDomain describes the underlying representation of authorizations in ~/.slack/credentials.json Historically we have used team_domain as a keys. As of cli v2.4.0, we switch to using the unique team_id. AuthByTeamDomain in this case should be understood to be a map of auths where string keys are Slack non-unique team_domains. Wherever possible, please use AuthByTeamID below instead

type AuthByTeamID

type AuthByTeamID map[string]SlackAuth

AuthByTeamID describes the representation of authorizations in ~/.slack/credentials.json as of v2.4.0, a map of auths where string keys are Slack unique team_ids, e.g. org E12345678A or workspace T123456789B

type BotUser

type BotUser struct {
	DisplayName  string `json:"display_name" yaml:"display_name"`
	AlwaysOnline *bool  `json:"always_online,omitempty" yaml:"always_online,omitempty"`
}

type ChannelInfo

type ChannelInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Channel model with fields that match what is returned from the conversations.info method Method documentation: https://docs.slack.dev/reference/methods/conversations.info

type Constraint

type Constraint struct {
	Type  string `json:"type" yaml:"type"`
	Value string `json:"value,omitempty" yaml:"value,omitempty"`
}

Constraint defines the structure of a constraint in the app manifest.

type Datastorer

type Datastorer interface {
	Name() string   // Name returns the name of the datastore
	SetName(string) // SetName sets the name of the datastore
	AppID() string  // AppID returns the app ID for the datastore
}

Datastorer is a named collection of key-value pairs for an app

type DeployedTrigger

type DeployedTrigger struct {
	ID          string          `json:"id"`
	DateCreated int             `json:"date_created"`
	DateUpdated int             `json:"date_updated"`
	Type        string          `json:"type"`
	Name        string          `json:"name"`
	Description string          `json:"description"`
	Usage       string          `json:"usage"`
	Webhook     string          `json:"webhook_url"`
	ShortcutURL string          `json:"shortcut_url"`
	Workflow    TriggerWorkflow `json:"workflow"`
	Inputs      *RawJSON        `json:"inputs"`
}

type DisplayInformation

type DisplayInformation struct {
	Name            string `json:"name" yaml:"name"`
	Description     string `json:"description,omitempty" yaml:"description,omitempty"`
	BackgroundColor string `json:"background_color,omitempty" yaml:"background_color,omitempty"`
	LongDescription string `json:"long_description,omitempty" yaml:"long_description,omitempty"`
}

type EnterpriseGrant

type EnterpriseGrant struct {
	WorkspaceID     string `json:"workspace_id"`
	WorkspaceDomain string `json:"workspace_domain"`
}

type EnvVariable

type EnvVariable struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type EventType

type EventType string
const (
	DatastoreRequestResult          EventType = "datastore_request_result"
	ExternalAuthMissingFunction     EventType = "external_auth_missing_function"
	ExternalAuthMissingSelectedAuth EventType = "external_auth_missing_oauth_token_or_selected_auth"
	ExternalAuthResult              EventType = "external_auth_result"
	ExternalAuthStarted             EventType = "external_auth_started"
	ExternalAuthTokenFetchResult    EventType = "external_auth_token_fetch_result"
	FunctionDeployment              EventType = "function_deployment"
	FunctionExecutionOutput         EventType = "function_execution_output"
	FunctionExecutionResult         EventType = "function_execution_result"
	FunctionExecutionStarted        EventType = "function_execution_started"
	TriggerExecuted                 EventType = "trigger_executed"
	TriggerPayloadReceived          EventType = "trigger_payload_received"
	WorkflowBillingResult           EventType = "workflow_billing_result"
	WorkflowBotInvited              EventType = "workflow_bot_invited"
	WorkflowCreatedFromTemplate     EventType = "workflow_created_from_template"
	WorkflowExecutionResult         EventType = "workflow_execution_result"
	WorkflowExecutionStarted        EventType = "workflow_execution_started"
	WorkflowPublished               EventType = "workflow_published"
	WorkflowStepExecutionResult     EventType = "workflow_step_execution_result"
	WorkflowStepStarted             EventType = "workflow_step_started"
	WorkflowUnpublished             EventType = "workflow_unpublished"
)

type ExternalAuthorizationInfo

type ExternalAuthorizationInfo struct {
	ProviderName       string              `json:"provider_name" yaml:"provider_name,flow"`
	ProviderKey        string              `json:"provider_key" yaml:"provider_key,flow"`
	ClientID           string              `json:"client_id" yaml:"client_id,flow"`
	ClientSecretExists bool                `json:"client_secret_exists" yaml:"client_secret_exists,flow"`
	ValidTokenExists   bool                `json:"valid_token_exists" yaml:"valid_token_exists,flow"`
	ExternalTokenIDs   []string            `json:"external_token_ids,omitempty" yaml:"external_token_ids,omitempty,flow"`
	ExternalTokens     []ExternalTokenInfo `json:"external_tokens,omitempty" yaml:"external_tokens,omitempty,flow"`
}

type ExternalAuthorizationInfoLists

type ExternalAuthorizationInfoLists struct {
	Authorizations []ExternalAuthorizationInfo `json:"authorizations" yaml:"authorizations,flow"`
	Workflows      []WorkflowsInfo             `json:"workflows,omitempty" yaml:"workflows,omitempty,flow"`
}

type ExternalTokenInfo

type ExternalTokenInfo struct {
	ExternalTokenID string `json:"external_token_id" yaml:"external_token_id,flow"`
	ExternalUserID  string `json:"external_user_id" yaml:"external_user_id,flow"`
	DateUpdated     int    `json:"date_updated" yaml:"date_updated,flow"`
}

type File

type File interface {
	// Stat returns the FileInfo that describes a file
	Stat() (os.FileInfo, error)
}

File represents an open file descriptor

type Function

type Function struct {
	// TODO: remove field when ACL endpoints accept callback ID
	ID          string `json:"id"`
	CallbackID  string `json:"callback_id"`
	Title       string `json:"title"`
	Description string `json:"description"`
}

type FunctionDistributionUser

type FunctionDistributionUser struct {
	ID       string `json:"user_id,omitempty" yaml:"user_id,omitempty"`
	Email    string `json:"email,omitempty" yaml:"email,omitempty"`
	UserName string `json:"username,omitempty" yaml:"username,omitempty"`
}

User model with fields that match what is returned from functions.distributions.permissions methods

type FunctionPermissions

type FunctionPermissions struct {
	FunctionMap map[string]struct {
		Type    Permission `yaml:"type" json:"type"`
		UserIDs []string   `yaml:"user_ids,omitempty" json:"user_ids,omitempty"`
	} `yaml:"function_distribution" json:"function_distribution"`
}

FunctionPermissions holds information for setting multiple function distributions

type FunctionRuntime

type FunctionRuntime string
const (
	LocallyRun  FunctionRuntime = "local"
	Remote      FunctionRuntime = "remote"
	SlackHosted FunctionRuntime = "slack"
)

type Icons

type Icons map[string]string

func (Icons) MarshalJSON

func (i Icons) MarshalJSON() ([]byte, error)

MarshalJSON ensures we only return icon sizes of 192 and 96 as these are the only sizes guaranteed to be available synchronously (through apps.create/apps.edit). All sizes are stored in our db and available eventually (within ~10s usually).

func (*Icons) UnmarshalJSON

func (i *Icons) UnmarshalJSON(data []byte) error

type IncomingWebhooks

type IncomingWebhooks struct {
	IsEnabled *bool `json:"incoming_webhooks_enabled,omitempty" yaml:"incoming_webhooks_enabled,omitempty"`
}

type InstallState

type InstallState string

Admin Approved Apps on by default in a enterprise/organization. Admin Approved Apps is sometimes on in standalone workspaces (an opt-in policy which can be set by Workspace Admins).

Under this policy, developers in orgs must request approval to install if they are requesting their app be granted access to all workspaces. Approval is required when specifying that the app be granted access to a single workspace within the org if there's a org workspace-level AAA policy enabled. Developers in standalone workspaces where policy is on must request app request approval as usual.

const (
	InstallSuccess          InstallState = "SUCCESS"
	InstallRequestPending   InstallState = "REQUEST_PENDING"
	InstallRequestCancelled InstallState = "REQUEST_CANCELLED"
	InstallRequestNotSent   InstallState = "REQUEST_NOT_SENT"
)

type ManifestAppHome

type ManifestAppHome struct {
	HomeTabEnabled             *bool `json:"home_tab_enabled,omitempty" yaml:"home_tab_enabled,omitempty"`
	MessagesTabEnabled         *bool `json:"messages_tab_enabled,omitempty" yaml:"messages_tab_enabled,omitempty"`
	MessagesTabReadOnlyEnabled *bool `json:"messages_tab_read_only_enabled,omitempty" yaml:"messages_tab_read_only_enabled,omitempty"`
}

ManifestAppHome

type ManifestAttribute

type ManifestAttribute struct {
	Type        string   `json:"type,omitempty" yaml:"type,omitempty"`
	Description string   `json:"description,omitempty" yaml:"description,omitempty"`
	Items       *RawJSON `json:"items,omitempty" yaml:"items,flow,omitempty"`
	Properties  *RawJSON `json:"properties,omitempty" yaml:"properties,flow,omitempty"`
}

ManifestAttribute defines the structure of a datastore attribute in the app manifest.

type ManifestAuthProviders

type ManifestAuthProviders struct {
	OAuth2 map[string]*RawJSON `json:"oauth2" yaml:"oauth2"`
}

type ManifestDatastore

type ManifestDatastore struct {
	PrimaryKey          string                       `json:"primary_key,omitempty" yaml:"primary_key,omitempty"`
	TimeToLiveAttribute string                       `json:"time_to_live_attribute,omitempty" yaml:"time_to_live_attribute,omitempty"`
	Attributes          map[string]ManifestAttribute `json:"attributes,omitempty" yaml:"attributes,flow,omitempty"`
}

ManifestDatastore defines the structure of a datastore in the app manifest.

type ManifestEventSubscriptions

type ManifestEventSubscriptions struct {
	RequestURL            string                 `json:"request_url,omitempty" yaml:"request_url,omitempty"`
	UserEvents            []string               `json:"user_events,omitempty" yaml:"user_events,flow,omitempty"`
	BotEvents             []string               `json:"bot_events,omitempty" yaml:"bot_events,flow,omitempty"`
	MetadataSubscriptions []MetadataSubscription `json:"metadata_subscriptions,omitempty" yaml:"metadata_subscriptions,flow,omitempty"`
}

ManifestEventSubscriptions

type ManifestFunction

type ManifestFunction struct {
	Title            string   `json:"title" yaml:"title"`
	Description      string   `json:"description" yaml:"description"`
	Type             string   `json:"type,omitempty" yaml:"type,omitempty"`
	Bindings         *RawJSON `json:"bindings,omitempty" yaml:"bindings,omitempty"`
	InputParameters  *RawJSON `json:"input_parameters" yaml:"input_parameters,flow"`
	OutputParameters *RawJSON `json:"output_parameters" yaml:"output_parameters,flow"`
}

ManifestFunction defines the structure of a function in the app manifest.

type ManifestInteractivity

type ManifestInteractivity struct {
	IsEnabled             bool   `json:"is_enabled" yaml:"is_enabled"`
	RequestURL            string `json:"request_url,omitempty" yaml:"request_url,omitempty"`
	MessageMenuOptionsURL string `json:"message_menu_options_url,omitempty" yaml:"message_menu_options_url,omitempty"`
}

type ManifestMetadata

type ManifestMetadata struct {
	MajorVersion uint64 `json:"major_version,omitempty" yaml:"major_version,omitempty"`
	MinorVersion uint64 `json:"minor_version,omitempty" yaml:"minor_version,omitempty"`
}

type ManifestOAuth2ProviderOptions

type ManifestOAuth2ProviderOptions struct {
	AuthorizationURL       string            `json:"authorization_url" yaml:"authorization_url,flow"`
	ClientID               string            `json:"client_id" yaml:"client_id,flow"`
	TokenURL               string            `json:"token_url" yaml:"token_url,flow"`
	Scope                  []string          `json:"scope" yaml:"scope,flow"`
	ProviderName           string            `json:"provider_name" yaml:"provider_name,flow"`
	IdentityConfig         *RawJSON          `json:"identity_config" yaml:"identity_config,flow"`
	AuthorizationURLExtras map[string]string `json:"authorization_url_extras,omitempty" yaml:"authorization_url_extras,omitempty,flow"`
}

type ManifestScopes

type ManifestScopes struct {
	Bot  []string `json:"bot,omitempty" yaml:"bot,flow,omitempty"`
	User []string `json:"user,omitempty" yaml:"user,flow,omitempty"`
}

ManifestScopes

type ManifestShortcutsItem

type ManifestShortcutsItem struct {
	CallbackID  string            `json:"callback_id" yaml:"callback_id"`
	Description string            `json:"description" yaml:"description"`
	Name        string            `json:"name" yaml:"name"`
	Type        ShortcutScopeType `json:"type" yaml:"type"`
}

ManifestShortcutsItem

type ManifestSlashCommandsItem

type ManifestSlashCommandsItem struct {
	Command      string `json:"command" yaml:"command"`
	URL          string `json:"url,omitempty" yaml:"url,omitempty"`
	Description  string `json:"description" yaml:"description"`
	ShouldEscape *bool  `json:"should_escape,omitempty" yaml:"should_escape,omitempty"`
	UsageHint    string `json:"usage_hint,omitempty" yaml:"usage_hint,omitempty"`
}

ManifestSlashCommandsItem

type MetadataSubscription

type MetadataSubscription struct {
	AppID     string `json:"app_id" yaml:"app_id"`
	EventType string `json:"event_type" yaml:"event_type"`
}

type NonRotatableAuth

type NonRotatableAuth struct {
	Token string `json:"token,omitempty"`
}

type OAuthConfig

type OAuthConfig struct {
	RedirectURLs           []string        `json:"redirect_urls,omitempty" yaml:"redirect_urls,flow,omitempty"`
	Scopes                 *ManifestScopes `json:"scopes,omitempty" yaml:"scopes,flow,omitempty"`
	TokenManagementEnabled *bool           `json:"token_management_enabled,omitempty" yaml:"token_management_enabled,omitempty"`
}

type Os

type Os interface {
	// Getenv defaults to `os.Getenv` and can be mocked to test
	Getenv(key string) (value string)

	// LookPath defaults to `os.LookPath` and can be mocked to test
	LookPath(file string) (path string, err error)

	// LookupEnv defaults to `os.LookupEnv` and can be mocked to test
	LookupEnv(key string) (value string, present bool)

	// Setenv defaults to `os.Setenv` and can be mocked to test
	Setenv(key string, value string) error

	// Getwd defaults to `os.Getwd` and can be mocked to test
	Getwd() (dir string, err error)

	// UserHomeDir returns the current user's home directory and can be mocked to test
	UserHomeDir() (dir string, err error)

	// GetExecutionDir returns the absolute path where the process started execution
	GetExecutionDir() string

	// SetExecutionDir sets the absolute path where the process started execution
	SetExecutionDir(dirPathAbs string)

	// IsNotExist returns a boolean indicating whether the provided error is known to report that a file or directory does not exist
	IsNotExist(error) bool

	// Glob returns the names of all files matching pattern or nil if there is no matching file. The syntax of patterns is the same as in Match.
	// Reference: https://pkg.go.dev/path/filepath#Glob
	Glob(pattern string) (matches []string, err error)

	// Exit causes the program to exit and return with the status code
	Exit(code int)

	// Stdout returns the file descriptor for stdout
	Stdout() File
}

Os are a group of operating system functions following the `os` interface that are shared by all packages and enables testing & mocking

type Permission

type Permission string
const (
	PermissionNamedEntities    Permission = "named_entities"
	PermissionAppCollaborators Permission = "app_collaborators"
	PermissionEveryone         Permission = "everyone"
)

Consumed in function distribution ACLs and trigger run ACLs distribution type or access/permission type: 'everyone' | 'app_collaborators' | 'named_entities';

func (Permission) IsValid

func (d Permission) IsValid() bool

func (Permission) ToString

func (d Permission) ToString() (userFriendlyString string)

type PreparePackageOpts

type PreparePackageOpts struct {
	SrcDirPath string
	DstDirPath string
	AuthTokens string
}

PreparePackageOpts contains options provided to the "BuildProject" hook at runtime

type ProviderData

type ProviderData struct {
	ProviderType string                         `json:"provider_type" yaml:"provider_type,flow"`
	Options      *ManifestOAuth2ProviderOptions `json:"options" yaml:"options,flow"`
}

type ProviderExternalAuthorizationInfo

type ProviderExternalAuthorizationInfo struct {
	ProviderName string `json:"provider_name" yaml:"provider_name,flow"`
	ProviderKey  string `json:"provider_key" yaml:"provider_key,flow"`
	SelectedAuth string `json:"selected_auth" yaml:"selected_auth,omitempty"`
}

type ProvidersInfo

type ProvidersInfo struct {
	ProviderName string            `json:"provider_name" yaml:"provider_name,flow"`
	ProviderKey  string            `json:"provider_key" yaml:"provider_key,flow"`
	SelectedAuth ExternalTokenInfo `json:"selected_auth,omitempty" yaml:"selected_auth,omitempty,flow"`
}

type RawJSON

type RawJSON struct {
	Data     *yaml.MapSlice
	JSONData *json.RawMessage
}

func ToRawJSON

func ToRawJSON(obj string) *RawJSON

ToRawJSON converts a string to types.RawJSON

func (*RawJSON) MarshalJSON

func (r *RawJSON) MarshalJSON() ([]byte, error)

TODO (@kattari) Should we remove this? It's not used anywhere.

func (*RawJSON) UnmarshalJSON

func (r *RawJSON) UnmarshalJSON(data []byte) error

func (*RawJSON) UnmarshalYAML

func (r *RawJSON) UnmarshalYAML(unmarshal func(interface{}) error) error

type RawTriggerDefinition

type RawTriggerDefinition struct {
	Key        string          `json:"key" yaml:"key"`
	TriggerRaw json.RawMessage `json:"trigger" yaml:"trigger"`
	Access     TriggerAccess   `json:"access,omitempty" yaml:"access,omitempty"`
}

RawTriggerDefinition type stores the trigger as raw JSON to handle untyped triggers

type RichPreviews

type RichPreviews struct {
	EntityTypes []string `json:"entity_types,omitempty" yaml:"entity_types,flow,omitempty"`
	IsActive    bool     `json:"is_active,omitempty" yaml:"is_active,flow,omitempty"`
}
type Search struct {
	SearchFunctionCallbackID        string `json:"search_function_callback_id,omitempty" yaml:"search_function_callback_id,omitempty"`
	SearchFiltersFunctionCallbackID string `json:"search_filters_function_callback_id,omitempty" yaml:"search_filters_function_callback_id,omitempty"`
	EnableAIAnswers                 *bool  `json:"enable_ai_answers,omitempty" yaml:"enable_ai_answers,omitempty"`
}

Search contains the search function of an app.

type SelectedAuthInfo

type SelectedAuthInfo struct {
	ExternalTokenID string `json:"external_token_id" yaml:"external_token_id,flow"`
	ExternalUserID  string `json:"external_user_id" yaml:"external_user_id,flow"`
	DateUpdated     string `json:"date_updated" yaml:"date_updated,flow"`
}

type ShortcutScopeType

type ShortcutScopeType string
type SiwsLinks struct {
	InitiateURI string `json:"initiate_uri,omitempty" yaml:"initiate_uri,omitempty"`
}

type SlackAuth

type SlackAuth struct {
	Token               string    `json:"token,omitempty"`
	TeamDomain          string    `json:"team_domain"`
	TeamID              string    `json:"team_id"`
	EnterpriseID        string    `json:"enterprise_id,omitempty"`
	UserID              string    `json:"user_id"`
	LastUpdated         time.Time `json:"last_updated,omitempty"`
	APIHost             *string   `json:"api_host,omitempty"`
	RefreshToken        string    `json:"refresh_token,omitempty"`
	ExpiresAt           int       `json:"exp,omitempty"`
	IsEnterpriseInstall bool      `json:"is_enterprise_install,omitempty"`
}

SlackAuth represents an authorization for the CLI to make requests of particular Slack team (workspace or organization) on behalf of the authorizing user.

A SlackAuth is created by logging in with the CLI via the `login` command

func (*SlackAuth) AuthLevel

func (a *SlackAuth) AuthLevel() string

AuthLevel returns the authorization level of a specific SlackAuth, e.g. organization or workspace level

func (*SlackAuth) ShouldRotateToken

func (a *SlackAuth) ShouldRotateToken() bool

ShouldRotateToken returns true if an auth credential can be rotated and also expires in <= 5min

func (*SlackAuth) TokenIsExpired

func (a *SlackAuth) TokenIsExpired() bool

TokenIsExpired returns true if an auth credential is expired or not

type SlackChannel

type SlackChannel struct {
	ID          string `json:"channel_id,omitempty" yaml:"channel_id,omitempty"`
	ChannelName string `json:"channel_name,omitempty" yaml:"channel_name,omitempty"`
}

func (*SlackChannel) String

func (c *SlackChannel) String() string

type SlackTeam

type SlackTeam struct {
	ID       string `json:"team_id,omitempty" yaml:"team_id,omitempty"`
	TeamName string `json:"team_name,omitempty" yaml:"team_name,omitempty"`
}

func (*SlackTeam) String

func (c *SlackTeam) String() string

type SlackUser

type SlackUser struct {
	ID             string                    `json:"user_id,omitempty" yaml:"user_id,omitempty"`
	Email          string                    `json:"user_email,omitempty" yaml:"user_email,omitempty"`
	UserName       string                    `json:"username,omitempty" yaml:"username,omitempty"`
	PermissionType AppCollaboratorPermission `json:"permission_type,omitempty" yaml:"permission_type,omitempty"`
}

func (*SlackUser) ShorthandF

func (u *SlackUser) ShorthandF() string

collaboratorShorthandF returns either the email or ID of the collaborator

func (*SlackUser) String

func (u *SlackUser) String() string

String returns a string representation of all SlackUser attributes

type SlackYaml

type SlackYaml struct {
	AppManifest `yaml:",inline"`
	Icon        string `yaml:"icon"`
	Hash        string
}

func (*SlackYaml) Verify

func (sy *SlackYaml) Verify() error

Verify checks that the app manifest meets some basic requirements

type Step

type Step struct {
	ID         string   `json:"id" yaml:"id"`
	FunctionID string   `json:"function_id" yaml:"function_id"`
	Inputs     *RawJSON `json:"inputs" yaml:"inputs,flow"`
}

Step defines the structure of a step in the app manifest.

type SuggestedPrompts

type SuggestedPrompts struct {
	Title   string `json:"title,omitempty" yaml:"title,omitempty"`
	Message string `json:"message,omitempty" yaml:"message,omitempty"`
}

type SuggestedTrigger

type SuggestedTrigger struct {
	Type        string            `json:"type" yaml:"type"`
	Name        string            `json:"name,omitempty" yaml:"name,omitempty"`
	Description string            `json:"description,omitempty" yaml:"description,omitempty"`
	Inputs      map[string]string `json:"inputs" yaml:"inputs,flow"`
}

SuggestedTrigger defines the structure of a suggested trigger in the app manifest.

type TeamInfo

type TeamInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Team model with fields that match what is returned from the team.info method Method documentation: https://docs.slack.dev/reference/methods/team.info

type Trigger

type Trigger struct {
	Type              string          `json:"type" yaml:"type"`                             // all
	FunctionAppID     string          `json:"function_app_id" yaml:"function_app_id"`       // all
	FunctionRef       string          `json:"function_reference" yaml:"function_reference"` // all
	Name              *string         `json:"name,omitempty" yaml:"name"`                   // shortcut, slash_command, message_shortcut
	Description       *string         `json:"description,omitempty" yaml:"description"`     // shortcut, slash_command, message_shortcut
	EventType         *string         `json:"event_type,omitempty"`                         // event
	MetadataEventType *string         `json:"metadata_event_type,omitempty"`                // event
	Schedule          *RawJSON        `json:"schedule,omitempty" yaml:"schedule"`           // scheduled
	Inputs            *RawJSON        `json:"inputs" yaml:"inputs,flow"`                    // all
	Filter            *RawJSON        `json:"filter,omitempty" yaml:"filter,flow"`          // all
	ChannelIDs        []string        `json:"channel_ids,omitempty" yaml:"channel_ids"`     // all
	RawMessage        json.RawMessage `json:"-" yaml:"-"`                                   // "-" will always omit
}

Trigger type is accepted by the `functions.triggers.*` methods

func (*Trigger) IsKnownType

func (t *Trigger) IsKnownType() bool

IsKnownType returns true if Trigger.Type is a known and supported type

type TriggerAccess

type TriggerAccess struct {
	UserIDs []string `json:"user_ids,omitempty" yaml:"user_ids,omitempty"`
}

TriggerAccess type describes the access for a particular trigger

type TriggerCreateMutation

type TriggerCreateMutation struct {
	Error   error
	Trigger TriggerDefinition
}

TriggerCreateMutation type is used by the CLI when calling the app hook 'triggers'

type TriggerDefinition

type TriggerDefinition struct {
	Key     string        `json:"key" yaml:"key"`
	Trigger *Trigger      `json:"trigger,omitempty" yaml:"trigger,omitempty"`
	Access  TriggerAccess `json:"access,omitempty" yaml:"access,omitempty"`
}

TriggerDefinition type is returned by the SDK hook 'triggers'

type TriggerDeleteMutation

type TriggerDeleteMutation struct {
	Error      error
	TriggerKey string
	TriggerID  string
}

TriggerDeleteMutation type is used by the CLI when calling the app hook 'triggers'

type TriggerMutations

type TriggerMutations struct {
	Create []TriggerCreateMutation
	Update []TriggerUpdateMutation
	Delete []TriggerDeleteMutation
}

TriggerMutations type is populated by the CLI when calling the app hook 'triggers'

type TriggerSyncOptions

type TriggerSyncOptions struct {
	App        App
	DeleteAll  bool
	Manifest   AppManifest
	AuthTokens string
}

type TriggerUpdateMutation

type TriggerUpdateMutation struct {
	Error     error
	TriggerID string
	Trigger   TriggerDefinition
}

TriggerUpdateMutation type is used by the CLI when calling the app hook 'triggers'

type TriggerWorkflow

type TriggerWorkflow struct {
	ID          string `json:"id"`
	CallbackID  string `json:"callback_id"`
	Title       string `json:"title"`
	Type        string `json:"type"`
	Description string `json:"description"`
	AppID       string `json:"app_id"`
	App         struct {
		ID    string `json:"id"`
		Name  string `json:"name"`
		Icons Icons  `json:"icons"`
	}
	InputParameters  *RawJSON `json:"input_parameters"`
	OutputParameters *RawJSON `json:"output_parameters"`
}

type UserInfo

type UserInfo struct {
	ID       string      `json:"id"`
	Name     string      `json:"name"`
	RealName string      `json:"real_name"`
	Profile  UserProfile `json:"profile"`
}

User model with fields that match what is returned from the users.info method Method documentation: https://docs.slack.dev/reference/methods/users.info

type UserProfile

type UserProfile struct {
	DisplayName string `json:"display_name"`
}

type Workflow

type Workflow struct {
	Title             string             `json:"title" yaml:"title"`
	Description       string             `json:"description" yaml:"description"`
	InputParameters   *RawJSON           `json:"input_parameters,omitempty" yaml:"input_parameters,flow,omitempty"`
	Steps             []Step             `json:"steps" yaml:"steps,flow"`
	SuggestedTriggers []SuggestedTrigger `json:"suggested_triggers,omitempty" yaml:"suggested_triggers,flow,omitempty"`
}

Workflow defines the structure of a workflow in the app manifest.

type WorkflowExternalAuthorizationInfo

type WorkflowExternalAuthorizationInfo struct {
	WorkflowID string                              `json:"workflow_id" yaml:"workflow_id,flow"`
	CallbackID string                              `json:"callback_id" yaml:"callback_id,flow"`
	Providers  []ProviderExternalAuthorizationInfo `json:"providers" yaml:"providers,flow"`
}

type WorkflowStep

type WorkflowStep struct {
	Name       string `json:"name" yaml:"name"`
	CallbackID string `json:"callback_id" yaml:"callback_id"`
}

type WorkflowsInfo

type WorkflowsInfo struct {
	WorkflowID string          `json:"workflow_id" yaml:"workflow_id,flow"`
	CallbackID string          `json:"callback_id" yaml:"callback_id,flow"`
	Providers  []ProvidersInfo `json:"providers" yaml:"providers,flow"`
}

type YAMLUnmarshalerMock

type YAMLUnmarshalerMock struct {
	mock.Mock
}

YAMLUnmarshalerMock implements the yaml unmarshal interface

Jump to

Keyboard shortcuts

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