1
0
Fork 0
Commit Graph

26 Commits (1aa51775f3d4b794b256574500c0d9aa708f4688)

Author SHA1 Message Date
Mike Gerwitz e003abcd4b Integrate TokenedDataApi into system
This changes the easejs interface for DataApi, which requires adding the
param to everything.  The TS interface was created in a previous commit and
already contained this parameter.  The idea is to remove the easejs
interface in the future, but traits are a barrier to that atm.

DocumentServer and controller demonstrate the mess that we have with regards
to instantiating dependencies.  This needs to change---DocumentServer itself
was something that was started but never fully realized.  It makes this
incredibly confusing, difficult to follow, and complicates important error
handling that ought to be taking place.  It also discourages implementing
additional dependencies.

I'm not going to go through and provide a ChangeLog-style commit message for
this commit.  I'm too exhausted by this crap.
2019-10-18 09:55:11 -04:00
Mike Gerwitz e058c8b509 Copyright range update
All files now have the same range, beginning from the conception of this
project.
2019-08-30 09:41:35 -04:00
Mike Gerwitz 3bed93e750 SpoofedNodeHttpImpl: Fix docblocks (User{Session=>Request})
Wrong object!
2018-05-01 09:44:55 -04:00
Jeffrey Fisher 7d0dc97162 Add HttpDataApiUrlData 2018-05-01 09:44:53 -04:00
Mike Gerwitz c1b6f796fe Add `quote' Data API type
* src/dapi/DataApiFactory.js (_createDataApi): Add support for
  `quote'.
* src/dapi/http/HttpDataApi.js (__construct): New `enctype' argument.
  (_encodeData, _encodeKeys): Remove former, rename latter to former.
  (encodeData, _urlEncode): Encode based on enctype and method.
  (*): Strict mode, es6 style.
2017-08-10 09:52:07 -04:00
Mike Gerwitz 020ca01458 HttpDataApi: Only serialize JSON on POST
* src/dapi/http/HttpDataApi.js (_encodeKeys): JSON.stringify on POST.
* test/dapi/http/HttpDataApiTest.js: Update tests accordingly.
  Add POST test.
2017-08-10 09:52:07 -04:00
Mike Gerwitz 65ab92f701 Add SpoofedNodeHttpImpl
Session spoofing is needed for making authenticated requests.
2017-06-28 15:51:18 -04:00
Mike Gerwitz 630af0a062 Add ability to provide origin to NodeHttpImpl
* src/dapi/http/NodeHttpImpl.js (_parseUrl): Add method.
  (__construct): Add argument.
  (requestData): Use it.

* test/dapi/http/NodeHttpImplTest.js: Add tests.
2017-06-21 13:55:15 -04:00
Mike Gerwitz 624f35a489 XhrHttpImpl: throw {=>Http}Error
* src/dapi/http/XhrHttpImpl.js (serveError): Throw HttpError instead
  of Error.
* test/dapi/http/XhrHttpImplTest.js: Test updated accordingly.
2017-06-21 10:52:46 -04:00
Mike Gerwitz a3e359a050 Add node dapi HTTP implementation
* src/dapi/http/HttpError.js: Add error subtype.
* src/dapi/http/NodeHttpImpl.js: Add node-based HTTP impl.
* test/dapi/http/HttpErrorTest.js: Add test.
* test/dapi/http/NodeHttpImplTest.js: Add test.
2017-06-21 10:52:46 -04:00
Mike Gerwitz 1bb5191e3e LoVullo Associates => R-T Specialty
Copyright notices updated.  More casual references to "LoVullo
Associates" replaced with "RT Specialty / Lovullo", which will be "RT
Specialty Buffalo" in the future.  Or "RT Specialty", depending on how
this is rolled out.  Or "Ryan Specialty Group".  Who knows.

"R-T Specialty, LLC." is the legal name, which includes the dash.  Not
to be confused with a certain television network.
2017-06-08 14:48:43 -04:00
Mike Gerwitz a6115018d2 Add x-www-form-urlencoded header for XhrHttpImpl
It might be the case that we may want to post raw data in the future; in
fact, I can guarantee it.  We'll cross that bridge when we come to it.

* src/dapi/http/XhrHttpImpl.js (openRequest): Set ContentType header
on POST

* test/dapi/http/XhrHttpImplTest.js: Modified accordingly
2016-04-14 12:08:00 -04:00
Mike Gerwitz 5c2c468183 ECMAScript 3 compatibility fixes
This is crazy, but LoVullo Associates still supports browsers as far back as
IE7, meaning that we need to maintain ES3 support; that will hopefully
change soon.
2015-05-31 23:51:08 -04:00
Mike Gerwitz a383a36bfc HttpDataApi#request permits null data 2015-05-29 12:45:02 -04:00
Mike Gerwitz 0599acc23a Key-value param encoding moved from XhrHttpImpl to HttpDataApi 2015-05-29 12:22:26 -04:00
Mike Gerwitz f122d85938 XhrHttpImpl modify URL for GET request params and encode key-value
Some of this may be more appropriate to move out of XhrHttpImpl into
something like HttpDataApi...
2015-05-29 09:35:21 -04:00
Mike Gerwitz ca68d12370 XhrHttpImpl no longer modifying response text
Status code included with error object
2015-05-28 15:15:41 -04:00
Mike Gerwitz 1669f9eeda XhrHttpImpl#request invokes XHR send
This should have always been the case; I am not sure what I was thinking,
considering that the object is encapsulated.
2015-05-28 15:15:39 -04:00
Mike Gerwitz af4a775155 AutoRetry delay implementation 2015-05-27 15:25:43 -04:00
Mike Gerwitz ca5d064455 AutoRetry trait initial implementation 2015-05-27 15:25:42 -04:00
Mike Gerwitz 8fbd4dd220 XhrHttpImpl#serveError 2015-05-12 16:32:49 -04:00
Mike Gerwitz d4328968e8 XhrHttpImpl considers any 2xx status to be successful 2015-05-12 16:32:49 -04:00
Mike Gerwitz 6cc260b443 XhrHttpImpl#isSuccessful determines HTTP response success
May be overridden by subtypes.
2015-05-12 16:32:48 -04:00
Mike Gerwitz 0e9c511117 HttpDataApi.request is now virtual
Will support mixins
2015-05-12 13:45:19 -04:00
Mike Gerwitz 6d0acf5916 Initial XhrHttpImpl implementation 2015-05-12 13:45:19 -04:00
Mike Gerwitz e0f1c600ba Began liberating DataApi
The Data API is being heavily refactored and tested; while moving files into the
Liza repository, I noticed some inefficiencies with the design. These are being
heavily improved upon.
2015-05-12 13:45:19 -04:00