@acoustic-content-sdk/tooling-rest 中文文档教程

发布于 4年前 浏览 11 更新于 3年前

npm

简单的 HTTP 客户端连接到 Acoustic Content 用于工具目的。

API Documentation

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

tooling-rest package

连接到声学内容的简单 HTTP 客户端,用于工具目的。

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

构造一个 REST 客户端,允许针对声学内容登录并允许发送请求

签名:

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

Parameters

ParameterTypeDescription
aApiUrlstringthe API URL

返回:

< code>PublicRestClient

a REST client

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

luceneEscapeKeyValue() function

生成一个搜索选择器并对值进行转义。 如果该值缺失,该方法会生成一个表达式来搜索缺失值。

Signature:

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

Parameters

ParameterTypeDescription
aKeystringthe search key
aTermstring &#124; null &#124; undefinedthe unescaped value

Returns:

string

the result of the escaping

首页 > @acoustic-content-sdk/tooling-rest > luceneEscapeKeyValueAnd

luceneEscapeKeyValueAnd() function

生成一个选择器并加入'AND'

签名:

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

Parameters

ParameterTypeDescription
aKeystringthe search key
aTermsstring[]the unescaped value

返回:

string

the result of the escaping

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

luceneEscapeKeyValueOr() function

生成一个选择器并加入'OR'

签名:

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

Parameters

ParameterTypeDescription
aKeystringthe search key
aTermsstring[]the unescaped value

返回:

/code>

string < result of the escaping

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

luceneEscapeTerm() function

根据 lucence 语法转义术语

签名:

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

Parameters

ParameterTypeDescription
aTermstringterm to escape

返回:

string

转义术语

首页 @acoustic-content-sdk/tooling-rest > BasicRestClient

BasicRestClient interface

Signature:

export interface BasicRestClient 

Properties

PropertyTypeDescription
get&lt;T&gt;(aRelPath: string, aQuery?: ParsedUrlQueryInput) =&gt; Promise&lt;T&gt;Performs a GET operation for JSON

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

ProtectedRestClient interface

Signature:

export interface ProtectedRestClient extends BasicRestClient 

Properties

PropertyTypeDescription
logout() =&gt; Promise&lt;PublicRestClient&gt;Execute a logout

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

PublicRestClient interface

Signature:

export interface PublicRestClient extends BasicRestClient 

Properties

PropertyTypeDescription
login(aCredentials?: Credentials) =&gt; Promise&lt;ProtectedRestClient&gt;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< /a> > @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< /a> > @acoustic-content-sdk/tooling-rest > site

site variable

Callback to return the current site

Signature:

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

首页 > @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;
}

首页 > @acoustic-content-sdk/tooling-rest > ProtectedRestClient > logout

ProtectedRestClient.logout property

Execute a logout

Signature:

logout: () => Promise<PublicRestClient>;

Home > @acoustic-content-sdk/tooling-rest > 基本休息客户端 > get

BasicRestClient.get property

Performs a GET operation for JSON

Signature:

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

首页 > @acoustic-content-sdk/tooling-rest > 公共休息客户端 > 登录

PublicRestClient.login property

针对声音内容登录。

签名:

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

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 &#124; null &#124; 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&lt;T&gt;(aRelPath: string, aQuery?: ParsedUrlQueryInput) =&gt; Promise&lt;T&gt;Performs a GET operation for JSON

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

ProtectedRestClient interface

Signature:

export interface ProtectedRestClient extends BasicRestClient 

Properties

PropertyTypeDescription
logout() =&gt; Promise&lt;PublicRestClient&gt;Execute a logout

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

PublicRestClient interface

Signature:

export interface PublicRestClient extends BasicRestClient 

Properties

PropertyTypeDescription
login(aCredentials?: Credentials) =&gt; Promise&lt;ProtectedRestClient&gt;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>;
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文