Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createTask types are not correct #18

Open
tjw0051 opened this issue Mar 24, 2022 · 0 comments
Open

createTask types are not correct #18

tjw0051 opened this issue Mar 24, 2022 · 0 comments

Comments

@tjw0051
Copy link

tjw0051 commented Mar 24, 2022

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}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant