Skip to content

Commit

Permalink
fixing declaration file issue from previous release; continue rewriti…
Browse files Browse the repository at this point in the history
…ng js tests to ts
  • Loading branch information
AleksandrRogov committed Sep 16, 2024
1 parent afc2f75 commit dc5cf45
Show file tree
Hide file tree
Showing 3 changed files with 274 additions and 319 deletions.
30 changes: 11 additions & 19 deletions src/dynamics-web-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,20 +277,12 @@ export class DynamicsWebApi {
internalRequest.url = response?.data.location;
delete internalRequest.transferMode;
delete internalRequest.fieldName;
delete internalRequest.property;
delete internalRequest.fileName;
return this._uploadFileChunk(internalRequest, request.data, response?.data.chunkSize);
};

private _downloadFileChunk = async (
request: InternalRequest,
bytesDownloaded: number = 0,
// fileSize: number = 0,
data: string = ""
): Promise<DownloadResponse> => {
// bytesDownloaded = bytesDownloaded || 0;
// fileSize = fileSize || 0;
// data = data || "";

private _downloadFileChunk = async (request: InternalRequest, bytesDownloaded: number = 0, data: string = ""): Promise<DownloadResponse> => {
request.range = "bytes=" + bytesDownloaded + "-" + (bytesDownloaded + Utility.downloadChunkSize - 1);
request.downloadSize = "full";

Expand Down Expand Up @@ -632,7 +624,7 @@ export class DynamicsWebApi {
* @returns {Promise} D365 Web Api Response
*/
callAction: CallAction = async <TResponse = any, TAction = any>(
request: BoundActionRequest<TAction> | UnboundActionRequest<TAction>
request: BoundActionRequest<TAction> | UnboundActionRequest<TAction>,
): Promise<TResponse> => {
ErrorHelper.parameterCheck(request, `DynamicsWebApi.callAction`, "request");
ErrorHelper.stringParameterCheck(request.actionName, `DynamicsWebApi.callAction`, "request.actionName");
Expand Down Expand Up @@ -1336,9 +1328,9 @@ export interface DeleteRequest extends CRUDRequest {
/**BATCH REQUESTS ONLY! Sets Content-ID header or references request in a Change Set. */
contentId?: string;
/**
* Field name that needs to be cleared (for example File Field)
* Field name that needs to be cleared (for example File Field)
* @deprecated Use "property".
*/
*/
fieldName?: string;
/**Single property that needs to be cleared (including the File property) */
property?: string;
Expand Down Expand Up @@ -1442,9 +1434,9 @@ export interface UnboundFunctionRequest extends BaseRequest {
*/
name?: string;
/**
* Name of the function.
* Name of the function.
* @deprecated Use "name" parameter.
*/
*/
functionName?: string;
/**Function's input parameters. Example: { param1: "test", param2: 3 }. */
parameters?: any;
Expand Down Expand Up @@ -1627,20 +1619,20 @@ export interface UploadRequest extends CRUDRequest {
/**The name of File Column (field) */
property?: string;
/**
* File Field Name
* File Field Name
* @deprecated Use "property".
*/
fieldName: string;
fieldName?: string;
}

export interface DownloadRequest extends CRUDRequest {
/**The name of File Column (field) */
property?: string;
/**
* File Field Name
* File Field Name
* @deprecated Use "property".
*/
fieldName: string;
fieldName?: string;
}

export interface CsdlMetadataRequest extends BaseRequest {
Expand Down
284 changes: 0 additions & 284 deletions tests/xhr.spec.js

This file was deleted.

Loading

0 comments on commit dc5cf45

Please sign in to comment.