Skip to content

Commit 504d18d

Browse files
fixing request parameter type for batchRequest
1 parent 870743d commit 504d18d

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

types/dynamics-web-api-callbacks.d.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ declare class DynamicsWebApi {
531531
* @param errorCallback - The function that will be passed through and be called by a failed response.
532532
* @param request
533533
*/
534-
executeBatch(successCallback: Function, errorCallback: Function, request?: Request): void;
534+
executeBatch(successCallback: Function, errorCallback: Function, request?: DynamicsWebApi.RequestBase): void;
535535
/**
536536
* Creates a new instance of DynamicsWebApi
537537
*
@@ -557,21 +557,24 @@ declare namespace DynamicsWebApi {
557557
expand?: Expand[]
558558
}
559559

560-
interface Request {
560+
interface RequestBase {
561561
/**XHR requests only! Indicates whether the requests should be made synchronously or asynchronously.Default value is 'true'(asynchronously). */
562562
async?: boolean;
563-
/**The name of the Entity Collection or Entity Logical name. */
564-
collection?: string;
565563
/**Impersonates the user.A String representing the GUID value for the Dynamics 365 system user id. */
566564
impersonate?: string;
567-
/**If set to 'true', DynamicsWebApi adds a request header 'Cache-Control: no-cache'.Default value is 'false'. */
565+
/** If set to 'true', DynamicsWebApi adds a request header 'Cache-Control: no-cache'.Default value is 'false'. */
568566
noCache?: boolean;
569-
/**Authorization Token. If set, onTokenRefresh will not be called. */
567+
/** Authorization Token. If set, onTokenRefresh will not be called. */
570568
token?: string;
571-
/**Sets a number of milliseconds before a request times out */
569+
/**Sets a number of milliseconds before a request times out. */
572570
timeout?: number;
573571
}
574572

573+
interface Request extends RequestBase {
574+
/**The name of the Entity Collection or Entity Logical name. */
575+
collection?: string;
576+
}
577+
575578
interface CRUDRequest extends Request {
576579
/** DEPRECATED Use "key" instead. A String representing the Primary Key(GUID) of the record. */
577580
id?: string;

types/dynamics-web-api.d.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ declare class DynamicsWebApi {
434434
/**
435435
* Executes a batch request. Please call DynamicsWebApi.startBatch() first to start a batch request.
436436
*/
437-
executeBatch(request?: Request): Promise<any[]>;
437+
executeBatch(request?: DynamicsWebApi.RequestBase): Promise<any[]>;
438438
/**
439439
* Creates a new instance of DynamicsWebApi
440440
*
@@ -460,11 +460,9 @@ declare namespace DynamicsWebApi {
460460
expand?: Expand[]
461461
}
462462

463-
interface Request {
463+
interface RequestBase {
464464
/**XHR requests only! Indicates whether the requests should be made synchronously or asynchronously.Default value is 'true'(asynchronously). */
465465
async?: boolean;
466-
/**The name of the Entity Collection or Entity Logical name. */
467-
collection?: string;
468466
/**Impersonates the user.A String representing the GUID value for the Dynamics 365 system user id. */
469467
impersonate?: string;
470468
/** If set to 'true', DynamicsWebApi adds a request header 'Cache-Control: no-cache'.Default value is 'false'. */
@@ -475,6 +473,11 @@ declare namespace DynamicsWebApi {
475473
timeout?: number;
476474
}
477475

476+
interface Request extends RequestBase {
477+
/**The name of the Entity Collection or Entity Logical name. */
478+
collection?: string;
479+
}
480+
478481
interface CRUDRequest extends Request {
479482
/** DEPRECATED Use "key" instead. A String representing the Primary Key(GUID) of the record. */
480483
id?: string;

0 commit comments

Comments
 (0)