 import Foundation
 import BrightFutures
 
+public typealias Metadata = [String: AnyObject]
+public typealias JSONAPIData = [String: AnyObject]
+
+
 /// The main class
 public class Spine {
 	

	
	:returns: A future that resolves to a ResourceCollection that contains the fetched resources.
	*/
	public func findAll<T: Resource>(type: T.Type) -> Future<(resources: ResourceCollection, meta: [String: AnyObject]?, jsonapi: [String: AnyObject]?), NSError> {
		let query = Query(resourceType: type)
		return find(query)
	}

	
	:returns: A future that resolves to a ResourceCollection that contains the fetched resources.
	*/
	public func find<T: Resource>(query: Query<T>) -> Future<(resources: ResourceCollection, meta: Metadata?, jsonapi: JSONAPIData?), NSError> {
		let promise = Promise<(resources: ResourceCollection, meta: Metadata?, jsonapi: JSONAPIData?), NSError>()
		
		let operation = FetchOperation(query: query, spine: self)
		
