1 | export declare namespace services {
|
2 | /**
|
3 | * Represents the interface between ApiClient and a Service Client.
|
4 | * @export
|
5 | * @interface ApiClientMessage
|
6 | */
|
7 | interface ApiClientMessage {
|
8 | headers: Array<{
|
9 | key: string;
|
10 | value: string;
|
11 | }>;
|
12 | body?: string;
|
13 | }
|
14 | /**
|
15 | * Represents a request sent from Service Clients to an ApiClient implementation.
|
16 | * @export
|
17 | * @interface ApiClientRequest
|
18 | * @extends {ApiClientMessage}
|
19 | */
|
20 | interface ApiClientRequest extends ApiClientMessage {
|
21 | url: string;
|
22 | method: string;
|
23 | }
|
24 | /**
|
25 | * Represents a response returned by ApiClient implementation to a Service Client.
|
26 | * @export
|
27 | * @interface ApiClientResponse
|
28 | * @extends {ApiClientMessage}
|
29 | */
|
30 | interface ApiClientResponse extends ApiClientMessage {
|
31 | /**
|
32 | * Result code of the attempt to satisfy the request. Normally this
|
33 | * corresponds to the HTTP status code returned by the server.
|
34 | */
|
35 | statusCode: number;
|
36 | }
|
37 | /**
|
38 | * Represents a response with parsed body.
|
39 | * @export
|
40 | * @interface ApiResponse
|
41 | */
|
42 | interface ApiResponse {
|
43 | headers: Array<{
|
44 | key: string;
|
45 | value: string;
|
46 | }>;
|
47 | body?: any;
|
48 | statusCode: number;
|
49 | }
|
50 | /**
|
51 | * Represents a basic contract for API request execution
|
52 | * @export
|
53 | * @interface ApiClient
|
54 | */
|
55 | interface ApiClient {
|
56 | /**
|
57 | * Dispatches a request to an API endpoint described in the request.
|
58 | * An ApiClient is expected to resolve the Promise in the case an API returns a non-200 HTTP
|
59 | * status code. The responsibility of translating a particular response code to an error lies with the
|
60 | * caller to invoke.
|
61 | * @param {ApiClientRequest} request request to dispatch to the ApiClient
|
62 | * @returns {Promise<ApiClientResponse>} Response from the ApiClient
|
63 | * @memberof ApiClient
|
64 | */
|
65 | invoke(request: ApiClientRequest): Promise<ApiClientResponse>;
|
66 | }
|
67 | /**
|
68 | * Represents an interface that provides API configuration options needed by service clients.
|
69 | * @interface ApiConfiguration
|
70 | */
|
71 | interface ApiConfiguration {
|
72 | /**
|
73 | * Configured ApiClient implementation
|
74 | */
|
75 | apiClient: ApiClient;
|
76 | /**
|
77 | * Authorization value to be used on any calls of the service client instance
|
78 | */
|
79 | authorizationValue: string;
|
80 | /**
|
81 | * Endpoint to hit by the service client instance
|
82 | */
|
83 | apiEndpoint: string;
|
84 | }
|
85 | /**
|
86 | * Class to be used as the base class for the generated service clients.
|
87 | */
|
88 | abstract class BaseServiceClient {
|
89 | private static isCodeSuccessful;
|
90 | private static buildUrl;
|
91 | private static interpolateParams;
|
92 | private static buildQueryString;
|
93 | /**
|
94 | * ApiConfiguration instance to provide dependencies for this service client
|
95 | */
|
96 | protected apiConfiguration: ApiConfiguration;
|
97 | private requestInterceptors;
|
98 | private responseInterceptors;
|
99 | /**
|
100 | * Creates new instance of the BaseServiceClient
|
101 | * @param {ApiConfiguration} apiConfiguration configuration parameter to provide dependencies to service client instance
|
102 | */
|
103 | protected constructor(apiConfiguration: ApiConfiguration);
|
104 | /**
|
105 | * Sets array of functions that is going to be executed before the request is send
|
106 | * @param {Function} requestInterceptor request interceptor function
|
107 | * @returns {BaseServiceClient}
|
108 | */
|
109 | withRequestInterceptors(...requestInterceptors: Array<(request: ApiClientRequest) => void | Promise<void>>): BaseServiceClient;
|
110 | /**
|
111 | * Sets array of functions that is going to be executed after the request is send
|
112 | * @param {Function} responseInterceptor response interceptor function
|
113 | * @returns {BaseServiceClient}
|
114 | */
|
115 | withResponseInterceptors(...responseInterceptors: Array<(response: ApiClientResponse) => void | Promise<void>>): BaseServiceClient;
|
116 | /**
|
117 | * Invocation wrapper to implement service operations in generated classes
|
118 | * @param method HTTP method, such as 'POST', 'GET', 'DELETE', etc.
|
119 | * @param endpoint base API url
|
120 | * @param path the path pattern with possible placeholders for path parameters in form {paramName}
|
121 | * @param pathParams path parameters collection
|
122 | * @param queryParams query parameters collection
|
123 | * @param headerParams headers collection
|
124 | * @param bodyParam if body parameter is present it is provided here, otherwise null or undefined
|
125 | * @param errors maps recognized status codes to messages
|
126 | * @param nonJsonBody if the body is in JSON format
|
127 | */
|
128 | protected invoke(method: string, endpoint: string, path: string, pathParams: Map<string, string>, queryParams: Array<{
|
129 | key: string;
|
130 | value: string;
|
131 | }>, headerParams: Array<{
|
132 | key: string;
|
133 | value: string;
|
134 | }>, bodyParam: any, errors: Map<number, string>, nonJsonBody?: boolean): Promise<any>;
|
135 | }
|
136 | /**
|
137 | * Represents a Login With Amazon(LWA) access token
|
138 | */
|
139 | interface AccessToken {
|
140 | token: string;
|
141 | expiry: Number;
|
142 | }
|
143 | /**
|
144 | * Represents a request for retrieving a Login With Amazon(LWA) access token
|
145 | */
|
146 | interface AccessTokenRequest {
|
147 | clientId: string;
|
148 | clientSecret: string;
|
149 | scope?: string;
|
150 | refreshToken?: string;
|
151 | }
|
152 | /**
|
153 | * Represents a response returned by LWA containing a Login With Amazon(LWA) access token
|
154 | */
|
155 | interface AccessTokenResponse {
|
156 | access_token: string;
|
157 | expires_in: number;
|
158 | scope: string;
|
159 | token_type: string;
|
160 | }
|
161 | /**
|
162 | * Represents the authentication configuration for a client ID and client secret
|
163 | */
|
164 | interface AuthenticationConfiguration {
|
165 | clientId: string;
|
166 | clientSecret: string;
|
167 | refreshToken?: string;
|
168 | authEndpoint?: string;
|
169 | }
|
170 | /**
|
171 | * Class to be used to call Amazon LWA to retrieve access tokens.
|
172 | */
|
173 | class LwaServiceClient extends BaseServiceClient {
|
174 | protected static EXPIRY_OFFSET_MILLIS: number;
|
175 | protected static REFRESH_ACCESS_TOKEN: string;
|
176 | protected static CLIENT_CREDENTIALS_GRANT_TYPE: string;
|
177 | protected static LWA_CREDENTIALS_GRANT_TYPE: string;
|
178 | protected static AUTH_ENDPOINT: string;
|
179 | protected authenticationConfiguration: AuthenticationConfiguration;
|
180 | protected tokenStore: {
|
181 | [cacheKey: string]: AccessToken;
|
182 | };
|
183 | protected grantType: string;
|
184 | constructor(options: {
|
185 | apiConfiguration: ApiConfiguration;
|
186 | authenticationConfiguration: AuthenticationConfiguration;
|
187 | grantType?: string;
|
188 | });
|
189 | getAccessTokenForScope(scope: string): Promise<string>;
|
190 | getAccessToken(scope?: string): Promise<string>;
|
191 | protected generateAccessToken(accessTokenRequest: AccessTokenRequest): Promise<AccessTokenResponse>;
|
192 | }
|
193 | }
|
194 | /**
|
195 | * function creating an AskSdk user agent.
|
196 | * @param packageVersion
|
197 | * @param customUserAgent
|
198 | */
|
199 | export declare function createUserAgent(packageVersion: string, customUserAgent: string): string;
|
200 | /**
|
201 | * An object containing an application ID. This is used to verify that the request was intended for your service.
|
202 | * @interface
|
203 | */
|
204 | export interface Application {
|
205 | /**
|
206 | * A string representing the application identifier for your skill.
|
207 | */
|
208 | 'applicationId': string;
|
209 | }
|
210 | /**
|
211 | * Describes the type of the Cause.
|
212 | * @interface
|
213 | */
|
214 | export declare type Cause = ConnectionCompleted;
|
215 | /**
|
216 | *
|
217 | * @interface
|
218 | */
|
219 | export interface Context {
|
220 | /**
|
221 | * Provides information about the current state of the Alexa service and the device interacting with your skill.
|
222 | */
|
223 | 'System': interfaces.system.SystemState;
|
224 | /**
|
225 | * Provides the current state for the Alexa.Presentation interface.
|
226 | */
|
227 | 'Alexa.Presentation'?: interfaces.alexa.presentation.PresentationState;
|
228 | /**
|
229 | * Provides the current state for the Alexa.Presentation.APL interface.
|
230 | */
|
231 | 'Alexa.Presentation.APL'?: interfaces.alexa.presentation.apl.RenderedDocumentState;
|
232 | /**
|
233 | * Provides the current state for the AudioPlayer interface.
|
234 | */
|
235 | 'AudioPlayer'?: interfaces.audioplayer.AudioPlayerState;
|
236 | /**
|
237 | * Provides the automotive specific information of the device.
|
238 | */
|
239 | 'Automotive'?: interfaces.automotive.AutomotiveState;
|
240 | /**
|
241 | * Provides the current state for the Display interface.
|
242 | */
|
243 | 'Display'?: interfaces.display.DisplayState;
|
244 | /**
|
245 | * Provides the last gathered geolocation information of the device.
|
246 | */
|
247 | 'Geolocation'?: interfaces.geolocation.GeolocationState;
|
248 | /**
|
249 | * Provides the characteristics of a device's viewport.
|
250 | */
|
251 | 'Viewport'?: interfaces.viewport.ViewportState;
|
252 | /**
|
253 | * This object contains a list of viewports characteristics related to the device's viewports.
|
254 | */
|
255 | 'Viewports'?: Array<interfaces.viewport.TypedViewportState>;
|
256 | /**
|
257 | * Provides the current state for Extensions interface
|
258 | */
|
259 | 'Extensions'?: interfaces.alexa.extension.ExtensionsState;
|
260 | /**
|
261 | * Provides the current state for the Alexa.DataStore.PackageManager interface.
|
262 | */
|
263 | 'Alexa.DataStore.PackageManager'?: interfaces.alexa.datastore.packagemanager.PackageManagerState;
|
264 | /**
|
265 | * Provides the current state for app link capability.
|
266 | */
|
267 | 'AppLink'?: interfaces.applink.AppLinkState;
|
268 | /**
|
269 | * Provides the current experimentation state
|
270 | */
|
271 | 'Experimentation'?: interfaces.alexa.experimentation.ExperimentationState;
|
272 | }
|
273 | /**
|
274 | * An object providing information about the device used to send the request. The device object contains both deviceId and supportedInterfaces properties. The deviceId property uniquely identifies the device. The supportedInterfaces property lists each interface that the device supports. For example, if supportedInterfaces includes AudioPlayer {}, then you know that the device supports streaming audio using the AudioPlayer interface.
|
275 | * @interface
|
276 | */
|
277 | export interface Device {
|
278 | /**
|
279 | * The deviceId property uniquely identifies the device. This identifier is scoped to a skill. Normally, disabling and re-enabling a skill generates a new identifier.
|
280 | */
|
281 | 'deviceId': string;
|
282 | /**
|
283 | * A persistent identifier for the Endpoint ID where the skill request is issued from. An endpoint represents an Alexa-connected Endpoint (like an Echo device, or an application) with which an Alexa customer can interact rather than a physical device, so it could represent applications on your fire TV or your Alexa phone app. The persistentEndpointId is a string that represents a unique identifier for the endpoint in the context of a request. It is in the Amazon Common Identifier format \"amzn1.alexa.endpoint.did.{id}\". This identifier space is scoped to a vendor, therefore it will stay the same regardless of skill enablement.
|
284 | */
|
285 | 'persistentEndpointId'?: string;
|
286 | /**
|
287 | * Lists each interface that the device supports. For example, if supportedInterfaces includes AudioPlayer {}, then you know that the device supports streaming audio using the AudioPlayer interface
|
288 | */
|
289 | 'supportedInterfaces': SupportedInterfaces;
|
290 | }
|
291 | /**
|
292 | * Enumeration indicating the status of the multi-turn dialog. This property is included if the skill meets the requirements to use the Dialog directives. Note that COMPLETED is only possible when you use the Dialog.Delegate directive. If you use intent confirmation, dialogState is considered COMPLETED if the user denies the entire intent (for instance, by answering “no” when asked the confirmation prompt). Be sure to also check the confirmationStatus property on the Intent object before fulfilling the user’s request.
|
293 | * @enum
|
294 | */
|
295 | export declare type DialogState = 'STARTED' | 'IN_PROGRESS' | 'COMPLETED';
|
296 | /**
|
297 | *
|
298 | * @interface
|
299 | */
|
300 | export declare type Directive = interfaces.customInterfaceController.StopEventHandlerDirective | interfaces.navigation.assistance.AnnounceRoadRegulation | interfaces.connections.SendRequestDirective | dialog.DynamicEntitiesDirective | interfaces.customInterfaceController.StartEventHandlerDirective | interfaces.gadgetController.SetLightDirective | interfaces.alexa.presentation.apl.SendIndexListDataDirective | dialog.DelegateDirective | dialog.ConfirmIntentDirective | interfaces.alexa.advertisement.InjectAds | interfaces.customInterfaceController.SendDirectiveDirective | interfaces.alexa.presentation.html.HandleMessageDirective | interfaces.alexa.presentation.apla.RenderDocumentDirective | dialog.ElicitSlotDirective | interfaces.alexa.presentation.html.StartDirective | interfaces.alexa.smartvision.snapshotprovider.GetSnapshotDirective | interfaces.audioplayer.StopDirective | dialog.ConfirmSlotDirective | interfaces.audioplayer.PlayDirective | interfaces.alexa.presentation.apl.ExecuteCommandsDirective | interfaces.display.RenderTemplateDirective | interfaces.conversations.ResetContextDirective | dialog.DelegateRequestDirective | interfaces.display.HintDirective | interfaces.connections.V1.StartConnectionDirective | interfaces.alexa.presentation.aplt.RenderDocumentDirective | interfaces.gameEngine.StartInputHandlerDirective | interfaces.videoapp.LaunchDirective | interfaces.alexa.presentation.aplt.ExecuteCommandsDirective | interfaces.gameEngine.StopInputHandlerDirective | interfaces.tasks.CompleteTaskDirective | interfaces.alexa.presentation.apl.RenderDocumentDirective | interfaces.connections.SendResponseDirective | interfaces.alexa.presentation.apl.SendTokenListDataDirective | interfaces.audioplayer.ClearQueueDirective | interfaces.alexa.presentation.apl.UpdateIndexListDataDirective;
|
301 | /**
|
302 | * An object that represents what the user wants.
|
303 | * @interface
|
304 | */
|
305 | export interface Intent {
|
306 | /**
|
307 | * A string representing the name of the intent.
|
308 | */
|
309 | 'name': string;
|
310 | /**
|
311 | * A map of key-value pairs that further describes what the user meant based on a predefined intent schema. The map can be empty.
|
312 | */
|
313 | 'slots'?: {
|
314 | [key: string]: Slot;
|
315 | };
|
316 | 'confirmationStatus': IntentConfirmationStatus;
|
317 | }
|
318 | /**
|
319 | * Indication of whether an intent or slot has been explicitly confirmed or denied by the user, or neither.
|
320 | * @enum
|
321 | */
|
322 | export declare type IntentConfirmationStatus = 'NONE' | 'DENIED' | 'CONFIRMED';
|
323 | /**
|
324 | * This denotes the status of the permission scope.
|
325 | * @enum
|
326 | */
|
327 | export declare type PermissionStatus = 'GRANTED' | 'DENIED';
|
328 | /**
|
329 | * Contains a consentToken allowing the skill access to information that the customer has consented to provide, such as address information. Note that the consentToken is deprecated. Use the apiAccessToken available in the context object to determine the user’s permissions.
|
330 | * @interface
|
331 | */
|
332 | export interface Permissions {
|
333 | /**
|
334 | * A token listing all the permissions granted for this user.
|
335 | */
|
336 | 'consentToken'?: string;
|
337 | /**
|
338 | * A map where the key is a LoginWithAmazon(LWA) scope and value is a list of key:value pairs which describe the state of user actions on the LWA scope. For e.g. \"scopes\" :{ \"alexa::devices:all:geolocation:read\":{\"status\":\"GRANTED\"}} This value of \"alexa::devices:all:geolocation:read\" will determine if the Geolocation data access is granted by the user, or else it will show a card of type AskForPermissionsConsent to the user to get this permission.
|
339 | */
|
340 | 'scopes'?: {
|
341 | [key: string]: Scope;
|
342 | };
|
343 | }
|
344 | /**
|
345 | * An object that describes the user (person) who is interacting with Alexa.
|
346 | * @interface
|
347 | */
|
348 | export interface Person {
|
349 | /**
|
350 | * A string that represents a unique identifier for the person who is interacting with Alexa. The length of this identifier can vary, but is never more than 255 characters. It is generated when a recognized user makes a request to your skill.
|
351 | */
|
352 | 'personId'?: string;
|
353 | /**
|
354 | * A token identifying the user in another system. This is only provided if the recognized user has successfully linked their skill account with their Alexa profile. The accessToken field will not appear if null.
|
355 | */
|
356 | 'accessToken'?: string;
|
357 | }
|
358 | /**
|
359 | * A request object that provides the details of the user’s request. The request body contains the parameters necessary for the service to perform its logic and generate a response.
|
360 | * @interface
|
361 | */
|
362 | export declare type Request = interfaces.alexa.advertisement.AdNotRendered | interfaces.alexa.datastore.packagemanager.InstallationError | events.skillevents.SkillEnabledRequest | services.listManagement.ListUpdatedEventRequest | interfaces.alexa.presentation.apl.UserEvent | events.skillevents.SkillDisabledRequest | services.listManagement.ListItemsCreatedEventRequest | SessionResumedRequest | SessionEndedRequest | interfaces.alexa.presentation.apl.LoadIndexListDataEvent | interfaces.alexa.presentation.apl.LoadTokenListDataEvent | interfaces.audioplayer.PlaybackFailedRequest | canfulfill.CanFulfillIntentRequest | interfaces.customInterfaceController.ExpiredRequest | interfaces.alexa.presentation.html.MessageRequest | interfaces.alexa.datastore.DataStoreError | LaunchRequest | authorization.AuthorizationGrantRequest | services.reminderManagement.ReminderCreatedEventRequest | interfaces.alexa.presentation.aplt.UserEvent | interfaces.alexa.advertisement.ReadyToEnqueueAudio | services.listManagement.ListItemsUpdatedEventRequest | services.listManagement.ListCreatedEventRequest | interfaces.audioplayer.PlaybackStartedRequest | interfaces.audioplayer.PlaybackNearlyFinishedRequest | interfaces.customInterfaceController.EventsReceivedRequest | services.reminderManagement.ReminderStatusChangedEventRequest | services.listManagement.ListItemsDeletedEventRequest | services.reminderManagement.ReminderDeletedEventRequest | interfaces.connections.ConnectionsResponse | services.listManagement.ListDeletedEventRequest | interfaces.gameEngine.InputHandlerEventRequest | interfaces.playbackcontroller.PauseCommandIssuedRequest | interfaces.playbackcontroller.PlayCommandIssuedRequest | interfaces.audioplayer.PlaybackFinishedRequest | events.skillevents.ProactiveSubscriptionChangedRequest | interfaces.display.ElementSelectedRequest | events.skillevents.PermissionChangedRequest | services.reminderManagement.ReminderUpdatedEventRequest | interfaces.alexa.advertisement.AdCompleted | interfaces.alexa.datastore.packagemanager.UpdateRequest | interfaces.alexa.presentation.apl.RuntimeErrorEvent | interfaces.alexa.presentation.html.RuntimeErrorRequest | dialog.InputRequest | IntentRequest | interfaces.alexa.datastore.packagemanager.UsagesRemoved | events.skillevents.NotificationSubscriptionChangedRequest | interfaces.conversations.APIInvocationRequest | services.reminderManagement.ReminderStartedEventRequest | interfaces.audioplayer.PlaybackStoppedRequest | interfaces.playbackcontroller.PreviousCommandIssuedRequest | interfaces.alexa.datastore.packagemanager.UsagesInstalled | events.skillevents.AccountLinkedRequest | interfaces.messaging.MessageReceivedRequest | interfaces.connections.ConnectionsRequest | interfaces.system.ExceptionEncounteredRequest | events.skillevents.PermissionAcceptedRequest | interfaces.playbackcontroller.NextCommandIssuedRequest | interfaces.alexa.presentation.apla.RuntimeErrorEvent;
|
363 | /**
|
364 | * Request wrapper for all requests sent to your Skill.
|
365 | * @interface
|
366 | */
|
367 | export interface RequestEnvelope {
|
368 | /**
|
369 | * The version specifier for the request.
|
370 | */
|
371 | 'version': string;
|
372 | /**
|
373 | * The session object provides additional context associated with the request.
|
374 | */
|
375 | 'session'?: Session;
|
376 | /**
|
377 | * The context object provides your skill with information about the current state of the Alexa service and device at the time the request is sent to your service. This is included on all requests. For requests sent in the context of a session (LaunchRequest and IntentRequest), the context object duplicates the user and application information that is also available in the session.
|
378 | */
|
379 | 'context': Context;
|
380 | /**
|
381 | * A request object that provides the details of the user’s request.
|
382 | */
|
383 | 'request': Request;
|
384 | }
|
385 | /**
|
386 | *
|
387 | * @interface
|
388 | */
|
389 | export interface Response {
|
390 | 'outputSpeech'?: ui.OutputSpeech;
|
391 | 'card'?: ui.Card;
|
392 | 'reprompt'?: ui.Reprompt;
|
393 | 'directives'?: Array<Directive>;
|
394 | /**
|
395 | * API response object containing API response value(s)
|
396 | */
|
397 | 'apiResponse'?: any;
|
398 | 'shouldEndSession'?: boolean;
|
399 | 'canFulfillIntent'?: canfulfill.CanFulfillIntent;
|
400 | /**
|
401 | * Experiment trigger response from skill
|
402 | */
|
403 | 'experimentation'?: interfaces.alexa.experimentation.ExperimentTriggerResponse;
|
404 | }
|
405 | /**
|
406 | *
|
407 | * @interface
|
408 | */
|
409 | export interface ResponseEnvelope {
|
410 | 'version': string;
|
411 | 'sessionAttributes'?: {
|
412 | [key: string]: any;
|
413 | };
|
414 | 'userAgent'?: string;
|
415 | 'response': Response;
|
416 | }
|
417 | /**
|
418 | * This is the value of LoginWithAmazon(LWA) consent scope. This object is used as in the key-value pairs that are provided in user.permissions.scopes object
|
419 | * @interface
|
420 | */
|
421 | export interface Scope {
|
422 | 'status'?: PermissionStatus;
|
423 | }
|
424 | /**
|
425 | * Represents a single execution of the alexa service
|
426 | * @interface
|
427 | */
|
428 | export interface Session {
|
429 | /**
|
430 | * A boolean value indicating whether this is a new session. Returns true for a new session or false for an existing session.
|
431 | */
|
432 | 'new': boolean;
|
433 | /**
|
434 | * A string that represents a unique identifier per a user’s active session.
|
435 | */
|
436 | 'sessionId': string;
|
437 | /**
|
438 | * An object that describes the user making the request.
|
439 | */
|
440 | 'user': User;
|
441 | /**
|
442 | * A map of key-value pairs. The attributes map is empty for requests where a new session has started with the property new set to true. When returning your response, you can include data you need to persist during the session in the sessionAttributes property. The attributes you provide are then passed back to your skill on the next request.
|
443 | */
|
444 | 'attributes'?: {
|
445 | [key: string]: any;
|
446 | };
|
447 | 'application': Application;
|
448 | }
|
449 | /**
|
450 | * An error object providing more information about the error that occurred.
|
451 | * @interface
|
452 | */
|
453 | export interface SessionEndedError {
|
454 | /**
|
455 | * A string indicating the type of error that occurred.
|
456 | */
|
457 | 'type': SessionEndedErrorType;
|
458 | /**
|
459 | * A string providing more information about the error.
|
460 | */
|
461 | 'message': string;
|
462 | }
|
463 | /**
|
464 | * A string indicating the type of error that occurred.
|
465 | * @enum
|
466 | */
|
467 | export declare type SessionEndedErrorType = 'INVALID_RESPONSE' | 'DEVICE_COMMUNICATION_ERROR' | 'INTERNAL_SERVICE_ERROR' | 'ENDPOINT_TIMEOUT';
|
468 | /**
|
469 | * The reason why session ended when not initiated from the Skill itself.
|
470 | * @enum
|
471 | */
|
472 | export declare type SessionEndedReason = 'USER_INITIATED' | 'ERROR' | 'EXCEEDED_MAX_REPROMPTS';
|
473 | /**
|
474 | *
|
475 | * @interface
|
476 | */
|
477 | export interface Slot {
|
478 | /**
|
479 | * A string that represents the name of the slot.
|
480 | */
|
481 | 'name': string;
|
482 | /**
|
483 | * A string that represents the value the user spoke for the slot. This is the actual value the user spoke, not necessarily the canonical value or one of the synonyms defined for the entity. Note that AMAZON.LITERAL slot values sent to your service are always in all lower case.
|
484 | */
|
485 | 'value'?: string;
|
486 | /**
|
487 | * Indication of whether an intent or slot has been explicitly confirmed or denied by the user, or neither.
|
488 | */
|
489 | 'confirmationStatus': SlotConfirmationStatus;
|
490 | /**
|
491 | * Contains the resultsof entity resolution. These are organized by authority. An authority represents the source for the data provided for the slot. For a custom slot type, the authority is the slot type you defined.
|
492 | */
|
493 | 'resolutions'?: slu.entityresolution.Resolutions;
|
494 | /**
|
495 | * Object representing the value of the slot.
|
496 | */
|
497 | 'slotValue'?: SlotValue;
|
498 | }
|
499 | /**
|
500 | * An enumeration indicating whether the user has explicitly confirmed or denied the value of this slot.
|
501 | * @enum
|
502 | */
|
503 | export declare type SlotConfirmationStatus = 'NONE' | 'DENIED' | 'CONFIRMED';
|
504 | /**
|
505 | * Object representing the value captured in the slot.
|
506 | * @interface
|
507 | */
|
508 | export declare type SlotValue = ListSlotValue | SimpleSlotValue;
|
509 | /**
|
510 | * Status indicates a high level understanding of the result of an execution.
|
511 | * @interface
|
512 | */
|
513 | export interface Status {
|
514 | /**
|
515 | * This is a code signifying the status of the execution initiated by the skill. Protocol adheres to HTTP status codes.
|
516 | */
|
517 | 'code': string;
|
518 | /**
|
519 | * This is a message that goes along with response code that can provide more information about what occurred.
|
520 | */
|
521 | 'message': string;
|
522 | }
|
523 | /**
|
524 | * An object listing each interface that the device supports. For example, if supportedInterfaces includes AudioPlayer {}, then you know that the device supports streaming audio using the AudioPlayer interface.
|
525 | * @interface
|
526 | */
|
527 | export interface SupportedInterfaces {
|
528 | 'Alexa.Advertisement'?: interfaces.alexa.advertisement.AlexaAdvertisementInterface;
|
529 | 'Alexa.Presentation.APL'?: interfaces.alexa.presentation.apl.AlexaPresentationAplInterface;
|
530 | 'Alexa.Presentation.APLT'?: interfaces.alexa.presentation.aplt.AlexaPresentationApltInterface;
|
531 | 'Alexa.Presentation.HTML'?: interfaces.alexa.presentation.html.AlexaPresentationHtmlInterface;
|
532 | 'AppLink'?: interfaces.applink.AppLinkInterface;
|
533 | 'AudioPlayer'?: interfaces.audioplayer.AudioPlayerInterface;
|
534 | 'Display'?: interfaces.display.DisplayInterface;
|
535 | 'VideoApp'?: interfaces.videoapp.VideoAppInterface;
|
536 | 'Geolocation'?: interfaces.geolocation.GeolocationInterface;
|
537 | 'Navigation'?: interfaces.navigation.NavigationInterface;
|
538 | }
|
539 | /**
|
540 | * This object encapsulates a specific functionality.
|
541 | * @interface
|
542 | */
|
543 | export interface Task {
|
544 | /**
|
545 | * Represents the name of the task.
|
546 | */
|
547 | 'name': string;
|
548 | /**
|
549 | * Represents the version of the task.
|
550 | */
|
551 | 'version': string;
|
552 | /**
|
553 | * Represents the input to handle the task.
|
554 | */
|
555 | 'input'?: any;
|
556 | }
|
557 | /**
|
558 | * An object that describes the Amazon account for which the skill is enabled.
|
559 | * @interface
|
560 | */
|
561 | export interface User {
|
562 | /**
|
563 | * A string that represents a unique identifier for the user who made the request. The length of this identifier can vary, but is never more than 255 characters. The userId is automatically generated when a user enables the skill in the Alexa app. Note: Disabling and re-enabling a skill generates a new identifier.
|
564 | */
|
565 | 'userId': string;
|
566 | /**
|
567 | * A token identifying the user in another system. This is only provided if the user has successfully linked their skill account with their Amazon account.
|
568 | */
|
569 | 'accessToken'?: string;
|
570 | 'permissions'?: Permissions;
|
571 | }
|
572 | export declare namespace authorization {
|
573 | /**
|
574 | * Authorization grant body.
|
575 | * @interface
|
576 | */
|
577 | interface AuthorizationGrantBody {
|
578 | 'grant': authorization.Grant;
|
579 | }
|
580 | }
|
581 | export declare namespace authorization {
|
582 | /**
|
583 | * Information that identifies a user in Amazon Alexa systems.
|
584 | * @interface
|
585 | */
|
586 | interface Grant {
|
587 | /**
|
588 | * Type of the grant.
|
589 | */
|
590 | 'type': authorization.GrantType;
|
591 | /**
|
592 | * The authorization code for the user.
|
593 | */
|
594 | 'code': string;
|
595 | }
|
596 | }
|
597 | export declare namespace authorization {
|
598 | /**
|
599 | * One of the grant types supported.
|
600 | * @enum
|
601 | */
|
602 | type GrantType = 'OAuth2.AuthorizationCode';
|
603 | }
|
604 | export declare namespace canfulfill {
|
605 | /**
|
606 | * CanFulfillIntent represents the response to canFulfillIntentRequest includes the details about whether the skill can understand and fulfill the intent request with detected slots.
|
607 | * @interface
|
608 | */
|
609 | interface CanFulfillIntent {
|
610 | 'canFulfill': canfulfill.CanFulfillIntentValues;
|
611 | /**
|
612 | * A map that represents skill's detailed response to each detected slot within the intent such as if skill can understand and fulfill the detected slot. This supplements the overall canFulfillIntent response and help Alexa make better ranking and arbitration decisions. The key is the name of the slot. The value is an object of type CanFulfillSlot.
|
613 | */
|
614 | 'slots'?: {
|
615 | [key: string]: canfulfill.CanFulfillSlot;
|
616 | };
|
617 | }
|
618 | }
|
619 | export declare namespace canfulfill {
|
620 | /**
|
621 | * Overall if skill can understand and fulfill the intent with detected slots. Respond YES when skill understands all slots, can fulfill all slots, and can fulfill the request in its entirety. Respond NO when skill either cannot understand the intent, cannot understand all the slots, or cannot fulfill all the slots. Respond MAYBE when skill can understand the intent, can partially or fully understand the slots, and can partially or fully fulfill the slots. The only cases where should respond MAYBE is when skill partially understand the request and can potentially complete the request if skill get more data, either through callbacks or through a multi-turn conversation with the user.
|
622 | * @enum
|
623 | */
|
624 | type CanFulfillIntentValues = 'YES' | 'NO' | 'MAYBE';
|
625 | }
|
626 | export declare namespace canfulfill {
|
627 | /**
|
628 | * This represents skill's capability to understand and fulfill each detected slot.
|
629 | * @interface
|
630 | */
|
631 | interface CanFulfillSlot {
|
632 | 'canUnderstand': canfulfill.CanUnderstandSlotValues;
|
633 | 'canFulfill'?: canfulfill.CanFulfillSlotValues;
|
634 | }
|
635 | }
|
636 | export declare namespace canfulfill {
|
637 | /**
|
638 | * This field indicates whether skill can fulfill relevant action for the slot, that has been partially or fully understood. The definition of fulfilling the slot is dependent on skill and skill is required to have logic in place to determine whether a slot value can be fulfilled in the context of skill or not. Return YES if Skill can certainly fulfill the relevant action for this slot value. Return NO if skill cannot fulfill the relevant action for this slot value. For specific recommendations to set the value refer to the developer docs for more details.
|
639 | * @enum
|
640 | */
|
641 | type CanFulfillSlotValues = 'YES' | 'NO';
|
642 | }
|
643 | export declare namespace canfulfill {
|
644 | /**
|
645 | * This field indicates whether skill has understood the slot value. In most typical cases, skills will do some form of entity resolution by looking up a catalog or list to determine whether they recognize the slot or not. Return YES if skill have a perfect match or high confidence match (for eg. synonyms) with catalog or list maintained by skill. Return NO if skill cannot understand or recognize the slot value. Return MAYBE if skill have partial confidence or partial match. This will be true when the slot value doesn’t exist as is, in the catalog, but a variation or a fuzzy match may exist. For specific recommendations to set the value refer to the developer docs for more details.
|
646 | * @enum
|
647 | */
|
648 | type CanUnderstandSlotValues = 'YES' | 'NO' | 'MAYBE';
|
649 | }
|
650 | export declare namespace dialog {
|
651 | /**
|
652 | * The delegation period.
|
653 | * @interface
|
654 | */
|
655 | interface DelegationPeriod {
|
656 | 'until'?: dialog.DelegationPeriodUntil;
|
657 | }
|
658 | }
|
659 | export declare namespace dialog {
|
660 | /**
|
661 | * The end of the specified delegation period. * EXPLICIT_RETURN - delegation lasts until the targeted dialog manager returns a delegate with a new target. * NEXT_TURN - delegation lasts until the next turn, which resumes with the current focused dialog manager.
|
662 | * @enum
|
663 | */
|
664 | type DelegationPeriodUntil = 'EXPLICIT_RETURN' | 'NEXT_TURN';
|
665 | }
|
666 | export declare namespace dialog {
|
667 | /**
|
668 | * Structured input data to send to a dialog manager. Currently, this is an Alexa Conversations input instance.
|
669 | * @interface
|
670 | */
|
671 | interface Input {
|
672 | /**
|
673 | * The Alexa Conversations input name as dictated in the Conversations model.
|
674 | */
|
675 | 'name': string;
|
676 | /**
|
677 | * A map of input slots by slot name.
|
678 | */
|
679 | 'slots'?: {
|
680 | [key: string]: Slot;
|
681 | };
|
682 | }
|
683 | }
|
684 | export declare namespace dialog {
|
685 | /**
|
686 | * The updated request to delegate. Null will delegate the current request.
|
687 | * @interface
|
688 | */
|
689 | type UpdatedRequest = dialog.UpdatedInputRequest | dialog.UpdatedIntentRequest;
|
690 | }
|
691 | export declare namespace dynamicEndpoints {
|
692 | /**
|
693 | * Base response type.
|
694 | * @interface
|
695 | */
|
696 | type BaseResponse = dynamicEndpoints.FailureResponse | dynamicEndpoints.SuccessResponse;
|
697 | }
|
698 | export declare namespace dynamicEndpoints {
|
699 | /**
|
700 | * Request from a Dynamic endpoint connection.
|
701 | * @interface
|
702 | */
|
703 | interface Request {
|
704 | /**
|
705 | * The version of the request message schema used.
|
706 | */
|
707 | 'version': string;
|
708 | /**
|
709 | * Denotes type of request.
|
710 | */
|
711 | 'type': string;
|
712 | /**
|
713 | * The requestId for the dynamic endpoint request.
|
714 | */
|
715 | 'requestId': string;
|
716 | /**
|
717 | * The request payload.
|
718 | */
|
719 | 'requestPayload': string;
|
720 | }
|
721 | }
|
722 | export declare namespace er.dynamic {
|
723 | /**
|
724 | * Represents an entity that the skill wants to store. An entity has an optional Id and the value and the synonyms for the entity
|
725 | * @interface
|
726 | */
|
727 | interface Entity {
|
728 | /**
|
729 | * An unique id associated with the entity
|
730 | */
|
731 | 'id'?: string;
|
732 | 'name': er.dynamic.EntityValueAndSynonyms;
|
733 | }
|
734 | }
|
735 | export declare namespace er.dynamic {
|
736 | /**
|
737 | * Represents an array of entities of a particular type.
|
738 | * @interface
|
739 | */
|
740 | interface EntityListItem {
|
741 | /**
|
742 | * The entity type. Must match the slot type as defined in the interaction model.
|
743 | */
|
744 | 'name': string;
|
745 | /**
|
746 | * A list of dynamic entities which are of the same type
|
747 | */
|
748 | 'values': Array<er.dynamic.Entity>;
|
749 | }
|
750 | }
|
751 | export declare namespace er.dynamic {
|
752 | /**
|
753 | * A container object with value and synomyms for the entity
|
754 | * @interface
|
755 | */
|
756 | interface EntityValueAndSynonyms {
|
757 | /**
|
758 | * The entity value
|
759 | */
|
760 | 'value': string;
|
761 | /**
|
762 | * An array of synonyms for the entity
|
763 | */
|
764 | 'synonyms'?: Array<string>;
|
765 | }
|
766 | }
|
767 | export declare namespace er.dynamic {
|
768 | /**
|
769 | * Replace the existing dynamic entities or clear them from the catalog
|
770 | * @enum
|
771 | */
|
772 | type UpdateBehavior = 'REPLACE' | 'CLEAR';
|
773 | }
|
774 | export declare namespace events.skillevents {
|
775 | /**
|
776 | *
|
777 | * @interface
|
778 | */
|
779 | interface AccountLinkedBody {
|
780 | 'accessToken'?: string;
|
781 | }
|
782 | }
|
783 | export declare namespace events.skillevents {
|
784 | /**
|
785 | *
|
786 | * @interface
|
787 | */
|
788 | interface NotificationSubscriptionChangedBody {
|
789 | /**
|
790 | * The list of to Topics that this user has subscribed/permitted to receive notification from your skill. If a customer unsubscribes for a Topic, this list will contain remaining Topics to which the customer is still subscribed to receive from your skill. If the list of subscriptions is empty, this customer has removed notification subscription for all Topics from your skill.
|
791 | */
|
792 | 'subscriptions'?: Array<events.skillevents.NotificationSubscriptionEvent>;
|
793 | }
|
794 | }
|
795 | export declare namespace events.skillevents {
|
796 | /**
|
797 | *
|
798 | * @interface
|
799 | */
|
800 | interface NotificationSubscriptionEvent {
|
801 | /**
|
802 | * The topicId will be one of the Topics specified in your Skill's manifest file.
|
803 | */
|
804 | 'topicId'?: string;
|
805 | }
|
806 | }
|
807 | export declare namespace events.skillevents {
|
808 | /**
|
809 | *
|
810 | * @interface
|
811 | */
|
812 | interface Permission {
|
813 | /**
|
814 | * The value representing the permission scope.
|
815 | */
|
816 | 'scope'?: string;
|
817 | }
|
818 | }
|
819 | export declare namespace events.skillevents {
|
820 | /**
|
821 | *
|
822 | * @interface
|
823 | */
|
824 | interface PermissionBody {
|
825 | /**
|
826 | * The current list of permissions consented to on the account level. It can be an empty list if there are no account level permissions consented to.
|
827 | */
|
828 | 'acceptedPermissions'?: Array<events.skillevents.Permission>;
|
829 | /**
|
830 | * The current list of permissions consented to on the person level. This is only present if the request contains the ```person``` object. It can be an empty list if there are no person level permissions consented to.
|
831 | */
|
832 | 'acceptedPersonPermissions'?: Array<events.skillevents.Permission>;
|
833 | }
|
834 | }
|
835 | export declare namespace events.skillevents {
|
836 | /**
|
837 | *
|
838 | * @interface
|
839 | */
|
840 | interface ProactiveSubscriptionChangedBody {
|
841 | /**
|
842 | * The list of events that this customer is currently subscribed to. If a customer unsubscribes from an event, this list will contain remaining event types to which the customer is still subscribed to receive from your skill. If the list of subscriptions is empty, this customer has unsubscribed from all event types from your skill.
|
843 | */
|
844 | 'subscriptions'?: Array<events.skillevents.ProactiveSubscriptionEvent>;
|
845 | }
|
846 | }
|
847 | export declare namespace events.skillevents {
|
848 | /**
|
849 | *
|
850 | * @interface
|
851 | */
|
852 | interface ProactiveSubscriptionEvent {
|
853 | 'eventName'?: string;
|
854 | }
|
855 | }
|
856 | export declare namespace interfaces.alexa.advertisement {
|
857 | /**
|
858 | * The interface provides skills with the ability to seamlessly integrate advertisements during their interactions with users.
|
859 | * @interface
|
860 | */
|
861 | interface AlexaAdvertisementInterface {
|
862 | }
|
863 | }
|
864 | export declare namespace interfaces.alexa.advertisement {
|
865 | /**
|
866 | * The object encapsulates information regarding the reasons why the ad is not being rendered.
|
867 | * @interface
|
868 | */
|
869 | interface Reason {
|
870 | /**
|
871 | * The enum represents various details explaining why the ad is not being rendered.
|
872 | */
|
873 | 'type'?: interfaces.alexa.advertisement.ReasonCode;
|
874 | /**
|
875 | * The message provides an explanation of the specific details as to why the ad is not being rendered.
|
876 | */
|
877 | 'message'?: string;
|
878 | }
|
879 | }
|
880 | export declare namespace interfaces.alexa.advertisement {
|
881 | /**
|
882 | * The enum represents various details explaining why the ad is not being rendered.
|
883 | * @enum
|
884 | */
|
885 | type ReasonCode = 'DEVICE_OCCUPIED' | 'UNSUPPORTED_DEVICE' | 'SKILL_DAILY_CAP_LIMIT_REACHED' | 'DOMAIN_DAILY_CAP_LIMIT_REACHED' | 'INTERNAL_SERVER_ERROR' | 'AD_NOT_AVAILABLE';
|
886 | }
|
887 | export declare namespace interfaces.alexa.comms.messagingcontroller {
|
888 | /**
|
889 | * A map whose key is the new status and value is the message ID list. The status of the messages whose IDs are in the list will be updated to the new status from the key.
|
890 | * @interface
|
891 | */
|
892 | interface StatusMap {
|
893 | /**
|
894 | * List of read messages
|
895 | */
|
896 | 'read'?: Array<string>;
|
897 | /**
|
898 | * List of deleted messages
|
899 | */
|
900 | 'deleted'?: Array<string>;
|
901 | }
|
902 | }
|
903 | export declare namespace interfaces.alexa.datastore {
|
904 | /**
|
905 | * DataStore error object payload.
|
906 | * @interface
|
907 | */
|
908 | type CommandsError = interfaces.alexa.datastore.DeviceUnavailableError | interfaces.alexa.datastore.DevicePermanantlyUnavailableError | interfaces.alexa.datastore.DataStoreInternalError | interfaces.alexa.datastore.StorageLimitExeceededError;
|
909 | }
|
910 | export declare namespace interfaces.alexa.datastore {
|
911 | /**
|
912 | * Content of a commands dispatch error.
|
913 | * @interface
|
914 | */
|
915 | interface DispatchErrorContent {
|
916 | /**
|
917 | * Identifier of the device where execution |