message: add callback api to index execute()
diff: @@ -4,6 +4,9 @@ import { IndexPriority, IndexLockMode, FieldIndexing, FieldStorage, FieldTermVec
  import { IDocumentStore } from "../IDocumentStore";
  import { PutIndexesOperation } from "../Operations/Indexes/PutIndexesOperation";
  import { SpatialOptions } from "./Spatial";
  +import { ErrorFirstCallback } from "../../Types/Callbacks";
  +import { TypeUtil } from "../../Utility/TypeUtil";
  +import { passResultToCallback } from "../../Utility/PromiseUtil";
  export abstract class AbstractIndexCreationTaskBase {
  @@ -39,25 +42,66 @@ export abstract class AbstractIndexCreationTaskBase {
  /**
  * Executes the index creation against the specified document store.
  */
  - public async execute(
  - store: IDocumentStore): Promise<void>;
  + public async execute(store: IDocumentStore): Promise<void>;
  + /**
  + * Executes the index creation against the specified document store.
  + */
  + public async execute(store: IDocumentStore, callback: ErrorFirstCallback<void>): Promise<void>;
  + /**
  + * Executes the index creation against the specified document store.
  + */
  + public async execute(store: IDocumentStore, conventions: DocumentConventions): Promise<void>;
  /**
  * Executes the index creation against the specified document store.
  */
  public async execute(
  - store: IDocumentStore, conventions: DocumentConventions): Promise<void>;
  + store: IDocumentStore,
  + conventions: DocumentConventions,
  + callback: ErrorFirstCallback<void>): Promise<void>;
  + /**
  + * Executes the index creation against the specified document store.
  + */
  + public async execute(store: IDocumentStore, conventions: DocumentConventions, database: string): Promise<void>;
  /**
  * Executes the index creation against the specified document store.
  */
  public async execute(
  - store: IDocumentStore, conventions: DocumentConventions, database: string): Promise<void>;
  + store: IDocumentStore,
  + conventions: DocumentConventions,
  + database: string,
  + callback: ErrorFirstCallback<void>): Promise<void>;
  public async execute(
  - store: IDocumentStore, conventions?: DocumentConventions, database?: string): Promise<void> {
  - if (arguments.length === 1) {
  - return store.executeIndex(this);
  + store: IDocumentStore,
  + conventionsOrCallback?: DocumentConventions | ErrorFirstCallback<void>,
  + databaseOrCallback?: string | ErrorFirstCallback<void>,
  + callback?: ErrorFirstCallback<void>): Promise<void> {
  +
  + let conventions: DocumentConventions;
  + let database: string;
  + if (arguments.length > 1) {
  + if (TypeUtil.isFunction(conventionsOrCallback)) {
  + callback = conventionsOrCallback;
  + } else if (TypeUtil.isFunction(databaseOrCallback)) {
  + callback = databaseOrCallback;
  + conventions = conventionsOrCallback;
  } else {
  - return this._putIndex(store, conventions, database);
  + conventions = conventionsOrCallback;
  + database = databaseOrCallback;
  + }
  }
  +
  + callback = callback || TypeUtil.NOOP;
  +
  + let resultPromise;
  + if (!conventions && !database) {
  + resultPromise = store.executeIndex(this);
  + } else {
  + resultPromise = this._putIndex(store, conventions, database);
  + }
  +
  + passResultToCallback(resultPromise, callback);
  +
  + return resultPromise;
  }
  private async _putIndex(
  