amazon-connect/amazon-connect-taskjs

createTask types are not correct

tjw0051 opened this issue · 0 comments

createTask(taskContact: TaskContactDefinition, callbacks?: SuccessFailOptions): void;

The TypeScript typings for agent.createTask are wrong - the optional parameters for TaskContactDefinition are not optional in the type definitions but the readme says that these should be:

  interface TaskContactDefinition {
    /** The  endpoint to assign to */
    readonly endpoint: Endpoint;

    /** The linked contact id */
    readonly previousContactId?: string;

    /** The task name */
    readonly name: string;

    /** The task description */
    readonly description: string;

    /** The task references */
    readonly references: ReferenceDictionary;

    /** The task scheduled time */
    readonly scheduledTime: number;

    /** A random value */
    readonly idempotencyToken: string;

  }

Also the callback is:

interface SuccessFailOptions {
    /** A callback that starts when the operation completes successfully. */
    readonly success?: SuccessFailCallback;

    /** A callback that starts when the operation has an error. */
    readonly failure?: SuccessFailCallback<[string]>;
  }

But success should return a contact ID like {contactId: string}