Compare commits

..

46 Commits

Author SHA1 Message Date
Peter Zignego c658616e0f Merge pull request #159 from pvzig/swift5
Swift 5
2019-04-04 21:44:49 -04:00
Peter Zignego c8a40de44f Fix package 2019-03-28 00:21:30 -04:00
Peter Zignego b212d1631a Pacakge tools 4.2 2019-03-28 00:16:50 -04:00
Peter Zignego 8adf701444 Update linux build steps to Swift 5 2019-03-28 00:05:30 -04:00
Peter Zignego b2f69d4b65 Swift 5 2019-03-27 23:57:06 -04:00
Peter Zignego 906d451200 Merge pull request #157 from tandinhle/master
Add missing endpoint of Channels API
2019-03-21 10:06:41 -04:00
Tan Le 80d2cab81c Add missing endpoint of Channels API
Add enpoints: join, leave, archive, unarchive, rename, kick
2019-03-19 10:57:38 -05:00
Peter Zignego c8bc22cbb9 Merge pull request #155 from allenhumphreys/ah/issue-151-support-threaded-ephemeral
Support sending ephemeral messages in threads
2019-03-09 19:50:57 -05:00
Peter Zignego e9ca0365c7 Merge pull request #154 from allenhumphreys/ah/change-thread-count
Change the number of threads to 1 for VaporEngineRTM
2019-03-09 19:50:15 -05:00
Allen Humphreys 52b0a7fd4e Support sending ephemeral messages in threads 2019-03-09 18:06:00 -06:00
Allen Humphreys 3651fc921b Change the number of threads to 1 2019-03-08 09:44:54 -06:00
Peter Zignego ef3425e38e Merge pull request #153 from rectalogic/edited
Edited is in nestedMessage for message_changed subtype.
2019-03-07 16:06:09 -05:00
Andrew Wason 533e961c85 Edited is in nestedMessage for message_changed subtype.
https://api.slack.com/events/message/message_changed
2019-03-07 15:18:20 -05:00
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
Peter Zignego 6385afb34a Fix preprocessor macros 2019-02-19 23:28:05 -05:00
Peter Zignego b880356dde Don’t build for CocoaPods 2019-02-19 22:47:36 -05:00
Peter Zignego fdd2a5aa36 4.2.1 2019-02-19 22:19:23 -05:00
Peter Zignego 93f8da2f69 Merge pull request #146 from pvzig/podspec
Fix podspec
2019-02-19 22:01:10 -05:00
Peter Zignego a165f3e57f Fix podspec 2019-02-19 21:40:33 -05:00
Peter Zignego d7f2221d77 Merge pull request #145 from rectalogic/files
Message contains an array of "files", not a single "file".
2019-02-18 22:51:08 -05:00
Peter Zignego 02bda676a9 Merge pull request #144 from henry2423/master
Add support for Ephemeral message API
2019-02-18 22:50:11 -05:00
Peter Zignego e4bd44e939 Merge pull request #140 from RobotsAndPencils/support-multiple-files
Add support for multiple files in a single event
2019-02-16 13:51:30 -05:00
Andrew Wason d83fbb1d7e Message contains an array of "files", not a single "file". 2019-02-15 17:13:59 -05:00
Henry Huang c2734a66c3 [FIX] sendEphemeral function parameter 2019-02-15 15:07:56 -06:00
Henry Huang 721f8964cf [ADD] post Ephemeral message API function 2019-02-15 15:02:57 -06:00
Brandon Evans 37ca701ae0 Add support for multiple files in a single event
> The file attribute attached to messages is replaced with a new files field that includes an array of files in a different format instead.
https://api.slack.com/changelog/2018-05-file-threads-soon-tread
2019-02-15 13:59:30 -07:00
Peter Zignego c1a89eedda Merge pull request #141 from RobotsAndPencils/add-user-profile-status
Add users.profile.set endpoint
2019-02-15 13:45:55 -05:00
Brandon Evans 8aeb88cea3 Add users.profile.set endpoint
This isn't an ideal implementation because it's not clear from the documentation if sending everything in the URL for a JSON request is supported, but this does work when tested manually.

This isn't complete support for the endpoint. In particular, custom profile fields won't be set.

