leash-integration-slack 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/leash/integration/slack.rb +122 -0
- metadata +57 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 8854cd0d9e0234e154a665ecfde8b6e0e94c92944d7ca61cfd739851f5ea4aad
|
|
4
|
+
data.tar.gz: 70a376d518e1e15d0a9496a0ffdf038c610c5d5a71af3034789f4b7fd5e8100f
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: c1f8c3feafd1f2cc67093624dcada395a49efd6d6c7e115250f0c23ad5abb632a8043322d76ded3c0b6966a9dbdd24e32c7c408b5cbbd0814d4794da47932ea4
|
|
7
|
+
data.tar.gz: 0acffd0dbaf8cd8584c4aa360d576d6fd5d697f09332b380f63dadd80fd7419fb738c195c7120c113404c2f58fbe3751d471933bc9d6b20a81dcb88f8c004e29
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Auto-generated by leash-codegen — do not edit manually
|
|
4
|
+
|
|
5
|
+
module Leash
|
|
6
|
+
module Integration
|
|
7
|
+
class SlackClient
|
|
8
|
+
# Create a new Slack integration client.
|
|
9
|
+
#
|
|
10
|
+
# @param leash [Leash::Client] the Leash SDK client
|
|
11
|
+
def initialize(leash)
|
|
12
|
+
@leash = leash
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# List public or pre-defined channels in the workspace with pagination
|
|
16
|
+
#
|
|
17
|
+
# @param limit [Float, nil] Maximum number of channels to return (default 100, max 200)
|
|
18
|
+
# @param cursor [String, nil] Pagination cursor for next page of results
|
|
19
|
+
# @return [Object]
|
|
20
|
+
def slack_list_channels(limit: nil, cursor: nil)
|
|
21
|
+
params = {
|
|
22
|
+
'limit' => limit,
|
|
23
|
+
'cursor' => cursor
|
|
24
|
+
}.compact
|
|
25
|
+
@leash.call('slack', 'slack_list_channels', params)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Post a new message to a Slack channel
|
|
29
|
+
#
|
|
30
|
+
# @param channel_id [String] The ID of the channel to post to
|
|
31
|
+
# @param text [String] The message text to post
|
|
32
|
+
# @return [Object]
|
|
33
|
+
def slack_post_message(channel_id, text)
|
|
34
|
+
params = {
|
|
35
|
+
'channel_id' => channel_id,
|
|
36
|
+
'text' => text
|
|
37
|
+
}.compact
|
|
38
|
+
@leash.call('slack', 'slack_post_message', params)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Reply to a specific message thread in Slack
|
|
42
|
+
#
|
|
43
|
+
# @param channel_id [String] The ID of the channel containing the thread
|
|
44
|
+
# @param thread_ts [String] The timestamp of the parent message in the format '1234567890.123456'. Timestamps in the format without the period can be converted by adding the period such that 6 numbers come after it.
|
|
45
|
+
# @param text [String] The reply text
|
|
46
|
+
# @return [Object]
|
|
47
|
+
def slack_reply_to_thread(channel_id, thread_ts, text)
|
|
48
|
+
params = {
|
|
49
|
+
'channel_id' => channel_id,
|
|
50
|
+
'thread_ts' => thread_ts,
|
|
51
|
+
'text' => text
|
|
52
|
+
}.compact
|
|
53
|
+
@leash.call('slack', 'slack_reply_to_thread', params)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Add a reaction emoji to a message
|
|
57
|
+
#
|
|
58
|
+
# @param channel_id [String] The ID of the channel containing the message
|
|
59
|
+
# @param timestamp [String] The timestamp of the message to react to
|
|
60
|
+
# @param reaction [String] The name of the emoji reaction (without ::)
|
|
61
|
+
# @return [Object]
|
|
62
|
+
def slack_add_reaction(channel_id, timestamp, reaction)
|
|
63
|
+
params = {
|
|
64
|
+
'channel_id' => channel_id,
|
|
65
|
+
'timestamp' => timestamp,
|
|
66
|
+
'reaction' => reaction
|
|
67
|
+
}.compact
|
|
68
|
+
@leash.call('slack', 'slack_add_reaction', params)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Get recent messages from a channel
|
|
72
|
+
#
|
|
73
|
+
# @param channel_id [String] The ID of the channel
|
|
74
|
+
# @param limit [Float, nil] Number of messages to retrieve (default 10)
|
|
75
|
+
# @return [Object]
|
|
76
|
+
def slack_get_channel_history(channel_id, limit: nil)
|
|
77
|
+
params = {
|
|
78
|
+
'channel_id' => channel_id,
|
|
79
|
+
'limit' => limit
|
|
80
|
+
}.compact
|
|
81
|
+
@leash.call('slack', 'slack_get_channel_history', params)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Get all replies in a message thread
|
|
85
|
+
#
|
|
86
|
+
# @param channel_id [String] The ID of the channel containing the thread
|
|
87
|
+
# @param thread_ts [String] The timestamp of the parent message in the format '1234567890.123456'. Timestamps in the format without the period can be converted by adding the period such that 6 numbers come after it.
|
|
88
|
+
# @return [Object]
|
|
89
|
+
def slack_get_thread_replies(channel_id, thread_ts)
|
|
90
|
+
params = {
|
|
91
|
+
'channel_id' => channel_id,
|
|
92
|
+
'thread_ts' => thread_ts
|
|
93
|
+
}.compact
|
|
94
|
+
@leash.call('slack', 'slack_get_thread_replies', params)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Get a list of all users in the workspace with their basic profile information
|
|
98
|
+
#
|
|
99
|
+
# @param cursor [String, nil] Pagination cursor for next page of results
|
|
100
|
+
# @param limit [Float, nil] Maximum number of users to return (default 100, max 200)
|
|
101
|
+
# @return [Object]
|
|
102
|
+
def slack_get_users(cursor: nil, limit: nil)
|
|
103
|
+
params = {
|
|
104
|
+
'cursor' => cursor,
|
|
105
|
+
'limit' => limit
|
|
106
|
+
}.compact
|
|
107
|
+
@leash.call('slack', 'slack_get_users', params)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Get detailed profile information for a specific user
|
|
111
|
+
#
|
|
112
|
+
# @param user_id [String] The ID of the user
|
|
113
|
+
# @return [Object]
|
|
114
|
+
def slack_get_user_profile(user_id)
|
|
115
|
+
params = {
|
|
116
|
+
'user_id' => user_id
|
|
117
|
+
}.compact
|
|
118
|
+
@leash.call('slack', 'slack_get_user_profile', params)
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: leash-integration-slack
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Leash
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-04-14 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: leash-sdk
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 0.2.0
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 0.2.0
|
|
27
|
+
description: Auto-generated typed client for the Slack integration on Leash.
|
|
28
|
+
email:
|
|
29
|
+
executables: []
|
|
30
|
+
extensions: []
|
|
31
|
+
extra_rdoc_files: []
|
|
32
|
+
files:
|
|
33
|
+
- lib/leash/integration/slack.rb
|
|
34
|
+
homepage: https://github.com/leash-build/leash-codegen
|
|
35
|
+
licenses:
|
|
36
|
+
- Apache-2.0
|
|
37
|
+
metadata: {}
|
|
38
|
+
post_install_message:
|
|
39
|
+
rdoc_options: []
|
|
40
|
+
require_paths:
|
|
41
|
+
- lib
|
|
42
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: 2.7.0
|
|
47
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
|
+
requirements:
|
|
49
|
+
- - ">="
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: '0'
|
|
52
|
+
requirements: []
|
|
53
|
+
rubygems_version: 3.0.3.1
|
|
54
|
+
signing_key:
|
|
55
|
+
specification_version: 4
|
|
56
|
+
summary: Typed Slack integration for Leash
|
|
57
|
+
test_files: []
|