Compare commits

..

16 Commits

Author SHA1 Message Date
Peter Zignego f6d6c779ae Update dependencies 2017-03-18 11:14:56 -04:00
Peter Zignego 11bb50f8d2 Delete Podfile.lock 2017-03-13 11:56:05 -04:00
Peter Zignego d721e0ba1a Delete Cartfile.resolved 2017-03-13 11:55:54 -04:00
Peter Zignego ba6066875c Update Package.swift 2017-03-13 11:55:40 -04:00
Peter Zignego 0f1a1a9de5 Update Cartfile 2017-03-13 11:54:43 -04:00
Peter Zignego a81cebf5c8 Update Podfile 2017-03-13 11:54:05 -04:00
Peter Zignego 94c9f7fe5a Bump version 2017-01-25 12:31:34 -05:00
Peter Zignego be8a5879f3 Merge pull request #77 from norwoodsystems/master
Updated podspec
2017-01-25 12:29:03 -05:00
kiancheong c657919704 Updated podspec 2017-01-25 14:42:19 +08:00
Peter Zignego abeef21d7a Merge pull request #75 from sersoft-gmbh/master
Fix author_name in Attachment, add Markdown fields for Attachments, fix optionality
2017-01-21 10:53:28 -05:00
Florian Friedrich 79e3b14593 Add missing ? in AttachmentField initializer 2017-01-20 16:16:35 +01:00
Florian Friedrich d9a4cda9b0 Made AttachmentField init params optional, fix author_name key in Attachment, add markdown fields to attachment 2017-01-20 16:11:08 +01:00
Peter Zignego 12b316da0b Merge pull request #73 from strogonoff/patch-1
OAuth: scopes must be supplied
2017-01-18 09:20:53 -05:00
Anton Strogonoff 13cade5c00 OAuth: scopes must be supplied
Slack API spec requires the "scope" parameter when requesting authorization code. Without it a token cannot be obtained as request fails with an error.
2017-01-18 16:21:03 +07:00
Peter Zignego 051e8dd6c8 Fix podspec 2017-01-16 22:11:52 -05:00
Peter Zignego 1adea1c54e Fix podspec 2017-01-16 22:02:43 -05:00
11 changed files with 40 additions and 48 deletions
+2 -2
View File
@@ -1,2 +1,2 @@
github "https://github.com/daltoniam/Starscream" == 2.0.2
github "https://github.com/pvzig/swifter.git" == 3.0.4
github "https://github.com/daltoniam/Starscream" == 2.0.3
github "https://github.com/pvzig/swifter" == 1.3.3
-2
View File
@@ -1,2 +0,0 @@
github "daltoniam/Starscream" "2.0.2"
github "pvzig/swifter" "3.0.4"
+3 -3
View File
@@ -4,8 +4,8 @@ let package = Package(
name: "SlackKit",
targets: [],
dependencies: [
.Package(url: "https://github.com/pvzig/swifter.git",
majorVersion: 3, minor: 0),
.Package(url: "https://github.com/daltoniam/Starscream", majorVersion: 2, minor: 0)
.Package(url: "https://github.com/pvzig/swifter",
majorVersion: 1),
.Package(url: "https://github.com/daltoniam/Starscream", majorVersion: 2)
]
)
+7 -7
View File
@@ -3,16 +3,16 @@ source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target 'SlackKit OS X' do
pod 'Starscream', '~> 2.0.2'
pod 'Swifter', :git => 'https://github.com/pvzig/swifter.git', :tag => '3.0.4'
pod 'Starscream', '~> 2.0.3'
pod 'Swifter', :git => 'https://github.com/pvzig/swifter.git', :tag => '1.3.3'
end
target 'SlackKit iOS' do
pod 'Starscream', '~> 2.0.2'
pod 'Swifter', :git => 'https://github.com/pvzig/swifter.git', :tag => '3.0.4'
pod 'Starscream', '~> 2.0.3'
pod 'Swifter', :git => 'https://github.com/pvzig/swifter.git', :tag => '1.3.3'
end
target 'SlackKit tvOS' do
pod 'Starscream', '~> 2.0.2'
pod 'Swifter', :git => 'https://github.com/pvzig/swifter.git', :tag => '3.0.4'
end
pod 'Starscream', '~> 2.0.3'
pod 'Swifter', :git => 'https://github.com/pvzig/swifter.git', :tag => '1.3.3'
end
-25
View File
@@ -1,25 +0,0 @@
PODS:
- Starscream (2.0.2)
- Swifter (1.3.2)
DEPENDENCIES:
- Starscream (~> 2.0.2)
- Swifter (from `https://github.com/pvzig/swifter.git`, tag `3.0.4`)
EXTERNAL SOURCES:
Swifter:
:git: https://github.com/pvzig/swifter.git
:tag: 3.0.4
CHECKOUT OPTIONS:
Swifter:
:git: https://github.com/pvzig/swifter.git
:tag: 3.0.4
SPEC CHECKSUMS:
Starscream: 6c135a34e0a6e60cedaa0b30db67a4c05cf7cd38
Swifter: dd1800ba8eb3e28b22b8bd20f91a8561a0110fac
PODFILE CHECKSUM: cd86ea0f8422027c9d5fa3c40243ae7a816fb79a
COCOAPODS: 1.1.0.rc.3
+2 -2
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SlackKit"
s.version = "3.1.8"
s.version = "3.1.9"
s.summary = "a Slack client library for OS X, iOS, and tvOS written in Swift"
s.homepage = "https://github.com/pvzig/SlackKit"
s.license = 'MIT'
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.10'
s.tvos.deployment_target = '9.0'
s.requires_arc = true
s.source_files = 'SlackKit/Sources/*.swift'
s.source_files = 'Sources/SlackKit/**/*.swift'
s.frameworks = 'Foundation'
s.dependency 'Starscream'
s.dependency 'Swifter'
+18 -2
View File
@@ -41,6 +41,8 @@ public struct Attachment {
public let footer: String?
public let footerIcon: String?
public let ts: Int?
public let markdownEnabledFields: Set<AttachmentTextField>?
internal init(attachment: [String: Any]?) {
fallback = attachment?["fallback"] as? String
@@ -61,9 +63,11 @@ public struct Attachment {
ts = attachment?["ts"] as? Int
fields = (attachment?["fields"] as? [[String: Any]])?.map { AttachmentField(field: $0) }
actions = (attachment?["actions"] as? [[String: Any]])?.map { Action(action: $0) }
markdownEnabledFields = (attachment?["mrkdwn_in"] as? [String]).map { Set($0.flatMap(AttachmentTextField.init)) }
}
public init(fallback: String, title:String, callbackID: String? = nil, type: String? = nil, colorHex: String? = nil, pretext: String? = nil, authorName: String? = nil, authorLink: String? = nil, authorIcon: String? = nil, titleLink: String? = nil, text: String? = nil, fields: [AttachmentField]? = nil, actions: [Action]? = nil, imageURL: String? = nil, thumbURL: String? = nil, footer: String? = nil, footerIcon:String? = nil, ts:Int? = nil) {
public init(fallback: String, title: String?, callbackID: String? = nil, type: String? = nil, colorHex: String? = nil, pretext: String? = nil, authorName: String? = nil, authorLink: String? = nil, authorIcon: String? = nil, titleLink: String? = nil, text: String? = nil, fields: [AttachmentField]? = nil, actions: [Action]? = nil, imageURL: String? = nil, thumbURL: String? = nil, footer: String? = nil, footerIcon:String? = nil, ts:Int? = nil, markdownFields: Set<AttachmentTextField>? = nil) {
self.fallback = fallback
self.callbackID = callbackID
self.type = type
@@ -82,6 +86,7 @@ public struct Attachment {
self.footer = footer
self.footerIcon = footerIcon
self.ts = ts
self.markdownEnabledFields = markdownFields
}
internal var dictionary: [String: Any] {
@@ -91,7 +96,7 @@ public struct Attachment {
attachment["attachment_type"] = type
attachment["color"] = color
attachment["pretext"] = pretext
attachment["authorName"] = authorName
attachment["author_name"] = authorName
attachment["author_link"] = authorLink
attachment["author_icon"] = authorIcon
attachment["title"] = title
@@ -104,6 +109,7 @@ public struct Attachment {
attachment["footer"] = footer
attachment["footer_icon"] = footerIcon
attachment["ts"] = ts
attachment["mrkdwn_in"] = markdownEnabledFields?.map { $0.rawValue }
return attachment
}
}
@@ -113,3 +119,13 @@ public enum AttachmentColor: String {
case warning = "warning"
case danger = "danger"
}
public enum AttachmentTextField: String {
case fallback = "fallback"
case pretext = "pretext"
case authorName = "author_name"
case title = "title"
case text = "text"
case fields = "fields"
case footer = "footer"
}
+2 -2
View File
@@ -33,9 +33,9 @@ public struct AttachmentField {
short = field?["short"] as? Bool
}
public init(title:String, value:String, short: Bool? = nil) {
public init(title: String?, value: String?, short: Bool? = nil) {
self.title = title
self.value = value.slackFormatEscaping
self.value = value?.slackFormatEscaping
self.short = short
}
+4 -1
View File
@@ -80,7 +80,10 @@ public struct OAuthServer {
private func oauthURLRequest(_ authorize: AuthorizeRequest) -> URLRequest? {
var components = URLComponents(string: "\(oauthURL)")
components?.queryItems = [URLQueryItem(name: "client_id", value: "\(authorize.clientID)")]
components?.queryItems = [
URLQueryItem(name: "client_id", value: "\(authorize.clientID)"),
URLQueryItem(name: "scope", value: "\(authorize.scope)"),
]
guard let url = components?.url else {
return nil
}
+1 -1
View File
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.1.8</string>
<string>3.1.9</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
+1 -1
View File
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.1.8</string>
<string>3.1.9</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>