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 Jun 24, 2014
1 parent 3390d0e commit a8b05d0
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 11 deletions.
49 changes: 42 additions & 7 deletions familysearch-javascript-sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -1998,11 +1998,8 @@ define('authentication',[
helpers.eraseAccessToken();
return helpers.chainHttpPromises(
plumbing.getUrl('http://oauth.net/core/2.0/endpoint/token'),
function() {
// See issue #48 - issuing the delete to FamilySearch returns an error
// so for not, just return an empty string
//return plumbing.del(url);
return '';
function(url) {
return plumbing.del(url);
});
};

Expand Down Expand Up @@ -2741,7 +2738,20 @@ define('changeHistory',[
* @function
* @return {Object} promise for the {@link user.functions:getAgent getAgent} response
*/
$getAgent: function() { return user.getAgent(this.$getAgentUrl()); }
$getAgent: function() { return user.getAgent(this.$getAgentUrl()); },

/**
* @ngdoc function
* @name changeHistory.types:constructor.Change#$restore
* @methodOf changeHistory.types:constructor.Change
* @function
* @param {Object=} opts options to pass to the http function specified during init
* @return {Object} promise for the {@link changeHistory.functions:restoreChange restoreChange} response
*/
$restore: function(opts) {
return exports.restoreChange(this.id, opts);
}

};

var changeHistoryResponseMapper = helpers.compose(
Expand Down Expand Up @@ -2836,7 +2846,31 @@ define('changeHistory',[
});
};

// TODO restore change
/**
* @ngdoc function
* @name changeHistory.functions:restoreChange
* @function
*
* @description
* Restore the specified change
*
* {@link https://familysearch.org/developers/docs/api/tree/Restore_Change_resource}
*
* {@link http://jsfiddle.net/DallanQ/JZ29U/ editable example}
*
* @param {string} chid change id or full URL of the restore changes endpoint
* @param {Object=} opts options to pass to the http function specified during init
* @return {Object} promise for the chid
*/
exports.restoreChange = function(chid, opts) {
return helpers.chainHttpPromises(
plumbing.getUrl('change-restore-template', chid, {chid: chid}),
function(url) {
return plumbing.post(url, null, {'Content-Type': void 0}, opts, function() { // don't send a Content-Type header
return chid;
});
});
};

return exports;
});
Expand Down Expand Up @@ -11052,6 +11086,7 @@ define('FamilySearch',[
getPersonChanges: changeHistory.getPersonChanges,
getChildAndParentsChanges: changeHistory.getChildAndParentsChanges,
getCoupleChanges: changeHistory.getCoupleChanges,
restoreChange: changeHistory.restoreChange,

// TODO discovery

Expand Down
7 changes: 4 additions & 3 deletions familysearch-javascript-sdk.min.js

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion js/docs-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,23 @@ NG_DOCS={
"shortDescription": "Get change history for a person",
"keywords": "api array change changehistory changes convenience count docs editable endpoint entries example familysearch full function functions getchanges history http https includes init net number options opts org params pass person pid promise response return types url"
},
{
"section": "api",
"id": "changeHistory.functions:restoreChange",
"shortName": "restoreChange",
"type": "function",
"moduleName": "changeHistory",
"shortDescription": "Restore the specified change",
"keywords": "api change changehistory changes chid editable endpoint example full function functions http https init net options opts org pass promise restore url"
},
{
"section": "api",
"id": "changeHistory.types:constructor.Change",
"shortName": "constructor.Change",
"type": "function",
"moduleName": "changeHistory",
"shortDescription": "Change made to a person or relationship",
"keywords": "$getagent $getagentname $getagenturl $getchangereason agent api change changehistory details function functions getagent pass person promise property reason relationship response timestamp title types updated url user"
"keywords": "$getagent $getagentname $getagenturl $getchangereason $restore agent api change changehistory details function functions getagent http init options opts pass person promise property reason relationship response restorechange timestamp title types updated url user"
},
{
"section": "api",
Expand Down
17 changes: 17 additions & 0 deletions partials/api/changeHistory.functions.restoreChange.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<h1><code ng:non-bindable="">restoreChange</code>
<div><span class="hint">functions in module <code ng:non-bindable="">changeHistory</code>
</span>
</div>
</h1>
<div><h2 id="description">Description</h2>
<div class="description"><div class="changehistory-functions-page changehistory-functions-restorechange-page"><p>Restore the specified change</p>
<p><a href="https://familysearch.org/developers/docs/api/tree/Restore_Change_resource"><a href="https://familysearch.org/developers/docs/api/tree/Restore_Change_resource">https://familysearch.org/developers/docs/api/tree/Restore_Change_resource</a></a></p>
<p><a href="http://jsfiddle.net/DallanQ/JZ29U/">editable example</a></p>
</div></div>
<h2 id="usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">restoreChange(chid[, opts]);</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>chid</td><td><a href="" class="label type-hint type-hint-string">string</a></td><td><div class="changehistory-functions-page changehistory-functions-restorechange-page"><p>change id or full URL of the restore changes endpoint</p>
</div></td></tr><tr><td>opts <div><em>(optional)</em></div></td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="changehistory-functions-page changehistory-functions-restorechange-page"><p>options to pass to the http function specified during init</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-object">Object</a></td><td><div class="changehistory-functions-page changehistory-functions-restorechange-page"><p>promise for the chid</p>
</div></td></tr></table></div>
</div>
5 changes: 5 additions & 0 deletions partials/api/changeHistory.types.constructor.Change.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ <h2 id="usage">Usage</h2>
<div class="$getchangereason"><h5 id="methods_$getchangereason_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">String</a></td><td><div class="changehistory-types-page changehistory-types-constructor-change-getchangereason-page"><p>reason for the change</p>
</div></td></tr></table></div>
</li>
<li><h3 id="methods_$restore">$restore(opts)</h3>
<div class="$restore"><h5 id="methods_$restore_parameters">Parameters</h5><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>opts <div><em>(optional)</em></div></td><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="changehistory-types-page changehistory-types-constructor-change-restore-page"><p>options to pass to the http function specified during init</p>
</div></td></tr></tbody></table><h5 id="methods_$restore_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-object">Object</a></td><td><div class="changehistory-types-page changehistory-types-constructor-change-restore-page"><p>promise for the <a href="#/api/changeHistory.functions:restoreChange">restoreChange</a> response</p>
</div></td></tr></table></div>
</li>
</ul>
</div>
<div class="member property"><h2 id="properties">Properties</h2>
Expand Down

0 comments on commit a8b05d0

Please sign in to comment.