Skip to content

v0.19.0

Choose a tag to compare

@soxtoby soxtoby released this 19 Oct 05:55
· 73 commits to master since this release

This release adds support for custom workflow functions and dynamic credential providers (which should make it easier to support multiple Slack apps and workspaces). Both of these required some subtle breaking changes, so be sure to check the section below.

Custom step functions that return dynamic options need to complete before acknowledging the event, so I've introduced an experimental IEventHandler<T> interface, which provides access to the typed event, the EventCallback, and a manual Acknowledge function. This can be used for any event type though, so you might find it useful outside of custom step functions.

  • Added dynamic credential providers:
    • UseApiTokenProvider for Web API requests.
    • UseAppLevelTokenProvider for app-level API requests.
    • UseSigningSecretProvider and UseVerificationTokenProvider for ASP.NET Core request validation.
  • Added request type, app, workspace and enterprise IDs to SlackRequestContext. API token providers also receive the API method, arguments and originating request.
  • Added experimental context-aware event handlers, with callback metadata and control over acknowledgement.
  • Added support for custom workflow functions:
    • FunctionExecuted event.
    • FunctionsApi.CompleteSuccess and CompleteError.
    • FunctionDistributionPermissionsApi.
    • FunctionWorkflowStepsApi, including form-response exports.
    • WorkflowsFeaturedApi and WorkflowTriggerPermissionsApi.
  • Added function execution data, bot access tokens and interactivity pointers to interaction requests. Block option requests also expose function execution data and bot access tokens.
  • Added interactivity-pointer support to ViewsApi.Open and Push.
  • Added AgentsSessionsApi.SetStatus and AgentSessionStopped.
  • Added chunks, task display mode, icon and username overrides to message streaming. StopStream also supports setting the agent session status.
  • Added TaskCardBlock, PlanBlock, CardBlock, CarouselBlock, ContainerBlock, AlertBlock, DataTableBlock and DataVisualizationBlock, with supporting icons, URL sources and chart types.
  • Added RawNumberCell and RichTextPreformatted.Language.
  • Added AppContextChanged, AppHomeOpened.Context and MessageEvent.AppContext.
  • Added MessageDeleted.PreviousMessage, and UserTeam and SourceTeam to message events.
  • Added MetadataJson and MetadataObject to MessageUpdate.
  • Added BotId and EnterpriseId to AuthTestResponse.
  • Added codeVerifier to OAuthV2Api.Access for PKCE.
  • Added an AssistantThreadsApi.SetSuggestedPrompts overload without a thread timestamp, for the Messages tab.
  • Date-like strings remain strings when deserializing untyped JSON.
  • ASP.NET Core only creates the hosted Socket Mode client when enabled, and cleans up request scopes when handlers fail.

Breaking changes

  • Renamed ISlackApiClient.AppsConnectionsApi to AppsConnections.
  • Removed deprecated configuration from SlackEndpointConfiguration:
    • Move UseSigningSecret, VerifyWith, UseEventUrlVerification and UseSocketMode into the AddSlackNet callback.
    • Pass connection options to UseSocketMode.
    • Keep MapToPrefix and DelayResponse in UseSlackNet. UseSocketMode now returns the service configuration.
  • Removed ISlackRequestValidationConfiguration. Custom validation configuration should use ISlackSigningSecretProvider and/or ISlackVerificationTokenProvider.
  • Configured signing secrets and verification tokens returning null or an empty string now reject requests.
  • ReplaceEventHandling, ISlackHandlerFactory.CreateEventHandler and SlackRequestContext.EventHandlers now use SlackNet.Handlers.Experimental.IEventHandler<Event>. Implement Handle(IEventContext<Event>), or adapt existing handlers with .ToEventHandler(). Existing RegisterEventHandler registrations continue to work.
  • ISlackServiceProvider implementations must provide GetApiTokenProvider() and GetAppLevelTokenProvider().
  • New parameters precede cancellationToken in OAuthV2Api.Access and ChatApi.StartStream, AppendStream and StopStream. Pass cancellation tokens by name, e.g. cancellationToken: token, and rebuild dependent projects.
  • Set SlackRequestContext.RequestId through its initializer; setting the corresponding dictionary entry no longer updates it.
  • Custom API clients must supply their own app-level token for Socket Mode to work.
  • Code relying on automatic date conversion in untyped JSON should parse date strings explicitly.
  • Deprecated trigger-first ViewsApi.Open and Push overloads. Use Open(view, triggerId: triggerId) and Push(view, triggerId: triggerId).
  • Deprecated the SlackApiClient constructor accepting HTTP dependencies and a token string. Use the constructor accepting separate API-token and app-level-token providers.

A big thanks to @enhancer13, @vgribok-aws, and @we4sz for their help with this release 🥳