Skip to content

createTask types are not correct #18

@tjw0051

Description

@tjw0051
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}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions