Skip to content

Update IRequestOptions interface to v5 spec#1311

Open
dixonyant wants to merge 17 commits intov5.0.0from
requestoptionsv5changes
Open

Update IRequestOptions interface to v5 spec#1311
dixonyant wants to merge 17 commits intov5.0.0from
requestoptionsv5changes

Conversation

@dixonyant
Copy link
Copy Markdown
Contributor

@dixonyant dixonyant commented Apr 13, 2026

Moving all request options into a legacy options interface that IRequestOptions will extend. IRequestOptions will only expose params, authentication, portal, requestOptions, and fetchOptions. All legacy options will be deprecated and some will be removed altogether in coming pr's.

Closes: #1292, #880

Copy link
Copy Markdown
Contributor

@patrickarlt patrickarlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dixonyant I have a few small things in the PR plus a request about refactoring the internalRequest() logic. Which could be in this PR or the future PR where you add rawRequest().

Comment thread .changeset/seven-lands-lose.md Outdated
"@esri/arcgis-rest-auth": major
---

Changed IRequestOptions interface to have only necessary top level properties, moved fetch and request options to fetchOptions and requestFlags
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dixonyant Can you enumerate all the options that changed here and what they changed to?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what will happen to "maxUrlLength"? @patrickarlt will it need to be removed or just moved somewhere else?

Comment thread packages/arcgis-rest-request/src/utils/IRequestOptions.ts Outdated
Comment thread packages/arcgis-rest-request/src/utils/IRequestOptions.ts Outdated
Comment thread packages/arcgis-rest-request/src/request.ts
});
}
if (rawResponse) {
console.warn(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rawResponse is actually deprecated to I think we need to rethink the roles of internalRequest() and request().

Currently request() exists to handle the request option and all the logic happens in internalRequest().

I think with our new model this will be different. We know request() will always be getting JSON so all the error and response processing, error retry, error checking etc... should probably happen in request().

Then inside internalRequest() we can do all the processing that needs to happen before the request like default options, etc... basically anything that we don't need to know about the response for.

Another thing that might help would be to break out as much of this logic as possible into utility functions that we can test in smaller increments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I 100% agree. Right now request is just calling internalRequest with a retry loop. Agreed that a lot of it can be broken down into helpers and updated to async/await syntax for legibility. I was going to handle gutting the rawResponse with adding rawRequest in the same future PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good we can merge this is an you can follow up with:

  • Add rawRequest()
  • Refactor internalRequest() and request() logic to support rawRequest()

@github-actions
Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
arcgis-rest-basemap-sessions.src 100% 100% 0
arcgis-rest-basemap-sessions.src.utils 100% 100% 0
arcgis-rest-demographics.src 100% 100% 0
arcgis-rest-developer-credentials.src 100% 100% 0
arcgis-rest-developer-credentials.src.shared 100% 100% 0
arcgis-rest-elevation.src 100% 100% 0
arcgis-rest-feature-service.src 100% 100% 0
arcgis-rest-feature-service.src.pbf-parser 100% 100% 0
arcgis-rest-geocoding.src 100% 100% 0
arcgis-rest-places.src 100% 100% 0
arcgis-rest-portal.src.groups 100% 100% 0
arcgis-rest-portal.src.items 100% 100% 0
arcgis-rest-portal.src.orgs 100% 100% 0
arcgis-rest-portal.src.services 100% 100% 0
arcgis-rest-portal.src.sharing 100% 100% 0
arcgis-rest-portal.src.users 100% 100% 0
arcgis-rest-portal.src.util 100% 100% 0
arcgis-rest-request.src 100% 100% 0
arcgis-rest-request.src.types 100% 100% 0
arcgis-rest-request.src.utils 100% 100% 0
arcgis-rest-routing.src 100% 100% 0
Summary 100% (2439 / 2439) 100% (1316 / 1316) 0

Minimum allowed line rate is 100%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants