Skip to content

Commit

Permalink
Update docs and files to distribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis committed Sep 14, 2015
1 parent ea650a3 commit dfbc465
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 65 deletions.
47 changes: 28 additions & 19 deletions 2.0/js/docs-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ NG_DOCS={
"type": "function",
"moduleName": "familysearch",
"shortDescription": "Initialize the FamilySearch object",
"keywords": "$timeout access access_token action angular api auto_expire auto_signin blocked call called calls clear client_id console convenient cookie debug developer development direct documentation environment exist expire_callback expired expires false familysearch function future global host hour hours inactivity init initialize issue js key logging mobile node oauth2 object optional opts overview pass pop-up port production prompted re-read received redirect redirect_uri registered response result running safari sandbox save_access_token saved script server session set settimeout sign staging system timeout timeout_function token true turn types uri user user-initiated users whichever"
"keywords": "__warning__ access access_token action api array auto_expire auto_signin blocked call called calls clear client client_id console convenient cookie cors-api-specifiation-request debug details developer development direct documentation enabled environment exist expire_callback expired expires false familysearch function future host hour hours inactivity init initialize issue js key logging mobile modifications node oauth2 object opts org overview pass pending pending_modifications pop-up port preflight production prompted re-read received redirect redirect_uri registered request requests require response result running safari sandbox save_access_token saved script server session set sign spec staging system token true turn types uri user user-initiated w3 whichever"
},
{
"section": "api",
Expand Down Expand Up @@ -1065,24 +1065,6 @@ NG_DOCS={
"shortDescription": "Set the "processing time" spent in FamilySearch REST endpoints.",
"keywords": "api counter endpoints familysearch function functions milliseconds plumbing processing reset rest set spent time wanted"
},
{
"section": "api",
"id": "redirect",
"shortName": "redirect",
"type": "overview",
"moduleName": "redirect",
"shortDescription": "Utility functions",
"keywords": "api docs familysearch functions https org overview redirect utility"
},
{
"section": "api",
"id": "redirect.functions:getRedirectUrl",
"shortName": "getRedirectUrl",
"type": "function",
"moduleName": "redirect",
"shortDescription": "FamilySearch API Docs",
"keywords": "access api changes context docs familysearch function functions https location memories ordinances org params person precedence redirect token uri url user"
},
{
"section": "api",
"id": "searchAndMatch",
Expand Down Expand Up @@ -1461,6 +1443,33 @@ NG_DOCS={
"shortDescription": "User - a user is returned from getCurrentUser;",
"keywords": "address agent api client contact contributor data display email en family familysearch female full function functions getcontactname getcurrentuser getdisplayname getemail getfamilyname getgender getgivenname getid getpersonid getpreferredlanguage gettreeuserid ids male object person raw returned sdk types user"
},
{
"section": "api",
"id": "utilities",
"shortName": "utilities",
"type": "overview",
"moduleName": "utilities",
"shortDescription": "Utility functions",
"keywords": "api docs familysearch functions https org overview utilities utility"
},
{
"section": "api",
"id": "utilities.functions:getPendingModifications",
"shortName": "getPendingModifications",
"type": "function",
"moduleName": "utilities",
"shortDescription": "Get a list of the pending modifications for the API.",
"keywords": "api array convenience docs familysearch function functions getpendingmodifications https includes list modifications org pending promise response utilities"
},
{
"section": "api",
"id": "utilities.functions:getRedirectUrl",
"shortName": "getRedirectUrl",
"type": "function",
"moduleName": "utilities",
"shortDescription": "FamilySearch API Docs",
"keywords": "access api changes context docs familysearch function functions https location memories ordinances org params person precedence redirect token uri url user utilities"
},
{
"section": "api",
"id": "vocabularies.functions:createVocabularyElement",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ <h1><code ng:non-bindable="">FamilySearch</code>
<ul>
<li><code>client_id</code> - the developer key you received from FamilySearch</li>
<li><code>environment</code> - sandbox, staging, or production</li>
<li><code>timeout_function</code> - optional timeout function: angular users should pass <code>$timeout</code>; otherwise the global <code>setTimeout</code> is used</li>
<li><code>redirect_uri</code> - the OAuth2 redirect uri you registered with FamilySearch. Does not need to exist,
but must have the same host and port as the server running your script;
however, it must exist for mobile safari - see the Overview section of the documentation</li>
<li><code>pending_modifications</code> - an array of pending modifications that should be enabled for all requests.
<strong>Warning</strong>: When pending modifications are enabled on the client, all requests will require a preflight request.
See the <a href="http://www.w3.org/TR/cors/#cors-api-specifiation-request">CORS spec</a> for more details.</li>
<li><code>auto_expire</code> - set to true if you want to the system to clear the access token when it has expired
(after one hour of inactivity or 24 hours, whichever comes first; should probably be false for node.js)</li>
<li><code>auto_signin</code> - set to true if you want the user to be prompted to sign in whenever you call an API function
Expand Down
18 changes: 18 additions & 0 deletions 2.0/partials/api/utilities.functions.getPendingModifications.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<h1><code ng:non-bindable="">getPendingModifications</code>
<div><span class="hint">functions in module <code ng:non-bindable="">utilities</code>
</span>
</div>
</h1>
<div><h2 id="description">Description</h2>
<div class="description"><div class="utilities-functions-page utilities-functions-getpendingmodifications-page"><p>Get a list of the pending modifications for the API.
The response includes the following convenience function</p>
<ul>
<li><code>getPendingModifications()</code> - get an array of the pending modifications from the response</li>
</ul>
<p><a href="https://familysearch.org/developers/docs/api/tree/Pending_Modifications_resource">FamilySearch API Docs</a></p>
</div></div>
<h2 id="usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">getPendingModifications();</pre>
<h4 id="usage_returns">Returns</h4><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="utilities-functions-page utilities-functions-getpendingmodifications-page"><p>Promise for the response</p>
</div></td></tr></table></div>
</div>
14 changes: 14 additions & 0 deletions 2.0/partials/api/utilities.functions.getRedirectUrl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<h1><code ng:non-bindable="">getRedirectUrl</code>
<div><span class="hint">functions in module <code ng:non-bindable="">utilities</code>
</span>
</div>
</h1>
<div><h2 id="description">Description</h2>
<div class="description"><div class="utilities-functions-page utilities-functions-getredirecturl-page"><p><a href="https://familysearch.org/developers/docs/api/tree/Redirect_resource">FamilySearch API Docs</a></p>
</div></div>
<h2 id="usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">getRedirectUrl([params]);</pre>
<h4 id="usage_parameters">Parameters</h4><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>params <div><em>(optional)</em></div></td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="utilities-functions-page utilities-functions-getredirecturl-page"><p>context (details, memories, ordinances, or changes), or person (id), or uri (takes precedence)</p>
</div></td></tr></tbody></table><h4 id="usage_returns">Returns</h4><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">string</a></td><td><div class="utilities-functions-page utilities-functions-getredirecturl-page"><p>URL with access token that will redirect the user to the specified location</p>
</div></td></tr></table></div>
</div>
7 changes: 7 additions & 0 deletions 2.0/partials/api/utilities.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<h1><code ng:non-bindable=""></code>
<div><span class="hint"></span>
</div>
</h1>
<div><div class="utilities-page"><p>Utility functions</p>
<p><a href="https://familysearch.org/developers/docs/api/resources#utilities">FamilySearch API Docs</a></p>
</div></div>
110 changes: 69 additions & 41 deletions familysearch-javascript-sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,6 @@ var instanceId = 0;
/**
* @ngdoc function
* @name familysearch.types:constructor.FamilySearch
*
* @description
* Initialize the FamilySearch object
Expand All @@ -1394,10 +1393,12 @@ var instanceId = 0;
*
* - `client_id` - the developer key you received from FamilySearch
* - `environment` - sandbox, staging, or production
* - `timeout_function` - optional timeout function: angular users should pass `$timeout`; otherwise the global `setTimeout` is used
* - `redirect_uri` - the OAuth2 redirect uri you registered with FamilySearch. Does not need to exist,
* but must have the same host and port as the server running your script;
* however, it must exist for mobile safari - see the Overview section of the documentation
* - `pending_modifications` - an array of pending modifications that should be enabled for all requests.
* __Warning__: When pending modifications are enabled on the client, all requests will require a preflight request.
* See the [CORS spec](http://www.w3.org/TR/cors/#cors-api-specifiation-request) for more details.
* - `auto_expire` - set to true if you want to the system to clear the access token when it has expired
* (after one hour of inactivity or 24 hours, whichever comes first; should probably be false for node.js)
* - `auto_signin` - set to true if you want the user to be prompted to sign in whenever you call an API function
Expand Down Expand Up @@ -1433,21 +1434,22 @@ var FS = module.exports = function(opts){
}

self.settings.environment = opts['environment'];

self.settings.redirectUri = opts['redirect_uri'] || opts['auth_callback']; // auth_callback is deprecated

self.settings.autoSignin = opts['auto_signin'];

self.settings.autoExpire = opts['auto_expire'];

if (opts['save_access_token']) {
if(opts['save_access_token']) {
self.settings.saveAccessToken = true;
self.helpers.readAccessToken();
}

if (opts['access_token']) {
if(opts['access_token']) {
self.settings.accessToken = opts['access_token'];
}

if(opts['pending_modifications'] && utils.isArray(opts['pending_modifications'])){
self.settings.pendingModifications = opts['pending_modifications'].join(',');
}

self.settings.debug = opts['debug'];

Expand All @@ -1471,12 +1473,12 @@ require('./modules/parentsAndChildren');
require('./modules/pedigree');
require('./modules/persons');
require('./modules/places');
require('./modules/redirect');
require('./modules/searchAndMatch');
require('./modules/sourceBox');
require('./modules/sources');
require('./modules/spouses');
require('./modules/users');
require('./modules/utilities');

// These files contain class definitions
require('./classes/base');
Expand Down Expand Up @@ -1525,7 +1527,7 @@ function extendFSPrototype(moduleName, functionName){
return this[moduleName][functionName].apply(this[moduleName], arguments);
};
}
},{"./classes/agent":6,"./classes/attribution":7,"./classes/base":8,"./classes/change":9,"./classes/childAndParents":10,"./classes/collection":11,"./classes/comment":12,"./classes/couple":13,"./classes/date":14,"./classes/discussion":15,"./classes/discussionRef":16,"./classes/fact":17,"./classes/gender":18,"./classes/memory":19,"./classes/memoryArtifactRef":20,"./classes/memoryPersona":21,"./classes/memoryPersonaRef":22,"./classes/name":23,"./classes/note":24,"./classes/person":25,"./classes/placeDescription":26,"./classes/placeReference":27,"./classes/placesSearchResult":28,"./classes/searchResult":29,"./classes/sourceDescription":30,"./classes/sourceRef":31,"./classes/textValue":32,"./classes/user":33,"./classes/vocabularyElement":34,"./classes/vocabularyList":35,"./globals":36,"./helpers":37,"./modules/authentication":38,"./modules/authorities":39,"./modules/changeHistory":40,"./modules/discussions":41,"./modules/memories":42,"./modules/notes":43,"./modules/parentsAndChildren":44,"./modules/pedigree":45,"./modules/persons":46,"./modules/places":47,"./modules/redirect":48,"./modules/searchAndMatch":49,"./modules/sourceBox":50,"./modules/sources":51,"./modules/spouses":52,"./modules/users":53,"./plumbing":54,"./utils":56}],6:[function(require,module,exports){
},{"./classes/agent":6,"./classes/attribution":7,"./classes/base":8,"./classes/change":9,"./classes/childAndParents":10,"./classes/collection":11,"./classes/comment":12,"./classes/couple":13,"./classes/date":14,"./classes/discussion":15,"./classes/discussionRef":16,"./classes/fact":17,"./classes/gender":18,"./classes/memory":19,"./classes/memoryArtifactRef":20,"./classes/memoryPersona":21,"./classes/memoryPersonaRef":22,"./classes/name":23,"./classes/note":24,"./classes/person":25,"./classes/placeDescription":26,"./classes/placeReference":27,"./classes/placesSearchResult":28,"./classes/searchResult":29,"./classes/sourceDescription":30,"./classes/sourceRef":31,"./classes/textValue":32,"./classes/user":33,"./classes/vocabularyElement":34,"./classes/vocabularyList":35,"./globals":36,"./helpers":37,"./modules/authentication":38,"./modules/authorities":39,"./modules/changeHistory":40,"./modules/discussions":41,"./modules/memories":42,"./modules/notes":43,"./modules/parentsAndChildren":44,"./modules/pedigree":45,"./modules/persons":46,"./modules/places":47,"./modules/searchAndMatch":48,"./modules/sourceBox":49,"./modules/sources":50,"./modules/spouses":51,"./modules/users":52,"./modules/utilities":53,"./plumbing":54,"./utils":56}],6:[function(require,module,exports){
var FS = require('./../FamilySearch'),
utils = require('./../utils'),
maybe = utils.maybe;
Expand Down Expand Up @@ -10344,33 +10346,6 @@ FS.prototype.getPlaceTypeGroups = function() {
});
};
},{"./../FamilySearch":5,"./../utils":56}],48:[function(require,module,exports){
var FS = require('./../FamilySearch');

/**
* @ngdoc overview
* @name redirect
* @description
* Utility functions
*
* {@link https://familysearch.org/developers/docs/api/resources#redirect FamilySearch API Docs}
*/

/**
* @ngdoc function
* @name redirect.functions:getRedirectUrl
*
* @description
*
* {@link https://familysearch.org/developers/docs/api/tree/Redirect_resource FamilySearch API Docs}
*
* @param {Object=} params context (details, memories, ordinances, or changes), or person (id), or uri (takes precedence)
* @return {string} URL with access token that will redirect the user to the specified location
*/
FS.prototype.getRedirectUrl = function(params) {
return this.helpers.appendAccessToken(this.helpers.appendQueryParameters(this.helpers.getAPIServerUrl('/platform/redirect'), params));
};
},{"./../FamilySearch":5}],49:[function(require,module,exports){
var FS = require('./../FamilySearch'),
utils = require('./../utils');

Expand Down Expand Up @@ -10524,7 +10499,7 @@ FS.prototype.getPersonMatchesQuery = function(params) {
});
};

},{"./../FamilySearch":5,"./../utils":56}],50:[function(require,module,exports){
},{"./../FamilySearch":5,"./../utils":56}],49:[function(require,module,exports){
var FS = require('./../FamilySearch'),
utils = require('./../utils'),
maybe = utils.maybe;
Expand Down Expand Up @@ -10756,7 +10731,7 @@ FS.prototype.deleteCollection = function(url) {
return this.plumbing.del(url);
};

},{"./../FamilySearch":5,"./../utils":56}],51:[function(require,module,exports){
},{"./../FamilySearch":5,"./../utils":56}],50:[function(require,module,exports){
var FS = require('./../FamilySearch'),
utils = require('./../utils'),
maybe = utils.maybe;
Expand Down Expand Up @@ -11016,7 +10991,7 @@ FS.prototype.deleteSourceRef = function(url, changeMessage) {
return this.plumbing.del(url, changeMessage ? {'X-Reason': changeMessage} : {});
};

},{"./../FamilySearch":5,"./../utils":56}],52:[function(require,module,exports){
},{"./../FamilySearch":5,"./../utils":56}],51:[function(require,module,exports){
var FS = require('../FamilySearch'),
utils = require('../utils'),
maybe = utils.maybe;
Expand Down Expand Up @@ -11110,7 +11085,7 @@ FS.prototype.restoreCouple = function(url) {
return this.plumbing.post(url, null, {'Content-Type': 'application/x-fs-v1+json'});
};

},{"../FamilySearch":5,"../utils":56}],53:[function(require,module,exports){
},{"../FamilySearch":5,"../utils":56}],52:[function(require,module,exports){
var FS = require('./../FamilySearch'),
utils = require('./../utils'),
maybe = utils.maybe;
Expand Down Expand Up @@ -11231,7 +11206,55 @@ FS.prototype.getCurrentUserPerson = function() {
});
};

},{"./../FamilySearch":5,"./../utils":56}],54:[function(require,module,exports){
},{"./../FamilySearch":5,"./../utils":56}],53:[function(require,module,exports){
var FS = require('./../FamilySearch');

/**
* @ngdoc overview
* @name utilities
* @description
* Utility functions
*
* {@link https://familysearch.org/developers/docs/api/resources#utilities FamilySearch API Docs}
*/

/**
* @ngdoc function
* @name utilities.functions:getRedirectUrl
*
* @description
*
* {@link https://familysearch.org/developers/docs/api/tree/Redirect_resource FamilySearch API Docs}
*
* @param {Object=} params context (details, memories, ordinances, or changes), or person (id), or uri (takes precedence)
* @return {string} URL with access token that will redirect the user to the specified location
*/
FS.prototype.getRedirectUrl = function(params) {
return this.helpers.appendAccessToken(this.helpers.appendQueryParameters(this.helpers.getAPIServerUrl('/platform/redirect'), params));
};

/**
* @ngdoc function
* @name utilities.functions:getPendingModifications
*
* @description Get a list of the pending modifications for the API.
* The response includes the following convenience function
*
* - `getPendingModifications()` - get an array of the pending modifications from the response
*
* {@link https://familysearch.org/developers/docs/api/tree/Pending_Modifications_resource FamilySearch API Docs}
*
* @return {Object} Promise for the response
*/
FS.prototype.getPendingModifications = function() {
return this.plumbing.get('/platform/pending-modifications').then(function(response){
response.getPendingModifications = function(){
return response.getData().features;
};
return response;
});
};
},{"./../FamilySearch":5}],54:[function(require,module,exports){
// These are globals so that their interface is the same
// both in the client and on the server
require('es6-promise').polyfill();
Expand Down Expand Up @@ -11508,6 +11531,11 @@ Plumbing.prototype.http = function(method, url, headers, data, retries) {
retries = self.settings.maxHttpRequestRetries;
}

// Pending modifications
if(self.settings.pendingModifications){
headers['X-FS-Feature-Tag'] = self.settings.pendingModifications;
}

var body = self.transformData(data, headers['Content-Type']);

// Make the HTTP request
Expand Down
8 changes: 4 additions & 4 deletions familysearch-javascript-sdk.min.js

Large diffs are not rendered by default.

0 comments on commit dfbc465

Please sign in to comment.