https://api.slack.com/methods/users.profile.set
2019-02-14 17:33:32 -07:00
126 changed files with 3352 additions and 647 deletions
+1 -1
View File
@@ -1 +1 @@
4.2
5.0
+2 -2
View File
@@ -1,2 +1,2 @@
github "daltoniam/Starscream" == 3.0.6
github "httpswift/swifter" == 1.4.5
github "daltoniam/Starscream" == 3.1.0
github "httpswift/swifter" == 1.4.6
@@ -1,4 +1,6 @@
// Generated by Apple Swift version 4.2.1 effective-4.1.50 (swiftlang-1000.11.42 clang-1000.11.45.1)
#if 0
#elif defined(__arm64__) && __arm64__
// Generated by Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"
@@ -20,7 +22,7 @@
#endif
#pragma clang diagnostic ignored "-Wauto-import"
#include <objc/NSObject.h>
#include <Foundation/Foundation.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
@@ -163,6 +165,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
#endif
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
@import ObjectiveC;
#endif
@@ -195,10 +200,221 @@ SWIFT_CLASS("_TtC10Starscream16FoundationStream")
SWIFT_CLASS("_TtC10Starscream9WebSocket")
@interface WebSocket : NSObject <NSStreamDelegate>
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_DEPRECATED_MSG("-init is unavailable");
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif
#pragma clang diagnostic pop
#elif defined(__ARM_ARCH_7A__) && __ARM_ARCH_7A__
// Generated by Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"
#if !defined(__has_include)
# define __has_include(x) 0
#endif
#if !defined(__has_attribute)
# define __has_attribute(x) 0
#endif
#if !defined(__has_feature)
# define __has_feature(x) 0
#endif
#if !defined(__has_warning)
# define __has_warning(x) 0
#endif
#if __has_include(<swift/objc-prologue.h>)
# include <swift/objc-prologue.h>
#endif
#pragma clang diagnostic ignored "-Wauto-import"
#include <Foundation/Foundation.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#if !defined(SWIFT_TYPEDEFS)
# define SWIFT_TYPEDEFS 1
# if __has_include(<uchar.h>)
# include <uchar.h>
# elif !defined(__cplusplus)
typedef uint_least16_t char16_t;
typedef uint_least32_t char32_t;
# endif
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
#endif
#if !defined(SWIFT_PASTE)
# define SWIFT_PASTE_HELPER(x, y) x##y
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
#endif
#if !defined(SWIFT_METATYPE)
# define SWIFT_METATYPE(X) Class
#endif
#if !defined(SWIFT_CLASS_PROPERTY)
# if __has_feature(objc_class_property)
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
# else
# define SWIFT_CLASS_PROPERTY(...)
# endif
#endif
#if __has_attribute(objc_runtime_name)
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
#else
# define SWIFT_RUNTIME_NAME(X)
#endif
#if __has_attribute(swift_name)
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
#else
# define SWIFT_COMPILE_NAME(X)
#endif
#if __has_attribute(objc_method_family)
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
#else
# define SWIFT_METHOD_FAMILY(X)
#endif
#if __has_attribute(noescape)
# define SWIFT_NOESCAPE __attribute__((noescape))
#else
# define SWIFT_NOESCAPE
#endif
#if __has_attribute(warn_unused_result)
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
# define SWIFT_WARN_UNUSED_RESULT
#endif
#if __has_attribute(noreturn)
# define SWIFT_NORETURN __attribute__((noreturn))
#else
# define SWIFT_NORETURN
#endif
#if !defined(SWIFT_CLASS_EXTRA)
# define SWIFT_CLASS_EXTRA
#endif
#if !defined(SWIFT_PROTOCOL_EXTRA)
# define SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_ENUM_EXTRA)
# define SWIFT_ENUM_EXTRA
#endif
#if !defined(SWIFT_CLASS)
# if __has_attribute(objc_subclassing_restricted)
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# else
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# endif
#endif
#if !defined(SWIFT_PROTOCOL)
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_EXTENSION)
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
#endif
#if !defined(OBJC_DESIGNATED_INITIALIZER)
# if __has_attribute(objc_designated_initializer)
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
# else
# define OBJC_DESIGNATED_INITIALIZER
# endif
#endif
#if !defined(SWIFT_ENUM_ATTR)
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
# else
# define SWIFT_ENUM_ATTR(_extensibility)
# endif
#endif
#if !defined(SWIFT_ENUM)
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# if __has_feature(generalized_swift_name)
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# else
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
# endif
#endif
#if !defined(SWIFT_UNAVAILABLE)
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
#endif
#if !defined(SWIFT_UNAVAILABLE_MSG)
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
#endif
#if !defined(SWIFT_AVAILABILITY)
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
#endif
#if !defined(SWIFT_DEPRECATED)
# define SWIFT_DEPRECATED __attribute__((deprecated))
#endif
#if !defined(SWIFT_DEPRECATED_MSG)
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
#endif
#if __has_feature(attribute_diagnose_if_objc)
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
#else
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
#endif
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
@import ObjectiveC;
#endif
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
#if __has_warning("-Wpragma-clang-attribute")
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
#endif
#pragma clang diagnostic ignored "-Wunknown-pragmas"
#pragma clang diagnostic ignored "-Wnullability"
#if __has_attribute(external_source_symbol)
# pragma push_macro("any")
# undef any
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Starscream",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
# pragma pop_macro("any")
#endif
@class NSStream;
SWIFT_CLASS("_TtC10Starscream16FoundationStream")
@interface FoundationStream : NSObject <NSStreamDelegate>
/// Delegate for the stream methods. Processes incoming bytes
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
SWIFT_CLASS("_TtC10Starscream9WebSocket")
@interface WebSocket : NSObject <NSStreamDelegate>
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif
#pragma clang diagnostic pop
#endif
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,6 @@
// Generated by Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
#if 0
#elif defined(__arm64__) && __arm64__
// Generated by Apple Swift version 5.0 effective-4.2 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"
@@ -20,7 +22,7 @@
#endif
#pragma clang diagnostic ignored "-Wauto-import"
#include <objc/NSObject.h>
#include <Foundation/Foundation.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
@@ -163,6 +165,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
#endif
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#endif
@@ -189,3 +194,201 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
# pragma clang attribute pop
#endif
#pragma clang diagnostic pop
#elif defined(__ARM_ARCH_7A__) && __ARM_ARCH_7A__
// Generated by Apple Swift version 5.0 effective-4.2 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"
#if !defined(__has_include)
# define __has_include(x) 0
#endif
#if !defined(__has_attribute)
# define __has_attribute(x) 0
#endif
#if !defined(__has_feature)
# define __has_feature(x) 0
#endif
#if !defined(__has_warning)
# define __has_warning(x) 0
#endif
#if __has_include(<swift/objc-prologue.h>)
# include <swift/objc-prologue.h>
#endif
#pragma clang diagnostic ignored "-Wauto-import"
#include <Foundation/Foundation.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#if !defined(SWIFT_TYPEDEFS)
# define SWIFT_TYPEDEFS 1
# if __has_include(<uchar.h>)
# include <uchar.h>
# elif !defined(__cplusplus)
typedef uint_least16_t char16_t;
typedef uint_least32_t char32_t;
# endif
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
#endif
#if !defined(SWIFT_PASTE)
# define SWIFT_PASTE_HELPER(x, y) x##y
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
#endif
#if !defined(SWIFT_METATYPE)
# define SWIFT_METATYPE(X) Class
#endif
#if !defined(SWIFT_CLASS_PROPERTY)
# if __has_feature(objc_class_property)
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
# else
# define SWIFT_CLASS_PROPERTY(...)
# endif
#endif
#if __has_attribute(objc_runtime_name)
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
#else
# define SWIFT_RUNTIME_NAME(X)
#endif
#if __has_attribute(swift_name)
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
#else
# define SWIFT_COMPILE_NAME(X)
#endif
#if __has_attribute(objc_method_family)
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
#else
# define SWIFT_METHOD_FAMILY(X)
#endif
#if __has_attribute(noescape)
# define SWIFT_NOESCAPE __attribute__((noescape))
#else
# define SWIFT_NOESCAPE
#endif
#if __has_attribute(warn_unused_result)
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
# define SWIFT_WARN_UNUSED_RESULT
#endif
#if __has_attribute(noreturn)
# define SWIFT_NORETURN __attribute__((noreturn))
#else
# define SWIFT_NORETURN
#endif
#if !defined(SWIFT_CLASS_EXTRA)
# define SWIFT_CLASS_EXTRA
#endif
#if !defined(SWIFT_PROTOCOL_EXTRA)
# define SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_ENUM_EXTRA)
# define SWIFT_ENUM_EXTRA
#endif
#if !defined(SWIFT_CLASS)
# if __has_attribute(objc_subclassing_restricted)
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# else
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# endif
#endif
#if !defined(SWIFT_PROTOCOL)
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_EXTENSION)
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
#endif
#if !defined(OBJC_DESIGNATED_INITIALIZER)
# if __has_attribute(objc_designated_initializer)
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
# else
# define OBJC_DESIGNATED_INITIALIZER
# endif
#endif
#if !defined(SWIFT_ENUM_ATTR)
# if defined(__has_attribute) && __has_attribute(enum_extensibility)
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
# else
# define SWIFT_ENUM_ATTR(_extensibility)
# endif
#endif
#if !defined(SWIFT_ENUM)
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# if __has_feature(generalized_swift_name)
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# else
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
# endif
#endif
#if !defined(SWIFT_UNAVAILABLE)
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
#endif
#if !defined(SWIFT_UNAVAILABLE_MSG)
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
#endif
#if !defined(SWIFT_AVAILABILITY)
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
#endif
#if !defined(SWIFT_DEPRECATED)
# define SWIFT_DEPRECATED __attribute__((deprecated))
#endif
#if !defined(SWIFT_DEPRECATED_MSG)
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
#endif
#if __has_feature(attribute_diagnose_if_objc)
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
#else
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
#endif
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#endif
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
#if __has_warning("-Wpragma-clang-attribute")
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
#endif
#pragma clang diagnostic ignored "-Wunknown-pragmas"
#pragma clang diagnostic ignored "-Wnullability"
#if __has_attribute(external_source_symbol)
# pragma push_macro("any")
# undef any
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Swifter",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
# pragma pop_macro("any")
#endif
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif
#pragma clang diagnostic pop
#endif
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
// Generated by Apple Swift version 4.2.1 effective-4.1.50 (swiftlang-1000.11.42 clang-1000.11.45.1)
// Generated by Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"
@@ -20,7 +20,7 @@
#endif
#pragma clang diagnostic ignored "-Wauto-import"
#include <objc/NSObject.h>
#include <Foundation/Foundation.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
@@ -163,6 +163,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
#endif
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
@import ObjectiveC;
#endif
@@ -195,7 +198,7 @@ SWIFT_CLASS("_TtC10Starscream16FoundationStream")
SWIFT_CLASS("_TtC10Starscream9WebSocket")
@interface WebSocket : NSObject <NSStreamDelegate>
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_DEPRECATED_MSG("-init is unavailable");
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end
#if __has_attribute(external_source_symbol)
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>18C54</string>
<string>18E226</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
@@ -29,17 +29,17 @@
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>10B61</string>
<string>10E125</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>18B71</string>
<string>18E219</string>
<key>DTSDKName</key>
<string>macosx10.14</string>
<key>DTXcode</key>
<string>1010</string>
<string>1020</string>
<key>DTXcodeBuild</key>
<string>10B61</string>
<string>10E125</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
@@ -1,4 +1,4 @@
// Generated by Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
// Generated by Apple Swift version 5.0 effective-4.2 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"
@@ -20,7 +20,7 @@
#endif
#pragma clang diagnostic ignored "-Wauto-import"
#include <objc/NSObject.h>
#include <Foundation/Foundation.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
@@ -163,6 +163,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
#endif
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#endif
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>18C54</string>
<string>18E226</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
@@ -29,17 +29,17 @@
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>10B61</string>
<string>10E125</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>18B71</string>
<string>18E219</string>
<key>DTSDKName</key>
<string>macosx10.14</string>
<key>DTXcode</key>
<string>1010</string>
<string>1020</string>
<key>DTXcodeBuild</key>
<string>10B61</string>
<string>10E125</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2015 Damian Kołakowski. All rights reserved.</string>
<key>UIDeviceFamily</key>
@@ -1,4 +1,4 @@
// Generated by Apple Swift version 4.2.1 effective-4.1.50 (swiftlang-1000.11.42 clang-1000.11.45.1)
// Generated by Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"
@@ -20,7 +20,7 @@
#endif
#pragma clang diagnostic ignored "-Wauto-import"
#include <objc/NSObject.h>
#include <Foundation/Foundation.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
@@ -163,6 +163,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
#endif
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
@import ObjectiveC;
#endif
@@ -195,7 +198,7 @@ SWIFT_CLASS("_TtC10Starscream16FoundationStream")
SWIFT_CLASS("_TtC10Starscream9WebSocket")
@interface WebSocket : NSObject <NSStreamDelegate>
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_DEPRECATED_MSG("-init is unavailable");
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end
#if __has_attribute(external_source_symbol)
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
// Generated by Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
// Generated by Apple Swift version 5.0 effective-4.2 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"
@@ -20,7 +20,7 @@
#endif
#pragma clang diagnostic ignored "-Wauto-import"
#include <objc/NSObject.h>
#include <Foundation/Foundation.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
@@ -163,6 +163,9 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
#endif
#if __has_feature(modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Foundation;
#endif
Binary file not shown.
Binary file not shown.
+8
View File
@@ -0,0 +1,8 @@
import XCTest
import SlackKitTests
var tests = [XCTestCaseEntry]()
tests += SlackKitTests.__allTests()
XCTMain(tests)
+13 -9
View File
@@ -1,4 +1,4 @@
// swift-tools-version:4.2
// swift-tools-version:5.0
import PackageDescription
@@ -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,24 +63,25 @@ let package = Package(
.library(name: "SKWebAPI", targets: ["SKWebAPI"])
],
targets: [
SlackKit, SKClient, SKCore, SKRTMAPI, SKServer, SKWebAPI
SlackKit, SKClient, SKCore, SKRTMAPI, SKServer, SKWebAPI, SlackKitTests
]
)
#if os(macOS)
package.dependencies = [
.package(url: "https://github.com/httpswift/swifter.git", .upToNextMinor(from: "1.4.5")),
.package(url: "https://github.com/vapor/websocket", .upToNextMinor(from: "1.1.1")),
.package(url: "https://github.com/daltoniam/Starscream", .upToNextMinor(from: "3.0.6"))
.package(url: "https://github.com/httpswift/swifter.git", .upToNextMinor(from: "1.4.6")),
.package(url: "https://github.com/vapor/websocket", .upToNextMinor(from: "1.1.2")),
.package(url: "https://github.com/daltoniam/Starscream", .upToNextMinor(from: "3.1.0"))
]
#elseif os(Linux)
package.dependencies = [
.package(url: "https://github.com/httpswift/swifter.git", .upToNextMinor(from: "1.4.5")),
.package(url: "https://github.com/vapor/websocket", .upToNextMinor(from: "1.1.1"))
.package(url: "https://github.com/httpswift/swifter.git", .upToNextMinor(from: "1.4.6")),
.package(url: "https://github.com/vapor/websocket", .upToNextMinor(from: "1.1.2"))
]
#elseif os(iOS) || os(tvOS)
package.dependencies = [
.package(url: "https://github.com/httpswift/swifter.git", .upToNextMinor(from: "1.4.5")),
.package(url: "https://github.com/daltoniam/Starscream", .upToNextMinor(from: "3.0.6"))
.package(url: "https://github.com/httpswift/swifter.git", .upToNextMinor(from: "1.4.6")),
.package(url: "https://github.com/daltoniam/Starscream", .upToNextMinor(from: "3.1.0"))
]
#endif
-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()
+86 -50
View File
@@ -25,7 +25,9 @@
import Dispatch
#endif
import Foundation
#if !COCOAPODS
@_exported import SKCore
#endif
open class Client {
internal(set) public var authenticatedUser: User?
@@ -113,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:
@@ -276,7 +282,7 @@ extension Client {
let timeout = DispatchTime.now() + Double(Int64(5.0 * Double(UInt64.nanosecondsPerSecond))) / Double(UInt64.nanosecondsPerSecond)
DispatchQueue.main.asyncAfter(deadline: timeout, execute: {
if let index = self.channels[channelID]?.usersTyping.index(of: userID) {
if let index = self.channels[channelID]?.usersTyping.firstIndex(of: userID) {
self.channels[channelID]?.usersTyping.remove(at: index)
}
})
@@ -330,7 +336,7 @@ extension Client {
return
}
if let userID = authenticatedUser?.id, let index = channels[id]?.members?.index(of: userID) {
if let userID = authenticatedUser?.id, let index = channels[id]?.members?.firstIndex(of: userID) {
channels[id]?.members?.remove(at: index)
}
}
@@ -358,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?.firstIndex(of: member) {
channels[channel]?.members?.remove(at: index)
}
}
}
// MARK: - Do Not Disturb
@@ -397,76 +427,82 @@ extension Client {
// MARK: - Files
extension Client {
func processFile(_ event: Event) {
guard
let file = event.file,
let id = file.id
else {
return
}
if let comment = file.initialComment, let commentID = comment.id {
if files[id]?.comments[commentID] == nil {
files[id]?.comments[commentID] = comment
for file in event.files {
guard
let id = file.id
else {
continue
}
if let comment = file.initialComment, let commentID = comment.id {
if files[id]?.comments[commentID] == nil {
files[id]?.comments[commentID] = comment
}
}
files[id] = file
}
files[id] = file
}
func filePrivate(_ event: Event) {
guard
let file = event.file,
let id = file.id
else {
return
for file in event.files {
guard
let id = file.id
else {
continue
}
files[id]?.isPublic = false
}
files[id]?.isPublic = false
}
func deleteFile(_ event: Event) {
guard
let file = event.file,
let id = file.id
else {
return
}
if files[id] != nil {
files.removeValue(forKey: id)
for file in event.files {
guard
let id = file.id
else {
continue
}
if files[id] != nil {
files.removeValue(forKey: id)
}
}
}
func fileCommentAdded(_ event: Event) {
guard
let file = event.file,
let id = file.id,
let comment = event.comment,
let commentID = comment.id
else {
return
for file in event.files {
guard
let id = file.id,
let comment = event.comment,
let commentID = comment.id
else {
continue
}
files[id]?.comments[commentID] = comment
}
files[id]?.comments[commentID] = comment
}
func fileCommentEdited(_ event: Event) {
guard
let file = event.file,
let id = file.id,
let comment = event.comment,
let commentID = comment.id
else {
return
for file in event.files {
guard
let id = file.id,
let comment = event.comment,
let commentID = comment.id
else {
continue
}
files[id]?.comments[commentID]?.comment = comment.comment
}
files[id]?.comments[commentID]?.comment = comment.comment
}
func fileCommentDeleted(_ event: Event) {
guard
let file = event.file,
let id = file.id,
let comment = event.comment,
let commentID = comment.id
else {
return
for file in event.files {
guard
let id = file.id,
let comment = event.comment,
let commentID = comment.id
else {
continue
}
_ = files[id]?.comments.removeValue(forKey: commentID)
}
_ = files[id]?.comments.removeValue(forKey: commentID)
}
}
+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).
+11 -3
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,17 +153,20 @@ 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 file: File?
public let files: [File]
public let message: Message?
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]) {
@@ -197,7 +202,10 @@ public class Event {
message = Message(dictionary: event)
nestedMessage = Message(dictionary: event["message"] as? [String: Any])
profile = CustomProfile(profile: event["profile"] as? [String: Any])
file = File(id: event["file"] as? String)
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] {
+5 -3
View File
@@ -47,12 +47,13 @@ public final class Message: Equatable {
public var isStarred: Bool?
public var pinnedTo: [String]?
public let comment: Comment?
public let file: File?
public var files: [File]?
public var reactions = [Reaction]()
public var attachments: [Attachment]?
public var responseType: MessageResponseType?
public var replaceOriginal: Bool?
public var deleteOriginal: Bool?
public let edited: Edited?
public init(dictionary: [String: Any]?) {
subtype = dictionary?["subtype"] as? String
@@ -79,12 +80,13 @@ public final class Message: Equatable {
isStarred = dictionary?["is_starred"] as? Bool
pinnedTo = dictionary?["pinned_to"] as? [String]
comment = Comment(comment: dictionary?["comment"] as? [String: Any])
file = File(file: dictionary?["file"] as? [String: Any])
files = (dictionary?["files"] as? [[String: Any]])?.map { File(file: $0) }
reactions = Reaction.reactionsFromArray(dictionary?["reactions"] as? [[String: Any]])
attachments = (dictionary?["attachments"] as? [[String: Any]])?.map { Attachment(attachment: $0) }
responseType = MessageResponseType(rawValue: dictionary?["response_type"] as? String ?? "")
replaceOriginal = dictionary?["replace_original"] as? Bool
deleteOriginal = dictionary?["delete_original"] as? Bool
edited = Edited(edited:dictionary?["edited"] as? [String: Any])
}
public init(ts: String?) {
@@ -101,7 +103,7 @@ public final class Message: Equatable {
upload = nil
itemType = nil
comment = nil
file = nil
edited = nil
}
public static func == (lhs: Message, rhs: Message) -> Bool {
+6
View File
@@ -34,6 +34,9 @@ public struct User {
public var image72: String?
public var image192: String?
public var customProfile: CustomProfile?
public var statusText: String?
public var statusEmoji: String?
public var statusExpiration: Int?
public init(profile: [String: Any]?) {
firstName = profile?["first_name"] as? String
@@ -47,6 +50,9 @@ public struct User {
image72 = profile?["image_72"] as? String
image192 = profile?["image_192"] as? String
customProfile = CustomProfile(customFields: profile?["fields"] as? [String: Any])
statusText = profile?["status_text"] as? String
statusEmoji = profile?["status_emoji"] as? String
statusExpiration = profile?["status_expiration"] as? Int
}
}
+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
@@ -23,7 +23,9 @@
#if os(macOS) || os(iOS) || os(tvOS)
import Foundation
#if !COCOAPODS
import SKCore
#endif
import Starscream
public class StarscreamRTM: RTMWebSocket, WebSocketDelegate {
@@ -21,7 +21,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#if os(Linux) || os(macOS)
#if os(Linux) || os(macOS) && !COCOAPODS
import Foundation
import HTTP
import WebSocket
@@ -29,7 +29,7 @@ import WebSocket
// Builds with *Swift Package Manager ONLY*
public class VaporEngineRTM: RTMWebSocket {
private let eventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount)
private let eventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: 1)
// Delegate
public weak var delegate: RTMDelegate?
// Websocket
+2
View File
@@ -25,8 +25,10 @@
import Dispatch
#endif
import Foundation
#if !COCOAPODS
import SKWebAPI
@_exported import SKCore
#endif
public protocol RTMWebSocket {
init()
+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/).
@@ -21,8 +21,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#if !COCOAPODS
import SKCore
import SKWebAPI
#endif
public struct OAuthMiddleware: Middleware {
private let config: OAuthConfig
@@ -21,7 +21,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#if !COCOAPODS
import SKCore
#endif
public struct MessageActionRequest {
public let action: Action?
@@ -41,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
@@ -21,7 +21,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#if !COCOAPODS
import SKCore
#endif
public struct MessageActionRoute {
let action: Action
@@ -21,7 +21,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#if !COCOAPODS
import SKCore
#endif
public struct OAuthResponse {
public let accessToken: String?
+2
View File
@@ -22,7 +22,9 @@
// THE SOFTWARE.
import Foundation
#if !COCOAPODS
import SKCore
#endif
public struct SKResponse {
let text: String
+2
View File
@@ -21,7 +21,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#if !COCOAPODS
@_exported import SKCore
#endif
public protocol SlackKitServer {
func start()
@@ -15,7 +15,7 @@ import Foundation
// limitations under the License.
public extension RequestType {
public var formURLEncodedBody: [(name: String, value: String)] {
var formURLEncodedBody: [(name: String, value: String)] {
guard let bodyString: String = self.body else {
return []
}
@@ -23,7 +23,7 @@ public extension RequestType {
return parse(body: bodyString)
}
public var postParams: [String: String] {
var postParams: [String: String] {
var ret = [String: String]()
guard let bodyString: String = self.body else {
return ret
@@ -15,12 +15,12 @@ import Foundation
public extension Response {
public init(code: Int, json: Any) throws {
init(code: Int, json: Any) throws {
let jsonData = try JSONSerialization.data(withJSONObject: json, options: [])
self.init(code: code, body: jsonData, headers: HTTPHeaders(dictionaryLiteral: ("content-type", "application/json")))
}
public init<T: Encodable>(code: Int, object: T, jsonEncoder: JSONEncoder = JSONEncoder()) throws {
init<T: Encodable>(code: Int, object: T, jsonEncoder: JSONEncoder = JSONEncoder()) throws {
let data = try jsonEncoder.encode(object)
self.init(code: code, body: data, headers: HTTPHeaders(dictionaryLiteral: ("content-type", "application/json")))
}
@@ -16,9 +16,9 @@ import Foundation
public extension RequestType {
/// The pairs of keys and values in the query string of the `RequestType`s path.
/// Complexity: 0(n) on all invocations.
public var queryPairs: [(key: String, value: String)] {
var queryPairs: [(key: String, value: String)] {
// Ensure there is a query string, otherwise return
guard let indexOfQuery = self.path.index(of: "?") else {
guard let indexOfQuery = self.path.firstIndex(of: "?") else {
return []
}
@@ -53,7 +53,7 @@ public extension RequestType {
/// Access the query string as a dictionary, with case sensitive keys.
/// Complexity: 0(n) on all invocations.
public var query: [String: String] {
var query: [String: String] {
var query: [String: String] = [:]
for (name, value) in self.queryPairs {
query[name] = value
@@ -106,7 +106,7 @@ extension String {
/// Return `Self` without the query string.
func prefixUpToQuery() -> String {
return self.index(of: "?")
return self.firstIndex(of: "?")
.map { self.prefix(upTo: $0) }
.map(String.init) ?? self
}
+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
+8
View File
@@ -31,10 +31,17 @@ public enum Endpoint: String {
case channelsMark = "channels.mark"
case channelsCreate = "channels.create"
case channelsInvite = "channels.invite"
case channelsJoin = "channels.join"
case channelsLeave = "channels.leave"
case channelsArchive = "channels.archive"
case channelsUnarchive = "channels.unarchive"
case channelsRename = "channels.rename"
case channelsKick = "channels.kick"
case channelsSetPurpose = "channels.setPurpose"
case channelsSetTopic = "channels.setTopic"
case chatDelete = "chat.delete"
case chatPostMessage = "chat.postMessage"
case chatPostEphemeral = "chat.postEphemeral"
case chatMeMessage = "chat.meMessage"
case chatUpdate = "chat.update"
case conversationsList = "conversations.list"
@@ -81,6 +88,7 @@ public enum Endpoint: String {
case usersGetPresence = "users.getPresence"
case usersInfo = "users.info"
case usersList = "users.list"
case usersProfileSet = "users.profile.set"
case usersSetActive = "users.setActive"
case usersSetPresence = "users.setPresence"
}
+2
View File
@@ -25,7 +25,9 @@
import Dispatch
#endif
import Foundation
#if !COCOAPODS
import SKCore
#endif
public struct NetworkInterface {
+184
View File
@@ -23,7 +23,9 @@
//swiftlint:disable file_length
import Foundation
#if !COCOAPODS
@_exported import SKCore
#endif
public final class WebAPI {
@@ -208,6 +210,30 @@ extension WebAPI {
public func inviteToChannel(_ channel: String, user: String, success: SuccessClosure?, failure: FailureClosure?) {
invite(.channelsInvite, channel: channel, user: user, success: success, failure: failure)
}
public func channelsJoin(_ name: String, validate: Bool, success: ChannelClosure?, failure: FailureClosure?) {
join(.channelsJoin, name: name, validate: validate, success: success, failure: failure)
}
public func channelsLeave(_ channel: String, success: SuccessClosure?, failure: FailureClosure?) {
leave(.channelsLeave, channel: channel, success: success, failure: failure)
}
public func channelsArchive(_ channel: String, success: SuccessClosure?, failure: FailureClosure?) {
archive(.channelsArchive, channel: channel, success: success, failure: failure)
}
public func channelsUnarchive(_ channel: String, success: SuccessClosure?, failure: FailureClosure?) {
unarchive(.channelsUnarchive, channel: channel, success: success, failure: failure)
}
public func channelsRename(_ channel: String, name: String, validate: Bool, success: ChannelClosure?, failure: FailureClosure?) {
rename(.channelsRename, channel: channel, name: name, validate: validate, success: success, failure: failure)
}
public func channelsKick(_ channel: String, user: String, success: SuccessClosure?, failure: FailureClosure?) {
kick(.channelsKick, channel: channel, user: user, success: success, failure: failure)
}
public func setChannelPurpose(channel: String, purpose: String, success: SuccessClosure?, failure: FailureClosure?) {
setInfo(.channelsSetPurpose, type: .purpose, channel: channel, text: purpose, success: {(purposeSet) in
@@ -313,6 +339,36 @@ extension WebAPI {
}
}
public func sendEphemeral(
channel: String,
text: String,
user: String,
thread: String? = nil,
asUser: Bool? = nil,
attachments: [Attachment?]? = nil,
linkNames: Bool? = nil,
parse: ParseMode? = nil,
success: (((ts: String?, channel: String?)) -> Void)?,
failure: FailureClosure?
) {
let parameters: [String: Any?] = [
"token": token,
"channel": channel,
"text": text,
"user": user,
"thread_ts": thread,
"as_user": asUser,
"attachments": encodeAttachments(attachments),
"link_names": linkNames,
"parse": parse?.rawValue,
]
networkInterface.request(.chatPostEphemeral, parameters: parameters, successClosure: {(response) in
success?((ts: response["sendMessage"] as? String, response["channel"] as? String))
}) {(error) in
failure?(error)
}
}
public func sendMeMessage(
channel: String,
text: String,
@@ -1079,6 +1135,46 @@ extension WebAPI {
}
}
public func usersProfileSet(profile: User.Profile, success: SuccessClosure?, failure: FailureClosure?) {
let profileValues = ([
"first_name": profile.firstName,
"last_name": profile.lastName,
"real_name": profile.realName,
"email": profile.email,
"phone": profile.phone,
"status_text": profile.statusText,
"status_emoji": profile.statusEmoji,
"status_expiration": profile.statusExpiration,
] as [String: Any?])
.filter { $0.value != nil }
.mapValues { $0! }
do {
let data = try JSONSerialization.data(withJSONObject: profileValues)
let json = String(data: data, encoding: .utf8)
guard let encodedJSON = json?.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else {
throw SlackError.clientJSONError
}
var urlComponents = URLComponents(string: "https://slack.com/api/users.profile.set")
urlComponents?.queryItems = [
URLQueryItem(name: "token", value: token),
URLQueryItem(name: "profile", value: encodedJSON)
]
guard let requestString = urlComponents?.url?.absoluteString else {
throw SlackError.clientNetworkError
}
networkInterface.customRequest(requestString, data: Data(), success: { _ in
success?(true)
}) {(error) in
failure?(error)
}
} catch {
failure?(error as? SlackError ?? SlackError.unknownError)
}
}
public func setUserActive(success: SuccessClosure?, failure: FailureClosure?) {
networkInterface.request(.usersSetActive, parameters: ["token": token], successClosure: { _ in
success?(true)
@@ -1279,4 +1375,92 @@ extension WebAPI {
failure?(error)
}
}
fileprivate func join(
_ endpoint: Endpoint,
name: String,
validate: Bool,
success: ChannelClosure?,
failure: FailureClosure?
) {
let parameters: [String: Any] = ["token": token, "name": name, "validate": validate]
networkInterface.request(endpoint, parameters: parameters, successClosure: { response in
success?(Channel(channel: response["channel"] as? [String: Any]))
}) {(error) in
failure?(error)
}
}
fileprivate func leave(
_ endpoint: Endpoint,
channel: String,
success: SuccessClosure?,
failure: FailureClosure?
) {
let parameters: [String: Any] = ["token": token, "channel": channel]
networkInterface.request(endpoint, parameters: parameters,successClosure: { _ in
success?(true)
}) {(error) in
failure?(error)
}
}
fileprivate func archive(
_ endpoint: Endpoint,
channel: String,
success: SuccessClosure?,
failure: FailureClosure?
) {
let parameters: [String: Any] = ["token": token, "channel": channel]
networkInterface.request(endpoint, parameters: parameters,successClosure: { _ in
success?(true)
}) {(error) in
failure?(error)
}
}
fileprivate func unarchive(
_ endpoint: Endpoint,
channel: String,
success: SuccessClosure?,
failure: FailureClosure?
) {
let parameters: [String: Any] = ["token": token, "channel": channel]
networkInterface.request(endpoint, parameters: parameters,successClosure: { _ in
success?(true)
}) {(error) in
failure?(error)
}
}
fileprivate func rename(
_ endpoint: Endpoint,
channel: String,
name: String,
validate: Bool,
success: ChannelClosure?,
failure: FailureClosure?
) {
let parameters: [String: Any] = ["token": token, "channel": channel, "name": name, "validate": validate ]
networkInterface.request(endpoint, parameters: parameters,successClosure: { response in
success?(Channel(channel: response["channel"] as? [String: Any]))
}) {(error) in
failure?(error)
}
}
fileprivate func kick(
_ endpoint: Endpoint,
channel: String,
user: String,
success: SuccessClosure?,
failure: FailureClosure?
) {
let parameters: [String: Any] = ["token": token, "channel": channel, "user": user]
networkInterface.request(endpoint, parameters: parameters,successClosure: { _ in
success?(true)
}) {(error) in
failure?(error)
}
}
}
+34 -35
View File
@@ -1,47 +1,16 @@
Pod::Spec.new do |s|
s.name = "SlackKit"
s.version = "4.2.0"
s.version = "4.3.0"
s.summary = "Write Slack apps in Swift"
s.homepage = "https://github.com/pvzig/SlackKit"
s.license = "MIT"
s.author = { "Peter Zignego" => "peter@launchsoft.co" }
s.source = { :git => "https://github.com/pvzig/SlackKit.git", :tag => s.version.to_s }
s.social_media_url = "https://twitter.com/pvzig"
s.ios.deployment_target = "10.0"
s.osx.deployment_target = "10.11"
s.tvos.deployment_target = "10.0"
s.platforms = { :ios => '10.0', :osx => '10.11', :tvos => '10.0' }
s.swift_version = '5.0'
s.cocoapods_version = '>= 1.4.0'
s.default_subspec = "SlackKit"
s.swift_version = "4.2"
s.cocoapods_version = ">= 1.4.0"
s.subspec "SKCore" do |ss|
ss.source_files = "SKCore/Sources/"
ss.framework = "Foundation"
end
s.subspec "SKClient" do |ss|
ss.source_files = "SKClient/Sources/"
ss.dependency "SlackKit/SKCore"
end
s.subspec "SKWebAPI" do |ss|
ss.source_files = "SKWebAPI/Sources/"
ss.dependency "SlackKit/SKCore"
end
s.subspec "SKRTMAPI" do |ss|
ss.source_files = "SKRTMAPI/Sources/"
ss.dependency "SlackKit/SKCore"
ss.dependency "SlackKit/SKWebAPI"
ss.dependency "Starscream", "3.0.6"
end
s.subspec "SKServer" do |ss|
ss.source_files = "SKServer/Sources/"
ss.dependency "SlackKit/SKCore"
ss.dependency "SlackKit/SKWebAPI"
ss.dependency "Swifter", "1.4.5"
end
s.subspec "SlackKit" do |ss|
ss.source_files = "SlackKit/Sources/"
@@ -51,4 +20,34 @@ Pod::Spec.new do |s|
ss.dependency "SlackKit/SKRTMAPI"
ss.dependency "SlackKit/SKServer"
end
s.subspec "SKClient" do |ss|
ss.source_files = "SKClient/Sources/"
ss.dependency "SlackKit/SKCore"
end
s.subspec "SKCore" do |ss|
ss.source_files = "SKCore/Sources/"
ss.framework = "Foundation"
end
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.1.0"
end
s.subspec "SKServer" do |ss|
ss.source_files = "SKServer/Sources/**/*.swift"
ss.dependency "SlackKit/SKCore"
ss.dependency "SlackKit/SKWebAPI"
ss.dependency "Swifter", "1.4.6"
end
s.subspec "SKWebAPI" do |ss|
ss.source_files = "SKWebAPI/Sources/"
ss.dependency "SlackKit/SKCore"
end
end
+410 -30
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 */; };
@@ -93,13 +108,64 @@
269A176D21FFDFB200F1F500 /* Swifter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 269A176121FFDB4C00F1F500 /* Swifter.framework */; };
269A18342204055200F1F500 /* Leaderbot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 269A18322204055200F1F500 /* Leaderbot.swift */; };
269A18352204055200F1F500 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 269A18332204055200F1F500 /* main.swift */; };
269A185C220BB32B00F1F500 /* Starscream.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 269A175A21FFDB4C00F1F500 /* Starscream.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
269A185D220BB32B00F1F500 /* Swifter.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 269A175B21FFDB4C00F1F500 /* Swifter.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
26D4E4D32210A31F00A67B67 /* Starscream.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 269A175A21FFDB4C00F1F500 /* Starscream.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
26D4E4D42210A31F00A67B67 /* Swifter.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 269A175B21FFDB4C00F1F500 /* Swifter.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
269A185C220BB32B00F1F500 /* Starscream.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 269A175A21FFDB4C00F1F500 /* Starscream.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
269A185D220BB32B00F1F500 /* Swifter.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 269A175B21FFDB4C00F1F500 /* Swifter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
26D4E4D32210A31F00A67B67 /* Starscream.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 269A175A21FFDB4C00F1F500 /* Starscream.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
26D4E4D42210A31F00A67B67 /* Swifter.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 269A175B21FFDB4C00F1F500 /* Swifter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
26D4E4D92210A33A00A67B67 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 269A18362204057900F1F500 /* main.swift */; };
26D4E605221211FD00A67B67 /* SlackKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 26D4E602221211B900A67B67 /* SlackKit.h */; settings = {ATTRIBUTES = (Public, ); }; };
26D4E6062212120100A67B67 /* SKClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 26D4E5FF221211B900A67B67 /* SKClient.h */; settings = {ATTRIBUTES = (Public, ); }; };
26D4E6072212120500A67B67 /* SKCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 26D4E603221211B900A67B67 /* SKCore.h */; settings = {ATTRIBUTES = (Public, ); }; };
26D4E6082212120900A67B67 /* SKRTMAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 26D4E5FE221211B900A67B67 /* SKRTMAPI.h */; settings = {ATTRIBUTES = (Public, ); }; };
26D4E6092212120F00A67B67 /* SKServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 26D4E600221211B900A67B67 /* SKServer.h */; settings = {ATTRIBUTES = (Public, ); }; };
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;
@@ -126,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; };
@@ -220,9 +291,36 @@
269A18332204055200F1F500 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
269A18362204057900F1F500 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
26D4E4D82210A31F00A67B67 /* Robot or Not Bot.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Robot or Not Bot.app"; sourceTree = BUILT_PRODUCTS_DIR; };
26D4E5FE221211B900A67B67 /* SKRTMAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SKRTMAPI.h; sourceTree = "<group>"; };
26D4E5FF221211B900A67B67 /* SKClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SKClient.h; sourceTree = "<group>"; };
26D4E600221211B900A67B67 /* SKServer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SKServer.h; sourceTree = "<group>"; };
26D4E601221211B900A67B67 /* SKWebAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SKWebAPI.h; sourceTree = "<group>"; };
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;
@@ -304,7 +402,9 @@
263B0FC521FE23C200AF9EF9 /* SKRTMAPI */,
263B0FDF21FE23DB00AF9EF9 /* SKServer */,
263B0FB821FE23B000AF9EF9 /* SKWebAPI */,
26D4E5FD221211B900A67B67 /* Supporting Files */,
269A18272204048300F1F500 /* Examples */,
26D4E6112220719D00A67B67 /* SlackKitTests */,
263B10CB21FE4DD900AF9EF9 /* Frameworks */,
263B0FD121FE23CD00AF9EF9 /* SlackKit.framework */,
263B0FAA21FE23A000AF9EF9 /* SKClient.framework */,
@@ -314,6 +414,7 @@
263B0FB721FE23B000AF9EF9 /* SKWebAPI.framework */,
263B0FEA21FE247300AF9EF9 /* Leaderboard.app */,
26D4E4D82210A31F00A67B67 /* Robot or Not Bot.app */,
2601B6C1222085AB00F197AB /* SlackKitTests.xctest */,
);
sourceTree = "<group>";
};
@@ -684,6 +785,108 @@
path = Sources;
sourceTree = "<group>";
};
26D4E5FD221211B900A67B67 /* Supporting Files */ = {
isa = PBXGroup;
children = (
26D4E602221211B900A67B67 /* SlackKit.h */,
26D4E5FF221211B900A67B67 /* SKClient.h */,
26D4E603221211B900A67B67 /* SKCore.h */,
26D4E5FE221211B900A67B67 /* SKRTMAPI.h */,
26D4E600221211B900A67B67 /* SKServer.h */,
26D4E601221211B900A67B67 /* SKWebAPI.h */,
26D4E604221211B900A67B67 /* Info.plist */,
);
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 */
@@ -691,6 +894,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
26D4E6072212120500A67B67 /* SKCore.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -698,6 +902,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
26D4E6062212120100A67B67 /* SKClient.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -705,6 +910,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
26D4E60A2212121400A67B67 /* SKWebAPI.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -712,6 +918,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
26D4E6082212120900A67B67 /* SKRTMAPI.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -719,6 +926,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
26D4E605221211FD00A67B67 /* SlackKit.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -726,12 +934,36 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
26D4E6092212120F00A67B67 /* SKServer.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* 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" */;
@@ -881,27 +1113,36 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1010;
LastUpgradeCheck = 1010;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Peter Zignego";
TargetAttributes = {
2601B6C0222085AB00F197AB = {
CreatedOnToolsVersion = 10.1;
LastSwiftMigration = 1020;
};
263B0F9A21FE235100AF9EF9 = {
CreatedOnToolsVersion = 10.1;
LastSwiftMigration = 1020;
};
263B0FA921FE23A000AF9EF9 = {
CreatedOnToolsVersion = 10.1;
LastSwiftMigration = 1020;
};
263B0FB621FE23B000AF9EF9 = {
CreatedOnToolsVersion = 10.1;
LastSwiftMigration = 1020;
};
263B0FC321FE23C200AF9EF9 = {
CreatedOnToolsVersion = 10.1;
LastSwiftMigration = 1020;
};
263B0FD021FE23CD00AF9EF9 = {
CreatedOnToolsVersion = 10.1;
LastSwiftMigration = 1010;
LastSwiftMigration = 1020;
};
263B0FDD21FE23DB00AF9EF9 = {
CreatedOnToolsVersion = 10.1;
LastSwiftMigration = 1020;
};
263B0FE921FE247300AF9EF9 = {
CreatedOnToolsVersion = 10.1;
@@ -929,11 +1170,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;
@@ -979,6 +1241,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;
@@ -1111,7 +1382,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 = 5.0;
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 = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALID_ARCHS = "x86_64 i386";
};
name = Release;
};
263B0F9121FE1B2300AF9EF9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -1172,6 +1537,7 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
@@ -1230,6 +1596,7 @@
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
@@ -1246,7 +1613,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/Info.plist";
INFOPLIST_FILE = "$(PROJECT_DIR)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -1259,7 +1626,7 @@
SDKROOT = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvos appletvsimulator";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALID_ARCHS = "$(ARCHS_STANDARD)";
@@ -1276,7 +1643,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/Info.plist";
INFOPLIST_FILE = "$(PROJECT_DIR)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -1289,7 +1656,7 @@
SDKROOT = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvos appletvsimulator";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALID_ARCHS = "$(ARCHS_STANDARD)";
@@ -1306,7 +1673,8 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/Info.plist";
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "$(PROJECT_DIR)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -1319,7 +1687,7 @@
SDKROOT = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALID_ARCHS = "$(ARCHS_STANDARD)";
@@ -1336,7 +1704,8 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/Info.plist";
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "$(PROJECT_DIR)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -1349,7 +1718,7 @@
SDKROOT = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALID_ARCHS = "$(ARCHS_STANDARD)";
@@ -1366,7 +1735,8 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/Info.plist";
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "$(PROJECT_DIR)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -1379,7 +1749,7 @@
SDKROOT = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvos appletvsimulator";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALID_ARCHS = "$(ARCHS_STANDARD)";
@@ -1396,7 +1766,8 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/Info.plist";
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "$(PROJECT_DIR)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -1409,7 +1780,7 @@
SDKROOT = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvos appletvsimulator";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALID_ARCHS = "$(ARCHS_STANDARD)";
@@ -1428,7 +1799,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(PROJECT_DIR)/Info.plist";
INFOPLIST_FILE = "$(PROJECT_DIR)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -1441,7 +1812,7 @@
SDKROOT = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALID_ARCHS = "$(ARCHS_STANDARD)";
@@ -1460,7 +1831,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(PROJECT_DIR)/Info.plist";
INFOPLIST_FILE = "$(PROJECT_DIR)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -1473,7 +1844,7 @@
SDKROOT = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALID_ARCHS = "$(ARCHS_STANDARD)";
@@ -1491,7 +1862,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/Info.plist";
INFOPLIST_FILE = "$(PROJECT_DIR)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -1505,7 +1876,7 @@
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALID_ARCHS = "$(ARCHS_STANDARD)";
@@ -1523,7 +1894,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(PROJECT_DIR)/Info.plist";
INFOPLIST_FILE = "$(PROJECT_DIR)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -1536,7 +1907,7 @@
SDKROOT = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALID_ARCHS = "$(ARCHS_STANDARD)";
@@ -1555,7 +1926,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(PROJECT_DIR)/Info.plist";
INFOPLIST_FILE = "$(PROJECT_DIR)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -1568,7 +1939,7 @@
SDKROOT = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvos appletvsimulator";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALID_ARCHS = "$(ARCHS_STANDARD)";
@@ -1587,7 +1958,7 @@
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(PROJECT_DIR)/Info.plist";
INFOPLIST_FILE = "$(PROJECT_DIR)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -1600,7 +1971,7 @@
SDKROOT = "";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvos appletvsimulator";
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3";
TVOS_DEPLOYMENT_TARGET = 10.0;
VALID_ARCHS = "$(ARCHS_STANDARD)";
@@ -1710,6 +2081,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>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
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>
+2
View File
@@ -22,11 +22,13 @@
// THE SOFTWARE.
import Foundation
#if !COCOAPODS
@_exported import SKClient
@_exported import SKCore
@_exported import SKRTMAPI
@_exported import SKServer
@_exported import SKWebAPI
#endif
public final class SlackKit: RTMAdapter {

Some files were not shown because too many files have changed in this diff Show More