expo-dev-menu-interface 0.7.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
3
3
  apply plugin: 'maven-publish'
4
4
 
5
5
  group = 'host.exp.exponent'
6
- version = '0.7.1'
6
+ version = '1.0.0'
7
7
 
8
8
  buildscript {
9
9
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
@@ -74,7 +74,7 @@ android {
74
74
  minSdkVersion safeExtGet("minSdkVersion", 21)
75
75
  targetSdkVersion safeExtGet("targetSdkVersion", 31)
76
76
  versionCode 6
77
- versionName '0.7.1'
77
+ versionName '1.0.0'
78
78
  }
79
79
  lintOptions {
80
80
  abortOnError false
@@ -6,7 +6,6 @@ import android.view.KeyEvent
6
6
  import android.view.MotionEvent
7
7
  import com.facebook.react.ReactNativeHost
8
8
  import com.facebook.react.bridge.ReadableMap
9
- import expo.interfaces.devmenu.expoapi.DevMenuExpoApiClientInterface
10
9
  import expo.interfaces.devmenu.items.DevMenuDataSourceItem
11
10
  import kotlinx.coroutines.CoroutineScope
12
11
 
@@ -90,11 +89,6 @@ interface DevMenuManagerInterface {
90
89
  */
91
90
  fun setCurrentScreen(screen: String?)
92
91
 
93
- /**
94
- * @return a instance of [DevMenuExpoApiClientInterface]
95
- */
96
- fun getExpoApiClient(): DevMenuExpoApiClientInterface
97
-
98
92
  /**
99
93
  * Sends an event to the delegate's bridge if exists.
100
94
  */
@@ -41,7 +41,4 @@ public protocol DevMenuManagerProtocol {
41
41
  @objc
42
42
  @discardableResult
43
43
  func toggleMenu() -> Bool
44
-
45
- @objc
46
- var expoApiClient: DevMenuExpoApiClientProtocol { get }
47
44
  }
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
10
10
  s.license = package['license']
11
11
  s.author = package['author']
12
12
  s.homepage = package['homepage']
13
- s.platform = :ios, '11.0'
13
+ s.platform = :ios, '13.0'
14
14
  s.swift_version = '5.2'
15
15
  s.source = { git: 'https://github.com/expo/expo.git' }
16
16
  s.static_framework = true
@@ -24,7 +24,7 @@ Pod::Spec.new do |s|
24
24
  s.pod_target_xcconfig = { "DEFINES_MODULE" => "YES" }
25
25
 
26
26
  s.test_spec 'Tests' do |test_spec|
27
- test_spec.platform = :ios, '12.0'
27
+ test_spec.platform = :ios, '13.0'
28
28
  test_spec.source_files = 'Tests/**/*.{h,m,swift}'
29
29
  test_spec.dependency 'Quick'
30
30
  test_spec.dependency 'Nimble'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-dev-menu-interface",
3
- "version": "0.7.1",
3
+ "version": "1.0.0",
4
4
  "description": "Interface for expo-dev-menu",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -25,5 +25,5 @@
25
25
  "peerDependencies": {
26
26
  "expo": "*"
27
27
  },
28
- "gitHead": "b6cb582b7da65f77a4b67fa0851463aa7a94c029"
28
+ "gitHead": "24bcb29e3ad33f8f576f60900ab1b1864dd33abf"
29
29
  }
@@ -1,42 +0,0 @@
1
- package expo.interfaces.devmenu.expoapi
2
-
3
- class DevMenuEASUpdates {
4
- data class Channel(
5
- val id: String,
6
- val name: String,
7
- val createdAt: String,
8
- val updatedAt: String
9
- )
10
-
11
- data class Branch(
12
- val id: String,
13
- val updates: Array<Update>
14
- ) {
15
- override fun equals(other: Any?): Boolean {
16
- if (this === other) return true
17
- if (javaClass != other?.javaClass) return false
18
-
19
- other as Branch
20
-
21
- if (id != other.id) return false
22
- if (!updates.contentEquals(other.updates)) return false
23
-
24
- return true
25
- }
26
-
27
- override fun hashCode(): Int {
28
- var result = id.hashCode()
29
- result = 31 * result + updates.contentHashCode()
30
- return result
31
- }
32
- }
33
-
34
- data class Update(
35
- val id: String,
36
- val message: String,
37
- val platform: String,
38
- val runtimeVersion: String,
39
- val createdAt: String,
40
- val updatedAt: String
41
- )
42
- }
@@ -1,27 +0,0 @@
1
- package expo.interfaces.devmenu.expoapi
2
-
3
- data class Response<T>(
4
- val status: Int,
5
- val data: T?
6
- )
7
-
8
- data class DevMenuGraphQLOptions(
9
- val limit: Int = 10,
10
- val offset: Int = 0
11
- )
12
-
13
- interface DevMenuExpoApiClientInterface {
14
- fun isLoggedIn(): Boolean
15
- fun setSessionSecret(newSessionSecret: String?)
16
- suspend fun queryMyProjects(options: DevMenuGraphQLOptions = DevMenuGraphQLOptions()): okhttp3.Response
17
- suspend fun queryDevSessions(deviceID: String?): okhttp3.Response
18
- suspend fun queryUpdateChannels(
19
- appId: String,
20
- options: DevMenuGraphQLOptions = DevMenuGraphQLOptions()
21
- ): Response<List<DevMenuEASUpdates.Channel>>
22
- suspend fun queryUpdateBranches(
23
- appId: String,
24
- branchesOptions: DevMenuGraphQLOptions = DevMenuGraphQLOptions(),
25
- updatesOptions: DevMenuGraphQLOptions = DevMenuGraphQLOptions()
26
- ): Response<List<DevMenuEASUpdates.Branch>>
27
- }
@@ -1,57 +0,0 @@
1
- // Copyright 2015-present 650 Industries. All rights reserved.
2
-
3
- import Foundation
4
-
5
- @objc
6
- public protocol DevMenuConstructibleFromDictionary {
7
- @objc
8
- init(dictionary: [String: Any])
9
- }
10
-
11
- public struct DevMenuEASUpdates {
12
- @objc
13
- public class Channel: NSObject, DevMenuConstructibleFromDictionary {
14
- public let id: String
15
- public let name: String
16
- public let createdAt: String
17
- public let updatedAt: String
18
-
19
- required public init(dictionary: [String: Any]) {
20
- id = dictionary["id"] as! String
21
- name = dictionary["name"] as! String
22
- createdAt = dictionary["createdAt"] as! String
23
- updatedAt = dictionary["updatedAt"] as! String
24
- }
25
- }
26
-
27
- @objc
28
- public class Branch: NSObject, DevMenuConstructibleFromDictionary {
29
- public let id: String
30
- public let updates: [Update]
31
-
32
- required public init(dictionary: [String: Any]) {
33
- id = dictionary["id"] as! String
34
- let updatesData = dictionary["updates"] as? [[String: Any]] ?? []
35
- updates = updatesData.map { Update(dictionary: $0) }
36
- }
37
- }
38
-
39
- @objc
40
- public class Update: NSObject, DevMenuConstructibleFromDictionary {
41
- public let id: String
42
- public let message: String
43
- public let platform: String
44
- public let runtimeVersion: String
45
- public let createdAt: String
46
- public let updatedAt: String
47
-
48
- required public init(dictionary: [String: Any]) {
49
- id = dictionary["id"] as! String
50
- message = dictionary["message"] as! String
51
- platform = dictionary["platform"] as! String
52
- runtimeVersion = dictionary["runtimeVersion"] as! String
53
- createdAt = dictionary["createdAt"] as! String
54
- updatedAt = dictionary["updatedAt"] as! String
55
- }
56
- }
57
- }
@@ -1,64 +0,0 @@
1
- // Copyright 2015-present 650 Industries. All rights reserved.
2
-
3
- import Foundation
4
-
5
- public typealias HTTPCompletionHandler = (Data?, URLResponse?, Error?) -> Void
6
-
7
- @objc
8
- public class DevMenuGraphQLOptions: NSObject {
9
- @objc
10
- public let limit: Int
11
- @objc
12
- public let offset: Int
13
-
14
- @objc
15
- public init(withLimit limit: Int = 10, withOffset offset: Int = 0) {
16
- self.limit = limit
17
- self.offset = offset
18
- }
19
-
20
- @objc
21
- public convenience init(withOffset offset: Int) {
22
- self.init(withLimit: 10, withOffset: offset)
23
- }
24
- }
25
-
26
- @objc
27
- public protocol DevMenuExpoApiClientProtocol {
28
- @objc
29
- func isLoggedIn() -> Bool
30
-
31
- @objc
32
- func setSessionSecret(_ sessionSecret: String?)
33
-
34
- @objc
35
- func queryUpdateChannels(
36
- appId: String,
37
- completionHandler: @escaping ([DevMenuEASUpdates.Channel]?, URLResponse?, Error?) -> Void,
38
- options: DevMenuGraphQLOptions
39
- )
40
-
41
- @objc
42
- func queryUpdateBranches(
43
- appId: String,
44
- completionHandler: @escaping ([DevMenuEASUpdates.Branch]?, URLResponse?, Error?) -> Void,
45
- branchesOptions: DevMenuGraphQLOptions,
46
- updatesOptions: DevMenuGraphQLOptions
47
- )
48
- }
49
-
50
- public extension DevMenuExpoApiClientProtocol {
51
- func queryUpdateChannels(
52
- appId: String,
53
- completionHandler: @escaping ([DevMenuEASUpdates.Channel]?, URLResponse?, Error?) -> Void
54
- ) {
55
- queryUpdateChannels(appId: appId, completionHandler: completionHandler, options: DevMenuGraphQLOptions())
56
- }
57
-
58
- func queryUpdateBranches(
59
- appId: String,
60
- completionHandler: @escaping ([DevMenuEASUpdates.Branch]?, URLResponse?, Error?) -> Void
61
- ) {
62
- queryUpdateBranches(appId: appId, completionHandler: completionHandler, branchesOptions: DevMenuGraphQLOptions(), updatesOptions: DevMenuGraphQLOptions())
63
- }
64
- }
@@ -1,86 +0,0 @@
1
- import Quick
2
- import Nimble
3
-
4
- @testable import EXDevMenuInterface
5
-
6
- class DevMenuEASUpdatesTest: QuickSpec {
7
- override func spec() {
8
- it("Channel constructor should populate all fields") {
9
- let seeder = [
10
- "id": "1234",
11
- "name": "channel-1",
12
- "createdAt": "1635508863",
13
- "updatedAt": "1635508873"
14
- ]
15
-
16
- let channel = DevMenuEASUpdates.Channel(dictionary: seeder)
17
-
18
- expect(channel.id).to(equal("1234"))
19
- expect(channel.name).to(equal("channel-1"))
20
- expect(channel.createdAt).to(equal("1635508863"))
21
- expect(channel.updatedAt).to(equal("1635508873"))
22
- }
23
-
24
- it("Update constructor should populate all fields") {
25
- let seeder = [
26
- "id": "1234",
27
- "message": "update-1",
28
- "platform": "ios",
29
- "runtimeVersion": "1",
30
- "createdAt": "1635508863",
31
- "updatedAt": "1635508873"
32
- ]
33
-
34
- let update = DevMenuEASUpdates.Update(dictionary: seeder)
35
-
36
- expect(update.id).to(equal("1234"))
37
- expect(update.message).to(equal("update-1"))
38
- expect(update.platform).to(equal("ios"))
39
- expect(update.runtimeVersion).to(equal("1"))
40
- expect(update.createdAt).to(equal("1635508863"))
41
- expect(update.updatedAt).to(equal("1635508873"))
42
- }
43
-
44
- it("Branch constructor should populate all fields") {
45
- let seeder = [
46
- "id": "1",
47
- "updates": [
48
- [
49
- "id": "1234",
50
- "message": "update-1",
51
- "platform": "ios",
52
- "runtimeVersion": "1",
53
- "createdAt": "1635508863",
54
- "updatedAt": "1635508873"
55
- ],
56
- [
57
- "id": "9876",
58
- "message": "update-2",
59
- "platform": "ios",
60
- "runtimeVersion": "2",
61
- "createdAt": "1635508863",
62
- "updatedAt": "1635508873"
63
- ]
64
- ]
65
- ] as [String: Any]
66
-
67
- let branch = DevMenuEASUpdates.Branch(dictionary: seeder)
68
- let update1 = branch.updates[0]
69
- let update2 = branch.updates[1]
70
-
71
- expect(branch.id).to(equal("1"))
72
- expect(update1.id).to(equal("1234"))
73
- expect(update1.message).to(equal("update-1"))
74
- expect(update1.platform).to(equal("ios"))
75
- expect(update1.runtimeVersion).to(equal("1"))
76
- expect(update1.createdAt).to(equal("1635508863"))
77
- expect(update1.updatedAt).to(equal("1635508873"))
78
- expect(update2.id).to(equal("9876"))
79
- expect(update2.message).to(equal("update-2"))
80
- expect(update2.platform).to(equal("ios"))
81
- expect(update2.runtimeVersion).to(equal("2"))
82
- expect(update2.createdAt).to(equal("1635508863"))
83
- expect(update2.updatedAt).to(equal("1635508873"))
84
- }
85
- }
86
- }