9.0.10076 • Published 4 years ago

@acoustic-content-sdk/tooling-rest v9.0.10076

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

npm

Simple HTTP client to connect to Acoustic Content for tooling purposes.

API Documentation

Home > @acoustic-content-sdk/tooling-rest

tooling-rest package

Simple HTTP client to connect to Acoustic Content for tooling purposes.

Functions

FunctionDescription
createClient(aApiUrl)Constructs a REST client that allows to login against acoustic content and that allows to send requests
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

Interfaces

InterfaceDescription
BasicRestClient
ProtectedRestClient
PublicRestClient

Variables

VariableDescription
authoringContentRead authoring content
authoringSearchPerforms an authoring search
deliveryContentRead delivery content
deliverySearchPerforms a delivery search
siteCallback to return the current site
VERSIONVersion and build number of the package

Home > @acoustic-content-sdk/tooling-rest > createClient

createClient() function

Constructs a REST client that allows to login against acoustic content and that allows to send requests

Signature:

export declare function createClient(aApiUrl: string): PublicRestClient;

Parameters

ParameterTypeDescription
aApiUrlstringthe API URL

Returns:

PublicRestClient

a REST client

Home > @acoustic-content-sdk/tooling-rest > luceneEscapeKeyValue

luceneEscapeKeyValue() function

Generates a search selector and escapes the value. If the value is missing the method generates an expression that searches for missing values.

Signature:

export declare function luceneEscapeKeyValue(aKey: string, aTerm: string | null | undefined): string;

Parameters

ParameterTypeDescription
aKeystringthe search key
aTermstring | null | undefinedthe unescaped value

Returns:

string

the result of the escaping

Home > @acoustic-content-sdk/tooling-rest > luceneEscapeKeyValueAnd

luceneEscapeKeyValueAnd() function

Generates a selector and joins with 'AND'

Signature:

export declare function luceneEscapeKeyValueAnd(aKey: string, ...aTerms: string[]): string;

Parameters

ParameterTypeDescription
aKeystringthe search key
aTermsstring[]the unescaped value

Returns:

string

the result of the escaping

Home > @acoustic-content-sdk/tooling-rest > luceneEscapeKeyValueOr

luceneEscapeKeyValueOr() function

Generates a selector and joins with 'OR'

Signature:

export declare function luceneEscapeKeyValueOr(aKey: string, ...aTerms: string[]): string;

Parameters

ParameterTypeDescription
aKeystringthe search key
aTermsstring[]the unescaped value

Returns:

string

the result of the escaping

Home > @acoustic-content-sdk/tooling-rest > luceneEscapeTerm

luceneEscapeTerm() function

Escapes a term according to lucence syntax

Signature:

export declare function luceneEscapeTerm(aTerm: string): string;

Parameters

ParameterTypeDescription
aTermstringterm to escape

Returns:

string

the escaped term

Home > @acoustic-content-sdk/tooling-rest > BasicRestClient

BasicRestClient interface

Signature:

export interface BasicRestClient 

Properties

PropertyTypeDescription
get<T>(aRelPath: string, aQuery?: ParsedUrlQueryInput) => Promise<T>Performs a GET operation for JSON

Home > @acoustic-content-sdk/tooling-rest > ProtectedRestClient

ProtectedRestClient interface

Signature:

export interface ProtectedRestClient extends BasicRestClient 

Properties

PropertyTypeDescription
logout() => Promise<PublicRestClient>Execute a logout

Home > @acoustic-content-sdk/tooling-rest > PublicRestClient

PublicRestClient interface

Signature:

export interface PublicRestClient extends BasicRestClient 

Properties

PropertyTypeDescription
login(aCredentials?: Credentials) => Promise<ProtectedRestClient>Login against acoustic content.

Home > @acoustic-content-sdk/tooling-rest > authoringContent

authoringContent variable

Read authoring content

Signature:

authoringContent: (aClient: ProtectedRestClient) => (aId: string) => Promise<AuthoringContentItem>

Home > @acoustic-content-sdk/tooling-rest > authoringSearch

authoringSearch variable

Performs an authoring search

Signature:

authoringSearch: (aClient: ProtectedRestClient) => <T>(aQuery: ParsedUrlQueryInput) => Promise<SearchResults<T>>

Home > @acoustic-content-sdk/tooling-rest > deliveryContent

deliveryContent variable

Read delivery content

Signature:

deliveryContent: (aClient: ProtectedRestClient) => (aId: string) => Promise<ContentItemWithLayout>

Home > @acoustic-content-sdk/tooling-rest > deliverySearch

deliverySearch variable

Performs a delivery search

Signature:

deliverySearch: (aClient: ProtectedRestClient) => <T>(aQuery: ParsedUrlQueryInput) => Promise<SearchResults<T>>

Home > @acoustic-content-sdk/tooling-rest > site

site variable

Callback to return the current site

Signature:

site: (aClient: ProtectedRestClient) => () => Promise<ContentItemWithLayout>

Home > @acoustic-content-sdk/tooling-rest > VERSION

VERSION variable

Version and build number of the package

Signature:

VERSION: {
    version: {
        major: string;
        minor: string;
        patch: string;
        branch: string;
    };
    build: Date;
}

Home > @acoustic-content-sdk/tooling-rest > ProtectedRestClient > logout

ProtectedRestClient.logout property

Execute a logout

Signature:

logout: () => Promise<PublicRestClient>;

Home > @acoustic-content-sdk/tooling-rest > BasicRestClient > get

BasicRestClient.get property

Performs a GET operation for JSON

Signature:

get: <T>(aRelPath: string, aQuery?: ParsedUrlQueryInput) => Promise<T>;

Home > @acoustic-content-sdk/tooling-rest > PublicRestClient > login

PublicRestClient.login property

Login against acoustic content.

Signature:

login: (aCredentials?: Credentials) => Promise<ProtectedRestClient>;
9.0.10076

4 years ago

9.0.10067

4 years ago

9.0.10040

4 years ago

9.0.10034

4 years ago

9.0.495

4 years ago

9.0.493

4 years ago

9.0.462

4 years ago