Manages URL parameters for FetchEngine with event emission.
Wraps PropertyStore with FetchEngine-specific event emission. Pulls initial params and validation from engine options.
// Access via engine.paramsengine.params.set('apiKey', 'abc123');engine.params.set({ page: '1', limit: '10' });// Method-specific paramsengine.params.set('format', 'json', 'GET');// Remove paramsengine.params.remove('apiKey');engine.params.remove(['page', 'limit']);// Check if param existsif (engine.params.has('apiKey')) { ... }// Get resolved params for a requestconst params = engine.params.resolve('GET', { extra: 'value' }); Copy
// Access via engine.paramsengine.params.set('apiKey', 'abc123');engine.params.set({ page: '1', limit: '10' });// Method-specific paramsengine.params.set('format', 'json', 'GET');// Remove paramsengine.params.remove('apiKey');engine.params.remove(['page', 'limit']);// Check if param existsif (engine.params.has('apiKey')) { ... }// Get resolved params for a requestconst params = engine.params.resolve('GET', { extra: 'value' });
Params type
Internal
Get the underlying PropertyStore for internal use.
Exposed for FetchEngineCore compliance. Internal components (executor, policies) access the store directly for resolution.
Get all params including method overrides.
const all = engine.params.all;// { default: { apiKey: '...' }, get: { format: '...' } } Copy
const all = engine.params.all;// { default: { apiKey: '...' }, get: { format: '...' } }
Get the default params (without method overrides).
Get method-specific params only (not merged with defaults).
Check if a param exists globally or for a specific method.
Optional
if (engine.params.has('apiKey')) { console.log('API key is set');} Copy
if (engine.params.has('apiKey')) { console.log('API key is set');}
Remove a param globally or for a specific method.
engine.params.remove('apiKey');engine.params.remove('format', 'GET'); Copy
engine.params.remove('apiKey');engine.params.remove('format', 'GET');
Remove multiple params globally or for a specific method.
engine.params.remove(['page', 'limit']);engine.params.remove(['format'], 'GET'); Copy
engine.params.remove(['page', 'limit']);engine.params.remove(['format'], 'GET');
Resolve the final params for a specific method.
Merges in order: defaults → method overrides → request overrides.
const params = engine.params.resolve('GET', { extra: 'value' }); Copy
const params = engine.params.resolve('GET', { extra: 'value' });
Set a param value globally or for a specific method.
engine.params.set('apiKey', 'abc123');engine.params.set('format', 'json', 'GET'); Copy
engine.params.set('apiKey', 'abc123');engine.params.set('format', 'json', 'GET');
Set multiple param values globally or for a specific method.
engine.params.set({ page: '1', limit: '10' });engine.params.set({ format: 'json' }, 'GET'); Copy
engine.params.set({ page: '1', limit: '10' });engine.params.set({ format: 'json' }, 'GET');
Manages URL parameters for FetchEngine with event emission.
Wraps PropertyStore with FetchEngine-specific event emission. Pulls initial params and validation from engine options.
Example