_getResourceUrlFromApiURL(aApiURL) |
Computes the resource URL given the API URL |
absoluteURL(aUrl, aDoc, aWindow) |
Makes sure the URL is absolute, resolved against the base URL |
binarySearch(arr, x, cmp) |
Performs a binary search on the array |
cacheLast(aEqualFunction, scheduler) |
Operator that will replay the last value of a sequence to potentially many subscribers. The following assertions hold true:- there will be no identical subsequent values - there will be at most one subscription to the original sequence - if there are no more subscriptions to the resulting observable (refcount falls to zero), the operator unsubscribes from the source - if the original sequence has produced at least one value, this value will be the startingThis operator differs from shareReplay(1) in the following way (in addition to ensuring a unique sequence): - if the source observable is hot, then shareReplay(1) will never unsubscribe even if its subscriptions fall to zero. cacheLast will unsubscribe - if the source observable is cold but still producing values when subscriptions fall to zero, then shareReplay(1) will not unsubscribe and will not cancel the sequence. cacheLast will unsubscribe and cancel the sequence.This operator differs from shareReplay({bufferSize: 1, refCount: true}) in the following way (in addition to ensuring a unique sequence): - if subscriptions fall to zero, then with shareReplay the first value that subsequent subscriptions will get is the first value of a new subscription to the source sequence. With cacheLast the first value will be the last value of the previous subscription. |
chunkArray(aArray, aSize) |
Splits the array into even chunks |
clientStorageFromWindow(aScope, aWindow) |
Returns our storage object from the window |
cloneDeep(aValue) |
Performs a deep clone for the value, supports just plain objects and arrays |
cloneUrlConfig(aUrlConfig) |
Constructs a clone |
createDeliveryContentItem(aItem) |
Converts a v1 delivery item structure into a simplified structure |
createDeliveryContentItemWithMetadata(aItem) |
Merges metadata into each level |
createError(aMessage, aCause) |
|
createGetter(aGetter) |
Constructs a getter description |
createGetterOnObservable(aObservable, aInitial) |
Constructs a getter description |
createLoggerService(aLoggerFactory) |
Constructs a logger service on the basis of a logger factory. The service makes sure not to create the same logger multiple times |
createMarkupRendererV2(aDeliveryContent, aAuthoringType, aLayoutMapping, aLayout, aMarkupTemplate, aExtendedContext$, aLoggerService, aScheduler) |
Constructs a new renderer that applies a handlebars transform to produce rendered markup. The markup will be kept current whenever any of the underlying data changes. |
createMessageHandler(aCorsWhitelist, aMsgHandlers, aLogger) |
Constructs an event listener that listens for messages |
createNavigateByPathHandler(aNavigate, aLogger) |
Executes a navigation event |
createRefreshHandler(aRefresh, aLogger) |
Executes a refresh event |
createSetModeHandler(aPublicApiHandler, aLogger) |
Executes a navigation event |
createSetterOnSubject(aSubject) |
Constructs a setter description |
createSubscribeActiveRouteHandler(onActiveRenderingContext, aLogger) |
Subscribes to the active route |
createSubscribeModeHandler(onUsePublic, aLogger) |
Subscribes to the active route |
createSubscribeRouteHandler(aGetRenderingContextByPath, aLogger) |
Subscribes to a given route |
createUnsubscribeHandler(aLogger) |
Subscribes to a given route |
dbgAddSource(aSource, aObject) |
Adds source information |
dbgCounter() |
|
filterArray(aArray, aPredicate) |
Filters an array |
flattenArray(aArray) |
|
forEach(aArray, aConsumer) |
Just run a callback for each element in an array |
forIn(aObject, aConsumer) |
Run a callback for each key value pair |
fromObservableOrT(aValue) |
Converts the generic type into an observable of the desired type |
generateItem(aGenerator) |
Creates an observable that exposes the result of the function call if the result is defined. Otherwise this is an empty sequence. |
getAuthoringConfigElements(aType) |
Returns the authoring config elements |
getAuthoringContentElements(aType) |
Returns the authoring content elements |
getBaseUrlFromDocument(aDoc, aWindow) |
Extracts the base URL from the current document |
getBaseUrlFromWindow(aWindow, aDocument) |
Returns a base URL from the window |
getItemStatus(aRenderingContext) |
Decodes the item status from the rendering context. This can e.g. be used to display status icons |
getLinksByRel(aDocument, aWindow) |
Returns all links in the document, ordered by rel |
getOrigin(aDoc, aWindow) |
Returns the orign from the doc |
hashString(oldHash, s) |
|
httpCreateTimer(aOptions) |
Creates a timer that fires at a randomly chosen interval as soon as subscribed to it |
httpGetJsonResource(aURL, aHttpService, aWithCredentials, aTrigger, aOptions, aLogger) |
|
httpGetStringResource(aURL, aHttpService, aWithCredentials, aTrigger, aOptions, aLogger) |
Represents an HTTP request, potentially made via the cache |
isArrayLikeOf(aValue, aPredicate) |
Tests if all elements of the array are of a particular type |
isArrayOf(aValue, aPredicate) |
Tests if all elements of the array are of a particular type |
isAuthoringConfigElement(aElement) |
Checks if an element is a config element |
isAuthoringContentElement(aElement) |
Checks if an element is a content element |
isAuthoringGroup(value) |
|
isAuthoringGroupElement(aValue) |
Tests if a field is a content type |
isAuthoringImage(value) |
|
isAuthoringReference(value) |
|
isAuthoringReferenceValue(value) |
|
isAuthoringText(value) |
|
isAuthoringVideo(value) |
|
isCategory(aValue, bOptional) |
|
isCategoryElement(aValue, bOptional) |
Tests if an element is a category element |
isDate(aValue) |
Tests if a value is a date |
isDateElement(aValue) |
Tests if an element is a date element |
isDeliveryReferenceElement(aValue) |
Tests if a value is a delivery reference element |
isElement(aValue, bOptional) |
Tests if the value is a value element |
isElementType(aValue) |
Tests if the value is a valid element type |
isEqual(aLeft, aRight) |
|
isErrorResponse(aResponse) |
Tests if a response is an error response |
isFile(aValue, bOptional) |
Tests if an element is a video. If the element is optional, it can be null or an arbitrary object. Otherwise we must have at least an asset and a URL. |
isFileElement(aValue) |
Tests if an element is a file element |
isFormattedTextElement(aValue) |
Tests if an element is a text element |
isGroupElement(aValue, bOptional) |
Tests if an element is a Group element |
isImage(aValue, bOptional) |
Tests if an element is an image. If the element is optional, it can be null or an arbitrary object. Otherwise we must have at least an asset and a URL. |
isImageElement(aValue) |
Tests if an element is an image element |
isLink(aValue, bOptional) |
Tests if we have a link element. We consider the element to exist if it has at least one of its fields set. |
isLinkElement(aValue) |
Tests if an element is a link element |
isLocalizedText(aText) |
Tests if a value is a localized context |
isLocation(aValue, bOptional) |
|
isLocationElement(aValue, bOptional) |
Tests if an element is a location element |
isMetadata(aValue) |
Tests if the object is valid metadata |
isMultiDateElement(aValue, bOptional) |
Tests if an element is a text element |
isMultiFileElement(aValue, bOptional) |
Tests if an element is a file element |
isMultiFormattedTextElement(aValue, bOptional) |
Tests if an element is a text element |
isMultiGroupElement(aValue, bOptional) |
Tests if an element is a Group element |
isMultiImageElement(aValue, bOptional) |
Tests if an element is an image element |
isMultiLinkElement(aValue, bOptional) |
Tests if an element is an image element |
isMultiNumberElement(aValue, bOptional) |
Tests if an element is a number element |
isMultiOptionSelectionElement(aValue, bOptional) |
Tests if an element is an option selection element |
isMultiProductElement(aValue, bOptional) |
Tests if an element is a text element |
isMultiReferenceElement(aValue, bOptional) |
Tests if an element is a reference element |
isMultiTextElement(aValue, bOptional) |
Tests if an element is a text element |
isMultiToggleElement(aValue, bOptional) |
Tests if an element is a toggle element |
isMultiVideoElement(aValue, bOptional) |
Tests if an element is an image element |
isNumberElement(aValue) |
Tests if an element is a number element |
isObjectOf(aValue, aPredicate) |
Tests if all fields of an object are of a particular type |
isOptional(aValue, aPredicate) |
|
isOptionalArrayOf(aValue, aPredicate) |
|
isOptionSelectionElement(aValue) |
Tests if an element is an option selection element |
isPlainObject(aObject) |
Tests for a plain object |
isProductElement(aValue) |
|
isReferenceElement(aValue) |
Tests if an element is a reference element |
isRenderingContextProvider(aValue) |
Tests is an object is a rendering context provider |
isRenderingContextV2(aValue) |
Tests if the object is a valid rendering context |
isSingleDateElement(aValue, bOptional) |
Tests if an element is a date element |
isSingleFileElement(aValue, bOptional) |
Tests if an element is a file element |
isSingleFormattedTextElement(aValue, bOptional) |
Tests if an element is a text element |
isSingleGroupElement(aValue, bOptional) |
Tests if an element is a Group element |
isSingleImageElement(aValue, bOptional) |
Tests if an element is an image element |
isSingleLinkElement(aValue, bOptional) |
Tests if an element is an image element |
isSingleNumberElement(aValue, bOptional) |
Tests if an element is a number element |
isSingleOptionSelectionElement(aValue, bOptional) |
Tests if an element is an option selection element |
isSingleProductElement(aValue, bOptional) |
Tests if an element is a text element |
isSingleReferenceElement(aValue, bOptional) |
Tests if an element is a reference element |
isSingleTextElement(aValue, bOptional) |
Tests if an element is a text element |
isSingleToggleElement(aValue, bOptional) |
Tests if an element is a toggle element |
isSingleVideoElement(aValue, bOptional) |
Tests if an element is an image element |
isTextElement(aValue) |
Tests if an element is a text element |
isToggleElement(aValue, bOptional) |
Tests if an element is a toggle element |
isURL(aValue) |
|
isUrlConfig(aValue) |
Tests if a value is a valid url config object |
isValueOf(aType, aValue, bOptional) |
Tests if the value is a value element |
isVideo(aValue, bOptional) |
Tests if an element is a video. If the element is optional, it can be null or an arbitrary object. Otherwise we must have at least an asset and a URL. |
isVideoElement(aValue) |
Tests if an element is a video element |
kebabCase(str) |
|
logModule(aVersion, aModule, aLogSvc) |
Logs version information for a module |
longHash() |
Returns an initial value for the hash code |
luceneEscapeKeyValue(aKey, aTerm) |
Generates a search selector and escapes the value. If the value is missing the method generates an expression that searches for missing values. |
luceneEscapeKeyValueAnd(aKey, aTerms) |
Generates a selector and joins with 'AND' |
luceneEscapeKeyValueOr(aKey, aTerms) |
Generates a selector and joins with 'OR' |
luceneEscapeTerm(aTerm) |
Escapes a term according to lucence syntax |
mapArray(aArray, aMapper) |
Maps every value in an array |
mergeObjects(aLeft, aRight) |
Merge objects together and consider undefined or empty objects as not overridable |
nary(aArity, aFunction) |
Implements a wrapper function that limits the arguments to the given size |
pageArrayEquals(aLeft, aRight) |
Tests if two page arrays are equal |
pageCloneSitePage(aSitePage) |
Performs a shallow clone of a site page |
pageCreatePartialSiteContextForSitePage(aPage, aSite) |
Returns the partial rendering context for a site page |
pageCreateSiteContextFromSearchResult(aPage, aSearchResult, aSite) |
Decomposes a search result into a site context structure |
pageEquals(aLeft, aRight) |
Tests if two pages are equal |
pageGetEncodedPath(aPath) |
Make sure we use a consistent encoding |
parseQueryString(aQuery) |
Parses the query string into key/value pairs |
pathForSearch(aPath) |
|
perfMeasure(aName) |
|
pluckPath(aPath, aDefault) |
Returns a function that plucks the given path from an object |
queryToCanonicalString(aValue) |
Converts various inputs into a query string. |
queryToString(aValue) |
Converts various inputs into a query string. |
reduceArray(aArray, aReducer, aInitial) |
Tests every value in an array |
reduceForIn(aObject, aFunction, aInitial) |
Run a callback for each key value pair |
reduceToObject(aArray, aKeyExtractor, aTransformer) |
Groups an array into an object given a key extractor |
rxBackpressure(aDelegate) |
Implementation of a backpressure operator. The operator will combine source items into chunks and produces a result observable per chunk. It will buffer source items as long as the observable of the last chunk has not finished, yet. |
rxCachedFunction(aDelegate, aAccessor) |
Implements a function that caches the result of another function |
rxLayoutIdFromRenderingContext(aLayoutMode, aRenderingContext, aTypeAccessor, aLayoutMappingAccessor, aLogSvc, aScheduler) |
Decodes the layout id from a type or provider |
rxUrlFromProvider(aProvider) |
Converts the provider into a URL |
rxWchFromAuthoringTypeByAccessor(aAccessor, aTypeId, aSelector, aTypeAccessor, aScheduler) |
Decodes information from the authoring element identified by the accessor expression. The method will first locate the correct authoring element based on the accessor and then applies a selector to extract the desired value from the element. |
rxWithSubscriptionCount(aCallback) |
Returns an operator that invokes a callback with the subscription count |
safeCmp(aComparator) |
Generates a safe comparator that also works if the arguments are nil |
sendJsonRequest(aUrl, aOptions, aTrigger, aHttpService, aLogger) |
Sends a request to the given options object and allows to trigger a refresh via the given trigger. |
sendRequest(aUrl, aOptions, aTrigger, aRequest, aLogger) |
Sends a request to the given options object and allows to trigger a refresh via the given trigger. |
sendTextRequest(aUrl, aOptions, aTrigger, aHttpService, aLogger) |
Sends a request to the given options object and allows to trigger a refresh via the given trigger. |
siteContextEquals(aLeft, aRight) |
Tests if two site contexts are equal |
thisThenThat(aFirst, aNext) |
Combines two observables such that the events on the first one are used until the second one starts to produce an event. From then on only the events on the second one will be used and the first one canceled. |
toInteger(aValue, aDefault) |
Converts the value to an integer |
urlConfigEquals(aLeft, aRight) |
Tests if two UrlConfig objects are equal |
urlEquals(aLeft, aRight) |
Tests if two URL objects are equal |
urlFromProvider(aProvider) |
Converts the provider into a URL |
urlSlashes(aUrl) |
Makes sure that a path starts and ends with slash |
urlToString(aURL) |
Shortcut to convert a URL to a string |
wchAddDebug(aPath, aRenderingContext) |
|
wchAddTypings(aRenderingContext) |
Adds typings next to the elements |
wchAdjustRenderingContextSearchQuery(aQuery) |
Analyzes the search query and makes sure that it contains the required fields. |
wchAdjustSitePagesSearchQuery(aQuery, aSiteId) |
Analyzes the search query and makes sure that it contains the required fields. |
wchAuthoringElementFromAccessor(aAccessor, aType) |
Decodes the authoring element from the accessor expression |
wchBoxFetchLevels(aLevels, aDefault) |
Returns the number of fetch levels |
wchBoxLayoutMode(aMode) |
Maps unknown or empty modes |
wchCreateUrlConfig(aBaseUrl, aApiUrl, aResourceUrl, aDocument) |
Constructs a interface based on some optional config values. |
wchCycleHandling(aCycle) |
|
wchDecodeAccessor(aPrototype, aAccessor) |
Tranlates the accessor to an expression |
wchDecodeExpression(aExpression) |
Decodes the expression back to an expression into elements. The expression might point either to the optimized element or to the elements structure itself. |
wchDeliveryContentByAccessor(aItem, aAccessor) |
Returns the element identified by the accessor string from a content item in delivery format |
wchElementFromRenderingContext(aContext, aAccessor) |
Decodes an element from the accessor |
wchForEachRenderingContext(aRenderingContext, aCallback) |
Iterates over all rendering contexts referenced by this context |
wchForEachType(aType, aCallback) |
Resolves all typeRef |
wchGetApiUrlFromResourceURL(aResourceURL) |
Computes the API URL given the resource URL |
wchGetApiUrlInContext(aApiUrl, aBaseURL, aPreviewCheck) |
Constructs a API URL based on a context check callback |
wchGetBaseURL(aDocument, aWindow) |
Decodes the base URL. The base URL is the URL that all routing URLs will start with and will be resolved as relative. The URL ends with a slash character. See . |
wchGetHubInfoFromBaseURL(aBaseURL) |
Decodes the hub info from the base URL. This assumes that the application is served from a location in WCH. |
wchGetHubInfoFromLinks(aDocument, aWindow) |
Decodes the hub info from links in the document |
wchGetHubInfoUrlProvider(aApiUrl, aPreviewCheck) |
Exposes a provider based on a API URL and a preview callback |
wchGetLayout(aLayoutMode, aContext) |
Returns the layout object for a particular mode for the rendering context |
wchGetPageSearchURL(aPath, aSiteId) |
Returns the URI for a page search URL |
wchGetParentPageURL(aParentId, aSiteId) |
Returns the URI for a parent page search |
wchGetSearchURL(aQueryString) |
Builds the search query string |
wchGetSiteContextURL(aParentId, aPageId, aSiteId) |
Returns the URI for a page search URL |
wchInsertPlaceholders(aRenderingContext, aResolver) |
|
wchIsPreviewMode(aBaseURL) |
Determines if the server is running in preview mode |
wchPlaceholderFromAccessor(aAccessor, aType) |
Decodes the placeholder from an accessor expression |
wchPlaceholderResolver(aTag, aSearch) |
Returns a resolver for placeholders based on WCH search |
wchPrepareRenderingContextInterceptors(aRenderingContextInterceptors) |
Prepare a list of interceptors |
wchResolveRenderingContext(aRenderingContext, aStrategy, aRenderingContextById, aLogger) |
Resolves the rendering context according to the configured strategy |
wchResolveType(aType) |
Resolves all typeRef |
wchSelectAccessor(aAccessor) |
parses a path expression |
wchTypeFromAccessor(aAccessor, aType) |
Decodes the element type from an accessor expression |