http-request-manager 18.15.0 → 18.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -906,13 +906,12 @@ class NormalizedRequestOptionsModel {
906
906
  }
907
907
 
908
908
  class PathTrackerStateModel {
909
- constructor(consumedValuesByKey = {}, baselineQuery, watchExpiresAt) {
909
+ constructor(consumedValuesByKey = {}, watchExpiresAt) {
910
910
  this.consumedValuesByKey = consumedValuesByKey;
911
- this.baselineQuery = baselineQuery;
912
911
  this.watchExpiresAt = watchExpiresAt;
913
912
  }
914
913
  static adapt(item) {
915
- return new PathTrackerStateModel(item?.consumedValuesByKey && typeof item.consumedValuesByKey === 'object' ? item.consumedValuesByKey : {}, item?.baselineQuery, item?.watchExpiresAt);
914
+ return new PathTrackerStateModel(item?.consumedValuesByKey && typeof item.consumedValuesByKey === 'object' ? item.consumedValuesByKey : {}, item?.watchExpiresAt);
916
915
  }
917
916
  }
918
917
 
@@ -6391,9 +6390,8 @@ class QueryParamsTrackerService {
6391
6390
  this.cleanupExpiredEntries();
6392
6391
  if (!normalized.hasQuery) {
6393
6392
  const pathState = this.ensurePathState(normalized.pathKey);
6394
- const pathSeenBefore = !!pathState.baselineQuery;
6393
+ const pathSeenBefore = Object.keys(pathState.consumedValuesByKey).length > 0;
6395
6394
  if (!pathSeenBefore) {
6396
- pathState.baselineQuery = {};
6397
6395
  this.persistState();
6398
6396
  }
6399
6397
  return !pathSeenBefore;
@@ -6415,19 +6413,20 @@ class QueryParamsTrackerService {
6415
6413
  if (Object.keys(filteredQuery).length === 0) {
6416
6414
  return false;
6417
6415
  }
6418
- if (!pathState.baselineQuery) {
6419
- pathState.baselineQuery = filteredQuery;
6416
+ const hash = this.stringifyQuery(filteredQuery);
6417
+ const consumed = pathState.consumedValuesByKey['__exact__'] || [];
6418
+ if (!consumed.includes(hash)) {
6419
+ pathState.consumedValuesByKey['__exact__'] = [...consumed, hash];
6420
6420
  this.persistState();
6421
6421
  return true;
6422
6422
  }
6423
- return this.stringifyQuery(pathState.baselineQuery) !== this.stringifyQuery(filteredQuery);
6423
+ return false;
6424
6424
  }
6425
6425
  checkVariation(normalized, options) {
6426
6426
  const pathState = this.ensurePathState(normalized.pathKey);
6427
6427
  if (Array.isArray(options.watchParams) && options.watchParams.length === 0) {
6428
- const pathSeenBefore = !!pathState.baselineQuery;
6428
+ const pathSeenBefore = Object.keys(pathState.consumedValuesByKey).length > 0;
6429
6429
  if (!pathSeenBefore) {
6430
- pathState.baselineQuery = {};
6431
6430
  pathState.watchExpiresAt = this.buildExpiryEpoch(typeof options.watchExpiresAt !== 'undefined' ? options.watchExpiresAt : options.watchParamsExpire);
6432
6431
  this.persistState();
6433
6432
  }
@@ -6449,9 +6448,6 @@ class QueryParamsTrackerService {
6449
6448
  }
6450
6449
  });
6451
6450
  if (accepted) {
6452
- if (!pathState.baselineQuery) {
6453
- pathState.baselineQuery = filteredQuery;
6454
- }
6455
6451
  pathState.watchExpiresAt = this.buildExpiryEpoch(typeof options.watchExpiresAt !== 'undefined' ? options.watchExpiresAt : options.watchParamsExpire);
6456
6452
  this.persistState();
6457
6453
  }
@@ -6609,9 +6605,8 @@ class QueryParamsTrackerService {
6609
6605
  pathState.consumedValuesByKey = {};
6610
6606
  pathState.watchExpiresAt = undefined;
6611
6607
  }
6612
- const hasBaseline = pathState.baselineQuery !== undefined;
6613
6608
  const hasTrackedValues = Object.keys(pathState.consumedValuesByKey).some((key) => (pathState.consumedValuesByKey[key] || []).length > 0);
6614
- if (!hasBaseline && !hasTrackedValues) {
6609
+ if (!hasTrackedValues) {
6615
6610
  delete this.state.paths[pathKey];
6616
6611
  }
6617
6612
  });
@@ -10142,22 +10137,22 @@ class RequestManagerStateDemoComponent {
10142
10137
  }
10143
10138
  onSetStateOptions() {
10144
10139
  const dbValue = this.database;
10145
- console.log('[onSetStateOptions] Called, checking form values:', {
10146
- isValid: this.isValid,
10147
- database: dbValue,
10148
- hasTable: !!dbValue?.table,
10149
- tableValue: dbValue?.table,
10150
- dataType: this.dataType
10151
- });
10140
+ // console.log('[onSetStateOptions] Called, checking form values:', {
10141
+ // isValid: this.isValid,
10142
+ // database: dbValue,
10143
+ // hasTable: !!dbValue?.table,
10144
+ // tableValue: dbValue?.table,
10145
+ // dataType: this.dataType
10146
+ // })
10152
10147
  if (!this.isValid) {
10153
- console.log('[onSetStateOptions] Form invalid, aborting');
10148
+ // console.log('[onSetStateOptions] Form invalid, aborting')
10154
10149
  return;
10155
10150
  }
10156
10151
  const reqParams = this.compileRequest();
10157
10152
  const db = DatabaseStorage.adapt(dbValue);
10158
- console.log('[onSetStateOptions] DatabaseStorage.adapt result:', db);
10153
+ // console.log('[onSetStateOptions] DatabaseStorage.adapt result:', db)
10159
10154
  const type = this.dataType === "ARRAY" ? DataType.ARRAY : DataType.OBJECT;
10160
- console.log('[onSetStateOptions] Calling setAPIOptions with:', { db, type, hasTable: !!db?.table });
10155
+ // console.log('[onSetStateOptions] Calling setAPIOptions with:', { db, type, hasTable: !!db?.table })
10161
10156
  this.stateManagerDemoService.setAPIOptions(reqParams.apiOptions, type, db);
10162
10157
  this.requestForm.markAsPristine();
10163
10158
  }