Compare commits

...

19 Commits

Author SHA1 Message Date
Peter Zignego c2f7632be4 Merge pull request #150 from pvzig/member-leave-join-events
Add support for member_joined_channel and member_left_channel events
2019-03-05 23:21:09 -05:00
Peter Zignego 245d709125 Guess not 2019-03-05 23:17:24 -05:00
Peter Zignego 1ad14f016a Remove old files 2019-03-05 23:11:37 -05:00
Peter Zignego 03561eab36 Generate test files on CI 2019-03-05 23:11:25 -05:00
Peter Zignego f2c98f9d86 Add support for member_left_channel and member_joined_channel events 2019-03-05 23:10:59 -05:00
Peter Zignego bde39be109 Readme 2019-03-05 21:17:44 -05:00
Peter Zignego 5d7ac480b2 More readme changes 2019-03-05 21:05:56 -05:00
Peter Zignego 3579579c80 Readme updates 2019-03-05 20:47:43 -05:00
Peter Zignego 47865cbcee Merge pull request #149 from henry2423/master
Fix MessageActionRequest Issue
2019-02-28 18:32:36 -05:00
Henry Huang 054f8f2d87 [FIX] ActionRequest JSON decoder 2019-02-28 16:59:10 -06:00
Henry d7a02da74b Merge pull request #1 from pvzig/master
Merge
2019-02-28 16:56:35 -06:00
Peter Zignego 1846597f04 Update README.md 2019-02-25 09:32:00 -05:00
Peter Zignego f94b3b247b Merge pull request #147 from pvzig/tests
Add testing
2019-02-24 20:07:50 -05:00
Peter Zignego a96c17a3ad Fix tests 2019-02-24 20:00:06 -05:00
Peter Zignego 6276a09ced Fix CI tests 2019-02-24 19:50:03 -05:00
Peter Zignego ca92016ab9 Fix job names 2019-02-24 19:14:59 -05:00
Peter Zignego 21bca0e0e8 Fix illegal character 2019-02-24 18:57:58 -05:00
Peter Zignego dd02e9aecc Testing setup 2019-02-24 18:52:08 -05:00
Peter Zignego 77cc351bd6 Exclude VaporEngineRTM from CocoaPod 2019-02-20 11:41:50 -05:00
36 changed files with 2388 additions and 471 deletions
+8
View File
@@ -0,0 +1,8 @@
import XCTest
import SlackKitTests
var tests = [XCTestCaseEntry]()
tests += SlackKitTests.__allTests()
XCTMain(tests)
+4 -1
View File
@@ -47,6 +47,9 @@ let SKWebAPI: Target = .target(name: "SKWebAPI",
dependencies: ["SKCore"],
path: "SKWebAPI/Sources")
let SlackKitTests: Target = .testTarget(name: "SlackKitTests",
dependencies: ["SlackKit", "SKCore", "SKClient", "SKRTMAPI", "SKServer"],
path: "SlackKitTests")
// MARK: Package
let package = Package(
@@ -60,7 +63,7 @@ let package = Package(
.library(name: "SKWebAPI", targets: ["SKWebAPI"])
],
targets: [
SlackKit, SKClient, SKCore, SKRTMAPI, SKServer, SKWebAPI
SlackKit, SKClient, SKCore, SKRTMAPI, SKServer, SKWebAPI, SlackKitTests
]
)
-28
View File
@@ -1,28 +0,0 @@
use_frameworks!
target 'SlackKit macOS' do
platform :osx, '10.11'
pod 'SKCore', '~> 4.1.0'
pod 'SKClient', '~> 4.1.0'
pod 'SKWebAPI', '~> 4.1.0'
pod 'SKRTMAPI', '~> 4.1.0'
pod 'SKServer', '~> 4.1.0'
end
target 'SlackKit iOS' do
platform :ios, '9.0'
pod 'SKCore', '~> 4.1.0'
pod 'SKClient', '~> 4.1.0'
pod 'SKWebAPI', '~> 4.1.0'
pod 'SKRTMAPI', '~> 4.1.0'
pod 'SKServer', '~> 4.1.0'
end
target 'SlackKit tvOS' do
platform :tvos, '9.0'
pod 'SKCore', '~> 4.1.0'
pod 'SKClient', '~> 4.1.0'
pod 'SKWebAPI', '~> 4.1.0'
pod 'SKRTMAPI', '~> 4.1.0'
pod 'SKServer', '~> 4.1.0'
end
+21 -70
View File
@@ -1,7 +1,9 @@
<p align="center"><img src="https://cloud.githubusercontent.com/assets/8311605/24083714/e921a0d4-0cb2-11e7-8384-d42113ef5056.png" alt="SlackKit" width="500"/></p>
[![Build Status](https://dev.azure.com/pzignego/SlackKit/_apis/build/status/pvzig.SlackKit?branchName=master)](https://dev.azure.com/pzignego/SlackKit/_build/latest?definitionId=2&branchName=master)
![Swift Version](https://img.shields.io/badge/Swift-4.2-orange.svg)
![Plaforms](https://img.shields.io/badge/Platforms-macOS,iOS,tvOS,Linux-lightgrey.svg)
![Plaforms](https://img.shields.io/badge/Platforms-macOS,_iOS,_tvOS,_Linux-lightgrey.svg)
![License MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg)
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg)](https://github.com/Carthage/Carthage)
@@ -20,16 +22,20 @@ It's intended to expose all of the functionality of Slack's [Real Time Messaging
Add `SlackKit` to your `Package.swift`
```swift
import PackageDescription
```swift
let package = Package(
dependencies: [
.package(url: "https://github.com/SlackKit/SlackKit.git", .upToNextMinor(from: "4.2.0"))
.package(url: "https://github.com/pvzig/SlackKit.git", .upToNextMinor(from: "4.2.0"))
]
)
```
**When built using Swift Package Manager, SlackKit includes the [vapor websocket framework](https://github.com/vapor/websocket) by default which requires libressl.**
You can install it with [homebrew](https://brew.sh): `brew install libressl`
For additional details, see the [SKRTMAPI readme](https://github.com/pvzig/SlackKit/tree/master/SKRTMAPI#swift-package-manager).
#### Carthage
Add `SlackKit` to your `Cartfile`:
@@ -46,6 +52,12 @@ pod 'SlackKit'
```
### Usage
To use the library in your project import it:
```swift
import SlackKit
```
#### The Basics
Create a bot user with an API token:
@@ -124,75 +136,14 @@ Slack has [many different oauth scopes](https://api.slack.com/docs/oauth-scopes)
If you authenticate using OAuth and the Add to Slack or Sign in with Slack buttons this is handled for you.
For local development of things like OAuth, slash commands, and message buttons, you may want to use a tool like [ngrok](https://ngrok.com).
#### Advanced Usage
Dont need the whole banana? Want more control over the low-level implementation details? Use the extensible frameworks SlackKit is built on:
#### Web API Methods
SlackKit currently supports the a subset of the Slack Web APIs that are available to bot users:
| Web APIs |
| ------------- |
| `api.test`|
| `api.revoke`|
| `auth.test`|
| `channels.history`|
| `channels.info`|
| `channels.list`|
| `channels.mark`|
| `channels.setPurpose`|
| `channels.setTopic`|
| `chat.delete`|
| `chat.meMessage`|
| `chat.postMessage`|
| `chat.update`|
| `emoji.list`|
| `files.comments.add`|
| `files.comments.edit`|
| `files.comments.delete`|
| `files.delete`|
| `files.info`|
| `files.upload`|
| `groups.close`|
| `groups.history`|
| `groups.info`|
| `groups.list`|
| `groups.mark`|
| `groups.open`|
| `groups.setPurpose`|
| `groups.setTopic`|
| `im.close`|
| `im.history`|
| `im.list`|
| `im.mark`|
| `im.open`|
| `mpim.close`|
| `mpim.history`|
| `mpim.list`|
| `mpim.mark`|
| `mpim.open`|
| `oauth.access`|
| `pins.add`|
| `pins.list`|
| `pins.remove`|
| `reactions.add`|
| `reactions.get`|
| `reactions.list`|
| `reactions.remove`|
| `rtm.start`|
| `stars.add`|
| `stars.remove`|
| `team.info`|
| `users.getPresence`|
| `users.info`|
| `users.list`|
| `users.setActive`|
| `users.setPresence`|
Dont need the whole banana? Want more control over the low-level implementation details? Use the extensible modules SlackKit is built on:
| Module | Slack Service |
| Framework | Description |
| ------------- |------------- |
| **[SKClient](https://github.com/pvzig/SlackKit/tree/master/SKClient)** | Write your own client implementation|
| **[SKRTMAPI](https://github.com/pvzig/SlackKit/tree/master/SKRTMAPI)** | Connect to the Slack RTM API|
| **[SKServer](https://github.com/pvzig/SlackKit/tree/master/SKServer)** | Spin up a server|
| **[SKServer](https://github.com/pvzig/SlackKit/tree/master/SKServer)** | Spin up a server for a Slack app|
| **[SKWebAPI](https://github.com/pvzig/SlackKit/tree/master/SKWebAPI)** | Access the Slack Web API|
### Examples
+49 -41
View File
@@ -1,68 +1,76 @@
# SKClient: SlackKit Client Module
![Swift Version](https://img.shields.io/badge/Swift-4.0.3-orange.svg)
![Plaforms](https://img.shields.io/badge/Platforms-macOS,iOS,tvOS,Linux-lightgrey.svg)
![License MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg)
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg)](https://github.com/Carthage/Carthage)
[![CocoaPods compatible](https://img.shields.io/badge/CocoaPods-compatible-brightgreen.svg)](https://cocoapods.org)
# SKClient
Create a custom SlackKit client.
## Installation
### CocoaPods
<details>
<summary><strong>Swift Package Manager</strong></summary>
Add SlackKit as a dependency to your <code>Package.swift</code> and specify SKClient as a target dependency:
Add SKClient to your pod file:
```swift
import PackageDescription
let package = Package(
name: "SampleApp",
products: [
.executable(
name: "SampleApp",
targets: ["SampleApp"]),
],
dependencies: [
.package(url: "https://github.com/pvzig/SlackKit.git", .upToNextMinor(from: "4.2.0")),
],
targets: [
.target(
name: "SampleApp",
dependencies: ["SKClient"])
]
)
```
use_frameworks!
pod 'SKClient'
```
and run
</details>
<details>
<summary><strong>Carthage</strong></summary>
Add SlackKit to your <code>Cartfile</code>:
```
# Use CocoaPods version >= 1.4.0
pod install
github "pvzig/SlackKit"
```
### Carthage
Add SKClient to your Cartfile:
```
github "SlackKit/SKClient"
```
and run
```
carthage bootstrap
```
Drag the built `SKClient.framework` into your Xcode project.
Drag the built <code>SKClient.framework</code> and it's dependency <code>SKCore.framework</code> into your Xcode project.
</details>
<details>
<summary><strong>CocoaPods</strong></summary>
Add SKClient to your <code>Podfile</code>:
### Swift Package Manager
Add SKClient to your Package.swift
```swift
import PackageDescription
let package = Package(
dependencies: [
.package(url: "https://github.com/SlackKit/SKClient.git", .upToNextMinor(from: "4.1.0"))
]
)
```
use_frameworks!
pod 'SlackKit/SKClient'
```
</details>
Run `swift build` on your applications main directory.
## Usage
To use the library in your project import it:
```
#### Carthage & SPM
```swift
import SKClient
```
## Usage
#### CocoaPods
```swift
import SlackKit
```
### The Basics
Subclass `Client` to create a custom SlackKit client.
```
@@ -78,7 +86,7 @@ class MyClient: Client {
}
```
Pass your custom client to [`SlackKit`](https://www.github.com/SlackKit/SlackKit) when adding an RTM bot:
Pass your custom client to [`SlackKit`](https://www.github.com/pvzig/SlackKit) when adding an RTM bot:
```
let bot = SlackKit()
+28
View File
@@ -115,6 +115,10 @@ open class Client {
manualPresenceChange(event)
case .prefChange:
changePreference(event)
case .memberJoinedChannel:
memberJoinedChannel(event)
case .memberLeftChannel:
memberLeftChannel(event)
case .userChange:
userChange(event)
case .teamJoin:
@@ -360,6 +364,30 @@ extension Client {
func channelHistoryChanged(_ event: Event) {
}
func memberJoinedChannel(_ event: Event) {
guard
let channel = event.channel?.id,
let member = event.user?.id
else {
return
}
channels[channel]?.members?.append(member)
}
func memberLeftChannel(_ event: Event) {
guard
let channel = event.channel?.id,
let member = event.user?.id
else {
return
}
if let index = channels[channel]?.members?.index(of: member) {
channels[channel]?.members?.remove(at: index)
}
}
}
// MARK: - Do Not Disturb
+3 -8
View File
@@ -1,9 +1,4 @@
# SKCore: SlackKit Models
![Swift Version](https://img.shields.io/badge/Swift-4.0.3-orange.svg)
![Plaforms](https://img.shields.io/badge/Platforms-macOS,iOS,tvOS,Linux-lightgrey.svg)
![License MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg)
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg)](https://github.com/Carthage/Carthage)
[![CocoaPods compatible](https://img.shields.io/badge/CocoaPods-compatible-brightgreen.svg)](https://cocoapods.org)
# SKCore
The shared model objects used by [SlackKit](https://www.github.com/pvzig/SlackKit).
SKCore contains the shared model objects used by [SlackKit](https://www.github.com/SlackKit/SlackKit) and the other [SlackKit modules](https://www.github.com/SlackKit).
+9 -1
View File
@@ -64,6 +64,8 @@ public enum EventType: String {
case pinRemoved = "pin_removed"
case pong = "pong"
case presenceChange = "presence_change"
case memberJoinedChannel = "member_joined_channel"
case memberLeftChannel = "member_left_channel"
case manualPresenceChange = "manual_presence_change"
case prefChange = "pref_change"
case userChange = "user_change"
@@ -151,6 +153,7 @@ public class Event {
public let edited: Edited?
public let bot: Bot?
public let channel: Channel?
public let channelType: String?
public let comment: Comment?
public let user: User?
public let files: [File]
@@ -158,10 +161,12 @@ public class Event {
public let nestedMessage: Message?
public let itemUser: String?
public let item: Item?
public let teamID: String?
public let dndStatus: DoNotDisturbStatus?
public let subteam: UserGroup?
public let subteamID: String?
public var profile: CustomProfile?
public let profile: CustomProfile?
public let inviterID: String?
//swiftlint:disable function_body_length
public init(_ event: [String: Any]) {
@@ -198,6 +203,9 @@ public class Event {
nestedMessage = Message(dictionary: event["message"] as? [String: Any])
profile = CustomProfile(profile: event["profile"] as? [String: Any])
files = (event["files"] as? [Any])?.compactMap { File(file: $0 as? [String: Any]) } ?? []
channelType = event["channel_type"] as? String
teamID = event["team"] as? String
inviterID = event["inviter"] as? String
// Comment, Channel, and User can come across as Strings or Dictionaries
if let commentDictionary = event["comment"] as? [String: Any] {
+66 -39
View File
@@ -1,68 +1,95 @@
# SKRTMAPI: SlackKit RTM Module
![Swift Version](https://img.shields.io/badge/Swift-4.0.3-orange.svg)
![Plaforms](https://img.shields.io/badge/Platforms-macOS,iOS,tvOS,Linux-lightgrey.svg)
![License MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg)
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg)](https://github.com/Carthage/Carthage)
[![CocoaPods compatible](https://img.shields.io/badge/CocoaPods-compatible-brightgreen.svg)](https://cocoapods.org)
# SKRTMAPI
A module for connecting to the [Slack Real Time Messaging API](https://api.slack.com/rtm).
Connect to the [Slack Real Time Messaging API](https://api.slack.com/rtm) in Swift.
## Installation
<details>
<summary><strong>Swift Package Manager</strong></summary>
Add SlackKit as a dependency to your <code>Package.swift</code> and specify SKRTMAPI as a target dependency:
### CocoaPods
Add SKRTMAPI to your pod file:
```swift
import PackageDescription
let package = Package(
name: "SampleApp",
products: [
.executable(
name: "SampleApp",
targets: ["SampleApp"]),
],
dependencies: [
.package(url: "https://github.com/pvzig/SlackKit.git", .upToNextMinor(from: "4.2.0")),
],
targets: [
.target(
name: "SampleApp",
dependencies: ["SKRTMAPI"])
]
)
```
use_frameworks!
pod 'SKRTMAPI'
**When built using Swift Package Manager, SKRTMAPI includes the [vapor websocket framework](https://github.com/vapor/websocket) by default which requires libressl.**
You can install it with [homebrew](https://brew.sh): `brew install libressl`
If you'd like to use SPM _without vapor websocket_, you can modify the [Package.swift](https://github.com/pvzig/SlackKit/blob/master/Package.swift#L18) file to exclude it:
```swift
let SKRTMAPI: Target = .target(name: "SKRTMAPI",
path: "SKRTMAPI/Sources",
exclude: ["Conformers/VaporEngineRTM.swift"])
#if os(macOS)
SKRTMAPI.dependencies = [
"SKCore",
"SKWebAPI",
"Starscream"
]
```
and run
</details>
<details>
<summary><strong>Carthage</strong></summary>
Add SlackKit to your <code>Cartfile</code>:
```
# Use CocoaPods version >= 1.4.0
pod install
github "pvzig/SlackKit"
```
### Carthage
Add SKRTMAPI to your Cartfile:
```
github "SlackKit/SKRTMAPI"
```
and run
```
carthage bootstrap
```
Drag the built `SKRTMAPI.framework` into your Xcode project.
Drag the built <code>SKRTMAPI.framework</code> and it's dependencies <code>SKCore.framework</code>, <code>SKWebAPI.framework</code>, and <code>Starscream.framework</code> into your Xcode project.
</details>
<details>
<summary><strong>CocoaPods</strong></summary>
Add SKRTMAPI to your <code>Podfile</code>:
### Swift Package Manager
Add SKRTMAPI to your Package.swift
```swift
import PackageDescription
let package = Package(
dependencies: [
.package(url: "https://github.com/SlackKit/SKRTMAPI.git", .upToNextMinor(from: "4.1.0"))
]
)
```
use_frameworks!
pod 'SlackKit/SKRTMAPI'
```
</details>
Run `swift build` on your applications main directory.
## Usage
To use the library in your project import it:
#### Carthage & SPM
```swift
import SKRTMAPI
```
## Usage
#### CocoaPods
```swift
import SlackKit
```
### The Basics
Initialize an instance of `SKRTMAPI` with a Slack auth token:
```swift
+46 -41
View File
@@ -1,68 +1,73 @@
# SKServer: SlackKit Server Module
![Swift Version](https://img.shields.io/badge/Swift-4.0.3-orange.svg)
![Plaforms](https://img.shields.io/badge/Platforms-macOS,iOS,tvOS,Linux-lightgrey.svg)
![License MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg)
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg)](https://github.com/Carthage/Carthage)
[![CocoaPods compatible](https://img.shields.io/badge/CocoaPods-compatible-brightgreen.svg)](https://cocoapods.org)
A server-side Swift module for creating Slack apps.
# SKServer
A server-side Swift framework for creating Slack apps.
## Installation
<details>
<summary><strong>Swift Package Manager</strong></summary>
Add SlackKit as a dependency to your <code>Package.swift</code> and specify SKServer as a target dependency:
### CocoaPods
Add SKServer to your pod file:
```swift
import PackageDescription
let package = Package(
name: "SampleApp",
products: [
.executable(
name: "SampleApp",
targets: ["SampleApp"]),
],
dependencies: [
.package(url: "https://github.com/pvzig/SlackKit.git", .upToNextMinor(from: "4.2.0")),
],
targets: [
.target(
name: "SampleApp",
dependencies: ["SKServer"])
]
)
```
use_frameworks!
pod 'SKServer'
```
and run
</details>
<details>
<summary><strong>Carthage</strong></summary>
Add SlackKit to your <code>Cartfile</code>:
```
# Use CocoaPods version >= 1.4.0
pod install
github "pvzig/SlackKit"
```
### Carthage
Add SKServer to your Cartfile:
```
github "SlackKit/SKServer"
```
and run
```
carthage bootstrap
```
Drag the built `SKServer.framework` into your Xcode project.
Drag the built <code>SKServer.framework</code> and it's dependencies <code>SKCore.framework</code>, <code>SKWebAPI.framework</code>, and <code>Swifter.framework</code> into your Xcode project.
</details>
<details>
<summary><strong>CocoaPods</strong></summary>
Add SKServer to your <code>Podfile</code>:
### Swift Package Manager
Add SKServer to your Package.swift
```swift
import PackageDescription
let package = Package(
dependencies: [
.package(url: "https://github.com/SlackKit/SKServer.git", .upToNextMinor(from: "4.1.0"))
]
)
```
use_frameworks!
pod 'SlackKit/SKServer'
```
</details>
Run `swift build` on your applications main directory.
## Usage
To use the library in your project import it:
#### Carthage & SPM
```swift
import SKServer
```
## Usage
#### CocoaPods
```swift
import SlackKit
```
### The Basics
For local development and testing of features like OAuth, slash commands, and message buttons that require connecting over https, you may want to use a tool like [ngrok](https://ngrok.com/).
@@ -43,7 +43,7 @@ public struct MessageActionRequest {
callbackID = response?["callback_id"] as? String
team = Team(team: response?["team"] as? [String: Any])
channel = Channel(channel: response?["channel"] as? [String: Any])
user = User(user: response?["channel"] as? [String: Any])
user = User(user: response?["user"] as? [String: Any])
actionTS = response?["action_ts"] as? String
messageTS = response?["message_ts"] as? String
attachmentID = response?["attachment_id"] as? String
+48 -39
View File
@@ -1,68 +1,77 @@
# SKWebAPI: SlackKit Web API Module
![Swift Version](https://img.shields.io/badge/Swift-4.0.3-orange.svg)
![Plaforms](https://img.shields.io/badge/Platforms-macOS,iOS,tvOS,Linux-lightgrey.svg)
![License MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg)
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg)](https://github.com/Carthage/Carthage)
[![CocoaPods compatible](https://img.shields.io/badge/CocoaPods-compatible-brightgreen.svg)](https://cocoapods.org)
# SKWebAPI
A Swift module to help make requests to the [Slack Web API](https://api.slack.com/web).
Make requests to the [Slack Web API](https://api.slack.com/web) in Swift.
## Installation
### CocoaPods
<details>
<summary><strong>Swift Package Manager</strong></summary>
Add SlackKit as a dependency to your <code>Package.swift</code> and specify SKWebAPI as a target dependency:
Add SKWebAPI to your pod file:
```swift
import PackageDescription
let package = Package(
name: "SampleApp",
products: [
.executable(
name: "SampleApp",
targets: ["SampleApp"]),
],
dependencies: [
.package(url: "https://github.com/pvzig/SlackKit.git", .upToNextMinor(from: "4.2.0")),
],
targets: [
.target(
name: "SampleApp",
dependencies: ["SKWebAPI"])
]
)
```
use_frameworks!
pod 'SKWebAPI'
```
and run
</details>
<details>
<summary><strong>Carthage</strong></summary>
Add SlackKit to your <code>Cartfile</code>:
```
# Use CocoaPods version >= 1.4.0
pod install
github "pvzig/SlackKit"
```
### Carthage
Add SKWebAPI to your Cartfile:
```
github "SlackKit/SKWebAPI"
```
and run
```
carthage bootstrap
```
Drag the built `SKWebAPI.framework` into your Xcode project.
Drag the built <code>SKWebAPI.framework</code> and it's dependency <code>SKCore.framework</code> into your Xcode project.
</details>
<details>
<summary><strong>CocoaPods</strong></summary>
Add SKWebAPI to your <code>Podfile</code>:
### Swift Package Manager
Add SKWebAPI to your Package.swift
```swift
import PackageDescription
let package = Package(
dependencies: [
.package(url: "https://github.com/SlackKit/SKWebAPI.git", .upToNextMinor(from: "4.1.0"))
]
)
```
use_frameworks!
pod 'SlackKit/SKWebAPI'
```
</details>
Run `swift build` on your applications main directory.
## Usage
To use the library in your project import it:
#### Carthage & SPM
```swift
import SKWebAPI
```
## Usage
#### CocoaPods
```swift
import SlackKit
```
### The Basics
Initialize an instance of `SKWebAPI` with a Slack auth token and make your requests:
```swift
+1
View File
@@ -33,6 +33,7 @@ Pod::Spec.new do |s|
s.subspec "SKRTMAPI" do |ss|
ss.source_files = "SKRTMAPI/Sources/**/*.swift"
ss.exclude_files = "SKRTMAPI/Sources/Conformers/VaporEngineRTM.swift"
ss.dependency "SlackKit/SKCore"
ss.dependency "SlackKit/SKWebAPI"
ss.dependency "Starscream", "3.0.6"
+334
View File
@@ -7,6 +7,21 @@
objects = {
/* Begin PBXBuildFile section */
2601B6CD2223038A00F197AB /* channel.json in Resources */ = {isa = PBXBuildFile; fileRef = 26D4E6282220731800A67B67 /* channel.json */; };
2601B6CE2223038A00F197AB /* conversation.json in Resources */ = {isa = PBXBuildFile; fileRef = 26D4E6222220731700A67B67 /* conversation.json */; };
2601B6CF2223038A00F197AB /* events.json in Resources */ = {isa = PBXBuildFile; fileRef = 26D4E6262220731800A67B67 /* events.json */; };
2601B6D02223038A00F197AB /* file.json in Resources */ = {isa = PBXBuildFile; fileRef = 26D4E62A2220731800A67B67 /* file.json */; };
2601B6D12223038A00F197AB /* group.json in Resources */ = {isa = PBXBuildFile; fileRef = 26D4E6272220731800A67B67 /* group.json */; };
2601B6D22223038A00F197AB /* im.json in Resources */ = {isa = PBXBuildFile; fileRef = 26D4E6232220731700A67B67 /* im.json */; };
2601B6D32223038A00F197AB /* mpim.json in Resources */ = {isa = PBXBuildFile; fileRef = 26D4E6212220731700A67B67 /* mpim.json */; };
2601B6D42223038A00F197AB /* rtm.connect.json in Resources */ = {isa = PBXBuildFile; fileRef = 26D4E6292220731800A67B67 /* rtm.connect.json */; };
2601B6D52223038A00F197AB /* rtm.start.json in Resources */ = {isa = PBXBuildFile; fileRef = 26D4E6202220731700A67B67 /* rtm.start.json */; };
2601B6D62223038A00F197AB /* user.json in Resources */ = {isa = PBXBuildFile; fileRef = 26D4E6242220731800A67B67 /* user.json */; };
2601B6D72223038A00F197AB /* usergroup.json in Resources */ = {isa = PBXBuildFile; fileRef = 26D4E6252220731800A67B67 /* usergroup.json */; };
2601B6E2222371A100F197AB /* SKCoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26D4E6362220733F00A67B67 /* SKCoreTests.swift */; };
2601B70C222F6CFD00F197AB /* SKClientTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2601B70B222F6CFD00F197AB /* SKClientTests.swift */; };
2601B70F222F766D00F197AB /* member_joined_channel.json in Resources */ = {isa = PBXBuildFile; fileRef = 2601B70D222F766D00F197AB /* member_joined_channel.json */; };
2601B710222F766D00F197AB /* member_left_channel.json in Resources */ = {isa = PBXBuildFile; fileRef = 2601B70E222F766D00F197AB /* member_left_channel.json */; };
263B102421FE33A000AF9EF9 /* UserGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 263B100921FE33A000AF9EF9 /* UserGroup.swift */; };
263B102521FE33A000AF9EF9 /* Scope.swift in Sources */ = {isa = PBXBuildFile; fileRef = 263B100A21FE33A000AF9EF9 /* Scope.swift */; };
263B102621FE33A000AF9EF9 /* AttachmentField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 263B100B21FE33A000AF9EF9 /* AttachmentField.swift */; };
@@ -106,6 +121,51 @@
26D4E60A2212121400A67B67 /* SKWebAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 26D4E601221211B900A67B67 /* SKWebAPI.h */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
2601B6CB2223032600F197AB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 263B0F8221FE1B2300AF9EF9 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 263B0F9A21FE235100AF9EF9;
remoteInfo = SKCore;
};
2601B6D82223039200F197AB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 263B0F8221FE1B2300AF9EF9 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 263B0FD021FE23CD00AF9EF9;
remoteInfo = SlackKit;
};
2601B6DA2223039200F197AB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 263B0F8221FE1B2300AF9EF9 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 263B0FA921FE23A000AF9EF9;
remoteInfo = SKClient;
};
2601B6DC2223039200F197AB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 263B0F8221FE1B2300AF9EF9 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 263B0FC321FE23C200AF9EF9;
remoteInfo = SKRTMAPI;
};
2601B6DE2223039200F197AB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 263B0F8221FE1B2300AF9EF9 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 263B0FDD21FE23DB00AF9EF9;
remoteInfo = SKServer;
};
2601B6E02223039200F197AB /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 263B0F8221FE1B2300AF9EF9 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 263B0FB621FE23B000AF9EF9;
remoteInfo = SKWebAPI;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
269A185A220BB2B800F1F500 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
@@ -132,6 +192,11 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
2601B6B72220813600F197AB /* SlackKitTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = SlackKitTests.xcconfig; sourceTree = "<group>"; };
2601B6C1222085AB00F197AB /* SlackKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SlackKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2601B70B222F6CFD00F197AB /* SKClientTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SKClientTests.swift; sourceTree = "<group>"; };
2601B70D222F766D00F197AB /* member_joined_channel.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = member_joined_channel.json; sourceTree = "<group>"; };
2601B70E222F766D00F197AB /* member_left_channel.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = member_left_channel.json; sourceTree = "<group>"; };
263B0F9B21FE235100AF9EF9 /* SKCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SKCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
263B0FAA21FE23A000AF9EF9 /* SKClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SKClient.framework; sourceTree = BUILT_PRODUCTS_DIR; };
263B0FB721FE23B000AF9EF9 /* SKWebAPI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SKWebAPI.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -233,9 +298,29 @@
26D4E602221211B900A67B67 /* SlackKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SlackKit.h; sourceTree = "<group>"; };
26D4E603221211B900A67B67 /* SKCore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SKCore.h; sourceTree = "<group>"; };
26D4E604221211B900A67B67 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
26D4E6142220719D00A67B67 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
26D4E6202220731700A67B67 /* rtm.start.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = rtm.start.json; sourceTree = "<group>"; };
26D4E6212220731700A67B67 /* mpim.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = mpim.json; sourceTree = "<group>"; };
26D4E6222220731700A67B67 /* conversation.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = conversation.json; sourceTree = "<group>"; };
26D4E6232220731700A67B67 /* im.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = im.json; sourceTree = "<group>"; };
26D4E6242220731800A67B67 /* user.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = user.json; sourceTree = "<group>"; };
26D4E6252220731800A67B67 /* usergroup.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = usergroup.json; sourceTree = "<group>"; };
26D4E6262220731800A67B67 /* events.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = events.json; sourceTree = "<group>"; };
26D4E6272220731800A67B67 /* group.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = group.json; sourceTree = "<group>"; };
26D4E6282220731800A67B67 /* channel.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = channel.json; sourceTree = "<group>"; };
26D4E6292220731800A67B67 /* rtm.connect.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = rtm.connect.json; sourceTree = "<group>"; };
26D4E62A2220731800A67B67 /* file.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = file.json; sourceTree = "<group>"; };
26D4E6362220733F00A67B67 /* SKCoreTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SKCoreTests.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
2601B6BE222085AB00F197AB /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
263B0F9821FE235100AF9EF9 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -319,6 +404,7 @@
263B0FB821FE23B000AF9EF9 /* SKWebAPI */,
26D4E5FD221211B900A67B67 /* Supporting Files */,
269A18272204048300F1F500 /* Examples */,
26D4E6112220719D00A67B67 /* SlackKitTests */,
263B10CB21FE4DD900AF9EF9 /* Frameworks */,
263B0FD121FE23CD00AF9EF9 /* SlackKit.framework */,
263B0FAA21FE23A000AF9EF9 /* SKClient.framework */,
@@ -328,6 +414,7 @@
263B0FB721FE23B000AF9EF9 /* SKWebAPI.framework */,
263B0FEA21FE247300AF9EF9 /* Leaderboard.app */,
26D4E4D82210A31F00A67B67 /* Robot or Not Bot.app */,
2601B6C1222085AB00F197AB /* SlackKitTests.xctest */,
);
sourceTree = "<group>";
};
@@ -712,6 +799,94 @@
path = "Supporting Files";
sourceTree = "<group>";
};
26D4E6112220719D00A67B67 /* SlackKitTests */ = {
isa = PBXGroup;
children = (
26D4E61A222072BC00A67B67 /* SlackKit */,
26D4E61B222072C600A67B67 /* SKClient */,
26D4E61C222072D100A67B67 /* SKCore */,
26D4E61D222072D600A67B67 /* SKRTMAPI */,
26D4E61E222072DC00A67B67 /* SKServer */,
26D4E61F222072E800A67B67 /* SKWebAPI */,
26D4E618222072A700A67B67 /* Resources */,
26D4E619222072B000A67B67 /* Supporting Files */,
);
path = SlackKitTests;
sourceTree = "<group>";
};
26D4E618222072A700A67B67 /* Resources */ = {
isa = PBXGroup;
children = (
26D4E6282220731800A67B67 /* channel.json */,
26D4E6222220731700A67B67 /* conversation.json */,
26D4E6262220731800A67B67 /* events.json */,
26D4E62A2220731800A67B67 /* file.json */,
26D4E6272220731800A67B67 /* group.json */,
26D4E6232220731700A67B67 /* im.json */,
26D4E6212220731700A67B67 /* mpim.json */,
26D4E6292220731800A67B67 /* rtm.connect.json */,
26D4E6202220731700A67B67 /* rtm.start.json */,
26D4E6242220731800A67B67 /* user.json */,
26D4E6252220731800A67B67 /* usergroup.json */,
2601B70D222F766D00F197AB /* member_joined_channel.json */,
2601B70E222F766D00F197AB /* member_left_channel.json */,
);
path = Resources;
sourceTree = "<group>";
};
26D4E619222072B000A67B67 /* Supporting Files */ = {
isa = PBXGroup;
children = (
26D4E6142220719D00A67B67 /* Info.plist */,
2601B6B72220813600F197AB /* SlackKitTests.xcconfig */,
);
path = "Supporting Files";
sourceTree = "<group>";
};
26D4E61A222072BC00A67B67 /* SlackKit */ = {
isa = PBXGroup;
children = (
);
path = SlackKit;
sourceTree = "<group>";
};
26D4E61B222072C600A67B67 /* SKClient */ = {
isa = PBXGroup;
children = (
2601B70B222F6CFD00F197AB /* SKClientTests.swift */,
);
path = SKClient;
sourceTree = "<group>";
};
26D4E61C222072D100A67B67 /* SKCore */ = {
isa = PBXGroup;
children = (
26D4E6362220733F00A67B67 /* SKCoreTests.swift */,
);
path = SKCore;
sourceTree = "<group>";
};
26D4E61D222072D600A67B67 /* SKRTMAPI */ = {
isa = PBXGroup;
children = (
);
path = SKRTMAPI;
sourceTree = "<group>";
};
26D4E61E222072DC00A67B67 /* SKServer */ = {
isa = PBXGroup;
children = (
);
path = SKServer;
sourceTree = "<group>";
};
26D4E61F222072E800A67B67 /* SKWebAPI */ = {
isa = PBXGroup;
children = (
);
path = SKWebAPI;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
@@ -766,6 +941,29 @@
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
2601B6C0222085AB00F197AB /* SlackKitTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 2601B6C6222085AB00F197AB /* Build configuration list for PBXNativeTarget "SlackKitTests" */;
buildPhases = (
2601B6BD222085AB00F197AB /* Sources */,
2601B6BE222085AB00F197AB /* Frameworks */,
2601B6BF222085AB00F197AB /* Resources */,
);
buildRules = (
);
dependencies = (
2601B6D92223039200F197AB /* PBXTargetDependency */,
2601B6DB2223039200F197AB /* PBXTargetDependency */,
2601B6DD2223039200F197AB /* PBXTargetDependency */,
2601B6DF2223039200F197AB /* PBXTargetDependency */,
2601B6E12223039200F197AB /* PBXTargetDependency */,
2601B6CC2223032600F197AB /* PBXTargetDependency */,
);
name = SlackKitTests;
productName = SlackKitTests;
productReference = 2601B6C1222085AB00F197AB /* SlackKitTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
263B0F9A21FE235100AF9EF9 /* SKCore */ = {
isa = PBXNativeTarget;
buildConfigurationList = 263B0FA021FE235100AF9EF9 /* Build configuration list for PBXNativeTarget "SKCore" */;
@@ -918,6 +1116,9 @@
LastUpgradeCheck = 1010;
ORGANIZATIONNAME = "Peter Zignego";
TargetAttributes = {
2601B6C0222085AB00F197AB = {
CreatedOnToolsVersion = 10.1;
};
263B0F9A21FE235100AF9EF9 = {
CreatedOnToolsVersion = 10.1;
};
@@ -963,11 +1164,32 @@
263B0FB621FE23B000AF9EF9 /* SKWebAPI */,
263B0FE921FE247300AF9EF9 /* Leaderboard */,
26D4E4CB2210A31F00A67B67 /* Robot or Not Bot */,
2601B6C0222085AB00F197AB /* SlackKitTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
2601B6BF222085AB00F197AB /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2601B6CD2223038A00F197AB /* channel.json in Resources */,
2601B710222F766D00F197AB /* member_left_channel.json in Resources */,
2601B6CE2223038A00F197AB /* conversation.json in Resources */,
2601B70F222F766D00F197AB /* member_joined_channel.json in Resources */,
2601B6CF2223038A00F197AB /* events.json in Resources */,
2601B6D02223038A00F197AB /* file.json in Resources */,
2601B6D12223038A00F197AB /* group.json in Resources */,
2601B6D22223038A00F197AB /* im.json in Resources */,
2601B6D32223038A00F197AB /* mpim.json in Resources */,
2601B6D42223038A00F197AB /* rtm.connect.json in Resources */,
2601B6D52223038A00F197AB /* rtm.start.json in Resources */,
2601B6D62223038A00F197AB /* user.json in Resources */,
2601B6D72223038A00F197AB /* usergroup.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
263B0F9921FE235100AF9EF9 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -1013,6 +1235,15 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
2601B6BD222085AB00F197AB /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2601B70C222F6CFD00F197AB /* SKClientTests.swift in Sources */,
2601B6E2222371A100F197AB /* SKCoreTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
263B0F9721FE235100AF9EF9 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -1145,7 +1376,101 @@
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
2601B6CC2223032600F197AB /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 263B0F9A21FE235100AF9EF9 /* SKCore */;
targetProxy = 2601B6CB2223032600F197AB /* PBXContainerItemProxy */;
};
2601B6D92223039200F197AB /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 263B0FD021FE23CD00AF9EF9 /* SlackKit */;
targetProxy = 2601B6D82223039200F197AB /* PBXContainerItemProxy */;
};
2601B6DB2223039200F197AB /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 263B0FA921FE23A000AF9EF9 /* SKClient */;
targetProxy = 2601B6DA2223039200F197AB /* PBXContainerItemProxy */;
};
2601B6DD2223039200F197AB /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 263B0FC321FE23C200AF9EF9 /* SKRTMAPI */;
targetProxy = 2601B6DC2223039200F197AB /* PBXContainerItemProxy */;
};
2601B6DF2223039200F197AB /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 263B0FDD21FE23DB00AF9EF9 /* SKServer */;
targetProxy = 2601B6DE2223039200F197AB /* PBXContainerItemProxy */;
};
2601B6E12223039200F197AB /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 263B0FB621FE23B000AF9EF9 /* SKWebAPI */;
targetProxy = 2601B6E02223039200F197AB /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
2601B6C7222085AB00F197AB /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 2601B6B72220813600F197AB /* SlackKitTests.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = "SlackKitTests/Supporting Files/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
OTHER_SWIFT_FLAGS = "-DXcode";
PRODUCT_BUNDLE_IDENTIFIER = com.launchsoft.SlackKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALID_ARCHS = "x86_64 i386";
};
name = Debug;
};
2601B6C8222085AB00F197AB /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "SlackKitTests/Supporting Files/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
OTHER_SWIFT_FLAGS = "-DXcode";
PRODUCT_BUNDLE_IDENTIFIER = com.launchsoft.SlackKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALID_ARCHS = "x86_64 i386";
};
name = Release;
};
263B0F9121FE1B2300AF9EF9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -1748,6 +2073,15 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
2601B6C6222085AB00F197AB /* Build configuration list for PBXNativeTarget "SlackKitTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2601B6C7222085AB00F197AB /* Debug */,
2601B6C8222085AB00F197AB /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
263B0F8521FE1B2300AF9EF9 /* Build configuration list for PBXProject "SlackKit" */ = {
isa = XCConfigurationList;
buildConfigurations = (
@@ -1,91 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "26D4E4CB2210A31F00A67B67"
BuildableName = "Robot or Not Bot.app"
BlueprintName = "Robot or Not Bot"
ReferencedContainer = "container:SlackKit.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "26D4E4CB2210A31F00A67B67"
BuildableName = "Robot or Not Bot.app"
BlueprintName = "Robot or Not Bot"
ReferencedContainer = "container:SlackKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "26D4E4CB2210A31F00A67B67"
BuildableName = "Robot or Not Bot.app"
BlueprintName = "Robot or Not Bot"
ReferencedContainer = "container:SlackKit.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "26D4E4CB2210A31F00A67B67"
BuildableName = "Robot or Not Bot.app"
BlueprintName = "Robot or Not Bot"
ReferencedContainer = "container:SlackKit.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2601B6C0222085AB00F197AB"
BuildableName = "SlackKitTests.xctest"
BlueprintName = "SlackKitTests"
ReferencedContainer = "container:SlackKit.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<CommandLineArguments>
<CommandLineArgument
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
+35 -111
View File
@@ -1,51 +1,56 @@
<p align="center"><img src="https://cloud.githubusercontent.com/assets/8311605/24083714/e921a0d4-0cb2-11e7-8384-d42113ef5056.png" alt="SlackKit" width="500"/></p>
# SlackKit: Slack Apps in Swift
![Swift Version](https://img.shields.io/badge/Swift-4.0.3-orange.svg)
![Plaforms](https://img.shields.io/badge/Platforms-macOS,iOS,tvOS,Linux-lightgrey.svg)
![License MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg)
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg)](https://github.com/Carthage/Carthage)
[![CocoaPods compatible](https://img.shields.io/badge/CocoaPods-compatible-brightgreen.svg)](https://cocoapods.org)
## Installation
<details>
<summary><strong>Swift Package Manager</strong></summary>
Add SlackKit to your <code>Package.swift</code>
## SlackKit: Slack Apps in Swift
### Description
SlackKit makes it easy to build Slack apps in Swift.
It's intended to expose all of the functionality of Slack's [Real Time Messaging API](https://api.slack.com/rtm) as well as the [web APIs](https://api.slack.com/web) that are accessible to [bot users](https://api.slack.com/bot-users). SlackKit also supports Slacks [OAuth 2.0](https://api.slack.com/docs/oauth) flow including the [Add to Slack](https://api.slack.com/docs/slack-button) and [Sign in with Slack](https://api.slack.com/docs/sign-in-with-slack) buttons, [incoming webhooks](https://api.slack.com/incoming-webhooks), [slash commands](https://api.slack.com/slash-commands), and [message buttons](https://api.slack.com/docs/message-buttons).
### Installation
#### Swift Package Manager
Add `SlackKit` to your `Package.swift`
```swift
import PackageDescription
```swift
let package = Package(
dependencies: [
.package(url: "https://github.com/SlackKit/SlackKit.git", .upToNextMinor(from: "4.1.0"))
.package(url: "https://github.com/pvzig/SlackKit.git", .upToNextMinor(from: "4.2.0"))
]
)
```
#### Carthage
**When built using Swift Package Manager, SlackKit includes the [vapor websocket framework](https://github.com/vapor/websocket) by default which requires libressl.**
Add `SlackKit` to your `Cartfile`:
You can install it with [homebrew](https://brew.sh): `brew install libressl`
For additional details, see the [SKRTMAPI readme](https://github.com/pvzig/SlackKit/tree/master/SKRTMAPI#swift-package-manager).
</details>
<details>
<summary><strong>Carthage</strong></summary>
Add SlackKit to your <code>Cartfile</code>:
```
github "SlackKit/SlackKit"
github "pvzig/SlackKit"
```
#### CocoaPods
Add `SlackKit` to your `Podfile`:
</details>
<details>
<summary><strong>CocoaPods</strong></summary>
Add SlackKit to your <code>Podfile</code>:
```
pod 'SlackKit'
```
</details>
### Usage
To use the library in your project import it:
#### Carthage & SPM
```swift
import SKWebAPI
```
#### CocoaPods
```swift
import SlackKit
```
#### The Basics
Create a bot user with an API token:
@@ -124,84 +129,3 @@ Slack has [many different oauth scopes](https://api.slack.com/docs/oauth-scopes)
If you authenticate using OAuth and the Add to Slack or Sign in with Slack buttons this is handled for you.
For local development of things like OAuth, slash commands, and message buttons, you may want to use a tool like [ngrok](https://ngrok.com).
#### Web API Methods
SlackKit currently supports the a subset of the Slack Web APIs that are available to bot users:
| Web APIs |
| ------------- |
| `api.test`|
| `api.revoke`|
| `auth.test`|
| `channels.history`|
| `channels.info`|
| `channels.list`|
| `channels.mark`|
| `channels.setPurpose`|
| `channels.setTopic`|
| `chat.delete`|
| `chat.meMessage`|
| `chat.postMessage`|
| `chat.update`|
| `emoji.list`|
| `files.comments.add`|
| `files.comments.edit`|
| `files.comments.delete`|
| `files.delete`|
| `files.info`|
| `files.upload`|
| `groups.close`|
| `groups.history`|
| `groups.info`|
| `groups.list`|
| `groups.mark`|
| `groups.open`|
| `groups.setPurpose`|
| `groups.setTopic`|
| `im.close`|
| `im.history`|
| `im.list`|
| `im.mark`|
| `im.open`|
| `mpim.close`|
| `mpim.history`|
| `mpim.list`|
| `mpim.mark`|
| `mpim.open`|
| `oauth.access`|
| `pins.add`|
| `pins.list`|
| `pins.remove`|
| `reactions.add`|
| `reactions.get`|
| `reactions.list`|
| `reactions.remove`|
| `rtm.start`|
| `stars.add`|
| `stars.remove`|
| `team.info`|
| `users.getPresence`|
| `users.info`|
| `users.list`|
| `users.setActive`|
| `users.setPresence`|
Dont need the whole banana? Want more control over the low-level implementation details? Use the extensible modules SlackKit is built on:
| Module | Slack Service |
| ------------- |------------- |
| **[SKClient](https://github.com/SlackKit/SKClient)** | Write your own client implementation|
| **[SKRTMAPI](https://github.com/SlackKit/SKRTMAPI)** | Connect to the Slack RTM API|
| **[SKServer](https://github.com/SlackKit/SKServer)** | Spin up a server|
| **[SKWebAPI](https://github.com/SlackKit/SKWebAPI)** | Access the Slack Web API|
### Examples
You can find the source code for several example applications [here](https://github.com/SlackKit/Examples).
### Tutorials
- [Build a Slack Bot and Deploy to Heroku](https://medium.com/@pvzig/building-slack-bots-in-swift-b99e243e444c)
### Get In Touch
Twitter: [@pvzig](https://twitter.com/pvzig)
Email: <peter@launchsoft.co>
+53
View File
@@ -0,0 +1,53 @@
{
"ok": true,
"channel": {
"id": "C1H9RESGL",
"name": "busting",
"is_channel": true,
"created": 1466025154,
"creator": "U0G9QF9C6",
"is_archived": false,
"is_general": false,
"name_normalized": "busting",
"is_shared": false,
"is_org_shared": false,
"is_member": true,
"is_private": false,
"is_mpim": false,
"last_read": "1503435939.000101",
"latest": {
"text": "Containment unit is 98% full",
"username": "ecto1138",
"bot_id": "B19LU7CSY",
"attachments": [
{
"text": "Don't get too attached",
"id": 1,
"fallback": "This is an attachment fallback"
}
],
"type": "message",
"subtype": "bot_message",
"ts": "1503435956.000247"
},
"unread_count": 1,
"unread_count_display": 1,
"members": [
"U0G9QF9C6",
"U1QNSQB9U"
],
"topic": {
"value": "Spiritual containment strategies",
"creator": "U0G9QF9C6",
"last_set": 1503435128
},
"purpose": {
"value": "Discuss busting ghosts",
"creator": "U0G9QF9C6",
"last_set": 1503435128
},
"previous_names": [
"dusting"
]
}
}
+39
View File
@@ -0,0 +1,39 @@
{
"ok": true,
"channel": {
"id": "C012AB3CD",
"name": "general",
"is_channel": true,
"is_group": false,
"is_im": false,
"created": 1449252889,
"creator": "W012A3BCD",
"is_archived": false,
"is_general": true,
"unlinked": 0,
"name_normalized": "general",
"is_read_only": false,
"is_shared": false,
"is_ext_shared": false,
"is_org_shared": false,
"pending_shared": [],
"is_pending_ext_shared": false,
"is_member": true,
"is_private": false,
"is_mpim": false,
"last_read": "1502126650.228446",
"topic": {
"value": "For public discussion of generalities",
"creator": "W012A3BCD",
"last_set": 1449709364
},
"purpose": {
"value": "This part of the workspace is for fun. Make fun here.",
"creator": "W012A3BCD",
"last_set": 1449709364
},
"previous_names": [ "specifics", "abstractions", "etc" ],
"num_members": 23,
"locale": "en-US"
}
}
+461
View File
@@ -0,0 +1,461 @@
{
"bot_added": {
"type": "bot_added",
"bot": {
"id": "B0EV3JE8Z",
"deleted": false,
"name": "bot",
"icons": {
"image_48": "https://slack.global.ssl.fastly.net/12b5a/plugins/bot/assets/service_48.png"
}
},
"cache_ts": 1448003197
},
"bot_changed": {
"type": "bot_added",
"bot": {
"id": "B0EV3JE8Z",
"deleted": false,
"name": "changed-bot",
"icons": {
"image_48": "https://slack.global.ssl.fastly.net/12b5a/plugins/bot/assets/service_48.png"
}
},
"cache_ts": 1448003197
},
"channel_archive": {
"type": "channel_archive",
"channel": "C0CJ25PDM",
"user": "U0CJ5PC7L"
},
"channel_created": {
"type": "channel_created",
"channel": {
"id": "C0F3Q8LH5",
"is_channel": true,
"name": "test-channel",
"created": 1448262090,
"creator": "U0CJ5PC7L"
},
"event_ts": "1448262090.810507"
},
"channel_deleted": {
"type": "channel_deleted",
"channel": "C0CJ25PDM"
},
"channel_joined": {
"type": "channel_joined",
"channel": {
"id": "C0CJ25PDM",
"name": "test",
"is_channel": true,
"created": 1444959237,
"creator": "U0CJ5PC7L",
"is_archived": false,
"is_general": false,
"is_member": true,
"last_read": "0000000000.000000",
"latest": {
"user": "U0F3LFX6K",
"type": "message",
"subtype": "channel_join",
"text": "<@U0F3LFX6K|carol> has joined the channel",
"ts": "1448262357.000002"
},
"unread_count": 0,
"unread_count_display": 0,
"members": [
"U0CJ5PC7L",
"U0F3LFX6K"
],
"topic": {
"value": "",
"creator": "",
"last_set": 0
},
"purpose": {
"value": "",
"creator": "",
"last_set": 0
}
}
},
"channel_left": {
"type": "channel_left",
"channel": "C0CJ25PDM"
},
"channel_marked": {
"type": "channel_marked",
"channel": "C0CJ25PDM",
"ts": "1448253718.000002",
"unread_count": 0,
"unread_count_display": 0,
"num_mentions": 0,
"num_mentions_display": 0,
"mention_count": 0,
"mention_count_display": 0
},
"channel_rename": {
"type": "channel_rename",
"channel": {
"id": "C0CJ25PDM",
"is_channel": true,
"name": "test-channel-rename",
"created": "1448262090"
},
"event_ts": "1448262186.810954"
},
"channel_unarchive": {
"type": "channel_unarchive",
"channel": "C0CJ25PDM",
"user": "U0CJ5PC7L"
},
"group_archive": {
"type": "group_archive",
"channel": "G0CHZSXFW",
"ts": "1448327143.000002"
},
"group_close": {
"type": "group_close",
"user": "U0CJ5PC7L",
"channel": "G0CHZSXFW"
},
"group_joined": {
"type": "group_joined",
"channel": {
"id": "G0CHZSXFW",
"name": "private",
"is_group": true,
"created": 1444959855,
"creator": "U0CJ5PC7L",
"is_archived": false,
"is_mpim": false,
"is_open": true,
"last_read": "1448328439.000011",
"latest": {
"user": "U0CJ5PC7L",
"type": "message",
"text": "I'm Alice! Yay!",
"ts": "1448328439.000011"
},
"unread_count": 0,
"unread_count_display": 0,
"members": [
"U0CJ5PC7L",
"U0F3LFX6K"
],
"topic": {
"value": "",
"creator": "",
"last_set": 0
},
"purpose": {
"value": "",
"creator": "",
"last_set": 0
}
}
},
"group_left": {
"type": "group_left",
"channel": "G0CHZSXFW"
},
"group_marked": {
"channel": "G0CHZSXFW",
"ts": "1448327532.000006",
"unread_count": 0,
"unread_count_display": 0,
"num_mentions": 0,
"num_mentions_display": 0,
"mention_count": 0,
"mention_count_display": 0,
"type": "group_marked",
"is_mpim": false
},
"group_rename": {
"type": "group_rename",
"channel": {
"id": "G0CHZSXFW",
"name": "test-group-rename",
"is_group": true,
"created": 1444959855
},
"ts": "1448327708.000007"
},
"group_unarchive": {
"type": "group_unarchive",
"channel": "G0CHZSXFW",
"ts": "1448327151.000004"
},
"im_close": {
"type": "im_close",
"user": "USLACKBOT",
"channel": "D0CJ1P4JJ"
},
"im_created": {
"type": "im_created",
"user": "U0F3LFX6K",
"channel": {
"id": "D0F3HHAQ3",
"is_im": true,
"user": "U0F3LFX6K",
"created": 1448254082,
"last_read": "0000000000.000000",
"latest": null,
"unread_count": 0,
"unread_count_display": 0,
"is_open": false
}
},
"im_marked": {
"type": "im_marked",
"channel": "D0CHZQWNP",
"ts": "1448253718.000002",
"dm_count": 0,
"unread_count_display": 0,
"num_mentions_display": 0,
"mention_count_display": 0
},
"im_open": {
"type": "im_open",
"user": "USLACKBOT",
"channel": "D0CJ1P4JJ"
},
"manual_presence_change": {
"type": "manual_presence_change",
"presence": "away",
"event_ts": "1448323107.373650"
},
"message::channel_archive": {
"user": "U0F3LFX6K",
"members": [
"U0CJ5PC7L",
"U0F3LFX6K"
],
"type": "message",
"subtype": "channel_archive",
"text": "<@U0F3LFX6K|carol> archived the channel (w/ 2 members)",
"channel": "C0CJ25PDM",
"ts": "1448491518.000007"
},
"message::channel_join": {
"user": "U0F3LFX6K",
"inviter": "U0CJ5PC7L",
"type": "message",
"subtype": "channel_join",
"text": "<@U0F3LFX6K|carol> has joined the channel",
"channel": "C0CJ25PDM",
"ts": "1448413360.000002"
},
"message::channel_leave": {
"user": "U0F3LFX6K",
"type": "message",
"subtype": "channel_leave",
"text": "<@U0F3LFX6K|carol> has left the channel",
"channel": "C0CJ25PDM",
"ts": "1448413366.000003"
},
"message::channel_name": {
"user": "U0F3LFX6K",
"old_name": "test",
"name": "test-channel-rename",
"type": "message",
"subtype": "channel_name",
"text": "<@U0F3LFX6K|carol> has renamed the channel from \"test\" to \"test-channel-rename\"",
"channel": "C0CJ25PDM",
"ts": "1449034681.000004"
},
"message::group_archive": {
"user": "U0F3LFX6K",
"type": "message",
"subtype": "group_archive",
"text": "<@U0F3LFX6K|carol> archived the private channel",
"channel": "G0CHZSXFW",
"ts": "1448490710.000005"
},
"message::group_join": {
"user": "U0F3LFX6K",
"inviter": "U0CJ5PC7L",
"type": "message",
"subtype": "group_join",
"text": "<@U0F3LFX6K|carol> has joined the group",
"channel": "G0CHZSXFW",
"ts": "1448486574.000003"
},
"message::group_leave": {
"user": "U0F3LFX6K",
"type": "message",
"subtype": "group_leave",
"text": "<@U0F3LFX6K|carol> has left the group",
"channel": "G0CHZSXFW",
"ts": "1448486522.000002"
},
"message::group_name": {
"user": "U0CJ5PC7L",
"old_name": "private",
"name": "private-rename",
"type": "message",
"subtype": "group_name",
"text": "<@U0CJ5PC7L|alice> has renamed the group from \"private\" to \"private-rename\"",
"channel": "G0CHZSXFW",
"ts": "1449034974.000003"
},
"message::group_unarchive": {
"user": "U0F3LFX6K",
"type": "message",
"subtype": "group_unarchive",
"text": "<@U0F3LFX6K|carol> un-archived the private channel",
"channel": "G0CHZSXFW",
"ts": "1448490716.000007"
},
"message::message_changed": {
"type": "message",
"message": {
"type": "message",
"user": "U0F3LFX6K",
"text": "Hi carol! :simple_smile:",
"edited": {
"user": "U0F3LFX6K",
"ts": "1448496795.000000"
},
"ts": "1448496754.000002"
},
"subtype": "message_changed",
"hidden": true,
"channel": "C0CJ25PDM",
"event_ts": "1448496795.861984",
"ts": "1448496795.000005"
},
"message::message_deleted": {
"type": "message",
"deleted_ts": "1448496776.000003",
"subtype": "message_deleted",
"hidden": true,
"channel": "C0CJ25PDM",
"event_ts": "1448496783.861926",
"ts": "1448496783.000004"
},
"pref_change": {
"type": "pref_change",
"name": "display_real_names_override",
"value": 1
},
"presence_change": {
"type": "presence_change",
"user": "U0CJ5PC7L",
"presence": "away"
},
"reaction_added": {
"type": "reaction_added",
"user": "U0CJ5PC7L",
"item": {
"type": "message",
"channel": "C0CHZA86Q",
"ts": "1444959632.000002"
},
"reaction": "+1",
"event_ts": "1450340664.394875"
},
"reaction_removed": {
"type": "reaction_removed",
"user": "U0CJ5PC7L",
"item": {
"type": "message",
"channel": "C0CHZA86Q",
"ts": "1444959632.000002"
},
"reaction": "+1",
"event_ts": "1450340723.395241"
},
"team_domain_change": {
"type": "team_domain_change",
"url": "https://sslack-api-test.slack.com",
"domain": "sslack-api-test",
"event_ts": "1448005008.450131"
},
"team_join": {
"type": "team_join",
"user": {
"id": "U0EV582MU",
"team_id": "T0CHZBU59",
"name": "eve",
"deleted": false,
"status": null,
"color": "674b1b",
"real_name": "eve",
"tz": "America/Los_Angeles",
"tz_label": "Pacific Standard Time",
"tz_offset": -28800,
"profile": {
"first_name": "eve",
"real_name": "eve",
"real_name_normalized": "eve",
"email": "leah+slack-api-test+eve@slack-corp.com",
"image_24": "https://secure.gravatar.com/avatar/11eb4e78a6b5e83a6434e831df883179.jpg?s=24&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0017-24.png",
"image_32": "https://secure.gravatar.com/avatar/11eb4e78a6b5e83a6434e831df883179.jpg?s=32&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0017-32.png",
"image_48": "https://secure.gravatar.com/avatar/11eb4e78a6b5e83a6434e831df883179.jpg?s=48&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0017-48.png",
"image_72": "https://secure.gravatar.com/avatar/11eb4e78a6b5e83a6434e831df883179.jpg?s=72&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0017-72.png",
"image_192": "https://secure.gravatar.com/avatar/11eb4e78a6b5e83a6434e831df883179.jpg?s=192&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F7fa9%2Fimg%2Favatars%2Fava_0017-192.png",
"image_512": "https://secure.gravatar.com/avatar/11eb4e78a6b5e83a6434e831df883179.jpg?s=512&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F7fa9%2Fimg%2Favatars%2Fava_0017-512.png",
"fields": null
},
"is_admin": false,
"is_owner": false,
"is_primary_owner": false,
"is_restricted": false,
"is_ultra_restricted": false,
"is_bot": false,
"presence": "away"
},
"cache_ts": 1448005248
},
"team_pref_change": {
"type": "team_pref_change",
"name": "require_at_for_mention",
"value": true
},
"team_rename": {
"type": "team_rename",
"name": "slack-api-test-test",
"event_ts": "1448004913.449540"
},
"user_change": {
"type": "user_change",
"user": {
"id": "U0CJ1TWKX",
"team_id": "T0CHZBU59",
"name": "bob",
"deleted": false,
"status": null,
"color": "4bbe2e",
"real_name": "bob",
"tz": "America/Los_Angeles",
"tz_label": "Pacific Standard Time",
"tz_offset": -28800,
"profile": {
"first_name": "bob",
"real_name": "bob",
"real_name_normalized": "bob",
"email": "leah+slack-api-test-user-change-test@slack-corp.com",
"image_24": "https://secure.gravatar.com/avatar/7c36ad3a7192f01d72cb3b189143eb4c.jpg?s=24&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0005-24.png",
"image_32": "https://secure.gravatar.com/avatar/7c36ad3a7192f01d72cb3b189143eb4c.jpg?s=32&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0005-32.png",
"image_48": "https://secure.gravatar.com/avatar/7c36ad3a7192f01d72cb3b189143eb4c.jpg?s=48&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0005-48.png",
"image_72": "https://secure.gravatar.com/avatar/7c36ad3a7192f01d72cb3b189143eb4c.jpg?s=72&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0005-72.png",
"image_192": "https://secure.gravatar.com/avatar/7c36ad3a7192f01d72cb3b189143eb4c.jpg?s=192&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F7fa9%2Fimg%2Favatars%2Fava_0005-192.png",
"image_512": "https://secure.gravatar.com/avatar/7c36ad3a7192f01d72cb3b189143eb4c.jpg?s=512&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F7fa9%2Fimg%2Favatars%2Fava_0005-512.png",
"fields": null
},
"is_admin": false,
"is_owner": false,
"is_primary_owner": false,
"is_restricted": false,
"is_ultra_restricted": false,
"is_bot": false
}
},
"user_typing": {
"type": "user_typing",
"channel": "C0CHZA86Q",
"user": "U0CJ1TWKX"
}
}
+59
View File
@@ -0,0 +1,59 @@
{
"id" : "F2147483862",
"created" : 1356032811,
"timestamp" : 1356032811,
"name" : "file.htm",
"title" : "My HTML file",
"mimetype" : "text\/plain",
"filetype" : "text",
"pretty_type": "Text",
"user" : "U2147483697",
"mode" : "hosted",
"editable" : true,
"is_external": false,
"external_type": "",
"username": "",
"size" : 12345,
"url_private": "https:\/\/slack.com\/files-pri\/T024BE7LD-F024BERPE\/1.png",
"url_private_download": "https:\/\/slack.com\/files-pri\/T024BE7LD-F024BERPE\/download\/1.png",
"thumb_64": "https:\/\/slack-files.com\/files-tmb\/T024BE7LD-F024BERPE-c66246\/1_64.png",
"thumb_80": "https:\/\/slack-files.com\/files-tmb\/T024BE7LD-F024BERPE-c66246\/1_80.png",
"thumb_360": "https:\/\/slack-files.com\/files-tmb\/T024BE7LD-F024BERPE-c66246\/1_360.png",
"thumb_360_gif": "https:\/\/slack-files.com\/files-tmb\/T024BE7LD-F024BERPE-c66246\/1_360.gif",
"thumb_360_w": 100,
"thumb_360_h": 100,
"thumb_480": "https:\/\/slack-files.com\/files-tmb\/T024BE7LD-F024BERPE-c66246\/1_480.png",
"thumb_480_w": 480,
"thumb_480_h": 480,
"thumb_160": "https:\/\/slack-files.com\/files-tmb\/T024BE7LD-F024BERPE-c66246\/1_160.png",
"permalink": "https:\/\/tinyspeck.slack.com\/files\/cal\/F024BERPE\/1.png",
"permalink_public" : "https:\/\/tinyspeck.slack.com\/T024BE7LD-F024BERPE-3f9216b62c",
"edit_link": "https:\/\/tinyspeck.slack.com\/files\/cal\/F024BERPE\/1.png/edit",
"preview": "&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;meta charset='utf-8'&gt;",
"preview_highlight": "&lt;div class=\"sssh-code\"&gt;&lt;div class=\"sssh-line\"&gt;&lt;pre&gt;&lt;!DOCTYPE html...",
"lines": 123,
"lines_more": 118,
"is_public": true,
"public_url_shared": false,
"display_as_bot" : false,
"channels": ["C024BE7LT"],
"groups": ["G12345"],
"ims": ["D12345"],
"initial_comment": {},
"num_stars": 7,
"is_starred": true,
"pinned_to": ["C024BE7LT"],
"reactions": [
{
"name": "astonished",
"count": 3,
"users": [ "U1", "U2", "U3" ]
},
{
"name": "facepalm",
"count": 1034,
"users": [ "U1", "U2", "U3", "U4", "U5" ]
}
],
"comments_count": 1
}
+27
View File
@@ -0,0 +1,27 @@
{
"id": "G024BE91L",
"name": "secretplans",
"is_group": "true",
"created": 1360782804,
"creator": "U024BE7LH",
"is_archived": false,
"is_mpim": false,
"members": [
"U024BE7LH"
],
"topic": {
"value": "Secret plans on hold",
"creator": "U024BE7LV",
"last_set": 1369677212
},
"purpose": {
"value": "Discuss secret plans that no-one else should know",
"creator": "U024BE7LH",
"last_set": 1360782804
},
"last_read": "1401383885.000061",
"latest": {},
"unread_count": 0,
"unread_count_display": 0
}
+7
View File
@@ -0,0 +1,7 @@
{
"id": "D024BFF1M",
"is_im": true,
"user": "U024BE7LH",
"created": 1360782804,
"is_user_deleted": false
}
@@ -0,0 +1,8 @@
{
"type": "member_joined_channel",
"user": "U0CJ1TWKX",
"channel": "C0CHZA86Q",
"channel_type": "C",
"team": "T0CHZBU59",
"inviter": "U123456789"
}
@@ -0,0 +1,7 @@
{
"type": "member_left_channel",
"user": "U0CJ5PC7L",
"channel": "C0CJ25PDM",
"channel_type": "C",
"team": "T0CHZBU59"
}
+15
View File
@@ -0,0 +1,15 @@
{
"id": "G024BE91L",
"name": "mpdm-user1--user2--user3-1",
"is_mpim": true,
"is_group": false,
"created": 1360782804,
"creator": "U024BE7LH",
"members": [
"U024BE7LH"
],
"last_read": "1401383885.000061",
"latest": { },
"unread_count": 0,
"unread_count_display": 0
}
+13
View File
@@ -0,0 +1,13 @@
{
"ok": true,
"url": "ws://localhost:5225",
"team": {
"id": "T02QYTVLG",
"name": "SF UTES",
"domain": "sfutes"
},
"self": {
"id": "U02QYTVLJ",
"name": "hess"
}
}
+604
View File
@@ -0,0 +1,604 @@
{
"ok": true,
"self": {
"id": "U0CJ5PC7L",
"name": "alice",
"prefs": {
"highlight_words": "",
"user_colors": "",
"color_names_in_list": true,
"growls_enabled": true,
"tz": "America\/Los_Angeles",
"push_dm_alert": true,
"push_mention_alert": true,
"push_everything": true,
"push_idle_wait": 2,
"push_sound": "b2.mp3",
"push_loud_channels": "",
"push_mention_channels": "",
"push_loud_channels_set": "",
"email_alerts": "instant",
"email_alerts_sleep_until": 0,
"email_misc": true,
"email_weekly": true,
"welcome_message_hidden": false,
"all_channels_loud": true,
"loud_channels": "",
"never_channels": "",
"loud_channels_set": "",
"show_member_presence": true,
"search_sort": "timestamp",
"expand_inline_imgs": true,
"expand_internal_inline_imgs": true,
"expand_snippets": false,
"posts_formatting_guide": true,
"seen_welcome_2": true,
"seen_ssb_prompt": false,
"seen_spaces_new_xp_tooltip": false,
"spaces_new_xp_banner_dismissed": false,
"search_only_my_channels": false,
"emoji_mode": "default",
"emoji_use": "{}",
"has_invited": true,
"has_uploaded": false,
"has_created_channel": true,
"search_exclude_channels": "",
"messages_theme": "default",
"webapp_spellcheck": true,
"no_joined_overlays": false,
"no_created_overlays": false,
"dropbox_enabled": false,
"seen_domain_invite_reminder": false,
"seen_member_invite_reminder": false,
"mute_sounds": false,
"arrow_history": false,
"tab_ui_return_selects": true,
"obey_inline_img_limit": true,
"new_msg_snd": "knock_brush.mp3",
"collapsible": false,
"collapsible_by_click": true,
"require_at": false,
"ssb_space_window": "",
"mac_ssb_bounce": "",
"mac_ssb_bullet": true,
"expand_non_media_attachments": true,
"show_typing": true,
"pagekeys_handled": true,
"last_snippet_type": "",
"display_real_names_override": 0,
"time24": false,
"enter_is_special_in_tbt": false,
"graphic_emoticons": false,
"convert_emoticons": true,
"autoplay_chat_sounds": true,
"ss_emojis": true,
"sidebar_behavior": "",
"seen_onboarding_start": false,
"onboarding_cancelled": false,
"seen_onboarding_slackbot_conversation": false,
"seen_onboarding_channels": false,
"seen_onboarding_direct_messages": false,
"seen_onboarding_invites": false,
"seen_onboarding_search": false,
"seen_onboarding_recent_mentions": false,
"seen_onboarding_starred_items": false,
"seen_onboarding_private_groups": false,
"onboarding_slackbot_conversation_step": 0,
"mark_msgs_read_immediately": true,
"start_scroll_at_oldest": true,
"snippet_editor_wrap_long_lines": false,
"ls_disabled": false,
"sidebar_theme": "default",
"sidebar_theme_custom_values": "",
"f_key_search": false,
"k_key_omnibox": true,
"speak_growls": false,
"mac_speak_voice": "com.apple.speech.synthesis.voice.Alex",
"mac_speak_speed": 250,
"comma_key_prefs": false,
"at_channel_suppressed_channels": "",
"push_at_channel_suppressed_channels": "",
"prompted_for_email_disabling": false,
"full_text_extracts": false,
"no_text_in_notifications": false,
"muted_channels": "",
"no_macssb1_banner": false,
"no_winssb1_banner": false,
"no_omnibox_in_channels": false,
"k_key_omnibox_auto_hide_count": 0,
"hide_user_group_info_pane": false,
"mentions_exclude_at_user_groups": false,
"privacy_policy_seen": true,
"search_exclude_bots": false,
"fuzzy_matching": false,
"load_lato_2": false,
"fuller_timestamps": false,
"last_seen_at_channel_warning": 0,
"flex_resize_window": false,
"msg_preview": false,
"msg_preview_displaces": true,
"msg_preview_persistent": true,
"emoji_autocomplete_big": false,
"winssb_run_from_tray": true,
"winssb_window_flash_behavior": "idle",
"two_factor_auth_enabled": false,
"two_factor_type": null,
"two_factor_backup_type": null,
"mentions_exclude_at_channels": true,
"confirm_clear_all_unreads": true,
"confirm_user_marked_away": true,
"box_enabled": false,
"seen_single_emoji_msg": false,
"confirm_sh_call_start": true,
"preferred_skin_tone": "",
"show_all_skin_tones": false,
"msg_select": "{ \"on\":false, \"single\":true, \"key\":true, \"links\":false, \"hover\":false }"
},
"created": 1444958977,
"manual_presence": "active",
"enterprise_user": {
"id": "T0CHZBU59",
"enterprise_id": "E12EF3W42",
"enterprise_name": "bertorg",
"is_admin": false,
"is_owner": false,
"teams": [
"T0CHZBU59"
]
}
},
"team": {
"id": "T0CHZBU59",
"name": "slack-api-test",
"email_domain": "",
"domain": "slack-api-test",
"msg_edit_window_mins": -1,
"prefs": {
"default_channels": [
"C0CHZA86Q",
"C0CJ5FF0R"
],
"msg_edit_window_mins": -1,
"allow_message_deletion": true,
"hide_referers": true,
"display_real_names": false,
"who_can_at_everyone": "regular",
"who_can_at_channel": "ra",
"warn_before_at_channel": "always",
"who_can_create_channels": "regular",
"who_can_archive_channels": "regular",
"who_can_create_groups": "ra",
"who_can_post_general": "ra",
"who_can_kick_channels": "admin",
"who_can_kick_groups": "regular",
"who_can_create_delete_user_groups": "admin",
"who_can_edit_user_groups": "admin",
"retention_type": 0,
"retention_duration": 0,
"group_retention_type": 0,
"group_retention_duration": 0,
"dm_retention_type": 0,
"dm_retention_duration": 0,
"file_retention_type": 0,
"file_retention_duration": 0,
"require_at_for_mention": 0,
"compliance_export_start": 0,
"auth_mode": "normal",
"who_can_manage_integrations": "regular"
},
"icon": {
"image_34": "https:\/\/slack.global.ssl.fastly.net\/66f9\/img\/avatars-teams\/ava_0014-34.png",
"image_44": "https:\/\/slack.global.ssl.fastly.net\/66f9\/img\/avatars-teams\/ava_0014-44.png",
"image_68": "https:\/\/slack.global.ssl.fastly.net\/66f9\/img\/avatars-teams\/ava_0014-68.png",
"image_88": "https:\/\/slack.global.ssl.fastly.net\/66f9\/img\/avatars-teams\/ava_0014-88.png",
"image_102": "https:\/\/slack.global.ssl.fastly.net\/66f9\/img\/avatars-teams\/ava_0014-102.png",
"image_132": "https:\/\/slack.global.ssl.fastly.net\/66f9\/img\/avatars-teams\/ava_0014-132.png",
"image_default": true
},
"over_storage_limit": false,
"plan": "",
"profile": [
],
"over_integrations_limit": true
},
"latest_event_ts": "1444959257.000000",
"channels": [
{
"id": "C0CHZA86Q",
"name": "general",
"is_channel": true,
"created": 1444958977,
"creator": "U0CJ5PC7L",
"is_archived": false,
"is_general": true,
"has_pins": false,
"is_member": true,
"last_read": "0000000000.000000",
"latest": {
"user": "U0CJ1TWKX",
"type": "message",
"subtype": "channel_join",
"text": "<@U0CJ1TWKX|bob> has joined the channel",
"ts": "1444959632.000002"
},
"unread_count": 0,
"unread_count_display": 0,
"members": [
"U0CJ1TWKX",
"U0CJ5PC7L"
],
"topic": {
"value": "Company-wide announcements and work-based matters",
"creator": "",
"last_set": 0
},
"purpose": {
"value": "This channel is for team-wide communication and announcements. All team members are in this channel.",
"creator": "",
"last_set": 0
}
},
{
"id": "C0CJ5FF0R",
"name": "random",
"is_channel": true,
"created": 1444958977,
"creator": "U0CJ5PC7L",
"is_archived": false,
"is_general": false,
"has_pins": false,
"is_member": true,
"last_read": "0000000000.000000",
"latest": {
"user": "U0CJ1TWKX",
"type": "message",
"subtype": "channel_join",
"text": "<@U0CJ1TWKX|bob> has joined the channel",
"ts": "1444959632.000002"
},
"unread_count": 0,
"unread_count_display": 0,
"members": [
"U0CJ1TWKX",
"U0CJ5PC7L"
],
"topic": {
"value": "Non-work banter and water cooler conversation",
"creator": "",
"last_set": 0
},
"purpose": {
"value": "A place for non-work-related flimflam, faffing, hodge-podge or jibber-jabber you'd prefer to keep out of more focused work-related channels.",
"creator": "",
"last_set": 0
}
},
{
"id": "C0CJ25PDM",
"name": "test",
"is_channel": true,
"created": 1444959237,
"creator": "U0CJ5PC7L",
"is_archived": false,
"is_general": false,
"has_pins": false,
"is_member": true,
"last_read": "0000000000.000000",
"latest": {
"user": "U0CJ5PC7L",
"type": "message",
"subtype": "channel_join",
"text": "<@U0CJ5PC7L|alice> has joined the channel",
"ts": "1444959236.000002"
},
"unread_count": 0,
"unread_count_display": 0,
"members": [
"U0CJ5PC7L"
],
"topic": {
"value": "",
"creator": "",
"last_set": 0
},
"purpose": {
"value": "",
"creator": "",
"last_set": 0
}
}
],
"groups": [
{
"id": "G0CHZSXFW",
"name": "private",
"is_group": true,
"created": 1444959855,
"creator": "U0CJ5PC7L",
"is_archived": false,
"is_mpim": false,
"has_pins": false,
"is_open": true,
"last_read": "0000000000.000000",
"latest": {
"user": "U0CJ1TWKX",
"inviter": "U0CJ5PC7L",
"type": "message",
"subtype": "group_join",
"text": "<@U0CJ1TWKX|bob> has joined the group",
"ts": "1444959855.000003"
},
"unread_count": 0,
"unread_count_display": 0,
"members": [
"U0CJ5PC7L"
],
"topic": {
"value": "",
"creator": "",
"last_set": 0
},
"purpose": {
"value": "",
"creator": "",
"last_set": 0
}
}
],
"ims": [
{
"id": "D0CJ1P4JJ",
"is_im": true,
"user": "USLACKBOT",
"created": 1444958977,
"has_pins": false,
"last_read": "1444958980.000002",
"latest": {
"type": "message",
"user": "USLACKBOT",
"text": "We just added $25 in credits to your team\u2019s account to celebrate the addition of <@U0CJ1TWKX>. Add another team member, and we\u2019ll add another $25 more when they join. More the merrier!",
"ts": "1444959632.000003"
},
"unread_count": 1,
"unread_count_display": 1,
"is_open": true
},
{
"id": "D0CHZQWNP",
"is_im": true,
"user": "U0CJ1TWKX",
"created": 1444959632,
"has_pins": false,
"last_read": "0000000000.000000",
"latest": {
"type": "message",
"user": "U0CJ1TWKX",
"text": "hi alice!",
"ts": "1444959642.000002"
},
"unread_count": 1,
"unread_count_display": 1,
"is_open": true
}
],
"cache_ts": 1444959857,
"users": [
{
"id": "U0CJ5PC7L",
"name": "alice",
"deleted": false,
"status": null,
"color": "9f69e7",
"real_name": "",
"tz": "America\/Los_Angeles",
"tz_label": "Pacific Daylight Time",
"tz_offset": -25200,
"profile": {
"real_name": "",
"real_name_normalized": "",
"email": "leah+slack-api-test-alice@slack-corp.com",
"image_24": "https:\/\/secure.gravatar.com\/avatar\/371dba50bd80313b4037d0bd41aa057b.jpg?s=24&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0026-24.png",
"image_32": "https:\/\/secure.gravatar.com\/avatar\/371dba50bd80313b4037d0bd41aa057b.jpg?s=32&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0026-32.png",
"image_48": "https:\/\/secure.gravatar.com\/avatar\/371dba50bd80313b4037d0bd41aa057b.jpg?s=48&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F272a%2Fimg%2Favatars%2Fava_0026-48.png",
"image_72": "https:\/\/secure.gravatar.com\/avatar\/371dba50bd80313b4037d0bd41aa057b.jpg?s=72&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0026-72.png",
"image_192": "https:\/\/secure.gravatar.com\/avatar\/371dba50bd80313b4037d0bd41aa057b.jpg?s=192&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F7fa9%2Fimg%2Favatars%2Fava_0026-192.png",
"image_512": "https:\/\/secure.gravatar.com\/avatar\/371dba50bd80313b4037d0bd41aa057b.jpg?s=512&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F7fa9%2Fimg%2Favatars%2Fava_0026-512.png"
},
"is_admin": true,
"is_owner": true,
"is_primary_owner": true,
"is_restricted": false,
"is_ultra_restricted": false,
"is_bot": false,
"has_files": false,
"has_2fa": false,
"presence": "active"
},
{
"id": "U0CJ1TWKX",
"name": "bob",
"deleted": false,
"status": null,
"color": "4bbe2e",
"real_name": "bob",
"tz": "America\/Los_Angeles",
"tz_label": "Pacific Daylight Time",
"tz_offset": -25200,
"profile": {
"first_name": "bob",
"real_name": "bob",
"real_name_normalized": "bob",
"email": "leah+slack-api-test-bob@slack-corp.com",
"image_24": "https:\/\/secure.gravatar.com\/avatar\/ce30a54b00402f5cad7cefd39bf19106.jpg?s=24&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0005-24.png",
"image_32": "https:\/\/secure.gravatar.com\/avatar\/ce30a54b00402f5cad7cefd39bf19106.jpg?s=32&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0005-32.png",
"image_48": "https:\/\/secure.gravatar.com\/avatar\/ce30a54b00402f5cad7cefd39bf19106.jpg?s=48&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0005-48.png",
"image_72": "https:\/\/secure.gravatar.com\/avatar\/ce30a54b00402f5cad7cefd39bf19106.jpg?s=72&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0005-72.png",
"image_192": "https:\/\/secure.gravatar.com\/avatar\/ce30a54b00402f5cad7cefd39bf19106.jpg?s=192&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F7fa9%2Fimg%2Favatars%2Fava_0005-192.png",
"image_512": "https:\/\/secure.gravatar.com\/avatar\/ce30a54b00402f5cad7cefd39bf19106.jpg?s=512&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F7fa9%2Fimg%2Favatars%2Fava_0005-512.png"
},
"is_admin": false,
"is_owner": false,
"is_primary_owner": false,
"is_restricted": false,
"is_ultra_restricted": false,
"is_bot": false,
"has_files": false,
"has_2fa": false,
"presence": "away"
},
{
"id": "U0F3LFX6K",
"team_id": "T0CHZBU59",
"name": "carol",
"deleted": false,
"status": null,
"color": "e96699",
"real_name": "carol",
"tz": "America/Los_Angeles",
"tz_label": "Pacific Standard Time",
"tz_offset": -28800,
"profile": {
"first_name": "carol",
"real_name": "carol",
"real_name_normalized": "carol",
"email": "leah+slack-api-test+carol@slack-corp.com",
"image_24": "https://secure.gravatar.com/avatar/fe6f44ad42f1c7eb53321c43cd4a3253.jpg?s=24&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0008-24.png",
"image_32": "https://secure.gravatar.com/avatar/fe6f44ad42f1c7eb53321c43cd4a3253.jpg?s=32&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0008-32.png",
"image_48": "https://secure.gravatar.com/avatar/fe6f44ad42f1c7eb53321c43cd4a3253.jpg?s=48&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0008-48.png",
"image_72": "https://secure.gravatar.com/avatar/fe6f44ad42f1c7eb53321c43cd4a3253.jpg?s=72&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0008-72.png",
"image_192": "https://secure.gravatar.com/avatar/fe6f44ad42f1c7eb53321c43cd4a3253.jpg?s=192&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F7fa9%2Fimg%2Favatars%2Fava_0008-192.png",
"image_512": "https://secure.gravatar.com/avatar/fe6f44ad42f1c7eb53321c43cd4a3253.jpg?s=512&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F7fa9%2Fimg%2Favatars%2Fava_0008-512.png",
"fields": null
},
"is_admin": false,
"is_owner": false,
"is_primary_owner": false,
"is_restricted": false,
"is_ultra_restricted": false,
"is_bot": false,
"has_2fa": false,
"presence": "active"
},
{
"id": "USLACKBOT",
"name": "slackbot",
"deleted": false,
"status": null,
"color": "757575",
"real_name": "slackbot",
"tz": null,
"tz_label": "Pacific Daylight Time",
"tz_offset": -25200,
"profile": {
"first_name": "slackbot",
"last_name": "",
"image_24": "https:\/\/slack.global.ssl.fastly.net\/66f9\/img\/slackbot_24.png",
"image_32": "https:\/\/slack.global.ssl.fastly.net\/66f9\/img\/slackbot_32.png",
"image_48": "https:\/\/slack.global.ssl.fastly.net\/66f9\/img\/slackbot_48.png",
"image_72": "https:\/\/slack.global.ssl.fastly.net\/66f9\/img\/slackbot_72.png",
"image_192": "https:\/\/slack.global.ssl.fastly.net\/66f9\/img\/slackbot_192.png",
"image_512": "https:\/\/slack.global.ssl.fastly.net\/7fa9\/img\/slackbot_512.png",
"real_name": "slackbot",
"real_name_normalized": "slackbot",
"email": null
},
"is_admin": false,
"is_owner": false,
"is_primary_owner": false,
"is_restricted": false,
"is_ultra_restricted": false,
"is_bot": false,
"presence": "active"
},
{
"id": "U0EUYE1E0",
"team_id": "T0CHZBU59",
"name": "test-bot",
"deleted": false,
"status": null,
"color": "3c989f",
"real_name": "Test Bot",
"tz": null,
"tz_label": "Pacific Daylight Time",
"tz_offset": -25200,
"profile": {
"bot_id": "B0EV07BEH",
"image_24": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_24.jpg",
"image_32": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_32.jpg",
"image_48": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_48.jpg",
"image_72": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_72.jpg",
"image_192": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_192.jpg",
"image_512": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_512.jpg",
"image_1024": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_512.jpg",
"image_original": "https://avatars.slack-edge.com/2015-11-19/14986249557_24078e22bcd76fabab72_original.jpg",
"first_name": "Test",
"last_name": "Bot",
"title": "bot-stuff",
"avatar_hash": "24078e22bcd7",
"real_name": "Test Bot",
"real_name_normalized": "Test Bot",
"fields": null
},
"is_admin": false,
"is_owner": false,
"is_primary_owner": false,
"is_restricted": false,
"is_ultra_restricted": false,
"is_bot": true,
"presence": "away"
},
{
"id": "W0E2S5A3B",
"team_id": "T0CHZBU59",
"name": "dave",
"deleted": false,
"status": null,
"color": "e96699",
"real_name": "dave",
"tz": "America/Los_Angeles",
"tz_label": "Pacific Standard Time",
"tz_offset": -28800,
"profile": {
"first_name": "dave",
"real_name": "dave",
"real_name_normalized": "dave",
"email": "bert+slack-api-test+dave@slack-corp.com",
"image_24": "https://secure.gravatar.com/avatar/fe6f44ad42f1c7eb53321c43cd4a3253.jpg?s=24&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0008-24.png",
"image_32": "https://secure.gravatar.com/avatar/fe6f44ad42f1c7eb53321c43cd4a3253.jpg?s=32&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0008-32.png",
"image_48": "https://secure.gravatar.com/avatar/fe6f44ad42f1c7eb53321c43cd4a3253.jpg?s=48&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0008-48.png",
"image_72": "https://secure.gravatar.com/avatar/fe6f44ad42f1c7eb53321c43cd4a3253.jpg?s=72&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F66f9%2Fimg%2Favatars%2Fava_0008-72.png",
"image_192": "https://secure.gravatar.com/avatar/fe6f44ad42f1c7eb53321c43cd4a3253.jpg?s=192&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F7fa9%2Fimg%2Favatars%2Fava_0008-192.png",
"image_512": "https://secure.gravatar.com/avatar/fe6f44ad42f1c7eb53321c43cd4a3253.jpg?s=512&d=https%3A%2F%2Fslack.global.ssl.fastly.net%2F7fa9%2Fimg%2Favatars%2Fava_0008-512.png",
"fields": null
},
"is_admin": false,
"is_owner": false,
"is_primary_owner": false,
"is_restricted": false,
"is_ultra_restricted": false,
"is_bot": false,
"has_2fa": false,
"presence": "active"
}
],
"cache_version": "v11-mouse",
"cache_ts_version": "v1-cat",
"bots": [
{
"id": "B0CJ5FF1P",
"deleted": false,
"name": "gdrive"
},
{
"id": "B0EV07BEH",
"deleted": false,
"name": "bot",
"icons": {
"image_36": "https://a.slack-edge.com/2fac/plugins/bot/assets/service_36.png",
"image_48": "https://a.slack-edge.com/2fac/plugins/bot/assets/service_48.png",
"image_72": "https://a.slack-edge.com/12b5a/plugins/bot/assets/service_72.png"
}
}
],
"url": "ws://localhost:5221"
}
+42
View File
@@ -0,0 +1,42 @@
{
"ok": true,
"user": {
"id": "W012A3CDE",
"team_id": "T012AB3C4",
"name": "spengler",
"deleted": false,
"color": "9f69e7",
"real_name": "Egon Spengler",
"tz": "America/Los_Angeles",
"tz_label": "Pacific Daylight Time",
"tz_offset": -25200,
"profile": {
"avatar_hash": "ge3b51ca72de",
"status_text": "Print is dead",
"status_emoji": ":books:",
"real_name": "Egon Spengler",
"display_name": "spengler",
"real_name_normalized": "Egon Spengler",
"display_name_normalized": "spengler",
"email": "spengler@ghostbusters.example.com",
"image_24": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_32": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_48": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_72": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_192": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"image_512": "https://.../avatar/e3b51ca72dee4ef87916ae2b9240df50.jpg",
"team": "T012AB3C4"
},
"is_admin": true,
"is_owner": false,
"is_primary_owner": false,
"is_restricted": false,
"is_ultra_restricted": false,
"is_bot": false,
"is_stranger": false,
"updated": 1502138686,
"is_app_user": false,
"has_2fa": false,
"locale": "en-US"
}
}
+31
View File
@@ -0,0 +1,31 @@
{
"id": "S0614TZR7",
"team_id": "T060RNRCH",
"is_usergroup": true,
"name": "Workspace Admins",
"description": "A group of all Administrators on your workspace.",
"handle": "admins",
"is_external": false,
"date_create": 1446598059,
"date_update": 1446670362,
"date_delete": 0,
"auto_type": "admin",
"created_by": "USLACKBOT",
"updated_by": "U060RNRCZ",
"deleted_by": null,
"prefs": {
"channels": [
],
"groups": [
]
},
"users": [
"U060RNRCZ",
"U060ULRC0",
"U06129G2V",
"U061309JM"
],
"user_count": "4"
}
@@ -0,0 +1,63 @@
//
// SKClientTests.swift
// SlackKitTests
//
// Created by Peter Zignego on 3/5/19.
// Copyright © 2019 Peter Zignego. All rights reserved.
//
import XCTest
@testable import SKClient
final class SKClientTests: XCTestCase {
static var rootPath: String {
#if Xcode
return Bundle(for: self).resourcePath!
#else
return "SlackKitTests/Resources"
#endif
}
struct JSONData {
static let rtm_start = try! Data(contentsOf: URL(fileURLWithPath: "\(rootPath)/rtm.start.json"))
static let member_joined_channel = try! Data(contentsOf: URL(fileURLWithPath: "\(rootPath)/member_joined_channel.json"))
static let member_left_channel = try! Data(contentsOf: URL(fileURLWithPath: "\(rootPath)/member_left_channel.json"))
}
static var allTests = [
("testMemberJoinedChannel", testMemberJoinedChannel),
("testMemberLeftChannel", testMemberLeftChannel)
]
var client: Client!
override func setUp() {
client = Client()
client.initialSetup(JSON: try! JSONSerialization.jsonObject(with: JSONData.rtm_start, options: []) as! [String: Any])
}
func testMemberJoinedChannel() {
let channelId = "C0CHZA86Q"
let userId = "U0CJ1TWKX"
let json = try! JSONSerialization.jsonObject(with: JSONData.member_joined_channel, options: []) as! [String: Any]
client.memberJoinedChannel(Event(json))
if let contains = client.channels[channelId]?.members?.contains(userId) {
XCTAssertTrue(contains)
} else {
XCTFail()
}
}
func testMemberLeftChannel() {
let channelId = "C0CJ25PDM"
let userId = "U0CJ5PC7L"
let json = try! JSONSerialization.jsonObject(with: JSONData.member_left_channel, options: []) as! [String: Any]
client.memberLeftChannel(Event(json))
if let contains = client.channels[channelId]?.members?.contains(userId) {
XCTAssertFalse(contains)
} else {
XCTFail()
}
}
}
+149
View File
@@ -0,0 +1,149 @@
//
// SKCoreTests.swift
//
// Copyright © 2017 Peter Zignego. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import XCTest
@testable import SKCore
final class SKCoreTests: XCTestCase {
static var rootPath: String {
#if Xcode
return Bundle(for: self).resourcePath!
#else
return "SlackKitTests/Resources"
#endif
}
struct JSONData {
static let channel = try! Data(contentsOf: URL(fileURLWithPath: "\(rootPath)/channel.json"))
static let conversation = try! Data(contentsOf: URL(fileURLWithPath: "\(rootPath)/conversation.json"))
static let file = try! Data(contentsOf: URL(fileURLWithPath: "\(rootPath)/file.json"))
static let group = try! Data(contentsOf: URL(fileURLWithPath: "\(rootPath)/group.json"))
static let im = try! Data(contentsOf: URL(fileURLWithPath: "\(rootPath)/im.json"))
static let mpim = try! Data(contentsOf: URL(fileURLWithPath: "\(rootPath)/mpim.json"))
static let user = try! Data(contentsOf: URL(fileURLWithPath: "\(rootPath)/user.json"))
static let usergroup = try! Data(contentsOf: URL(fileURLWithPath: "\(rootPath)/usergroup.json"))
static let events = try! Data(contentsOf: URL(fileURLWithPath: "\(rootPath)/events.json"))
}
static var allTests = [
("testChannel", testChannel),
("testConversation", testConversation),
("testFile", testFile),
("testGroup", testGroup),
("testIm", testIm),
("TestMpim", testMpim),
("testUser", testUser),
("testUserGroup", testUserGroup),
("testEvents", testEvents)
]
func testEvents() {
let eventsKeys = [
// Bot Event
"bot_added","bot_changed",
// Channel Event
"channel_archive","channel_created","channel_deleted",
"channel_joined", "channel_left", "channel_marked",
"channel_rename","channel_unarchive",
// Group Event
"group_archive","group_close","group_joined",
"group_left", "group_marked","group_rename","group_unarchive",
// Im Event
"im_close","im_created","im_marked","im_open", "manual_presence_change",
// Message Event
"message::channel_join", "message::channel_leave", "message::channel_name",
"message::group_join", "message::group_name", "message::group_unarchive",
"message::message_changed", "message::message_deleted",
// Preference Event
"pref_change", "presence_change",
// Reaction Event
"reaction_added", "reaction_removed",
// Team Event
"team_domain_change", "team_join", "team_pref_change",
"team_rename",
// User Event
"user_change", "user_typing"
]
let data = JSONData.events
let json = try! JSONSerialization.jsonObject(with: data, options: []) as! [String: Any]
_ = eventsKeys.map { json[$0] as! [String: Any] }.map { Event($0) }
}
func testChannel() {
let data = JSONData.channel
let json = try! JSONSerialization.jsonObject(with: data, options: []) as! [String : Any]
let channel = Channel(channel: json)
XCTAssertNotNil(channel)
}
func testConversation() {
let data = JSONData.conversation
let json = try! JSONSerialization.jsonObject(with: data, options: []) as! [String : Any]
let channel = Channel(channel: json["channel"] as?[String : Any])
XCTAssertNotNil(channel)
}
func testFile() {
let data = JSONData.file
let json = try! JSONSerialization.jsonObject(with: data, options: []) as! [String : Any]
let file = File(file: json)
XCTAssertNotNil(file)
}
func testGroup() {
let data = JSONData.group
let json = try! JSONSerialization.jsonObject(with: data, options: []) as! [String: Any]
let channel = Channel(channel: json)
XCTAssertNotNil(channel)
}
func testIm() {
let data = JSONData.im
let json = try! JSONSerialization.jsonObject(with: data, options: []) as! [String: Any]
let channel = Channel(channel: json)
XCTAssertNotNil(channel)
}
func testMpim() {
let data = JSONData.mpim
let json = try! JSONSerialization.jsonObject(with: data, options: []) as! [String: Any]
let channel = Channel(channel: json)
XCTAssertNotNil(channel)
}
func testUser() {
let data = JSONData.user
let json = try! JSONSerialization.jsonObject(with: data, options: []) as! [String: Any]
let user = User(user: json)
XCTAssertNotNil(user)
}
func testUserGroup() {
let data = JSONData.usergroup
let json = try! JSONSerialization.jsonObject(with: data, options: []) as! [String: Any]
let userGroup = UserGroup(userGroup: json)
XCTAssertNotNil(userGroup)
}
}
+22
View File
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
@@ -0,0 +1,16 @@
//
// SlackKitTests.xcconfig
// SlackKit
//
// Created by Peter Zignego on 1/28/19.
// Copyright © 2019 Peter Zignego. All rights reserved.
//
// Configuration settings file format documentation can be found at:
// https://help.apple.com/xcode/#/dev745c5c974
FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = "$(PROJECT_DIR)/Frameworks/macOS";
FRAMEWORK_SEARCH_PATHS[sdk=appletvos*] = "$(PROJECT_DIR)/Frameworks/tvOS";
FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*] = "$(PROJECT_DIR)/Frameworks/iOS";
FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*] = "$(PROJECT_DIR)/Frameworks/iOS";
FRAMEWORK_SEARCH_PATHS[sdk=appletvsimulator*] = "$(PROJECT_DIR)/Frameworks/tvOS";
+31
View File
@@ -0,0 +1,31 @@
import XCTest
extension SKClientTests {
static let __allTests = [
("testMemberJoinedChannel", testMemberJoinedChannel),
("testMemberLeftChannel", testMemberLeftChannel),
]
}
extension SKCoreTests {
static let __allTests = [
("testChannel", testChannel),
("testConversation", testConversation),
("testEvents", testEvents),
("testFile", testFile),
("testGroup", testGroup),
("testIm", testIm),
("testMpim", testMpim),
("testUser", testUser),
("testUserGroup", testUserGroup),
]
}
#if !os(macOS)
public func __allTests() -> [XCTestCaseEntry] {
return [
testCase(SKClientTests.__allTests),
testCase(SKCoreTests.__allTests),
]
}
#endif
+27
View File
@@ -7,6 +7,7 @@ trigger:
- master
jobs:
# Builds
- job: macOS
pool:
vmImage: 'macOS-10.13'
@@ -19,6 +20,14 @@ jobs:
configuration: 'Release'
xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace'
xcodeVersion: '10'
- task: Xcode@5
inputs:
actions: 'test'
scheme: 'SlackKitTests'
sdk: 'macosx'
configuration: 'Debug'
xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace'
xcodeVersion: '10'
- job: iOS
pool:
vmImage: 'macOS-10.13'
@@ -31,6 +40,14 @@ jobs:
configuration: 'Release'
xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace'
xcodeVersion: '10'
- task: Xcode@5
inputs:
actions: 'test'
scheme: 'SlackKitTests'
sdk: 'iphonesimulator'
configuration: 'Debug'
xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace'
xcodeVersion: '10'
- job: tvOS
pool:
vmImage: 'macOS-10.13'
@@ -43,6 +60,14 @@ jobs:
configuration: 'Release'
xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace'
xcodeVersion: '10'
- task: Xcode@5
inputs:
actions: 'test'
scheme: 'SlackKitTests'
sdk: 'appletvsimulator'
configuration: 'Debug'
xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace'
xcodeVersion: '10'
- job: Linux
pool:
vmImage: 'ubuntu-16.04'
@@ -55,3 +80,5 @@ jobs:
tar xzf swift-4.2.1-RELEASE-ubuntu16.04.tar.gz -C $(Build.SourcesDirectory)
# Swift build
$(Build.SourcesDirectory)/swift-4.2.1-RELEASE-ubuntu16.04/usr/bin/swift build
# Swift test
$(Build.SourcesDirectory)/swift-4.2.1-RELEASE-ubuntu16.04/usr/bin/swift test