@dereekb/firebase 11.1.4 → 11.1.6

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.
package/index.cjs.js CHANGED
@@ -5456,14 +5456,16 @@ function iterationQueryDocChangeWatcher(config) {
5456
5456
  delay: timeUntilActive = DEFAULT_QUERY_CHANGE_WATCHER_DELAY
5457
5457
  } = config;
5458
5458
  const stream$ = instance.snapshotIteration.firstSuccessfulPageResults$.pipe(rxjs.switchMap(first => {
5459
- var _beginCheckingAt$expi;
5460
5459
  const {
5461
5460
  time,
5462
5461
  stream
5463
5462
  } = first.value.value;
5464
- const beginCheckingAt = date.toExpires(time, timeUntilActive);
5463
+ const beginCheckingAt = util.calculateExpirationDate({
5464
+ expiresFromDate: time,
5465
+ expiresIn: timeUntilActive
5466
+ });
5465
5467
  // don't start streaming until the given moment.
5466
- return rxjs.timer((_beginCheckingAt$expi = beginCheckingAt.expiresAt) != null ? _beginCheckingAt$expi : new Date()).pipe(rxjs.switchMap(() => stream().pipe(rxjs.skip(1) // skip the first value, as it should be equivalent to the query results given.
5468
+ return rxjs.timer(beginCheckingAt).pipe(rxjs.switchMap(() => stream().pipe(rxjs.skip(1) // skip the first value, as it should be equivalent to the query results given.
5467
5469
  )));
5468
5470
  }), rxjs.shareReplay(1));
5469
5471
  const event$ = stream$.pipe(rxjs.map(event => {
@@ -9775,7 +9777,7 @@ function shouldSendCreatedNotificationInput(input) {
9775
9777
  sendNotificationThrottleTime: inputSendNotificationThrottleTime
9776
9778
  } = input;
9777
9779
  const sendNotificationThrottleTime = inputSendNotificationThrottleTime != null ? inputSendNotificationThrottleTime : util.MS_IN_HOUR;
9778
- const isNotThrottled = sendNotificationThrottleDate ? date.timeHasExpired(sendNotificationThrottleDate, sendNotificationThrottleTime) : true;
9780
+ const isNotThrottled = sendNotificationThrottleDate ? !util.isThrottled(sendNotificationThrottleTime, sendNotificationThrottleDate) : true;
9779
9781
  return sendNotification !== false && isNotThrottled;
9780
9782
  }
9781
9783
  /**
package/index.esm.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { increment, onSnapshot, getDoc, deleteDoc, setDoc, updateDoc, doc, collectionGroup, collection, runTransaction, writeBatch, limit as limit$1, limitToLast as limitToLast$1, orderBy as orderBy$1, documentId, where as where$1, startAt as startAt$1, startAfter as startAfter$1, endAt as endAt$1, endBefore as endBefore$1, getCountFromServer, getDocs, query } from 'firebase/firestore';
2
- import { cachedGetter, mergeModifiers, asArray, filterUndefinedValues, objectHasNoKeys, filterFalsyAndEmptyValues, build, wrapUseAsyncFunction, makeWithFactory, performMakeLoop, runAsyncTasksForValues, filterMaybeArrayValues, useAsync, toModelFieldConversions, makeModelMapFunctions, modifyModelMapFunctions, assignValuesToPOJOFunction, KeyValueTypleValueFilter, asObjectCopyFactory, passThrough, isEqualToValueDecisionFunction, transformStringFunctionConfig, transformStringFunction, isDate, transformNumberFunction, sortValuesFunctionOrMapIdentityWithSortRef, unique, isMapIdentityFunction, chainMapSameFunctions, filterUniqueFunction, filterUniqueTransform, filterFromPOJOFunction, mapObjectMapFunction, copyObject, mapObjectMap, filterEmptyArrayValues, modelFieldMapFunctions, toModelMapFunctions, latLngStringFunction, DEFAULT_LAT_LNG_STRING_VALUE, sortAscendingIndexNumberRefFunction, bitwiseSetDencoder, MAP_IDENTITY, filterNullAndUndefinedValues, convertToArray, pushItemOrArrayItemsIntoArray, separateValues, UTF_8_START_CHARACTER, UTF_PRIVATE_USAGE_AREA_START, mergeArraysIntoArray, lastValue, flattenArrayOrValueArray, performAsyncTasks, batch, allowValueOnceFilter, asGetter, getValueFromGetter, mapIdentityFunction, performTasksFromFactoryInParallelFunction, flattenArray, groupValues, forEachInIterable, stringContains, arrayToObject, takeFront, isOddNumber, objectToMap, ServerErrorResponse, toReadableError, capitalizeFirstLetter, lowercaseFirstLetter, toRelativeSlashPathStartType, mappedUseFunction, iterableToArray, setContainsAllValues, usePromise, slashPathFactory, errorMessageContainsString, bitwiseObjectDencoder, updateMaybeValue, mergeObjects, mergeObjectsFunction, UNSET_INDEX_NUMBER, forEachKeyValue, ModelRelationUtility, filterKeysOnPOJOFunction, areEqualPOJOValuesUsingPojoFilter, filterOnlyUndefinedValues, makeModelMap, MS_IN_HOUR, multiValueMapBuilder } from '@dereekb/util';
2
+ import { cachedGetter, mergeModifiers, asArray, filterUndefinedValues, objectHasNoKeys, filterFalsyAndEmptyValues, build, wrapUseAsyncFunction, makeWithFactory, performMakeLoop, runAsyncTasksForValues, filterMaybeArrayValues, useAsync, toModelFieldConversions, makeModelMapFunctions, modifyModelMapFunctions, assignValuesToPOJOFunction, KeyValueTypleValueFilter, asObjectCopyFactory, passThrough, isEqualToValueDecisionFunction, transformStringFunctionConfig, transformStringFunction, isDate, transformNumberFunction, sortValuesFunctionOrMapIdentityWithSortRef, unique, isMapIdentityFunction, chainMapSameFunctions, filterUniqueFunction, filterUniqueTransform, filterFromPOJOFunction, mapObjectMapFunction, copyObject, mapObjectMap, filterEmptyArrayValues, modelFieldMapFunctions, toModelMapFunctions, latLngStringFunction, DEFAULT_LAT_LNG_STRING_VALUE, sortAscendingIndexNumberRefFunction, bitwiseSetDencoder, MAP_IDENTITY, filterNullAndUndefinedValues, convertToArray, pushItemOrArrayItemsIntoArray, separateValues, UTF_8_START_CHARACTER, UTF_PRIVATE_USAGE_AREA_START, mergeArraysIntoArray, lastValue, flattenArrayOrValueArray, performAsyncTasks, batch, allowValueOnceFilter, asGetter, getValueFromGetter, mapIdentityFunction, performTasksFromFactoryInParallelFunction, flattenArray, calculateExpirationDate, groupValues, forEachInIterable, stringContains, arrayToObject, takeFront, isOddNumber, objectToMap, ServerErrorResponse, toReadableError, capitalizeFirstLetter, lowercaseFirstLetter, toRelativeSlashPathStartType, mappedUseFunction, iterableToArray, setContainsAllValues, usePromise, slashPathFactory, errorMessageContainsString, bitwiseObjectDencoder, updateMaybeValue, mergeObjects, mergeObjectsFunction, UNSET_INDEX_NUMBER, forEachKeyValue, ModelRelationUtility, filterKeysOnPOJOFunction, areEqualPOJOValuesUsingPojoFilter, filterOnlyUndefinedValues, makeModelMap, isThrottled, MS_IN_HOUR, multiValueMapBuilder } from '@dereekb/util';
3
3
  import { filterMaybe, lazyFrom, itemAccumulator, ItemPageIterator, mappedPageItemIteration } from '@dereekb/rxjs';
4
4
  import { from, map, combineLatest, shareReplay, of, exhaustMap, Observable, switchMap, timer, skip } from 'rxjs';
5
5
  import { UNKNOWN_WEBSITE_LINK_TYPE, decodeWebsiteLinkEncodedDataToWebsiteFileLink, encodeWebsiteFileLinkToWebsiteLinkEncodedData, AbstractModelPermissionService, grantedRoleMapReader, noAccessRoleMap, fullAccessRoleMap, IsE164PhoneNumber } from '@dereekb/model';
6
- import { formatToISO8601DateString, toJsDate, toISODateString, isSameDate, dateRange, toExpires, sortByDateFunction, yearWeekCode, UNKNOWN_YEAR_WEEK_CODE, timeHasExpired } from '@dereekb/date';
6
+ import { formatToISO8601DateString, toJsDate, toISODateString, isSameDate, dateRange, sortByDateFunction, yearWeekCode, UNKNOWN_YEAR_WEEK_CODE } from '@dereekb/date';
7
7
  import { httpsCallable } from 'firebase/functions';
8
8
  import { ref, getMetadata, getDownloadURL, uploadString, uploadBytes, getBytes, getBlob, uploadBytesResumable, deleteObject, list } from 'firebase/storage';
9
9
  import { Expose, Type } from 'class-transformer';
@@ -5859,15 +5859,17 @@ function iterationQueryDocChangeWatcher(config) {
5859
5859
  delay: timeUntilActive = DEFAULT_QUERY_CHANGE_WATCHER_DELAY
5860
5860
  } = config;
5861
5861
  const stream$ = instance.snapshotIteration.firstSuccessfulPageResults$.pipe(switchMap(first => {
5862
- var _beginCheckingAt$expi;
5863
5862
  const {
5864
5863
  time,
5865
5864
  stream
5866
5865
  } = first.value.value;
5867
- const beginCheckingAt = toExpires(time, timeUntilActive);
5866
+ const beginCheckingAt = calculateExpirationDate({
5867
+ expiresFromDate: time,
5868
+ expiresIn: timeUntilActive
5869
+ });
5868
5870
 
5869
5871
  // don't start streaming until the given moment.
5870
- return timer((_beginCheckingAt$expi = beginCheckingAt.expiresAt) != null ? _beginCheckingAt$expi : new Date()).pipe(switchMap(() => stream().pipe(skip(1) // skip the first value, as it should be equivalent to the query results given.
5872
+ return timer(beginCheckingAt).pipe(switchMap(() => stream().pipe(skip(1) // skip the first value, as it should be equivalent to the query results given.
5871
5873
  )));
5872
5874
  }), shareReplay(1));
5873
5875
  const event$ = stream$.pipe(map(event => {
@@ -10788,7 +10790,7 @@ function shouldSendCreatedNotificationInput(input) {
10788
10790
  sendNotificationThrottleTime: inputSendNotificationThrottleTime
10789
10791
  } = input;
10790
10792
  const sendNotificationThrottleTime = inputSendNotificationThrottleTime != null ? inputSendNotificationThrottleTime : MS_IN_HOUR;
10791
- const isNotThrottled = sendNotificationThrottleDate ? timeHasExpired(sendNotificationThrottleDate, sendNotificationThrottleTime) : true;
10793
+ const isNotThrottled = sendNotificationThrottleDate ? !isThrottled(sendNotificationThrottleTime, sendNotificationThrottleDate) : true;
10792
10794
  return sendNotification !== false && isNotThrottled;
10793
10795
  }
10794
10796
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/firebase",
3
- "version": "11.1.4",
3
+ "version": "11.1.6",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./src/index.d.ts",
package/test/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [11.1.6](https://github.com/dereekb/dbx-components/compare/v11.1.5-dev...v11.1.6) (2025-03-20)
6
+
7
+
8
+
9
+ ## [11.1.5](https://github.com/dereekb/dbx-components/compare/v11.1.4-dev...v11.1.5) (2025-03-20)
10
+
11
+
12
+
5
13
  ## [11.1.4](https://github.com/dereekb/dbx-components/compare/v11.1.3-dev...v11.1.4) (2025-03-17)
6
14
 
7
15
 
package/test/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/firebase/test",
3
- "version": "11.1.4",
3
+ "version": "11.1.6",
4
4
  "type": "commonjs",
5
5
  "peerDependencies": {
6
6
  "@dereekb/util": "*",