Skip to content

Commit

Permalink
integration -> api-integ; close #34
Browse files Browse the repository at this point in the history
  • Loading branch information
justincy committed Dec 8, 2017
1 parent 7c03c78 commit f556c8c
Show file tree
Hide file tree
Showing 16 changed files with 663 additions and 365 deletions.
2 changes: 1 addition & 1 deletion src/FamilySearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ FamilySearch.prototype.platformHost = function(){
case 'beta':
return 'https://beta.familysearch.org';
default:
return 'https://integration.familysearch.org';
return 'https://api-integ.familysearch.org';
}
};

Expand Down
5 changes: 5 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
If you make any changes to tests and need to record one of them, you may end up
needing to record all of them again. The requests all share one recorded
oauth request and in order to record one new test you must record a fresh oauth
request with a fresh token. Once that is done, the token won't match the other
recorded requests so they all need to be re-recorded.
6 changes: 3 additions & 3 deletions test/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* Helper method that assists in managing exceptions during async tests
* http://stackoverflow.com/a/15208067
*/
module.exports = function check( done, f ) {
module.exports = function check(done, f) {
try {
f();
done();
} catch( e ) {
done( e );
} catch(e) {
done(e);
}
};
98 changes: 47 additions & 51 deletions test/responses/browserGetPerson.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions test/responses/browserOauthPassword.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
"body": "grant_type=password&client_id=a02j000000JBxOxAAL&username=sdktester&password=1234sdkpass",
"status": 200,
"response": {
"token": "USYS996204AFB923618109AD7D3B316F694D_idses-int02.a.fsglobal.net",
"access_token": "USYSEFE1E2E4FE0E8455572D3855875083D4_idses-int01.a.fsglobal.net",
"token_type": "family_search",
"access_token": "USYS996204AFB923618109AD7D3B316F694D_idses-int02.a.fsglobal.net"
"token": "USYSEFE1E2E4FE0E8455572D3855875083D4_idses-int01.a.fsglobal.net"
},
"headers": {
"server": "Apache-Coyote/1.1",
"expires": "Tue, 03 Jul 2001 06:00:00 GMT",
"last-modified": "Tue Nov 29 20:45:25 GMT+00:00 2016",
"last-modified": "Fri Dec 08 19:53:14 GMT 2017",
"cache-control": "no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0",
"pragma": "no-cache",
"content-type": "application/json;charset=ISO-8859-1",
"content-language": "en",
"content-length": "185",
"date": "Tue, 29 Nov 2016 20:45:24 GMT",
"date": "Fri, 08 Dec 2017 19:53:14 GMT",
"connection": "close",
"access-control-allow-methods": "OPTIONS, HEAD, GET, PUT, POST, DELETE",
"access-control-allow-headers": "Accept, Accept-Charset, Accept-Encoding, Accept-Language, Accept-Datetime, Authorization, Cache-Control, Connection, Content-Length, Content-Md5, Content-Type, Date, Expect, From, Host, If-Match, If-Modified-Since, If-None-Match, If-Range, If-Unmodified-Since, Location, Origin, Pragma, Range, Referer, SingularityJSHeader, Te, User-Agent, Warning, X-Expect-Override, X-Reason, X-Requested-With, X-FS-Feature-Tag",
"access-control-expose-headers": "Location, Link, Warning, X-Entity-ID, Content-Location, X-Processing-Time, Retry-After, X-FS-Page-Context, Allow",
"access-control-expose-headers": "Location, Link, Warning, X-Entity-ID, Content-Location, X-Processing-Time, Retry-After, X-FS-Page-Context, Allow, ETag",
"access-control-allow-origin": "null",
"access-control-max-age": "604800",
"vary": "Origin"
Expand Down
130 changes: 63 additions & 67 deletions test/responses/browserRedirect.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions test/responses/createPerson.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"scope": "https://integration.familysearch.org:443",
"scope": "https://api-integ.familysearch.org:443",
"method": "POST",
"path": "/platform/tree/persons",
"body": {
Expand Down Expand Up @@ -35,16 +35,16 @@
"headers": {
"cache-control": "no-cache, no-store, no-transform, must-revalidate, max-age=0",
"content-type": "application/x-fs-v1+json",
"date": "Tue, 15 Nov 2016 22:37:51 GMT",
"link": "<https://integration.familysearch.org/platform/tree/ancestry?person=L58V-TY1>; rel=\"ancestry\", <https://integration.familysearch.org/platform/tree/persons/L58V-TY1/child-relationships>; rel=\"child-relationships\", <https://integration.familysearch.org/platform/tree/descendancy?person=L58V-TY1>; rel=\"descendancy\", <https://integration.familysearch.org/platform/tree/persons/L58V-TY1/discussion-references>; rel=\"discussion-references\", <https://integration.familysearch.org/platform/tree/persons/L58V-TY1/matches>; rel=\"matches\", <https://integration.familysearch.org/platform/tree/persons/L58V-TY1/notes>; rel=\"notes\", <https://integration.familysearch.org/platform/tree/persons/L58V-TY1/parent-relationships>; rel=\"parent-relationships\", <https://integration.familysearch.org/platform/tree/persons-with-relationships?person=L58V-TY1>; rel=\"person-with-relationships\", <https://integration.familysearch.org/platform/tree/persons>; rel=\"persons\", <https://integration.familysearch.org/platform/tree/persons/L58V-TY1/source-references>; rel=\"source-references\", <https://integration.familysearch.org/platform/tree/persons/L58V-TY1/spouse-relationships>; rel=\"spouse-relationships\"",
"location": "https://integration.familysearch.org/platform/tree/persons/L58V-TY1",
"date": "Fri, 08 Dec 2017 19:52:53 GMT",
"link": "<https://api-integ.familysearch.org/platform/tree/ancestry?person=L5FW-NT1>; rel=\"ancestry\", <https://api-integ.familysearch.org/platform/tree/persons/L5FW-NT1/child-relationships>; rel=\"child-relationships\", <https://api-integ.familysearch.org/platform/tree/descendancy?person=L5FW-NT1>; rel=\"descendancy\", <https://api-integ.familysearch.org/platform/tree/persons/L5FW-NT1/discussion-references>; rel=\"discussion-references\", <https://api-integ.familysearch.org/platform/tree/persons/L5FW-NT1/matches>; rel=\"matches\", <https://api-integ.familysearch.org/platform/tree/persons/L5FW-NT1/notes>; rel=\"notes\", <https://api-integ.familysearch.org/platform/tree/persons/L5FW-NT1/parent-relationships>; rel=\"parent-relationships\", <https://api-integ.familysearch.org/platform/tree/persons>; rel=\"persons\", <https://api-integ.familysearch.org/platform/tree/persons/L5FW-NT1/source-references>; rel=\"source-references\", <https://api-integ.familysearch.org/platform/tree/persons/L5FW-NT1/spouse-relationships>; rel=\"spouse-relationships\"",
"location": "https://api-integ.familysearch.org/platform/tree/persons/L5FW-NT1",
"server": "Apache-Coyote/1.1",
"vary": "Accept, Accept-Language, Accept-Encoding, Expect, Accept-Encoding",
"x-entity-id": "L58V-TY1",
"x-processing-time": "166",
"x-throttle-millis-left": "1796823",
"x-throttle-millis-used": "3177",
"x-throttle-window-size": "1800000",
"x-entity-id": "L5FW-NT1",
"x-processing-time": "141",
"x-throttle-millis-left": "55883",
"x-throttle-millis-used": "4117",
"x-throttle-window-size": "60000",
"content-length": "0",
"connection": "Close"
}
Expand Down
35 changes: 18 additions & 17 deletions test/responses/deletePerson.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"scope": "https://integration.familysearch.org:443",
"scope": "https://api-integ.familysearch.org:443",
"method": "POST",
"path": "/platform/tree/persons",
"body": {
Expand Down Expand Up @@ -35,38 +35,39 @@
"headers": {
"cache-control": "no-cache, no-store, no-transform, must-revalidate, max-age=0",
"content-type": "application/x-fs-v1+json",
"date": "Tue, 15 Nov 2016 22:37:52 GMT",
"link": "<https://integration.familysearch.org/platform/tree/ancestry?person=L58V-RR5>; rel=\"ancestry\", <https://integration.familysearch.org/platform/tree/persons/L58V-RR5/child-relationships>; rel=\"child-relationships\", <https://integration.familysearch.org/platform/tree/descendancy?person=L58V-RR5>; rel=\"descendancy\", <https://integration.familysearch.org/platform/tree/persons/L58V-RR5/discussion-references>; rel=\"discussion-references\", <https://integration.familysearch.org/platform/tree/persons/L58V-RR5/matches>; rel=\"matches\", <https://integration.familysearch.org/platform/tree/persons/L58V-RR5/notes>; rel=\"notes\", <https://integration.familysearch.org/platform/tree/persons/L58V-RR5/parent-relationships>; rel=\"parent-relationships\", <https://integration.familysearch.org/platform/tree/persons-with-relationships?person=L58V-RR5>; rel=\"person-with-relationships\", <https://integration.familysearch.org/platform/tree/persons>; rel=\"persons\", <https://integration.familysearch.org/platform/tree/persons/L58V-RR5/source-references>; rel=\"source-references\", <https://integration.familysearch.org/platform/tree/persons/L58V-RR5/spouse-relationships>; rel=\"spouse-relationships\"",
"location": "https://integration.familysearch.org/platform/tree/persons/L58V-RR5",
"date": "Fri, 08 Dec 2017 19:52:53 GMT",
"link": "<https://api-integ.familysearch.org/platform/tree/ancestry?person=L5FW-NYM>; rel=\"ancestry\", <https://api-integ.familysearch.org/platform/tree/persons/L5FW-NYM/child-relationships>; rel=\"child-relationships\", <https://api-integ.familysearch.org/platform/tree/descendancy?person=L5FW-NYM>; rel=\"descendancy\", <https://api-integ.familysearch.org/platform/tree/persons/L5FW-NYM/discussion-references>; rel=\"discussion-references\", <https://api-integ.familysearch.org/platform/tree/persons/L5FW-NYM/matches>; rel=\"matches\", <https://api-integ.familysearch.org/platform/tree/persons/L5FW-NYM/notes>; rel=\"notes\", <https://api-integ.familysearch.org/platform/tree/persons/L5FW-NYM/parent-relationships>; rel=\"parent-relationships\", <https://api-integ.familysearch.org/platform/tree/persons>; rel=\"persons\", <https://api-integ.familysearch.org/platform/tree/persons/L5FW-NYM/source-references>; rel=\"source-references\", <https://api-integ.familysearch.org/platform/tree/persons/L5FW-NYM/spouse-relationships>; rel=\"spouse-relationships\"",
"location": "https://api-integ.familysearch.org/platform/tree/persons/L5FW-NYM",
"server": "Apache-Coyote/1.1",
"vary": "Accept, Accept-Language, Accept-Encoding, Expect, Accept-Encoding",
"x-entity-id": "L58V-RR5",
"x-processing-time": "148",
"x-throttle-millis-left": "1796541",
"x-throttle-millis-used": "3459",
"x-throttle-window-size": "1800000",
"x-entity-id": "L5FW-NYM",
"x-processing-time": "143",
"x-throttle-millis-left": "55575",
"x-throttle-millis-used": "4425",
"x-throttle-window-size": "60000",
"content-length": "0",
"connection": "Close"
}
},
{
"scope": "https://integration.familysearch.org:443",
"scope": "https://api-integ.familysearch.org:443",
"method": "DELETE",
"path": "/platform/tree/persons/L58V-RR5",
"path": "/platform/tree/persons/L5FW-NYM",
"body": "",
"status": 204,
"response": "",
"headers": {
"cache-control": "no-transform, must-revalidate, max-age=0",
"content-location": "/tree/persons/L58V-RR5",
"content-location": "/tree/persons/L5FW-NYM",
"content-type": "application/x-fs-v1+json",
"date": "Tue, 15 Nov 2016 22:37:53 GMT",
"date": "Fri, 08 Dec 2017 19:52:54 GMT",
"link": "<https://api-integ.familysearch.org/tree/person/L5FW-NYM/details>; rel=\"alternate\"",
"server": "Apache-Coyote/1.1",
"vary": "Accept, Accept-Language, Accept-Encoding, Expect, Accept-Encoding",
"x-processing-time": "167",
"x-throttle-millis-left": "1796375",
"x-throttle-millis-used": "3625",
"x-throttle-window-size": "1800000",
"x-processing-time": "165",
"x-throttle-millis-left": "55410",
"x-throttle-millis-used": "4590",
"x-throttle-window-size": "60000",
"connection": "Close"
}
}
Expand Down
11 changes: 4 additions & 7 deletions test/responses/errors.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"scope": "https://integration.familysearch.org:443",
"scope": "https://api-integ.familysearch.org:443",
"method": "GET",
"path": "/platform/tree/persons/PPPPPP",
"body": "",
Expand All @@ -18,15 +18,12 @@
"cache-control": "no-cache, no-store, no-transform, must-revalidate, max-age=0",
"content-location": "/tree/persons/PPPPPP",
"content-type": "application/x-fs-v1+json",
"date": "Tue, 15 Nov 2016 22:37:56 GMT",
"date": "Fri, 08 Dec 2017 19:53:07 GMT",
"server": "Apache-Coyote/1.1",
"vary": "Accept, Accept-Language, Accept-Encoding, Expect, Accept-Encoding",
"warning": "400 FamilySearch \"Unable to read tf person.\"",
"x-processing-time": "171",
"x-throttle-millis-left": "1795572",
"x-throttle-millis-used": "4428",
"x-throttle-window-size": "1800000",
"transfer-encoding": "chunked",
"x-processing-time": "164",
"content-length": "262",
"connection": "Close"
}
}
Expand Down
Loading

0 comments on commit f556c8c

Please sign in to comment.