Documentation
¶
Index ¶
- Constants
- func GetAccessTypeDescriptionForEveryone(app App) string
- func IsAppFlagDeploy(str string) bool
- func IsAppFlagEnvironment(str string) bool
- func IsAppFlagLocal(str string) bool
- func IsAppFlagValid(str string) bool
- func IsAppID(str string) bool
- func IsEnterpriseTeamID(str string) bool
- func IsNamedEntityFlag(flags *pflag.FlagSet) bool
- func IsTeamID(str string) bool
- func IsWorkspaceTeamID(str string) bool
- type ActivityArgs
- type ActivityLevel
- type ActivityRequest
- type App
- type AppCollaboratorPermission
- type AppDatastoreBulkDelete
- type AppDatastoreBulkDeleteResult
- type AppDatastoreBulkGet
- type AppDatastoreBulkGetResult
- type AppDatastoreBulkPut
- type AppDatastoreBulkPutResult
- type AppDatastoreCount
- type AppDatastoreCountResult
- type AppDatastoreDelete
- type AppDatastoreDeleteResult
- type AppDatastoreGet
- type AppDatastoreGetResult
- type AppDatastorePut
- type AppDatastorePutResult
- type AppDatastoreQuery
- type AppDatastoreQueryResult
- type AppDatastoreUpdate
- type AppDatastoreUpdateResult
- type AppDirectory
- type AppFeatures
- type AppInstallationStatus
- type AppManifest
- type AppSettings
- type Apps
- func (a *Apps) GetAllDeployedApps() ([]App, string)
- func (a *Apps) GetAllLocalApps() []App
- func (a *Apps) GetDeployedByTeamDomain(teamDomain string) App
- func (a *Apps) GetDeployedByTeamID(teamID string) App
- func (a *Apps) GetLocalByTeamID(teamID string) App
- func (a *Apps) IsEmpty() bool
- func (a *Apps) MapByTeamID(apps map[string]App) (appsByTeamID map[string]App, err error)
- func (a *Apps) RemoveDeployedByTeamID(teamID string)
- func (a *Apps) RemoveLocalByTeamID(teamID string)
- func (a *Apps) Set(app App) error
- func (a *Apps) SetLocal(app App) error
- type AssistantView
- type AuthByTeamDomain
- type AuthByTeamID
- type BotUser
- type ChannelInfo
- type Constraint
- type Datastorer
- type DeployedTrigger
- type DisplayInformation
- type EnterpriseGrant
- type EnvVariable
- type EventType
- type ExternalAuthorizationInfo
- type ExternalAuthorizationInfoLists
- type ExternalTokenInfo
- type File
- type Function
- type FunctionDistributionUser
- type FunctionPermissions
- type FunctionRuntime
- type Icons
- type IncomingWebhooks
- type InstallState
- type ManifestAppHome
- type ManifestAttribute
- type ManifestAuthProviders
- type ManifestDatastore
- type ManifestEventSubscriptions
- type ManifestFunction
- type ManifestInteractivity
- type ManifestMetadata
- type ManifestOAuth2ProviderOptions
- type ManifestScopes
- type ManifestShortcutsItem
- type ManifestSlashCommandsItem
- type MetadataSubscription
- type NonRotatableAuth
- type OAuthConfig
- type Os
- type Permission
- type PreparePackageOpts
- type ProviderData
- type ProviderExternalAuthorizationInfo
- type ProvidersInfo
- type RawJSON
- type RawTriggerDefinition
- type RichPreviews
- type Search
- type SelectedAuthInfo
- type ShortcutScopeType
- type SiwsLinks
- type SlackAuth
- type SlackChannel
- type SlackTeam
- type SlackUser
- type SlackYaml
- type Step
- type SuggestedPrompts
- type SuggestedTrigger
- type TeamInfo
- type Trigger
- type TriggerAccess
- type TriggerCreateMutation
- type TriggerDefinition
- type TriggerDeleteMutation
- type TriggerMutations
- type TriggerSyncOptions
- type TriggerUpdateMutation
- type TriggerWorkflow
- type UserInfo
- type UserProfile
- type Workflow
- type WorkflowExternalAuthorizationInfo
- type WorkflowStep
- type WorkflowsInfo
- type YAMLUnmarshalerMock
Constants ¶
const ( TriggerTypeShortcut = "shortcut" TriggerTypeSlashCommand = "slash_command" TriggerTypeMessageShortcut = "message_shortcut" TriggerTypeEvent = "event" TriggerTypeWebhook = "webhook" TriggerTypeScheduled = "scheduled" )
Supported trigger types
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
const AuthLevelWorkspace = "workspace"
const GrantAllOrgWorkspaces = "all"
const SchemaVersion = 1
Variables ¶
This section is empty.
Functions ¶
func GetAccessTypeDescriptionForEveryone ¶
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 ¶
IsAppFlagDeploy returns if the flag represents the deployed app environment
func IsAppFlagEnvironment ¶
IsAppFlagEnvironment returns if the flag denotes the local or deployed app
func IsAppFlagLocal ¶
IsAppFlagLocal returns if the flag represents the local app environment
func IsAppFlagValid ¶
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 ¶
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 ¶
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 ¶
isNamedEntityFlag returns true if named entity flags are set
func IsTeamID ¶
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 ¶
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 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 (*App) IsEnterpriseApp ¶
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 ¶
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 ¶
IsInstalled returns true if the app's installation status indicates that it is installed
func (*App) IsNew ¶
IsNew returns whether the app hasn't been written to the file system yet (e.g. apps.json / apps.dev.json)
func (*App) IsUninstalled ¶
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 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 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 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 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 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 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 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 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 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 ¶
GetAllDeployedApps returns all deployed Apps
func (*Apps) GetAllLocalApps ¶
GetAllLocalApps returns all local Apps in apps.dev.json
func (*Apps) GetDeployedByTeamDomain ¶
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 ¶
GetDeployedByTeamID returns an existing deployed App by teamID, otherwise, returns a new instance of App
func (*Apps) GetLocalByTeamID ¶
GetLocalByTeamID returns a dev App based on the provided teamID; if it doesn't exist, returns a new App
func (*Apps) MapByTeamID ¶
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 ¶
RemoveDeployedByTeamID removes the deployed App that corresponds to the provided teamID
func (*Apps) RemoveLocalByTeamID ¶
RemoveLocalByTeamID removes the local App associated with 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 ¶
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 ¶
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 ChannelInfo ¶
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 EnvVariable ¶
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 File ¶
type File interface {
// Stat returns the FileInfo that describes a file
Stat() (os.FileInfo, error)
}
File represents an open file descriptor
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 ¶
func (Icons) MarshalJSON ¶
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 ¶
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 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 ManifestMetadata ¶
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 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 ¶
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 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 (*RawJSON) MarshalJSON ¶
TODO (@kattari) Should we remove this? It's not used anywhere.
func (*RawJSON) UnmarshalJSON ¶
func (*RawJSON) UnmarshalYAML ¶
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 Search ¶
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 ShortcutScopeType ¶
type ShortcutScopeType string
type SiwsLinks ¶
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 ¶
AuthLevel returns the authorization level of a specific SlackAuth, e.g. organization or workspace level
func (*SlackAuth) ShouldRotateToken ¶
ShouldRotateToken returns true if an auth credential can be rotated and also expires in <= 5min
func (*SlackAuth) TokenIsExpired ¶
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 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 ¶
collaboratorShorthandF returns either the email or ID of the collaborator
type SlackYaml ¶
type SlackYaml struct {
AppManifest `yaml:",inline"`
Icon string `yaml:"icon"`
Hash string
}
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 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 ¶
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 ¶
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 ¶
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 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 ¶
YAMLUnmarshalerMock implements the yaml unmarshal interface