-
Notifications
You must be signed in to change notification settings - Fork 24
Architecture
All classes extend BaseClass which contains common functionality for managing IDs and links, maintaining pointers to the SDK instance that the object is associated with, and serialization. Each class is in its own file in the src/classes directory.
All constructors have (client, data) as their signature. client is an SDK instance. Each object needs a reference to the SDK instance that created it, otherwise it won't be able to make any requests to the API for retrieving additional data or saving changes.
data is an optional JSON object containing the data for the object. The structure of the JSON should match what is returned by the API.
Any object can be turned back into a JSON object by calling toJSON() or serialized into a JSON string by calling toString().
Modules are groupings of common functionality. They determine the groupings contained in the SDK documentation and largely reflect the groupings contained in the API documentation.
Not all methods can be called directly due to Collections defining entry points into the API. For example, you can't request a person's change history without first requesting the person and then requesting their changes by calling getChanges() on the person object. This means many methods only accept a full URL while only a few methods can also accept an ID.
-
FamilySearch.jsis the main file that contains the definition of the FamilySearch class, includes all other files it needs, and handles instantiation of SDK instances. -
globals.jsdefines defaults for configuration options. -
helpers.jsandutils.jscontain utility methods. There was some attempt to distinguish the two files by having all methods which need access to an SDK instance inhelpers.jsand all static methods inutils.jsbut the separation was never completed. -
overview.jscontains content for the home page of the documentation. -
plumbing.jscontains methods for issuing and managing HTTP requests. -
relationshipHelpers.jsis a group of methods shared by some modules to manage relationships.