Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
99b4b39
Merge pull request #1317 from Esri/rawrequest-replace-rawresponse
dixonyant Jun 18, 2026
006b834
wip remove rawResponse from packages
dixonyant Jun 18, 2026
4db15f5
Merge branch 'appendCustomParams-update' into updatepackagestorequest…
dixonyant Jun 23, 2026
711cec5
refactor(developer-credentials): migrate request method shape and ali…
dixonyant Jun 23, 2026
c08ddd2
refactor(elevation): migrate request method shape
dixonyant Jun 23, 2026
ab05b41
refactor(feature-service): migrate request method shape and align tests
dixonyant Jun 23, 2026
ec5de03
refactor(geocoding): migrate request method shape and align tests
dixonyant Jun 23, 2026
2865073
refactor(places): migrate request method shape
dixonyant Jun 23, 2026
ddd4ba2
refactor(portal): migrate request method shape and align tests
dixonyant Jun 23, 2026
762af37
refactor(request): migrate request method shape
dixonyant Jun 23, 2026
b6dea54
refactor(basemap-sessions): migrate request method shape
dixonyant Jun 23, 2026
ead9c35
remove raw geocode
dixonyant Jun 26, 2026
68c64f9
remove raw bulk geocode
dixonyant Jun 26, 2026
80b2f77
remove raw get feature
dixonyant Jun 26, 2026
a4f1ec2
remove raw get item resource and info
dixonyant Jun 26, 2026
2e70e57
handle queryFeatures and queryFeaturesRaw
dixonyant Jun 30, 2026
1ea4b0e
fix bulk test to test for error object instead of string
dixonyant Jun 30, 2026
1a8f3e5
handle getItemData and getItemDataRaw
dixonyant Jun 30, 2026
17f88cb
adjust spread order and consolidate http method sets
dixonyant Jul 1, 2026
1ac926c
make method change disallow more explicit
dixonyant Jul 1, 2026
b694710
found two more
dixonyant Jul 1, 2026
a268127
add changeset
dixonyant Jul 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .changeset/cold-teams-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
"@esri/arcgis-rest-basemap-sessions": major
"@esri/arcgis-rest-developer-credentials": major
"@esri/arcgis-rest-elevation": major
"@esri/arcgis-rest-feature-service": major
"@esri/arcgis-rest-geocoding": major
"@esri/arcgis-rest-places": major
"@esri/arcgis-rest-portal": major
"@esri/arcgis-rest-request": major
---

remove support for rawResponse and update packages to new IRequestOptions shape

### Summary

This change drops support for `rawResponse` from all packages, updates all packages to use the new `IRequestOptions` shape, and adds support for raw requests with new methods.

- `rawResponse` support removed from REST JS
- fetch methods now return JSON only. Non-JSON data can be fetched using `rawRequest()` or new wrapper methods that implement it.
- added `queryFeaturesRaw()` and `getItemDataRaw()`
- converted all `httpMethod` instances to the new `fetchOptions.method`

### Why these changes were made

- REST JS methods are being moved to return JSON only in most cases.
- Generic types will be easier to implement and improve our TypeScript commitment.
- Improve API surface area and our testing landscape.
- Separate default function from more advanced uses.

### Breaking Changes

- `getFeature()` no longer supports raw response.
- `queryFeatures()` can no longer be used to query features as pbf with `f=pbf`.
- `bulkGeocode()` no longer supports raw response.
- `geocode()` no longer supports raw response.
- `getItemData()` no longer supports raw, file, or binary responses, use getItemDataRaw()instead.
deprecated IItemDataOptions since we don't support the file property in getItemData() anymore. Use getItemDataRaw() to get the native response instead.
- `getItemInfo()` no longer supports rawResponse as an option and uses rawRequest() as default behavior.
- `getItemResource()` no longer supports rawResponse as an option and uses rawRequest() as default behavior.

### Migration guide

