Skip to content

Commit

Permalink
refactor(feature responses): removes unneccessay feature layer respon…
Browse files Browse the repository at this point in the history
…se interfaces

AFFECTS PACKAGES:
@esri/arcgis-rest-feature-layer

BREAKING CHANGE:
removes IAddFeaturesResult, IAddAttachmentResponse, IDeleteFeaturesResult,
IDeleteAttachmentsResponse, IGetAttachmentsResponse, IUpdateFeaturesResult, &
IUpdateAttachmentResponse
  • Loading branch information
tomwayson committed Apr 18, 2019
1 parent 4adff11 commit 1948010
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 77 deletions.
12 changes: 1 addition & 11 deletions packages/arcgis-rest-feature-layer/src/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ export interface IAddFeaturesRequestOptions
features: IFeature[];
}

/**
* Add features results.
*/
export interface IAddFeaturesResult {
/**
* Array of JSON response Object(s) for each feature added.
*/
addResults?: IEditFeatureResult[];
}

/**
* ```js
* import { addFeatures } from '@esri/arcgis-rest-feature-layer';
Expand All @@ -57,7 +47,7 @@ export interface IAddFeaturesResult {
*/
export function addFeatures(
requestOptions: IAddFeaturesRequestOptions
): Promise<IAddFeaturesResult> {
): Promise<{ addResults?: IEditFeatureResult[] }> {
const url = `${cleanUrl(requestOptions.url)}/addFeatures`;

// edit operations are POST only
Expand Down
12 changes: 1 addition & 11 deletions packages/arcgis-rest-feature-layer/src/addAttachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ export interface IAddAttachmentOptions extends ILayerRequestOptions {
attachment: File;
}

/**
* `addAttachment()` request response.
*/
export interface IAddAttachmentResponse {
/**
* Standard AGS add/update/edit result Object for the attachment.
*/
addAttachmentResult: IEditFeatureResult;
}

/**
* ```js
* import { addAttachment } from '@esri/arcgis-rest-feature-layer';
Expand All @@ -47,7 +37,7 @@ export interface IAddAttachmentResponse {
*/
export function addAttachment(
requestOptions: IAddAttachmentOptions
): Promise<IAddAttachmentResponse> {
): Promise<{ addAttachmentResult: IEditFeatureResult }> {
const options: IAddAttachmentOptions = {
params: {},
...requestOptions
Expand Down
12 changes: 1 addition & 11 deletions packages/arcgis-rest-feature-layer/src/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ export interface IDeleteFeaturesRequestOptions
objectIds: number[];
}

/**
* Delete features results.
*/
export interface IDeleteFeaturesResult {
/**
* Array of JSON response Object(s) for each feature deleted.
*/
deleteResults?: IEditFeatureResult[];
}

/**
* ```js
* import { deleteFeatures } from '@esri/arcgis-rest-feature-layer';
Expand All @@ -53,7 +43,7 @@ export interface IDeleteFeaturesResult {
*/
export function deleteFeatures(
requestOptions: IDeleteFeaturesRequestOptions
): Promise<IDeleteFeaturesResult> {
): Promise<{ deleteResults?: IEditFeatureResult[] }> {
const url = `${cleanUrl(requestOptions.url)}/deleteFeatures`;

// edit operations POST only
Expand Down
12 changes: 1 addition & 11 deletions packages/arcgis-rest-feature-layer/src/deleteAttachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ export interface IDeleteAttachmentsOptions extends ILayerRequestOptions {
attachmentIds: number[];
}

/**
* `updateAttachment()` request response.
*/
export interface IDeleteAttachmentsResponse {
/**
* Array of standard AGS add/update/edit result Object(s) for the attachment(s).
*/
deleteAttachmentResults: IEditFeatureResult[];
}

/**
* ```js
* import { deleteAttachments } from '@esri/arcgis-rest-feature-layer';
Expand All @@ -46,7 +36,7 @@ export interface IDeleteAttachmentsResponse {
*/
export function deleteAttachments(
requestOptions: IDeleteAttachmentsOptions
): Promise<IDeleteAttachmentsResponse> {
): Promise<{ deleteAttachmentResults: IEditFeatureResult[] }> {
const options: IDeleteAttachmentsOptions = {
params: {},
...requestOptions
Expand Down
12 changes: 1 addition & 11 deletions packages/arcgis-rest-feature-layer/src/getAttachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@ export interface IAttachmentInfo {
name: string;
}

/**
* `getAttachments()` request response.
*/
export interface IGetAttachmentsResponse {
/**
* Array of `attachmentInfo` Object(s) for each related attachment. Empty Array means no attachments.
*/
attachmentInfos: IAttachmentInfo[];
}

/**
* ```js
* import { getAttachments } from '@esri/arcgis-rest-feature-layer';
Expand All @@ -51,7 +41,7 @@ export interface IGetAttachmentsResponse {
*/
export function getAttachments(
requestOptions: IGetAttachmentsOptions
): Promise<IGetAttachmentsResponse> {
): Promise<{ attachmentInfos: IAttachmentInfo[] }> {
// pass through
return request(
`${cleanUrl(requestOptions.url)}/${requestOptions.featureId}/attachments`,
Expand Down
12 changes: 1 addition & 11 deletions packages/arcgis-rest-feature-layer/src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ export interface IUpdateFeaturesRequestOptions
features: IFeature[];
}

/**
* Update features results.
*/
export interface IUpdateFeaturesResult {
/**
* Array of JSON response Object(s) for each feature updated.
*/
updateResults?: IEditFeatureResult[];
}

/**
*
* ```js
Expand All @@ -57,7 +47,7 @@ export interface IUpdateFeaturesResult {
*/
export function updateFeatures(
requestOptions: IUpdateFeaturesRequestOptions
): Promise<IUpdateFeaturesResult> {
): Promise<{ updateResults?: IEditFeatureResult[] }> {
const url = `${cleanUrl(requestOptions.url)}/updateFeatures`;

// edit operations are POST only
Expand Down
12 changes: 1 addition & 11 deletions packages/arcgis-rest-feature-layer/src/updateAttachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ export interface IUpdateAttachmentOptions extends ILayerRequestOptions {
attachmentId: number;
}

/**
* `updateAttachment()` request response.
*/
export interface IUpdateAttachmentResponse {
/**
* Standard AGS add/update/edit result Object for the attachment.
*/
updateAttachmentResult: IEditFeatureResult;
}

/**
*
* ```js
Expand All @@ -52,7 +42,7 @@ export interface IUpdateAttachmentResponse {
*/
export function updateAttachment(
requestOptions: IUpdateAttachmentOptions
): Promise<IUpdateAttachmentResponse> {
): Promise<{ updateAttachmentResult: IEditFeatureResult }> {
const options: IUpdateAttachmentOptions = {
params: {},
...requestOptions
Expand Down

0 comments on commit 1948010

Please sign in to comment.