@acoustic-content-sdk/tooling-rest 中文文档教程
简单的 HTTP 客户端连接到 Acoustic Content 用于工具目的。
Home > @acoustic-content-sdk/tooling-rest
tooling-rest package
连接到声学内容的简单 HTTP 客户端,用于工具目的。
Functions
Function | Description |
---|---|
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
Interface | Description |
---|---|
BasicRestClient | |
ProtectedRestClient | |
PublicRestClient |
Variables
Variable | Description |
---|---|
authoringContent | Read authoring content |
authoringSearch | Performs an authoring search |
deliveryContent | Read delivery content |
deliverySearch | Performs a delivery search |
site | Callback to return the current site |
VERSION | Version and build number of the package |
Home > @acoustic-content-sdk/tooling-rest > createClient
createClient() function
构造一个 REST 客户端,允许针对声学内容登录并允许发送请求
签名:
export declare function createClient(aApiUrl: string): PublicRestClient;
Parameters
Parameter | Type | Description |
---|---|---|
aApiUrl | string | the 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
Parameter | Type | Description |
---|---|---|
aKey | string | the search key |
aTerm | string | null | undefined | the 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
Parameter | Type | Description |
---|---|---|
aKey | string | the search key |
aTerms | string[] | 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
Parameter | Type | Description |
---|---|---|
aKey | string | the search key |
aTerms | string[] | 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
Parameter | Type | Description |
---|---|---|
aTerm | string | term to escape |
返回:
string
转义术语
首页 @acoustic-content-sdk/tooling-rest > BasicRestClient
BasicRestClient interface
Signature:
export interface BasicRestClient
Properties
Property | Type | Description |
---|---|---|
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
Property | Type | Description |
---|---|---|
logout | () => Promise<PublicRestClient> | Execute a logout |
Home > ; @acoustic-content-sdk/tooling-rest > PublicRestClient
PublicRestClient interface
Signature:
export interface PublicRestClient extends BasicRestClient
Properties
Property | Type | Description |
---|---|---|
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< /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>;
Simple HTTP client to connect to Acoustic Content for tooling purposes.
Home > @acoustic-content-sdk/tooling-rest
tooling-rest package
Simple HTTP client to connect to Acoustic Content for tooling purposes.
Functions
Function | Description |
---|---|
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
Interface | Description |
---|---|
BasicRestClient | |
ProtectedRestClient | |
PublicRestClient |
Variables
Variable | Description |
---|---|
authoringContent | Read authoring content |
authoringSearch | Performs an authoring search |
deliveryContent | Read delivery content |
deliverySearch | Performs a delivery search |
site | Callback to return the current site |
VERSION | Version 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
Parameter | Type | Description |
---|---|---|
aApiUrl | string | the 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
Parameter | Type | Description |
---|---|---|
aKey | string | the search key |
aTerm | string | null | undefined | the 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
Parameter | Type | Description |
---|---|---|
aKey | string | the search key |
aTerms | string[] | 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
Parameter | Type | Description |
---|---|---|
aKey | string | the search key |
aTerms | string[] | 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
Parameter | Type | Description |
---|---|---|
aTerm | string | term to escape |
Returns:
string
the escaped term
Home > @acoustic-content-sdk/tooling-rest > BasicRestClient
BasicRestClient interface
Signature:
export interface BasicRestClient
Properties
Property | Type | Description |
---|---|---|
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
Property | Type | Description |
---|---|---|
logout | () => Promise<PublicRestClient> | Execute a logout |
Home > @acoustic-content-sdk/tooling-rest > PublicRestClient
PublicRestClient interface
Signature:
export interface PublicRestClient extends BasicRestClient
Properties
Property | Type | Description |
---|---|---|
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>;