- To get a raw response, construct your own request and use `rawRequest()` to fetch a native response.
- For querying features as `pbf`, use `queryFeaturesRaw()` and supply `f=pbf` in the query options.
- To manually set an HTTP method, supply `fetchOptions.method` in IRequestOptions instead of top-level `httpMethod`.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function startNewSession({
duration = DEFAULT_DURATION
}: IRequestNewSessionParams): Promise<IStartSessionResponse> {
return request(startSessionUrl, {
httpMethod: "GET",
fetchOptions: { method: "GET" },
authentication: authentication,
params: { styleFamily, durationSeconds: duration }
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ import { getRegisteredAppInfo } from "./shared/getRegisteredAppInfo.js";
export async function createApiKey(
requestOptions: ICreateApiKeyOptions
): Promise<IApiKeyResponse> {
requestOptions.httpMethod = "POST";
requestOptions.fetchOptions = {
...requestOptions.fetchOptions,
method: "POST"
};

// filter param buckets:
const baseRequestOptions = extractBaseRequestOptions(requestOptions); // snapshot of basic IRequestOptions before customized params being built into it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ import { ICreateOAuthAppOption, IOAuthApp } from "./shared/types/oAuthType.js";
export async function createOAuthApp(
requestOptions: ICreateOAuthAppOption
): Promise<IOAuthApp> {
requestOptions.httpMethod = "POST";
requestOptions.fetchOptions = {
...requestOptions.fetchOptions,
method: "POST"
};

// filter param buckets:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ export async function getRegisteredAppInfo(
const url =
getPortalUrl(requestOptions) +
`/content/users/${userName}/items/${requestOptions.itemId}/registeredAppInfo`;
requestOptions.httpMethod = "POST";
requestOptions.fetchOptions = {
...requestOptions.fetchOptions,
method: "POST"
};

const registeredAppResponse: IRegisteredAppResponse = await request(url, {
...requestOptions,
Expand Down
10 changes: 2 additions & 8 deletions packages/arcgis-rest-developer-credentials/src/shared/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,9 @@ export function extractBaseRequestOptions<T extends IRequestOptions>(
options: T
): Partial<IRequestOptions> {
const requestOptionsProperties: Array<keyof T> = [
"credentials",
"headers",
"hideToken",
"httpMethod",
"maxUrlLength",
"portal",
"rawResponse",
"signal",
"suppressWarnings"
"requestFlags",
"fetchOptions"
];

return filterKeys(options, requestOptionsProperties);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ import { request } from "@esri/arcgis-rest-request";
export async function unregisterApp(
requestOptions: IUnregisterAppOptions
): Promise<IUnregisterAppResponse> {
requestOptions.httpMethod = "POST";
requestOptions.fetchOptions = {
...requestOptions.fetchOptions,
method: "POST"
};

// get app
const baseRequestOptions = extractBaseRequestOptions(requestOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ import {
export async function updateApiKey(
requestOptions: IUpdateApiKeyOptions
): Promise<IApiKeyResponse> {
requestOptions.httpMethod = "POST";
requestOptions.fetchOptions = {
...requestOptions.fetchOptions,
method: "POST"
};
const baseRequestOptions = extractBaseRequestOptions(requestOptions); // get base requestOptions snapshot

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ import { getRegisteredAppInfo } from "./shared/getRegisteredAppInfo.js";
export async function updateOAuthApp(
requestOptions: IUpdateOAuthOptions
): Promise<IOAuthApp> {
requestOptions.httpMethod = "POST";
requestOptions.fetchOptions = {
...requestOptions.fetchOptions,
method: "POST"
};

// get app
const baseRequestOptions = extractBaseRequestOptions(requestOptions); // get base requestOptions snapshot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ describe("getApiKey()", () => {
const apiKeyResponse = await getApiKey({
itemId: "cddcacee5848488bb981e6c6ff91ab79",
authentication: authOnline,
httpMethod: "GET"
fetchOptions: { method: "GET" }
});

// verify first fetch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe("registerApp()", () => {
const requestOptions: IGetAppInfoOptions = {
itemId: "fake-itemID",
authentication: authOnline,
httpMethod: "GET"
fetchOptions: { method: "GET" }
};

const appResponse = await getRegisteredAppInfo(requestOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe("registerApp()", () => {
httpReferrers: ["https://www.esri.com/en-us/home"],
privileges: [],
authentication: authOnline,
httpMethod: "GET"
fetchOptions: { method: "GET" }
};

const appResponse = await registerApp(requestOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@ type successResponse =
*/
export interface IFindElevationAtManyPointsResponse extends successResponse {}

type IRequestOptionsWithoutHttpMethod = Omit<
IRequestOptions,
"fetchOptions"
> & {
fetchOptions?: Omit<RequestInit, "method">;
};

/**
* Options for {@linkcode findElevationAtPoint}.
*/
export interface IFindElevationAtManyPointsOptions
extends Omit<IRequestOptions, "httpMethod" | "f">,
extends IRequestOptionsWithoutHttpMethod,
queryParams {}

/**
Expand Down
14 changes: 12 additions & 2 deletions packages/arcgis-rest-elevation/src/findElevationAtPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@ type successResponse =
*/
export interface IFindElevationAtPointResponse extends successResponse {}

type IRequestOptionsWithoutHttpMethod = Omit<
IRequestOptions,
"fetchOptions"
> & {
fetchOptions?: Omit<RequestInit, "method">;
};

/**
* Options for {@linkcode findElevationAtPoint}.
*/
export interface IFindElevationAtPointOptions
extends Omit<IRequestOptions, "httpMethod" | "f">,
extends IRequestOptionsWithoutHttpMethod,
queryParams {}

/**
Expand Down Expand Up @@ -68,7 +75,10 @@ export function findElevationAtPoint(
return (
request(`${baseUrl}/elevation/at-point`, {
...options,
httpMethod: "GET"
fetchOptions: {
...options.fetchOptions,
method: "GET"
}
}) as Promise<successResponse>
).then((response) => {
const r: IFindElevationAtPointResponse = {
Expand Down
7 changes: 5 additions & 2 deletions packages/arcgis-rest-feature-service/src/getAttachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ export function getAttachments(
requestOptions: IGetAttachmentsOptions
): Promise<{ attachmentInfos: IAttachmentInfo[] }> {
const options: IGetAttachmentsOptions = {
httpMethod: "GET",
...requestOptions
...requestOptions,
fetchOptions: {
method: "GET",
...requestOptions.fetchOptions
}
};

// pass through
Expand Down
Loading