File: service.coffee
Defined in: |
Constant Summary
-
DEFAULT_PROTOCOL
=
If the user doesn't add one on their url, assume HTTP.
-
"http://"
-
VERSION_PATH
=
A list of endpoints exposed by the service.
-
"version"
- TEMPLATES_PATH =
-
"templates"
- RELEASE_PATH =
-
"version/release"
- CLASSKEY_PATH =
-
"classkeys"
- LISTS_PATH =
-
"lists"
- MODEL_PATH =
-
"model"
- SUMMARYFIELDS_PATH =
-
"summaryfields"
- QUERY_RESULTS_PATH =
-
"query/results"
- QUICKSEARCH_PATH =
-
"search"
- WIDGETS_PATH =
-
"widgets"
- ENRICHMENT_PATH =
-
"list/enrichment"
- WITH_OBJ_PATH =
-
"listswithobject"
- SUBTRACT_PATH =
-
'lists/subtract'
- WHOAMI_PATH =
-
"user/whoami"
- PREF_PATH =
-
'user/preferences'
- PATH_VALUES_PATH =
-
'path/values'
- USER_TOKENS =
-
'user/tokens'
- ID_RESOLUTION_PATH =
-
'ids'
-
HAS_PROTOCOL
=
Pattern for detecting if URI has a protocol
-
/^https?:\/\//i
-
HAS_SUFFIX
=
Pattern for detecting if the URI has the necessary service suffix.
-
/service\/?$/i
-
SUFFIX
=
The suffix all service URIs must end in.
-
"/service/"
Method Summary
- ? (void) NEEDS_AUTH(path, q)
- ? (void) DEFAULT_ERROR_HANDLER(e) BY DEFAULT, LOG ERRORS TO THE CONSOLE.
- ? (([List) getListFinder(name) A private helper that produces a function that will read through an array of Lists, and find the first one with the given name.
- ? (void) LIST_PIPE(service, prop = 'listName')
- ? (void) TO_NAMES(xs = [])
- ? (Promise<BufferedReader<Array<Object>>>) Service.prototype.rowByRow(q, args...) Process the results of a query row by row.
- ? (Promise<BufferedReader<Object>>) Service.prototype.recordByRecord(q, args...) Process the results of a query item by item.
- ? (void) Service.flushCaches() Static method to flush the cached models, versions and summary-field informations.
- ? (void) Service.connect(opts) Static method for instantiation.
Method Details
? (void) NEEDS_AUTH(path, q)
? (void) DEFAULT_ERROR_HANDLER(e)
BY DEFAULT, LOG ERRORS TO THE CONSOLE.
? (([List) getListFinder(name)
A private helper that produces a function that will read through an array of Lists, and find the first one with the given name. The returned function returns a promise to find the given list, and will be rejected if no list of that name can be found.
? (void) LIST_PIPE(service, prop = 'listName')
? (void) TO_NAMES(xs = [])
? (Promise<BufferedReader<Array<Object>>>) Service.prototype.rowByRow(q, args...)
Process the results of a query row by row.
? (Promise<BufferedReader<Object>>) Service.prototype.recordByRecord(q, args...)
Process the results of a query item by item.
? (void) Service.flushCaches()
Static method to flush the cached models, versions and summary-field informations.
This should be used if running in a persistent process and this data is at risk of getting stale.
? (void) Service.connect(opts)
Static method for instantiation. Allows us to provide alternate implementations in the future, and pass this function around when needed.