intentful
Version:
Create Custom Skills with less headache
58 lines (57 loc) • 2.4 kB
TypeScript
import * as Alexa from 'ask-sdk';
import { APLDocument } from '../../apl';
import { APLADocument } from '../../apla';
import { LocaleString, ModelProvider } from '../../types';
import { RegionAllAllowedTypesEndpointUri, SkillManifestEndpointAllAllowedTypesEndpointUri, SkillManifestModel } from '../interfaces';
import { Locale } from '../locale';
import { DynamoDBInfo, FilePackageWriter, LabeledRequestHandler } from '../models';
import { JSBRequestInterceptor, JSBResponseInterceptor } from '../types';
export type Locales = {
[locale in LocaleString]?: Locale;
};
export type APLDocuments = {
[documentName: string]: APLDocument;
};
export type APLADocuments = {
[documentName: string]: APLADocument;
};
export interface CustomEndpointsProps {
endpoint: SkillManifestEndpointAllAllowedTypesEndpointUri;
regions?: {
EU?: RegionAllAllowedTypesEndpointUri;
FE?: RegionAllAllowedTypesEndpointUri;
IN?: RegionAllAllowedTypesEndpointUri;
NA?: RegionAllAllowedTypesEndpointUri;
};
}
export interface SkillProps {
name: string;
custom: CustomEndpointsProps;
customUserAgent?: string;
dynamoDBInfo?: DynamoDBInfo;
requestInterceptor?: JSBRequestInterceptor;
responseInterceptor?: JSBResponseInterceptor;
}
export declare class Skill implements ModelProvider<SkillManifestModel>, FilePackageWriter {
readonly props: SkillProps;
readonly locales: Locales;
readonly aplDocuments: APLDocuments;
readonly aplaDocuments: APLADocuments;
constructor(props: SkillProps);
toJSON(): SkillManifestModel;
addLocale(locale: Locale): this;
addAPLDocument(aplDocument: APLDocument): this;
addAPLADocument(aplaDocument: APLADocument): this;
addAlexaHostedDynamoDBPersistenceAdapter(builder: Alexa.CustomSkillBuilder): void;
addDynamoDBPersistenceAdapter(builder: Alexa.CustomSkillBuilder): void;
addRequestInterceptor(builder: Alexa.CustomSkillBuilder): void;
addResponseInterceptor(builder: Alexa.CustomSkillBuilder): void;
getErrorHandlers(): Alexa.ErrorHandler[];
builder(): Alexa.CustomSkillBuilder;
handler(): Alexa.LambdaHandler;
writeSkillPackage(rootFolder?: string): void;
getRequestHandlers(): LabeledRequestHandler[];
private getLocaleStrings;
model(): SkillManifestModel;
writeToPackageFile(baseSkillPackagePath?: string | undefined): void;
}