Skip to content

Commit 565ad13

Browse files
committed
Merge branch 'develop'
2 parents f9fcf9f + 294eb4b commit 565ad13

File tree

134 files changed

+5728
-1604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+5728
-1604
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
## Build generated
99
build/
1010
DerivedData/
11+
Index/
1112

1213
## Various settings
1314
*.pbxuser

.swift-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.2

AutocompleteClient.xcodeproj/project.pbxproj

Lines changed: 270 additions & 170 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

AutocompleteClient.xcodeproj/xcshareddata/xcschemes/AutocompleteClient.xcscheme

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
30-
shouldUseLaunchSchemeArgsEnv = "YES"
31-
codeCoverageEnabled = "YES">
29+
codeCoverageEnabled = "YES"
30+
shouldUseLaunchSchemeArgsEnv = "YES">
3231
<Testables>
3332
<TestableReference
3433
skipped = "NO">
@@ -57,7 +56,6 @@
5756
buildConfiguration = "Debug"
5857
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5958
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
60-
language = ""
6159
launchStyle = "0"
6260
useCustomWorkingDirectory = "NO"
6361
ignoresPersistentStateOnLaunch = "NO"

AutocompleteClient.xcworkspace/contents.xcworkspacedata

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

AutocompleteClient/Constants/Constants.swift

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -50,29 +50,31 @@ struct Constants {
5050
}
5151

5252
struct Query {
53-
static let autocompleteKey = "autocomplete_key"
53+
static let apiKey = "key"
5454
static let baseURLString = "https://ac.cnstrc.com"
5555
static let httpMethod = "GET"
5656
static let queryStringFormat = "%@/%@/%@"
5757

5858
static let sessionIncrementTimeoutInSeconds: TimeInterval = 1800 // 30 mins
5959
}
6060

61+
struct ClientID {
62+
static let key = "kClientID"
63+
}
64+
6165
struct AutocompleteQuery {
6266
static let pathString = "autocomplete"
6367
static let numResults = "num_results"
6468
static let numResultsForSectionNamePrefix = "num_results_"
65-
}
66-
67-
struct SearchQuery {
68-
static let pathString = "search"
69-
static let page = "page"
70-
static let numResultsPerPage = "num_results_per_page"
71-
static let numResultsPerPageForSectionNamePrefix = "num_results_per_page_"
69+
static let queryItemForSection = { (name: String) -> String in return Constants.AutocompleteQuery.numResultsForSectionNamePrefix + name }
70+
71+
static let sectionNameSearchSuggestions = "Search Suggestions"
72+
static let sectionNameProducts = "Products"
73+
74+
static let defaultItemCountPerSection = 10
7275
}
7376

7477
struct Response {
75-
// static let expectedStatusCode = 200
7678
static let singleSectionResultField = "suggestions"
7779
static let multiSectionResultField = "sections"
7880
}
@@ -91,54 +93,52 @@ struct Constants {
9193

9294
struct Track {
9395
static let httpMethod = "GET"
94-
static let autocompleteKey = "autocomplete_key"
96+
static let apiKey = "key"
9597
static let baseURLString = "https://ac.cnstrc.com"
96-
static let trackStringFormat = "%@/%@/%@/%@"
97-
static let trackBehaviorStringFormat = "%@/%@"
9898
static let expectedStatusCode = 204
99-
100-
static let dateTime = "_dt"
101-
static let defaultTrackingSectionName = "Products"
102-
}
103-
104-
struct TrackAutocomplete {
105-
static let pathString = "autocomplete"
99+
106100
static let autocompleteSection = "autocomplete_section"
107101
static let searchTerm = "term"
108-
static let action = "action"
109-
static let actionSearchResults = "search-results"
110-
static let actionFocus = "focus"
111-
static let actionSessionStart = "session_start"
112-
}
113-
114-
struct TrackSearch{
115-
static let format = "%@/autocomplete/%@/search"
116-
static let originalQuery = "original_query"
117-
static let pathBehavior = "behavior"
118-
}
119-
120-
struct TrackAutocompleteResultClicked {
121-
static let selectType = "select"
122-
static let searchType = "search"
123-
static let type = "select"
124102
static let trigger = "tr"
125103
static let triggerType = "click"
126104
static let originalQuery = "original_query"
127105
static let groupName = "group[group_name]"
128106
static let groupID = "group[group_id]"
129-
}
130-
131-
struct TrackConversion {
132-
static let type = "conversion"
133-
static let item = "item"
134107
static let itemId = "item_id"
135108
static let revenue = "revenue"
109+
static let dateTime = "_dt"
110+
static let defaultItemSectionName = "Products"
111+
}
112+
113+
struct TrackSessionStart {
114+
static let format = "%@/behavior?action=session_start"
115+
}
116+
117+
struct TrackInputFocus {
118+
static let format = "%@/behavior?action=focus"
119+
}
120+
121+
struct TrackAutocompleteSelect {
122+
static let format = "%@/autocomplete/%@/select"
136123
}
137124

138-
struct TrackSearchTermTyped {
139-
static let type = "search"
125+
struct TrackSearchSubmit {
126+
static let format = "%@/autocomplete/%@/search"
127+
}
128+
129+
struct TrackSearchResultsLoaded {
130+
static let format = "%@/behavior?action=search-results"
131+
}
132+
133+
struct TrackSearchClickThrough {
134+
static let format = "%@/autocomplete/%@/click_through"
140135
}
141136

137+
struct TrackConversion {
138+
static let format = "%@/autocomplete/%@/conversion"
139+
140+
}
141+
142142
struct Logging{
143143
private static let prefix = "[ConstructorIO]:"
144144
private static let format: (_ message: String) -> String = { message in return "\(Logging.prefix) \(message)" }

AutocompleteClient/FW/API/Data/TaskResponse.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
// http://constructor.io/
77
//
88

9-
import UIKit
9+
import Foundation
1010

1111
/**
1212
Task response must be constructed through one of the two constructors so it's impossible to have a response
1313
that has no data and no error
1414
*/
1515
public class TaskResponse<T, E> {
16-
let data: T?
17-
let error: E?
16+
public let data: T?
17+
public let error: E?
1818

1919
init(data: T) {
2020
self.data = data

AutocompleteClient/FW/API/DataSource/AbstractConstructorDataSource.swift

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)