@dereekb/firebase-server 13.11.18 → 13.12.1

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.
Files changed (67) hide show
  1. package/index.cjs.js +218 -31
  2. package/index.esm.js +217 -34
  3. package/mailgun/package.json +9 -9
  4. package/mcp/index.cjs.default.js +1 -0
  5. package/mcp/index.cjs.js +3646 -0
  6. package/mcp/index.cjs.mjs +2 -0
  7. package/mcp/index.d.ts +1 -0
  8. package/mcp/index.esm.js +3609 -0
  9. package/mcp/package.json +33 -0
  10. package/mcp/src/index.d.ts +1 -0
  11. package/mcp/src/lib/controller/index.d.ts +2 -0
  12. package/mcp/src/lib/controller/mcp.controller.d.ts +19 -0
  13. package/mcp/src/lib/controller/mcp.wellknown.controller.d.ts +25 -0
  14. package/mcp/src/lib/index.d.ts +5 -0
  15. package/mcp/src/lib/mcp.config.d.ts +100 -0
  16. package/mcp/src/lib/mcp.module.d.ts +49 -0
  17. package/mcp/src/lib/service/index.d.ts +8 -0
  18. package/mcp/src/lib/service/mcp.manifest.d.ts +150 -0
  19. package/mcp/src/lib/service/mcp.response-formatter.d.ts +36 -0
  20. package/mcp/src/lib/service/mcp.server.factory.d.ts +124 -0
  21. package/mcp/src/lib/service/mcp.tool-generator.d.ts +235 -0
  22. package/mcp/src/lib/service/mcp.visibility.d.ts +99 -0
  23. package/mcp/src/lib/service/tools/mcp.tool.model-decode.d.ts +87 -0
  24. package/mcp/src/lib/service/tools/mcp.tool.model-get.d.ts +81 -0
  25. package/mcp/src/lib/service/tools/mcp.tool.model-info.d.ts +84 -0
  26. package/mcp/src/lib/service/tools/mcp.tool.whoami.d.ts +72 -0
  27. package/mcp/src/lib/transport/index.d.ts +1 -0
  28. package/mcp/src/lib/transport/streamable-http.transport.d.ts +21 -0
  29. package/model/index.cjs.js +639 -266
  30. package/model/index.esm.js +640 -270
  31. package/model/package.json +9 -9
  32. package/model/src/lib/storagefile/extension/compress.pdf.d.ts +29 -1
  33. package/model/src/lib/storagefile/index.d.ts +1 -0
  34. package/model/src/lib/storagefile/storagefile.action.server.d.ts +29 -2
  35. package/model/src/lib/storagefile/storagefile.mcp.d.ts +32 -0
  36. package/model/src/lib/storagefile/storagefile.module.d.ts +20 -3
  37. package/oidc/index.cjs.js +322 -147
  38. package/oidc/index.esm.js +321 -148
  39. package/oidc/package.json +10 -10
  40. package/oidc/src/lib/controller/oidc.wellknown.controller.d.ts +6 -15
  41. package/oidc/src/lib/middleware/oauth-auth.middleware.d.ts +22 -2
  42. package/oidc/src/lib/middleware/oauth-auth.module.d.ts +57 -0
  43. package/oidc/src/lib/oidc.config.d.ts +73 -0
  44. package/oidc/src/lib/oidc.module.d.ts +44 -2
  45. package/package.json +22 -10
  46. package/src/lib/auth/auth.service.d.ts +16 -1
  47. package/src/lib/auth/auth.service.error.util.d.ts +24 -5
  48. package/src/lib/env/env.config.d.ts +16 -0
  49. package/src/lib/env/env.service.d.ts +9 -0
  50. package/src/lib/nest/controller/model/model.api.get.service.d.ts +35 -1
  51. package/src/lib/nest/env/env.service.d.ts +1 -0
  52. package/src/lib/nest/model/api.details.d.ts +116 -5
  53. package/src/lib/nest/model/crud.assert.function.d.ts +1 -1
  54. package/src/lib/nest/model/index.d.ts +1 -0
  55. package/src/lib/nest/model/invoke.model.function.d.ts +89 -0
  56. package/test/package.json +11 -11
  57. package/twilio/LICENSE +21 -0
  58. package/twilio/index.cjs.default.js +1 -0
  59. package/twilio/index.cjs.js +404 -0
  60. package/twilio/index.cjs.mjs +2 -0
  61. package/twilio/index.d.ts +1 -0
  62. package/twilio/index.esm.js +398 -0
  63. package/twilio/package.json +25 -0
  64. package/twilio/src/index.d.ts +1 -0
  65. package/twilio/src/lib/index.d.ts +1 -0
  66. package/twilio/src/lib/notification.send.service.twilio.d.ts +148 -0
  67. package/zoho/package.json +9 -9
@@ -1,7 +1,7 @@
1
- import { mapObjectKeysToLowercase, multiValueMapBuilder, batch, runAsyncTasksForValues, asArray, pushArrayItemsIntoArray, UNSET_INDEX_NUMBER, areEqualPOJOValues, performAsyncTasks, removeValuesAtIndexesFromArrayCopy, takeFront, makeModelMap, computeNextFreeIndexOnSortedValuesFunction, readIndexNumber, asPromise, dateOrMillisecondsToDate, filterOnlyUndefinedValues, iterablesAreSetEquivalent, mapIdentityFunction, makeValuesGroupMap, filterMaybeArrayValues, cutStringFunction, takeLast, separateValues, unique, mergeSlashPaths, ModelRelationUtility, isThrottled, isPast, unixDateTimeSecondsNumberFromDate, slashPathDetails, MS_IN_MINUTE, expirationDetails, dateFromDateOrTimeMillisecondsNumber, cachedGetter, MS_IN_HOUR, documentFileExtensionForMimeType, useCallback, ZIP_FILE_MIME_TYPE, MAP_IDENTITY, pushItemOrArrayItemsIntoArray, asDecisionFunction } from '@dereekb/util';
1
+ import { mapObjectKeysToLowercase, multiValueMapBuilder, batch, runAsyncTasksForValues, asArray, pushArrayItemsIntoArray, UNSET_INDEX_NUMBER, areEqualPOJOValues, performAsyncTasks, removeValuesAtIndexesFromArrayCopy, takeFront, makeModelMap, computeNextFreeIndexOnSortedValuesFunction, readIndexNumber, asPromise, dateOrMillisecondsToDate, filterOnlyUndefinedValues, iterablesAreSetEquivalent, mapIdentityFunction, makeValuesGroupMap, filterMaybeArrayValues, cutStringFunction, takeLast, separateValues, unique, addMilliseconds, mergeSlashPaths, ModelRelationUtility, isThrottled, isPast, unixDateTimeSecondsNumberFromDate, slashPathDetails, MS_IN_MINUTE, expirationDetails, dateFromDateOrTimeMillisecondsNumber, cachedGetter, MS_IN_HOUR, documentFileExtensionForMimeType, useCallback, ZIP_FILE_MIME_TYPE, MAP_IDENTITY, pushItemOrArrayItemsIntoArray, asDecisionFunction } from '@dereekb/util';
2
2
  import { yearWeekCode, isSameDate, findMaxDate, findMinDate } from '@dereekb/date';
3
- import { CREATE_NOTIFICATION_ID_REQUIRED_ERROR_CODE, NOTIFICATION_BOX_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_BOX_EXCLUSION_TARGET_INVALID_ERROR_CODE, NOTIFICATION_BOX_EXISTS_FOR_MODEL_ERROR_CODE, NOTIFICATION_BOX_RECIPIENT_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_MODEL_ALREADY_INITIALIZED_ERROR_CODE, NOTIFICATION_USER_BLOCKED_FROM_BEING_ADD_TO_RECIPIENTS_ERROR_CODE, NOTIFICATION_USER_INVALID_UID_FOR_CREATE_ERROR_CODE, NOTIFICATION_USER_LOCKED_CONFIG_FROM_BEING_UPDATED_ERROR_CODE, firestoreDummyKey, mergeNotificationBoxRecipients, mergeNotificationUserNotificationBoxRecipientConfigs, applyExclusionsToNotificationUserNotificationBoxRecipientConfigs, mergeNotificationBoxRecipientTemplateConfigs, effectiveNotificationBoxRecipientTemplateConfig, notificationSendExclusionCanSendFunction, mergeNotificationUserDefaultNotificationBoxRecipientConfig, DEFAULT_NOTIFICATION_TEMPLATE_TYPE, NotificationRecipientSendFlag, allowedNotificationRecipients, loadDocumentsForIds, getDocumentSnapshotDataPairsWithData, cleanupOldNotificationLoggedEventDaysParamsType, cleanupSentNotificationsParamsType, createNotificationBoxParamsType, createNotificationSummaryParamsType, createNotificationUserParamsType, resyncNotificationUserParamsType, sendNotificationParamsType, sendQueuedNotificationsParamsType, updateNotificationBoxParamsType, updateNotificationBoxRecipientParamsType, updateNotificationSummaryParamsType, updateNotificationUserParamsType, updateNotificationUserDefaultNotificationBoxRecipientConfig, effectiveNotificationBoxRecipientConfig, updateNotificationUserNotificationBoxRecipientConfigs, calculateNsForNotificationUserNotificationBoxRecipientConfigs, getDocumentSnapshotDataPairs, iterateFirestoreDocumentSnapshotPairs, notificationUsersFlaggedForNeedsSyncQuery, notificationSummaryIdForModel, loadNotificationBoxDocumentForReferencePair, updateNotificationUserNotificationSendExclusions, notificationBoxRecipientTemplateConfigArrayToRecord, updateNotificationRecipient, setIdAndKeyFromKeyIdRefOnDocumentData, inferKeyFromTwoWayFlatFirestoreModelKey, NotificationSendType, getDocumentSnapshotData, notificationSendFlagsImplyIsComplete, NotificationSendState, mergeNotificationSendMessagesResult, notificationsPastSendAtTimeQuery, loadDocumentsForDocumentReferencesFromValues, notificationLoggedEventDayId, shouldSaveNotificationToNotificationWeek, notificationsReadyForCleanupQuery, notificationLoggedEventDaysOlderThanQuery, initializeAllApplicableNotificationBoxesParamsType, initializeAllApplicableNotificationSummariesParamsType, initializeNotificationModelParamsType, firestoreModelKeyCollectionName, notificationBoxesFlaggedForNeedsInitializationQuery, notificationSummariesFlaggedForNeedsInitializationQuery, noContentNotificationMessageFunctionFactory, _createNotificationDocumentFromPair, createNotificationDocumentPair, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_SUBJECT_MAX_LENGTH, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_MESSAGE_MAX_LENGTH, sortNotificationItemsFunction, NOTIFICATION_SUMMARY_ITEM_LIMIT, NOTIFICATION_TASK_SUBTASK_CHECKPOINT_PROCESSING, NOTIFICATION_TASK_SUBTASK_CHECKPOINT_CLEANUP, completeSubtaskProcessingAndScheduleCleanupTaskResult, delayCompletion, notificationTaskComplete, notificationTaskDelayRetry, DEFAULT_NOTIFICATION_TASK_SUBTASK_CLEANUP_RETRY_DELAY, DEFAULT_NOTIFICATION_TASK_SUBTASK_CLEANUP_RETRY_ATTEMPTS, STORAGE_FILE_GROUP_CREATE_INPUT_ERROR_CODE, STORAGE_FILE_ALREADY_PROCESSED_ERROR_CODE, STORAGE_FILE_CANNOT_BE_DELETED_YET_ERROR_CODE, STORAGE_FILE_GROUP_QUEUED_FOR_INITIALIZATION_ERROR_CODE, STORAGE_FILE_MODEL_ALREADY_INITIALIZED_ERROR_CODE, STORAGE_FILE_NOT_FLAGGED_FOR_DELETION_ERROR_CODE, STORAGE_FILE_NOT_FLAGGED_FOR_GROUPS_SYNC_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_ALLOWED_FOR_INVALID_STATE_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_AVAILABLE_FOR_TYPE_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_QUEUED_FOR_PROCESSING_ERROR_CODE, UPLOADED_FILE_DOES_NOT_EXIST_ERROR_CODE, UPLOADED_FILE_INITIALIZATION_DISCARDED_ERROR_CODE, UPLOADED_FILE_INITIALIZATION_FAILED_ERROR_CODE, UPLOADED_FILE_NOT_ALLOWED_TO_BE_INITIALIZED_ERROR_CODE, createStorageFileParamsType, createStorageFileGroupParamsType, deleteAllQueuedStorageFilesParamsType, deleteStorageFileParamsType, downloadMultipleStorageFilesParamsType, downloadStorageFileParamsType, initializeAllStorageFilesFromUploadsParamsType, initializeStorageFileFromUploadParamsType, processAllQueuedStorageFilesParamsType, processStorageFileParamsType, regenerateAllFlaggedStorageFileGroupsContentParamsType, regenerateStorageFileGroupContentParamsType, syncAllFlaggedStorageFilesWithGroupsParamsType, syncStorageFileWithGroupsParamsType, updateStorageFileParamsType, updateStorageFileGroupParamsType, UPLOADS_FOLDER_PATH, iterateStorageListFilesByEachFile, StorageFileProcessingState, storageFilesQueuedForProcessingQuery, STORAGE_FILE_PROCESSING_STUCK_THROTTLE_CHECK_MS, StorageFileState, createNotificationDocument, storageFileProcessingNotificationTaskTemplate, storageFilesQueuedForDeleteQuery, loadStorageFileGroupDocumentForReferencePair, calculateStorageFileGroupEmbeddedFileUpdate, iterateFirestoreDocumentSnapshotPairBatches, storageFileFlaggedForSyncWithGroupsQuery, createStorageFileDocumentPairFactory, StorageFileCreationType, calculateStorageFileGroupRegeneration, storageFileGroupZipFileStoragePath, STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE, getDocumentSnapshotDataPair, storageFileGroupsFlaggedForContentRegenerationQuery, initializeAllApplicableStorageFileGroupsParamsType, initializeStorageFileModelParamsType, storageFileGroupsFlaggedForNeedsInitializationQuery, STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE_CREATE_ZIP_SUBTASK, storedFileReaderFactory, STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_TYPE, copyStoragePath, notificationSubtaskComplete, STORAGE_FILE_GROUP_ZIP_INFO_JSON_FILE_NAME, limitUploadFileTypeDeterminer, combineUploadFileTypeDeterminers, STORAGEFILE_RELATED_FILE_METADATA_KEY, storageFilePurposeAndUserQuery } from '@dereekb/firebase';
4
- import { preconditionConflictError, assertSnapshotData, internalServerError } from '@dereekb/firebase-server';
3
+ import { CREATE_NOTIFICATION_ID_REQUIRED_ERROR_CODE, NOTIFICATION_BOX_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_BOX_EXCLUSION_TARGET_INVALID_ERROR_CODE, NOTIFICATION_BOX_EXISTS_FOR_MODEL_ERROR_CODE, NOTIFICATION_BOX_RECIPIENT_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_MODEL_ALREADY_INITIALIZED_ERROR_CODE, NOTIFICATION_USER_BLOCKED_FROM_BEING_ADD_TO_RECIPIENTS_ERROR_CODE, NOTIFICATION_USER_INVALID_UID_FOR_CREATE_ERROR_CODE, NOTIFICATION_USER_LOCKED_CONFIG_FROM_BEING_UPDATED_ERROR_CODE, firestoreDummyKey, mergeNotificationBoxRecipients, mergeNotificationUserNotificationBoxRecipientConfigs, applyExclusionsToNotificationUserNotificationBoxRecipientConfigs, mergeNotificationBoxRecipientTemplateConfigs, effectiveNotificationBoxRecipientTemplateConfig, notificationSendExclusionCanSendFunction, mergeNotificationUserDefaultNotificationBoxRecipientConfig, DEFAULT_NOTIFICATION_TEMPLATE_TYPE, NotificationRecipientSendFlag, allowedNotificationRecipients, loadDocumentsForIds, getDocumentSnapshotDataPairsWithData, cleanupOldNotificationLoggedEventDaysParamsType, cleanupSentNotificationsParamsType, createNotificationBoxParamsType, createNotificationSummaryParamsType, createNotificationUserParamsType, resyncNotificationUserParamsType, sendNotificationParamsType, sendQueuedNotificationsParamsType, updateNotificationBoxParamsType, updateNotificationBoxRecipientParamsType, updateNotificationSummaryParamsType, updateNotificationUserParamsType, updateNotificationUserDefaultNotificationBoxRecipientConfig, effectiveNotificationBoxRecipientConfig, updateNotificationUserNotificationBoxRecipientConfigs, calculateNsForNotificationUserNotificationBoxRecipientConfigs, getDocumentSnapshotDataPairs, iterateFirestoreDocumentSnapshotPairs, notificationUsersFlaggedForNeedsSyncQuery, notificationSummaryIdForModel, loadNotificationBoxDocumentForReferencePair, updateNotificationUserNotificationSendExclusions, notificationBoxRecipientTemplateConfigArrayToRecord, updateNotificationRecipient, setIdAndKeyFromKeyIdRefOnDocumentData, inferKeyFromTwoWayFlatFirestoreModelKey, NotificationSendType, getDocumentSnapshotData, notificationSendFlagsImplyIsComplete, NotificationSendState, mergeNotificationSendMessagesResult, notificationsPastSendAtTimeQuery, loadDocumentsForDocumentReferencesFromValues, notificationLoggedEventDayId, shouldSaveNotificationToNotificationWeek, notificationsReadyForCleanupQuery, notificationLoggedEventDaysOlderThanQuery, initializeAllApplicableNotificationBoxesParamsType, initializeAllApplicableNotificationSummariesParamsType, initializeNotificationModelParamsType, firestoreModelKeyCollectionName, notificationBoxesFlaggedForNeedsInitializationQuery, notificationSummariesFlaggedForNeedsInitializationQuery, noContentNotificationMessageFunctionFactory, _createNotificationDocumentFromPair, createNotificationDocumentPair, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_SUBJECT_MAX_LENGTH, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_MESSAGE_MAX_LENGTH, sortNotificationItemsFunction, NOTIFICATION_SUMMARY_ITEM_LIMIT, NOTIFICATION_TASK_SUBTASK_CHECKPOINT_PROCESSING, NOTIFICATION_TASK_SUBTASK_CHECKPOINT_CLEANUP, completeSubtaskProcessingAndScheduleCleanupTaskResult, delayCompletion, notificationTaskComplete, notificationTaskDelayRetry, DEFAULT_NOTIFICATION_TASK_SUBTASK_CLEANUP_RETRY_DELAY, DEFAULT_NOTIFICATION_TASK_SUBTASK_CLEANUP_RETRY_ATTEMPTS, STORAGE_FILE_GROUP_CREATE_INPUT_ERROR_CODE, STORAGE_FILE_ALREADY_PROCESSED_ERROR_CODE, STORAGE_FILE_CANNOT_BE_DELETED_YET_ERROR_CODE, STORAGE_FILE_GROUP_QUEUED_FOR_INITIALIZATION_ERROR_CODE, STORAGE_FILE_MODEL_ALREADY_INITIALIZED_ERROR_CODE, STORAGE_FILE_NOT_FLAGGED_FOR_DELETION_ERROR_CODE, STORAGE_FILE_NOT_FLAGGED_FOR_GROUPS_SYNC_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_ALLOWED_FOR_INVALID_STATE_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_AVAILABLE_FOR_TYPE_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_QUEUED_FOR_PROCESSING_ERROR_CODE, UPLOADED_FILE_DOES_NOT_EXIST_ERROR_CODE, UPLOADED_FILE_INITIALIZATION_DISCARDED_ERROR_CODE, UPLOADED_FILE_INITIALIZATION_FAILED_ERROR_CODE, UPLOADED_FILE_NOT_ALLOWED_TO_BE_INITIALIZED_ERROR_CODE, createStorageFileParamsType, createStorageFileGroupParamsType, createStorageFileSignedUploadUrlParamsType, deleteAllQueuedStorageFilesParamsType, deleteStorageFileParamsType, downloadMultipleStorageFilesParamsType, downloadStorageFileParamsType, initializeAllStorageFilesFromUploadsParamsType, initializeStorageFileFromUploadParamsType, processAllQueuedStorageFilesParamsType, processStorageFileParamsType, regenerateAllFlaggedStorageFileGroupsContentParamsType, regenerateStorageFileGroupContentParamsType, syncAllFlaggedStorageFilesWithGroupsParamsType, syncStorageFileWithGroupsParamsType, updateStorageFileParamsType, updateStorageFileGroupParamsType, UPLOADS_FOLDER_PATH, iterateStorageListFilesByEachFile, StorageFileProcessingState, storageFilesQueuedForProcessingQuery, STORAGE_FILE_PROCESSING_STUCK_THROTTLE_CHECK_MS, StorageFileState, createNotificationDocument, storageFileProcessingNotificationTaskTemplate, storageFilesQueuedForDeleteQuery, loadStorageFileGroupDocumentForReferencePair, calculateStorageFileGroupEmbeddedFileUpdate, iterateFirestoreDocumentSnapshotPairBatches, storageFileFlaggedForSyncWithGroupsQuery, createStorageFileDocumentPairFactory, StorageFileCreationType, calculateStorageFileGroupRegeneration, storageFileGroupZipFileStoragePath, STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE, getDocumentSnapshotDataPair, storageFileGroupsFlaggedForContentRegenerationQuery, DEFAULT_CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_EXPIRES_IN_MS, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MIN_EXPIRES_IN_MS, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MAX_EXPIRES_IN_MS, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MAX_FILENAME_LENGTH, initializeAllApplicableStorageFileGroupsParamsType, initializeStorageFileModelParamsType, storageFileGroupsFlaggedForNeedsInitializationQuery, STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE_CREATE_ZIP_SUBTASK, storedFileReaderFactory, STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_TYPE, copyStoragePath, notificationSubtaskComplete, STORAGE_FILE_GROUP_ZIP_INFO_JSON_FILE_NAME, limitUploadFileTypeDeterminer, combineUploadFileTypeDeterminers, STORAGEFILE_RELATED_FILE_METADATA_KEY, storageFilePurposeAndUserQuery } from '@dereekb/firebase';
4
+ import { preconditionConflictError, assertSnapshotData, internalServerError, badRequestError } from '@dereekb/firebase-server';
5
5
  import { hoursToMilliseconds, addHours, isFuture, addMinutes, addSeconds, addDays } from 'date-fns';
6
6
  import { Optional, Inject, Injectable, Module, Global } from '@nestjs/common';
7
7
  import { ConfigModule } from '@nestjs/config';
@@ -10,7 +10,7 @@ import sharp from 'sharp';
10
10
  import { PDFName, PDFDocument, PDFRawStream, PDFArray } from '@cantoo/pdf-lib';
11
11
  import archiver from 'archiver';
12
12
 
13
- function _array_like_to_array$9(arr, len) {
13
+ function _array_like_to_array$a(arr, len) {
14
14
  if (len == null || len > arr.length) len = arr.length;
15
15
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
16
16
  return arr2;
@@ -75,15 +75,15 @@ function _non_iterable_rest$4() {
75
75
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
76
76
  }
77
77
  function _sliced_to_array$4(arr, i) {
78
- return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$9(arr, i) || _non_iterable_rest$4();
78
+ return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$a(arr, i) || _non_iterable_rest$4();
79
79
  }
80
- function _unsupported_iterable_to_array$9(o, minLen) {
80
+ function _unsupported_iterable_to_array$a(o, minLen) {
81
81
  if (!o) return;
82
- if (typeof o === "string") return _array_like_to_array$9(o, minLen);
82
+ if (typeof o === "string") return _array_like_to_array$a(o, minLen);
83
83
  var n = Object.prototype.toString.call(o).slice(8, -1);
84
84
  if (n === "Object" && o.constructor) n = o.constructor.name;
85
85
  if (n === "Map" || n === "Set") return Array.from(n);
86
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
86
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
87
87
  }
88
88
  function _ts_generator$h(thisArg, body) {
89
89
  var f, y, t, _ = {
@@ -464,13 +464,13 @@ var DEFAULT_MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_MAX_BATCH_SIZE_PER_REQUEST =
464
464
  });
465
465
  }
466
466
 
467
- function _array_like_to_array$8(arr, len) {
467
+ function _array_like_to_array$9(arr, len) {
468
468
  if (len == null || len > arr.length) len = arr.length;
469
469
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
470
470
  return arr2;
471
471
  }
472
- function _array_without_holes$6(arr) {
473
- if (Array.isArray(arr)) return _array_like_to_array$8(arr);
472
+ function _array_without_holes$7(arr) {
473
+ if (Array.isArray(arr)) return _array_like_to_array$9(arr);
474
474
  }
475
475
  function asyncGeneratorStep$g(gen, resolve, reject, _next, _throw, key, arg) {
476
476
  try {
@@ -501,7 +501,7 @@ function _async_to_generator$g(fn) {
501
501
  });
502
502
  };
503
503
  }
504
- function _define_property$d(obj, key, value) {
504
+ function _define_property$e(obj, key, value) {
505
505
  if (key in obj) {
506
506
  Object.defineProperty(obj, key, {
507
507
  value: value,
@@ -514,13 +514,13 @@ function _define_property$d(obj, key, value) {
514
514
  }
515
515
  return obj;
516
516
  }
517
- function _iterable_to_array$6(iter) {
517
+ function _iterable_to_array$7(iter) {
518
518
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
519
519
  }
520
- function _non_iterable_spread$6() {
520
+ function _non_iterable_spread$7() {
521
521
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
522
522
  }
523
- function _object_spread$c(target) {
523
+ function _object_spread$d(target) {
524
524
  for(var i = 1; i < arguments.length; i++){
525
525
  var source = arguments[i] != null ? arguments[i] : {};
526
526
  var ownKeys = Object.keys(source);
@@ -530,12 +530,12 @@ function _object_spread$c(target) {
530
530
  }));
531
531
  }
532
532
  ownKeys.forEach(function(key) {
533
- _define_property$d(target, key, source[key]);
533
+ _define_property$e(target, key, source[key]);
534
534
  });
535
535
  }
536
536
  return target;
537
537
  }
538
- function ownKeys$b(object, enumerableOnly) {
538
+ function ownKeys$c(object, enumerableOnly) {
539
539
  var keys = Object.keys(object);
540
540
  if (Object.getOwnPropertySymbols) {
541
541
  var symbols = Object.getOwnPropertySymbols(object);
@@ -543,27 +543,27 @@ function ownKeys$b(object, enumerableOnly) {
543
543
  }
544
544
  return keys;
545
545
  }
546
- function _object_spread_props$b(target, source) {
546
+ function _object_spread_props$c(target, source) {
547
547
  source = source != null ? source : {};
548
548
  if (Object.getOwnPropertyDescriptors) {
549
549
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
550
550
  } else {
551
- ownKeys$b(Object(source)).forEach(function(key) {
551
+ ownKeys$c(Object(source)).forEach(function(key) {
552
552
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
553
553
  });
554
554
  }
555
555
  return target;
556
556
  }
557
- function _to_consumable_array$6(arr) {
558
- return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$6();
557
+ function _to_consumable_array$7(arr) {
558
+ return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$9(arr) || _non_iterable_spread$7();
559
559
  }
560
- function _unsupported_iterable_to_array$8(o, minLen) {
560
+ function _unsupported_iterable_to_array$9(o, minLen) {
561
561
  if (!o) return;
562
- if (typeof o === "string") return _array_like_to_array$8(o, minLen);
562
+ if (typeof o === "string") return _array_like_to_array$9(o, minLen);
563
563
  var n = Object.prototype.toString.call(o).slice(8, -1);
564
564
  if (n === "Object" && o.constructor) n = o.constructor.name;
565
565
  if (n === "Map" || n === "Set") return Array.from(n);
566
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
566
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
567
567
  }
568
568
  function _ts_generator$g(thisArg, body) {
569
569
  var f, y, t, _ = {
@@ -728,12 +728,12 @@ function _ts_generator$g(thisArg, body) {
728
728
  initialExplicitRecipients = canSendToExplicitRecipients ? notification.r : [];
729
729
  initialGlobalRecipients = canSendToGlobalRecipients && inputGlobalRecipients ? inputGlobalRecipients : [];
730
730
  explicitRecipients = initialExplicitRecipients.map(function(x) {
731
- return _object_spread$c({}, x, effectiveNotificationBoxRecipientTemplateConfig(x));
731
+ return _object_spread$d({}, x, effectiveNotificationBoxRecipientTemplateConfig(x));
732
732
  });
733
733
  globalRecipients = initialGlobalRecipients.map(function(x) {
734
- return _object_spread$c({}, x, effectiveNotificationBoxRecipientTemplateConfig(x));
734
+ return _object_spread$d({}, x, effectiveNotificationBoxRecipientTemplateConfig(x));
735
735
  });
736
- explicitAndGlobalRecipients = _to_consumable_array$6(explicitRecipients).concat(_to_consumable_array$6(globalRecipients));
736
+ explicitAndGlobalRecipients = _to_consumable_array$7(explicitRecipients).concat(_to_consumable_array$7(globalRecipients));
737
737
  allBoxRecipientConfigs = canSendToBoxRecipients && notificationBox ? notificationBox.r : [];
738
738
  recipientUids = new Set();
739
739
  relevantBoxRecipientConfigs = [];
@@ -815,7 +815,7 @@ function _ts_generator$g(thisArg, body) {
815
815
  var userTemplateTypeConfig = (_notificationUserRecipientConfig_c_notificationTemplateType = notificationUserRecipientConfig.c[notificationTemplateType]) !== null && _notificationUserRecipientConfig_c_notificationTemplateType !== void 0 ? _notificationUserRecipientConfig_c_notificationTemplateType : {};
816
816
  var templateConfig = mergeNotificationBoxRecipientTemplateConfigs(effectiveNotificationBoxRecipientTemplateConfig(userTemplateTypeConfig), x);
817
817
  // replace the input NotificationRecipientWithConfig with the user's config
818
- x = _object_spread_props$b(_object_spread$c({}, notificationUserRecipientConfig, effectiveNotificationBoxRecipientTemplateConfig(templateConfig)), {
818
+ x = _object_spread_props$c(_object_spread$d({}, notificationUserRecipientConfig, effectiveNotificationBoxRecipientTemplateConfig(templateConfig)), {
819
819
  uid: uid
820
820
  });
821
821
  }
@@ -834,7 +834,7 @@ function _ts_generator$g(thisArg, body) {
834
834
  });
835
835
  return [
836
836
  4,
837
- Promise.all(_to_consumable_array$6(recipientUids).map(function(uid) {
837
+ Promise.all(_to_consumable_array$7(recipientUids).map(function(uid) {
838
838
  return authService.userContext(uid).loadDetails().then(function(details) {
839
839
  return [
840
840
  uid,
@@ -1119,8 +1119,8 @@ function _ts_generator$g(thisArg, body) {
1119
1119
  // flag as removed in the NotificationUser details if not already flagged as such
1120
1120
  if (currentNotificationUserBoxIndexExists && currentNotificationUserBoxConfig.rm !== true) {
1121
1121
  var _currentNotificationUserBoxConfig_c;
1122
- updatedBc = _to_consumable_array$6(notificationUser.bc);
1123
- updatedBc[currentNotificationUserBoxIndex] = _object_spread_props$b(_object_spread$c({}, currentNotificationUserBoxConfig), {
1122
+ updatedBc = _to_consumable_array$7(notificationUser.bc);
1123
+ updatedBc[currentNotificationUserBoxIndex] = _object_spread_props$c(_object_spread$d({}, currentNotificationUserBoxConfig), {
1124
1124
  nb: notificationBoxId,
1125
1125
  c: (_currentNotificationUserBoxConfig_c = currentNotificationUserBoxConfig.c) !== null && _currentNotificationUserBoxConfig_c !== void 0 ? _currentNotificationUserBoxConfig_c : {},
1126
1126
  i: UNSET_INDEX_NUMBER,
@@ -1159,13 +1159,13 @@ function _ts_generator$g(thisArg, body) {
1159
1159
  updateWithNotificationBoxRecipient = notificationBoxRecipient;
1160
1160
  }
1161
1161
  }
1162
- var updatedNotificationUserBoxEntry = mergeNotificationUserNotificationBoxRecipientConfigs(_object_spread_props$b(_object_spread$c({}, currentNotificationUserBoxConfig), {
1162
+ var updatedNotificationUserBoxEntry = mergeNotificationUserNotificationBoxRecipientConfigs(_object_spread_props$c(_object_spread$d({}, currentNotificationUserBoxConfig), {
1163
1163
  i: notificationBoxRecipient.i,
1164
1164
  c: (_currentNotificationUserBoxConfig_c1 = currentNotificationUserBoxConfig.c) !== null && _currentNotificationUserBoxConfig_c1 !== void 0 ? _currentNotificationUserBoxConfig_c1 : {},
1165
1165
  nb: notificationBoxId,
1166
1166
  rm: false // remove/clear the removed flag
1167
1167
  }), updateWithNotificationBoxRecipient);
1168
- updatedBc = _to_consumable_array$6(notificationUser.bc);
1168
+ updatedBc = _to_consumable_array$7(notificationUser.bc);
1169
1169
  if (currentNotificationUserBoxIndexExists) {
1170
1170
  updatedBc[currentNotificationUserBoxIndex] = updatedNotificationUserBoxEntry;
1171
1171
  } else {
@@ -1223,7 +1223,7 @@ function _ts_generator$g(thisArg, body) {
1223
1223
  return result;
1224
1224
  }
1225
1225
 
1226
- function _array_like_to_array$7(arr, len) {
1226
+ function _array_like_to_array$8(arr, len) {
1227
1227
  if (len == null || len > arr.length) len = arr.length;
1228
1228
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
1229
1229
  return arr2;
@@ -1231,8 +1231,8 @@ function _array_like_to_array$7(arr, len) {
1231
1231
  function _array_with_holes$3(arr) {
1232
1232
  if (Array.isArray(arr)) return arr;
1233
1233
  }
1234
- function _array_without_holes$5(arr) {
1235
- if (Array.isArray(arr)) return _array_like_to_array$7(arr);
1234
+ function _array_without_holes$6(arr) {
1235
+ if (Array.isArray(arr)) return _array_like_to_array$8(arr);
1236
1236
  }
1237
1237
  function asyncGeneratorStep$f(gen, resolve, reject, _next, _throw, key, arg) {
1238
1238
  try {
@@ -1268,7 +1268,7 @@ function _class_call_check$a(instance, Constructor) {
1268
1268
  throw new TypeError("Cannot call a class as a function");
1269
1269
  }
1270
1270
  }
1271
- function _define_property$c(obj, key, value) {
1271
+ function _define_property$d(obj, key, value) {
1272
1272
  if (key in obj) {
1273
1273
  Object.defineProperty(obj, key, {
1274
1274
  value: value,
@@ -1281,7 +1281,7 @@ function _define_property$c(obj, key, value) {
1281
1281
  }
1282
1282
  return obj;
1283
1283
  }
1284
- function _iterable_to_array$5(iter) {
1284
+ function _iterable_to_array$6(iter) {
1285
1285
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1286
1286
  }
1287
1287
  function _iterable_to_array_limit$3(arr, i) {
@@ -1311,10 +1311,10 @@ function _iterable_to_array_limit$3(arr, i) {
1311
1311
  function _non_iterable_rest$3() {
1312
1312
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1313
1313
  }
1314
- function _non_iterable_spread$5() {
1314
+ function _non_iterable_spread$6() {
1315
1315
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1316
1316
  }
1317
- function _object_spread$b(target) {
1317
+ function _object_spread$c(target) {
1318
1318
  for(var i = 1; i < arguments.length; i++){
1319
1319
  var source = arguments[i] != null ? arguments[i] : {};
1320
1320
  var ownKeys = Object.keys(source);
@@ -1324,12 +1324,12 @@ function _object_spread$b(target) {
1324
1324
  }));
1325
1325
  }
1326
1326
  ownKeys.forEach(function(key) {
1327
- _define_property$c(target, key, source[key]);
1327
+ _define_property$d(target, key, source[key]);
1328
1328
  });
1329
1329
  }
1330
1330
  return target;
1331
1331
  }
1332
- function ownKeys$a(object, enumerableOnly) {
1332
+ function ownKeys$b(object, enumerableOnly) {
1333
1333
  var keys = Object.keys(object);
1334
1334
  if (Object.getOwnPropertySymbols) {
1335
1335
  var symbols = Object.getOwnPropertySymbols(object);
@@ -1337,30 +1337,30 @@ function ownKeys$a(object, enumerableOnly) {
1337
1337
  }
1338
1338
  return keys;
1339
1339
  }
1340
- function _object_spread_props$a(target, source) {
1340
+ function _object_spread_props$b(target, source) {
1341
1341
  source = source != null ? source : {};
1342
1342
  if (Object.getOwnPropertyDescriptors) {
1343
1343
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1344
1344
  } else {
1345
- ownKeys$a(Object(source)).forEach(function(key) {
1345
+ ownKeys$b(Object(source)).forEach(function(key) {
1346
1346
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1347
1347
  });
1348
1348
  }
1349
1349
  return target;
1350
1350
  }
1351
1351
  function _sliced_to_array$3(arr, i) {
1352
- return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$7(arr, i) || _non_iterable_rest$3();
1352
+ return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$8(arr, i) || _non_iterable_rest$3();
1353
1353
  }
1354
- function _to_consumable_array$5(arr) {
1355
- return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$5();
1354
+ function _to_consumable_array$6(arr) {
1355
+ return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$6();
1356
1356
  }
1357
- function _unsupported_iterable_to_array$7(o, minLen) {
1357
+ function _unsupported_iterable_to_array$8(o, minLen) {
1358
1358
  if (!o) return;
1359
- if (typeof o === "string") return _array_like_to_array$7(o, minLen);
1359
+ if (typeof o === "string") return _array_like_to_array$8(o, minLen);
1360
1360
  var n = Object.prototype.toString.call(o).slice(8, -1);
1361
1361
  if (n === "Object" && o.constructor) n = o.constructor.name;
1362
1362
  if (n === "Map" || n === "Set") return Array.from(n);
1363
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
1363
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
1364
1364
  }
1365
1365
  function _ts_generator$f(thisArg, body) {
1366
1366
  var f, y, t, _ = {
@@ -1651,7 +1651,7 @@ function _ts_generator$f(thisArg, body) {
1651
1651
  });
1652
1652
  var effectiveConfigChanged = !areEqualPOJOValues(currentEffectiveRecipient, nextEffectiveRecipient);
1653
1653
  if (effectiveConfigChanged) {
1654
- updatedConfig = _object_spread_props$a(_object_spread$b({}, currentConfig), {
1654
+ updatedConfig = _object_spread_props$b(_object_spread$c({}, currentConfig), {
1655
1655
  ns: true
1656
1656
  });
1657
1657
  }
@@ -1830,7 +1830,7 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
1830
1830
  recipientHasChange = !areEqualPOJOValues(nextRecipient, recipient);
1831
1831
  // only update recipients if the next/new recipient is not equal to the existing one
1832
1832
  if (recipientHasChange) {
1833
- r = _to_consumable_array$5(notificationBox.r);
1833
+ r = _to_consumable_array$6(notificationBox.r);
1834
1834
  r[recipientIndex] = nextRecipient;
1835
1835
  nextRecipientsMap.set(nb, nextRecipient);
1836
1836
  } else {
@@ -1874,7 +1874,7 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
1874
1874
  var existingConfig = notificationBoxConfigsToSyncInThisBatchMap.get(nb);
1875
1875
  if (notificationUserNotificationBoxConfigsToMarkAsRemoved.has(nb) || existingConfig.rm) {
1876
1876
  // if the recipient was being removed or is marked as removed, then update the config to confirm removal
1877
- nextConfig = _object_spread_props$a(_object_spread$b({}, existingConfig), {
1877
+ nextConfig = _object_spread_props$b(_object_spread$c({}, existingConfig), {
1878
1878
  nb: nb,
1879
1879
  rm: true,
1880
1880
  i: UNSET_INDEX_NUMBER
@@ -1882,7 +1882,7 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
1882
1882
  } else {
1883
1883
  // else, use the updated recipient and keep/copy the
1884
1884
  var updatedRecipient = nextRecipientsMap.get(nb);
1885
- nextConfig = _object_spread_props$a(_object_spread$b({}, existingConfig), {
1885
+ nextConfig = _object_spread_props$b(_object_spread$c({}, existingConfig), {
1886
1886
  nb: nb,
1887
1887
  rm: false,
1888
1888
  i: updatedRecipient.i
@@ -2450,7 +2450,7 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
2450
2450
  targetRecipient = notificationBox.r[targetRecipientIndex];
2451
2451
  if (remove) {
2452
2452
  if (targetRecipientIndex !== -1) {
2453
- r = _to_consumable_array$5(notificationBox.r); // remove if they exist.
2453
+ r = _to_consumable_array$6(notificationBox.r); // remove if they exist.
2454
2454
  delete r[targetRecipientIndex];
2455
2455
  }
2456
2456
  } else {
@@ -2458,12 +2458,12 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
2458
2458
  throw notificationBoxRecipientDoesNotExistsError();
2459
2459
  }
2460
2460
  c = (_ref = inputC != null ? notificationBoxRecipientTemplateConfigArrayToRecord(inputC) : targetRecipient === null || targetRecipient === void 0 ? void 0 : targetRecipient.c) !== null && _ref !== void 0 ? _ref : {};
2461
- nextRecipient = _object_spread$b({
2461
+ nextRecipient = _object_spread$c({
2462
2462
  uid: uid,
2463
2463
  i: (_ref1 = targetRecipient === null || targetRecipient === void 0 ? void 0 : targetRecipient.i) !== null && _ref1 !== void 0 ? _ref1 : UNSET_INDEX_NUMBER,
2464
2464
  c: c
2465
2465
  }, updateNotificationRecipient(targetRecipient !== null && targetRecipient !== void 0 ? targetRecipient : {}, params));
2466
- r = _to_consumable_array$5(notificationBox.r);
2466
+ r = _to_consumable_array$6(notificationBox.r);
2467
2467
  if (targetRecipient) {
2468
2468
  nextRecipient.i = targetRecipient.i;
2469
2469
  nextRecipient = mergeNotificationBoxRecipients(targetRecipient, nextRecipient);
@@ -2544,7 +2544,7 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
2544
2544
  3,
2545
2545
  9
2546
2546
  ];
2547
- newUserTemplate = _object_spread_props$a(_object_spread$b({}, notificationUser), {
2547
+ newUserTemplate = _object_spread_props$b(_object_spread$c({}, notificationUser), {
2548
2548
  bc: updatedBc !== null && updatedBc !== void 0 ? updatedBc : [],
2549
2549
  b: updatedB !== null && updatedB !== void 0 ? updatedB : []
2550
2550
  });
@@ -2580,7 +2580,7 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
2580
2580
  }
2581
2581
  _state.label = 12;
2582
2582
  case 12:
2583
- updatedNotificationBox = _object_spread_props$a(_object_spread$b({}, notificationBox), {
2583
+ updatedNotificationBox = _object_spread_props$b(_object_spread$c({}, notificationBox), {
2584
2584
  r: r
2585
2585
  });
2586
2586
  notificationBoxWasCreated = false;
@@ -2818,10 +2818,10 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
2818
2818
  notificationTemplate.at = 0; // reset checkpoint attempt/delay count
2819
2819
  }
2820
2820
  // add the checkpoint to the notification
2821
- notificationTemplate.tpr = _to_consumable_array$5(removeFromCompletionsArrayWithTaskResult(notification.tpr, handleTaskResult)).concat(_to_consumable_array$5(asArray(completion)));
2821
+ notificationTemplate.tpr = _to_consumable_array$6(removeFromCompletionsArrayWithTaskResult(notification.tpr, handleTaskResult)).concat(_to_consumable_array$6(asArray(completion)));
2822
2822
  // calculate the updated notification item
2823
- notificationTemplate.n = _object_spread_props$a(_object_spread$b({}, notification.n), {
2824
- d: _object_spread$b({}, notification.n.d, updateMetadata ? filterOnlyUndefinedValues(updateMetadata) : undefined // ignore any undefined values
2823
+ notificationTemplate.n = _object_spread_props$b(_object_spread$c({}, notification.n), {
2824
+ d: _object_spread$c({}, notification.n.d, updateMetadata ? filterOnlyUndefinedValues(updateMetadata) : undefined // ignore any undefined values
2825
2825
  )
2826
2826
  });
2827
2827
  // can only run the next part if the tpr has changed, and the number of checkpoints completed has increased
@@ -3171,7 +3171,7 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
3171
3171
  case 13:
3172
3172
  if (sendEmailsResult != null) {
3173
3173
  success1 = sendEmailsResult.success, failed = sendEmailsResult.failed;
3174
- esr = success1.length ? _to_consumable_array$5(currentEsr).concat(_to_consumable_array$5(success1.map(function(x) {
3174
+ esr = success1.length ? _to_consumable_array$6(currentEsr).concat(_to_consumable_array$6(success1.map(function(x) {
3175
3175
  return x.toLowerCase();
3176
3176
  }))) : undefined;
3177
3177
  if (failed.length > 0) {
@@ -3292,7 +3292,7 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
3292
3292
  case 26:
3293
3293
  if (sendTextsResult != null) {
3294
3294
  success2 = sendTextsResult.success, failed1 = sendTextsResult.failed;
3295
- tsr = success2.length ? _to_consumable_array$5(currentTsr).concat(_to_consumable_array$5(success2)) : undefined;
3295
+ tsr = success2.length ? _to_consumable_array$6(currentTsr).concat(_to_consumable_array$6(success2)) : undefined;
3296
3296
  if (failed1.length > 0) {
3297
3297
  ts = NotificationSendState.SENT_PARTIAL;
3298
3298
  } else {
@@ -4144,7 +4144,7 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
4144
4144
  ];
4145
4145
  case 1:
4146
4146
  notificationDocuments = _state.sent();
4147
- notificationDocumentsGroupedByNotificationBox = _to_consumable_array$5(makeValuesGroupMap(notificationDocuments, function(x) {
4147
+ notificationDocumentsGroupedByNotificationBox = _to_consumable_array$6(makeValuesGroupMap(notificationDocuments, function(x) {
4148
4148
  return x.parent.id;
4149
4149
  }).values());
4150
4150
  return [
@@ -4200,7 +4200,7 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
4200
4200
  }
4201
4201
  }
4202
4202
  }
4203
- pairsGroupedByWeek = _to_consumable_array$5(makeValuesGroupMap(normalPairsWithDataAndMarkedDeleted, function(x) {
4203
+ pairsGroupedByWeek = _to_consumable_array$6(makeValuesGroupMap(normalPairsWithDataAndMarkedDeleted, function(x) {
4204
4204
  return yearWeekCode(x.data.sat);
4205
4205
  }).entries());
4206
4206
  // batch incase there are a lot of new notifications to move to week
@@ -4214,7 +4214,7 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
4214
4214
  });
4215
4215
  });
4216
4216
  // group logged events by ISO day string (derived from sat) for archival into NotificationLoggedEventDay.
4217
- pairsGroupedByLoggedEventDay = _to_consumable_array$5(makeValuesGroupMap(loggedEventPairsWithDataAndMarkedDeleted, function(x) {
4217
+ pairsGroupedByLoggedEventDay = _to_consumable_array$6(makeValuesGroupMap(loggedEventPairsWithDataAndMarkedDeleted, function(x) {
4218
4218
  return notificationLoggedEventDayId(x.data.sat);
4219
4219
  }).entries());
4220
4220
  // batch incase there are a lot of new logged events to move to a single day
@@ -4257,7 +4257,7 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
4257
4257
  var shouldSaveToNotificationWeek = shouldSaveNotificationToNotificationWeek(data);
4258
4258
  return shouldSaveToNotificationWeek ? data.n : undefined;
4259
4259
  }));
4260
- n = _to_consumable_array$5((_ref = notificationWeek === null || notificationWeek === void 0 ? void 0 : notificationWeek.n) !== null && _ref !== void 0 ? _ref : []).concat(_to_consumable_array$5(newItems));
4260
+ n = _to_consumable_array$6((_ref = notificationWeek === null || notificationWeek === void 0 ? void 0 : notificationWeek.n) !== null && _ref !== void 0 ? _ref : []).concat(_to_consumable_array$6(newItems));
4261
4261
  if (!!notificationWeek) return [
4262
4262
  3,
4263
4263
  3
@@ -4351,7 +4351,7 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = hoursToMilliseconds(NOTIFICATION_T
4351
4351
  });
4352
4352
  return [
4353
4353
  4,
4354
- pagedItems.writeAllItemsInTransaction(transaction, _to_consumable_array$5(existingItems).concat(_to_consumable_array$5(newItems)))
4354
+ pagedItems.writeAllItemsInTransaction(transaction, _to_consumable_array$6(existingItems).concat(_to_consumable_array$6(newItems)))
4355
4355
  ];
4356
4356
  case 2:
4357
4357
  _state.sent();
@@ -4658,7 +4658,7 @@ function _class_call_check$9(instance, Constructor) {
4658
4658
  throw new TypeError("Cannot call a class as a function");
4659
4659
  }
4660
4660
  }
4661
- function _define_property$b(obj, key, value) {
4661
+ function _define_property$c(obj, key, value) {
4662
4662
  if (key in obj) {
4663
4663
  Object.defineProperty(obj, key, {
4664
4664
  value: value,
@@ -4671,7 +4671,7 @@ function _define_property$b(obj, key, value) {
4671
4671
  }
4672
4672
  return obj;
4673
4673
  }
4674
- function _object_spread$a(target) {
4674
+ function _object_spread$b(target) {
4675
4675
  for(var i = 1; i < arguments.length; i++){
4676
4676
  var source = arguments[i] != null ? arguments[i] : {};
4677
4677
  var ownKeys = Object.keys(source);
@@ -4681,12 +4681,12 @@ function _object_spread$a(target) {
4681
4681
  }));
4682
4682
  }
4683
4683
  ownKeys.forEach(function(key) {
4684
- _define_property$b(target, key, source[key]);
4684
+ _define_property$c(target, key, source[key]);
4685
4685
  });
4686
4686
  }
4687
4687
  return target;
4688
4688
  }
4689
- function ownKeys$9(object, enumerableOnly) {
4689
+ function ownKeys$a(object, enumerableOnly) {
4690
4690
  var keys = Object.keys(object);
4691
4691
  if (Object.getOwnPropertySymbols) {
4692
4692
  var symbols = Object.getOwnPropertySymbols(object);
@@ -4694,12 +4694,12 @@ function ownKeys$9(object, enumerableOnly) {
4694
4694
  }
4695
4695
  return keys;
4696
4696
  }
4697
- function _object_spread_props$9(target, source) {
4697
+ function _object_spread_props$a(target, source) {
4698
4698
  source = source != null ? source : {};
4699
4699
  if (Object.getOwnPropertyDescriptors) {
4700
4700
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
4701
4701
  } else {
4702
- ownKeys$9(Object(source)).forEach(function(key) {
4702
+ ownKeys$a(Object(source)).forEach(function(key) {
4703
4703
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
4704
4704
  });
4705
4705
  }
@@ -4921,7 +4921,7 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
4921
4921
  initialized = true;
4922
4922
  return [
4923
4923
  4,
4924
- documentInTransaction.update(_object_spread_props$9(_object_spread$a({}, template), {
4924
+ documentInTransaction.update(_object_spread_props$a(_object_spread$b({}, template), {
4925
4925
  m: undefined,
4926
4926
  s: null,
4927
4927
  fi: false // set false
@@ -5345,13 +5345,13 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
5345
5345
  });
5346
5346
  }
5347
5347
 
5348
- function _type_of$2(obj) {
5348
+ function _type_of$3(obj) {
5349
5349
  "@swc/helpers - typeof";
5350
5350
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
5351
5351
  }
5352
5352
  function __decorate(decorators, target, key, desc) {
5353
5353
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5354
- if ((typeof Reflect === "undefined" ? "undefined" : _type_of$2(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5354
+ if ((typeof Reflect === "undefined" ? "undefined" : _type_of$3(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5355
5355
  else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5356
5356
  return c > 3 && r && Object.defineProperty(target, key, r), r;
5357
5357
  }
@@ -5428,7 +5428,7 @@ function _create_class$1(Constructor, protoProps, staticProps) {
5428
5428
  if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
5429
5429
  return Constructor;
5430
5430
  }
5431
- function _define_property$a(obj, key, value) {
5431
+ function _define_property$b(obj, key, value) {
5432
5432
  if (key in obj) {
5433
5433
  Object.defineProperty(obj, key, {
5434
5434
  value: value,
@@ -5556,8 +5556,8 @@ function _ts_generator$d(thisArg, body) {
5556
5556
  function NotificationTemplateService(_inputDefaults, _inputConfigs) {
5557
5557
  var _this = this;
5558
5558
  _class_call_check$8(this, NotificationTemplateService);
5559
- _define_property$a(this, "_defaults", void 0);
5560
- _define_property$a(this, "_config", void 0);
5559
+ _define_property$b(this, "_defaults", void 0);
5560
+ _define_property$b(this, "_config", void 0);
5561
5561
  this._defaults = _inputDefaults !== null && _inputDefaults !== void 0 ? _inputDefaults : {};
5562
5562
  this._config = new Map();
5563
5563
  if (_inputConfigs != null) {
@@ -5671,7 +5671,7 @@ function _async_to_generator$c(fn) {
5671
5671
  });
5672
5672
  };
5673
5673
  }
5674
- function _define_property$9(obj, key, value) {
5674
+ function _define_property$a(obj, key, value) {
5675
5675
  if (key in obj) {
5676
5676
  Object.defineProperty(obj, key, {
5677
5677
  value: value,
@@ -5684,7 +5684,7 @@ function _define_property$9(obj, key, value) {
5684
5684
  }
5685
5685
  return obj;
5686
5686
  }
5687
- function _object_spread$9(target) {
5687
+ function _object_spread$a(target) {
5688
5688
  for(var i = 1; i < arguments.length; i++){
5689
5689
  var source = arguments[i] != null ? arguments[i] : {};
5690
5690
  var ownKeys = Object.keys(source);
@@ -5694,12 +5694,12 @@ function _object_spread$9(target) {
5694
5694
  }));
5695
5695
  }
5696
5696
  ownKeys.forEach(function(key) {
5697
- _define_property$9(target, key, source[key]);
5697
+ _define_property$a(target, key, source[key]);
5698
5698
  });
5699
5699
  }
5700
5700
  return target;
5701
5701
  }
5702
- function ownKeys$8(object, enumerableOnly) {
5702
+ function ownKeys$9(object, enumerableOnly) {
5703
5703
  var keys = Object.keys(object);
5704
5704
  if (Object.getOwnPropertySymbols) {
5705
5705
  var symbols = Object.getOwnPropertySymbols(object);
@@ -5707,12 +5707,12 @@ function ownKeys$8(object, enumerableOnly) {
5707
5707
  }
5708
5708
  return keys;
5709
5709
  }
5710
- function _object_spread_props$8(target, source) {
5710
+ function _object_spread_props$9(target, source) {
5711
5711
  source = source != null ? source : {};
5712
5712
  if (Object.getOwnPropertyDescriptors) {
5713
5713
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
5714
5714
  } else {
5715
- ownKeys$8(Object(source)).forEach(function(key) {
5715
+ ownKeys$9(Object(source)).forEach(function(key) {
5716
5716
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
5717
5717
  });
5718
5718
  }
@@ -5911,8 +5911,8 @@ function _ts_generator$c(thisArg, body) {
5911
5911
  if (updateNextRunAtTime != null) {
5912
5912
  sat = updateNextRunAtTime === true ? inputNow !== null && inputNow !== void 0 ? inputNow : new Date() : updateNextRunAtTime;
5913
5913
  }
5914
- pair = createNotificationDocumentPair(_object_spread_props$8(_object_spread$9({}, input), {
5915
- template: _object_spread_props$8(_object_spread$9({}, input.template), {
5914
+ pair = createNotificationDocumentPair(_object_spread_props$9(_object_spread$a({}, input), {
5915
+ template: _object_spread_props$9(_object_spread$a({}, input.template), {
5916
5916
  sat: sat
5917
5917
  })
5918
5918
  }));
@@ -5925,7 +5925,7 @@ function _ts_generator$c(thisArg, body) {
5925
5925
  ];
5926
5926
  case 1:
5927
5927
  pairExists = _state.sent();
5928
- result = _object_spread_props$8(_object_spread$9({}, pair), {
5928
+ result = _object_spread_props$9(_object_spread$a({}, pair), {
5929
5929
  notificationCreated: false
5930
5930
  });
5931
5931
  if (!pairExists) return [
@@ -6053,7 +6053,7 @@ function _create_class(Constructor, protoProps, staticProps) {
6053
6053
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
6054
6054
  return Constructor;
6055
6055
  }
6056
- function _define_property$8(obj, key, value) {
6056
+ function _define_property$9(obj, key, value) {
6057
6057
  if (key in obj) {
6058
6058
  Object.defineProperty(obj, key, {
6059
6059
  value: value,
@@ -6066,7 +6066,7 @@ function _define_property$8(obj, key, value) {
6066
6066
  }
6067
6067
  return obj;
6068
6068
  }
6069
- function _object_spread$8(target) {
6069
+ function _object_spread$9(target) {
6070
6070
  for(var i = 1; i < arguments.length; i++){
6071
6071
  var source = arguments[i] != null ? arguments[i] : {};
6072
6072
  var ownKeys = Object.keys(source);
@@ -6076,7 +6076,7 @@ function _object_spread$8(target) {
6076
6076
  }));
6077
6077
  }
6078
6078
  ownKeys.forEach(function(key) {
6079
- _define_property$8(target, key, source[key]);
6079
+ _define_property$9(target, key, source[key]);
6080
6080
  });
6081
6081
  }
6082
6082
  return target;
@@ -6243,7 +6243,7 @@ function _ts_generator$b(thisArg, body) {
6243
6243
  */ var MutableNotificationExpediteService = /*#__PURE__*/ function() {
6244
6244
  function MutableNotificationExpediteService() {
6245
6245
  _class_call_check$5(this, MutableNotificationExpediteService);
6246
- _define_property$8(this, "_notificationServerActions", void 0);
6246
+ _define_property$9(this, "_notificationServerActions", void 0);
6247
6247
  }
6248
6248
  _create_class(MutableNotificationExpediteService, [
6249
6249
  {
@@ -6276,7 +6276,7 @@ function _ts_generator$b(thisArg, body) {
6276
6276
  case 0:
6277
6277
  return [
6278
6278
  4,
6279
- this._notificationServerActions.sendNotification(_object_spread$8({
6279
+ this._notificationServerActions.sendNotification(_object_spread$9({
6280
6280
  key: firestoreDummyKey()
6281
6281
  }, options))
6282
6282
  ];
@@ -6332,20 +6332,20 @@ MutableNotificationExpediteService = __decorate([
6332
6332
  ];
6333
6333
  }
6334
6334
 
6335
- function _array_like_to_array$6(arr, len) {
6335
+ function _array_like_to_array$7(arr, len) {
6336
6336
  if (len == null || len > arr.length) len = arr.length;
6337
6337
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6338
6338
  return arr2;
6339
6339
  }
6340
- function _array_without_holes$4(arr) {
6341
- if (Array.isArray(arr)) return _array_like_to_array$6(arr);
6340
+ function _array_without_holes$5(arr) {
6341
+ if (Array.isArray(arr)) return _array_like_to_array$7(arr);
6342
6342
  }
6343
6343
  function _class_call_check$4(instance, Constructor) {
6344
6344
  if (!(instance instanceof Constructor)) {
6345
6345
  throw new TypeError("Cannot call a class as a function");
6346
6346
  }
6347
6347
  }
6348
- function _define_property$7(obj, key, value) {
6348
+ function _define_property$8(obj, key, value) {
6349
6349
  if (key in obj) {
6350
6350
  Object.defineProperty(obj, key, {
6351
6351
  value: value,
@@ -6358,13 +6358,13 @@ function _define_property$7(obj, key, value) {
6358
6358
  }
6359
6359
  return obj;
6360
6360
  }
6361
- function _iterable_to_array$4(iter) {
6361
+ function _iterable_to_array$5(iter) {
6362
6362
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
6363
6363
  }
6364
- function _non_iterable_spread$4() {
6364
+ function _non_iterable_spread$5() {
6365
6365
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6366
6366
  }
6367
- function _object_spread$7(target) {
6367
+ function _object_spread$8(target) {
6368
6368
  for(var i = 1; i < arguments.length; i++){
6369
6369
  var source = arguments[i] != null ? arguments[i] : {};
6370
6370
  var ownKeys = Object.keys(source);
@@ -6374,12 +6374,12 @@ function _object_spread$7(target) {
6374
6374
  }));
6375
6375
  }
6376
6376
  ownKeys.forEach(function(key) {
6377
- _define_property$7(target, key, source[key]);
6377
+ _define_property$8(target, key, source[key]);
6378
6378
  });
6379
6379
  }
6380
6380
  return target;
6381
6381
  }
6382
- function ownKeys$7(object, enumerableOnly) {
6382
+ function ownKeys$8(object, enumerableOnly) {
6383
6383
  var keys = Object.keys(object);
6384
6384
  if (Object.getOwnPropertySymbols) {
6385
6385
  var symbols = Object.getOwnPropertySymbols(object);
@@ -6387,27 +6387,27 @@ function ownKeys$7(object, enumerableOnly) {
6387
6387
  }
6388
6388
  return keys;
6389
6389
  }
6390
- function _object_spread_props$7(target, source) {
6390
+ function _object_spread_props$8(target, source) {
6391
6391
  source = source != null ? source : {};
6392
6392
  if (Object.getOwnPropertyDescriptors) {
6393
6393
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
6394
6394
  } else {
6395
- ownKeys$7(Object(source)).forEach(function(key) {
6395
+ ownKeys$8(Object(source)).forEach(function(key) {
6396
6396
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
6397
6397
  });
6398
6398
  }
6399
6399
  return target;
6400
6400
  }
6401
- function _to_consumable_array$4(arr) {
6402
- return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$4();
6401
+ function _to_consumable_array$5(arr) {
6402
+ return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$5();
6403
6403
  }
6404
- function _unsupported_iterable_to_array$6(o, minLen) {
6404
+ function _unsupported_iterable_to_array$7(o, minLen) {
6405
6405
  if (!o) return;
6406
- if (typeof o === "string") return _array_like_to_array$6(o, minLen);
6406
+ if (typeof o === "string") return _array_like_to_array$7(o, minLen);
6407
6407
  var n = Object.prototype.toString.call(o).slice(8, -1);
6408
6408
  if (n === "Object" && o.constructor) n = o.constructor.name;
6409
6409
  if (n === "Map" || n === "Set") return Array.from(n);
6410
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
6410
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
6411
6411
  }
6412
6412
  // MARK: Provider Factories
6413
6413
  /**
@@ -6422,7 +6422,7 @@ function _unsupported_iterable_to_array$6(o, minLen) {
6422
6422
  * @returns The assembled {@link NotificationServerActionsContext}
6423
6423
  */ // eslint-disable-next-line @typescript-eslint/max-params
6424
6424
  function notificationServerActionsContextFactory(context, notificationTemplateService, notificationSendService, notificationTaskService, notificationsExpediteService) {
6425
- return _object_spread_props$7(_object_spread$7({}, context), {
6425
+ return _object_spread_props$8(_object_spread$8({}, context), {
6426
6426
  notificationTemplateService: notificationTemplateService,
6427
6427
  notificationSendService: notificationSendService,
6428
6428
  notificationTaskService: notificationTaskService,
@@ -6445,7 +6445,7 @@ function notificationServerActionsContextFactory(context, notificationTemplateSe
6445
6445
  * @param notificationInitServerActionsContextConfig - Init-specific configuration.
6446
6446
  * @returns A new {@link NotificationInitServerActions} instance.
6447
6447
  */ function notificationInitServerActionsFactory(context, notificationInitServerActionsContextConfig) {
6448
- return notificationInitServerActions(_object_spread$7({}, context, notificationInitServerActionsContextConfig));
6448
+ return notificationInitServerActions(_object_spread$8({}, context, notificationInitServerActionsContextConfig));
6449
6449
  }
6450
6450
  /**
6451
6451
  * Convenience function used to generate ModuleMetadata for an app's NotificationModule.
@@ -6469,14 +6469,14 @@ function notificationServerActionsContextFactory(context, notificationTemplateSe
6469
6469
  return {
6470
6470
  imports: [
6471
6471
  ConfigModule
6472
- ].concat(_to_consumable_array$4(dependencyModuleImport), _to_consumable_array$4(imports !== null && imports !== void 0 ? imports : [])),
6472
+ ].concat(_to_consumable_array$5(dependencyModuleImport), _to_consumable_array$5(imports !== null && imports !== void 0 ? imports : [])),
6473
6473
  exports: [
6474
6474
  NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN,
6475
6475
  NotificationExpediteService,
6476
6476
  NotificationTemplateService,
6477
6477
  NotificationServerActions,
6478
6478
  NotificationInitServerActions
6479
- ].concat(_to_consumable_array$4(exports !== null && exports !== void 0 ? exports : [])),
6479
+ ].concat(_to_consumable_array$5(exports !== null && exports !== void 0 ? exports : [])),
6480
6480
  providers: [
6481
6481
  {
6482
6482
  provide: NotificationExpediteService,
@@ -6512,7 +6512,7 @@ function notificationServerActionsContextFactory(context, notificationTemplateSe
6512
6512
  NOTIFICATION_INIT_SERVER_ACTIONS_CONTEXT_CONFIG_TOKEN
6513
6513
  ]
6514
6514
  }
6515
- ].concat(_to_consumable_array$4(providers !== null && providers !== void 0 ? providers : []))
6515
+ ].concat(_to_consumable_array$5(providers !== null && providers !== void 0 ? providers : []))
6516
6516
  };
6517
6517
  }
6518
6518
  /**
@@ -6539,7 +6539,7 @@ GlobalNotificationModule = __decorate([
6539
6539
  })
6540
6540
  ], GlobalNotificationModule);
6541
6541
 
6542
- function _array_like_to_array$5(arr, len) {
6542
+ function _array_like_to_array$6(arr, len) {
6543
6543
  if (len == null || len > arr.length) len = arr.length;
6544
6544
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6545
6545
  return arr2;
@@ -6547,8 +6547,8 @@ function _array_like_to_array$5(arr, len) {
6547
6547
  function _array_with_holes$2(arr) {
6548
6548
  if (Array.isArray(arr)) return arr;
6549
6549
  }
6550
- function _array_without_holes$3(arr) {
6551
- if (Array.isArray(arr)) return _array_like_to_array$5(arr);
6550
+ function _array_without_holes$4(arr) {
6551
+ if (Array.isArray(arr)) return _array_like_to_array$6(arr);
6552
6552
  }
6553
6553
  function asyncGeneratorStep$a(gen, resolve, reject, _next, _throw, key, arg) {
6554
6554
  try {
@@ -6579,7 +6579,7 @@ function _async_to_generator$a(fn) {
6579
6579
  });
6580
6580
  };
6581
6581
  }
6582
- function _define_property$6(obj, key, value) {
6582
+ function _define_property$7(obj, key, value) {
6583
6583
  if (key in obj) {
6584
6584
  Object.defineProperty(obj, key, {
6585
6585
  value: value,
@@ -6592,7 +6592,7 @@ function _define_property$6(obj, key, value) {
6592
6592
  }
6593
6593
  return obj;
6594
6594
  }
6595
- function _iterable_to_array$3(iter) {
6595
+ function _iterable_to_array$4(iter) {
6596
6596
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
6597
6597
  }
6598
6598
  function _iterable_to_array_limit$2(arr, i) {
@@ -6622,10 +6622,10 @@ function _iterable_to_array_limit$2(arr, i) {
6622
6622
  function _non_iterable_rest$2() {
6623
6623
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6624
6624
  }
6625
- function _non_iterable_spread$3() {
6625
+ function _non_iterable_spread$4() {
6626
6626
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6627
6627
  }
6628
- function _object_spread$6(target) {
6628
+ function _object_spread$7(target) {
6629
6629
  for(var i = 1; i < arguments.length; i++){
6630
6630
  var source = arguments[i] != null ? arguments[i] : {};
6631
6631
  var ownKeys = Object.keys(source);
@@ -6635,12 +6635,12 @@ function _object_spread$6(target) {
6635
6635
  }));
6636
6636
  }
6637
6637
  ownKeys.forEach(function(key) {
6638
- _define_property$6(target, key, source[key]);
6638
+ _define_property$7(target, key, source[key]);
6639
6639
  });
6640
6640
  }
6641
6641
  return target;
6642
6642
  }
6643
- function ownKeys$6(object, enumerableOnly) {
6643
+ function ownKeys$7(object, enumerableOnly) {
6644
6644
  var keys = Object.keys(object);
6645
6645
  if (Object.getOwnPropertySymbols) {
6646
6646
  var symbols = Object.getOwnPropertySymbols(object);
@@ -6648,30 +6648,30 @@ function ownKeys$6(object, enumerableOnly) {
6648
6648
  }
6649
6649
  return keys;
6650
6650
  }
6651
- function _object_spread_props$6(target, source) {
6651
+ function _object_spread_props$7(target, source) {
6652
6652
  source = source != null ? source : {};
6653
6653
  if (Object.getOwnPropertyDescriptors) {
6654
6654
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
6655
6655
  } else {
6656
- ownKeys$6(Object(source)).forEach(function(key) {
6656
+ ownKeys$7(Object(source)).forEach(function(key) {
6657
6657
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
6658
6658
  });
6659
6659
  }
6660
6660
  return target;
6661
6661
  }
6662
6662
  function _sliced_to_array$2(arr, i) {
6663
- return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$2();
6663
+ return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$2();
6664
6664
  }
6665
- function _to_consumable_array$3(arr) {
6666
- return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$3();
6665
+ function _to_consumable_array$4(arr) {
6666
+ return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$6(arr) || _non_iterable_spread$4();
6667
6667
  }
6668
- function _unsupported_iterable_to_array$5(o, minLen) {
6668
+ function _unsupported_iterable_to_array$6(o, minLen) {
6669
6669
  if (!o) return;
6670
- if (typeof o === "string") return _array_like_to_array$5(o, minLen);
6670
+ if (typeof o === "string") return _array_like_to_array$6(o, minLen);
6671
6671
  var n = Object.prototype.toString.call(o).slice(8, -1);
6672
6672
  if (n === "Object" && o.constructor) n = o.constructor.name;
6673
6673
  if (n === "Map" || n === "Set") return Array.from(n);
6674
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
6674
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
6675
6675
  }
6676
6676
  function _ts_generator$a(thisArg, body) {
6677
6677
  var f, y, t, _ = {
@@ -6863,7 +6863,7 @@ function _ts_generator$a(thisArg, body) {
6863
6863
  });
6864
6864
  if (messagesToSend.length > 0) {
6865
6865
  // add the new items to existing n, then keep the last 1000
6866
- sortedN = _to_consumable_array$3(existingMessages).concat(_to_consumable_array$3(messagesToSend.map(function(x) {
6866
+ sortedN = _to_consumable_array$4(existingMessages).concat(_to_consumable_array$4(messagesToSend.map(function(x) {
6867
6867
  var message = '';
6868
6868
  if (x.content.openingMessage) {
6869
6869
  message = x.content.openingMessage;
@@ -6871,7 +6871,7 @@ function _ts_generator$a(thisArg, body) {
6871
6871
  if (x.content.closingMessage) {
6872
6872
  message = (message ? message + '\n\n' : message) + x.content.closingMessage;
6873
6873
  }
6874
- var item = _object_spread_props$6(_object_spread$6({}, x.item), {
6874
+ var item = _object_spread_props$7(_object_spread$7({}, x.item), {
6875
6875
  s: cutSubject(x.content.title),
6876
6876
  g: cutMessage(message)
6877
6877
  });
@@ -6908,7 +6908,7 @@ function _ts_generator$a(thisArg, body) {
6908
6908
  5
6909
6909
  ];
6910
6910
  // if it does not exist, and we are allowed to create new summaries, create it and add the new notifications
6911
- createTemplate = _object_spread$6({}, makeNewNotificationSummaryTemplate(inferKeyFromTwoWayFlatFirestoreModelKey(notificationSummaryId)), updateTemplate);
6911
+ createTemplate = _object_spread$7({}, makeNewNotificationSummaryTemplate(inferKeyFromTwoWayFlatFirestoreModelKey(notificationSummaryId)), updateTemplate);
6912
6912
  return [
6913
6913
  4,
6914
6914
  notificationSummaryDocument.create(createTemplate)
@@ -7386,13 +7386,13 @@ function _ts_generator$8(thisArg, body) {
7386
7386
  };
7387
7387
  }
7388
7388
 
7389
- function _array_like_to_array$4(arr, len) {
7389
+ function _array_like_to_array$5(arr, len) {
7390
7390
  if (len == null || len > arr.length) len = arr.length;
7391
7391
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
7392
7392
  return arr2;
7393
7393
  }
7394
- function _array_without_holes$2(arr) {
7395
- if (Array.isArray(arr)) return _array_like_to_array$4(arr);
7394
+ function _array_without_holes$3(arr) {
7395
+ if (Array.isArray(arr)) return _array_like_to_array$5(arr);
7396
7396
  }
7397
7397
  function _assert_this_initialized(self) {
7398
7398
  if (self === void 0) {
@@ -7438,7 +7438,7 @@ function _class_call_check$3(instance, Constructor) {
7438
7438
  throw new TypeError("Cannot call a class as a function");
7439
7439
  }
7440
7440
  }
7441
- function _define_property$5(obj, key, value) {
7441
+ function _define_property$6(obj, key, value) {
7442
7442
  if (key in obj) {
7443
7443
  Object.defineProperty(obj, key, {
7444
7444
  value: value,
@@ -7478,13 +7478,13 @@ function _instanceof$2(left, right) {
7478
7478
  return left instanceof right;
7479
7479
  }
7480
7480
  }
7481
- function _iterable_to_array$2(iter) {
7481
+ function _iterable_to_array$3(iter) {
7482
7482
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
7483
7483
  }
7484
- function _non_iterable_spread$2() {
7484
+ function _non_iterable_spread$3() {
7485
7485
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7486
7486
  }
7487
- function _object_spread$5(target) {
7487
+ function _object_spread$6(target) {
7488
7488
  for(var i = 1; i < arguments.length; i++){
7489
7489
  var source = arguments[i] != null ? arguments[i] : {};
7490
7490
  var ownKeys = Object.keys(source);
@@ -7494,12 +7494,12 @@ function _object_spread$5(target) {
7494
7494
  }));
7495
7495
  }
7496
7496
  ownKeys.forEach(function(key) {
7497
- _define_property$5(target, key, source[key]);
7497
+ _define_property$6(target, key, source[key]);
7498
7498
  });
7499
7499
  }
7500
7500
  return target;
7501
7501
  }
7502
- function ownKeys$5(object, enumerableOnly) {
7502
+ function ownKeys$6(object, enumerableOnly) {
7503
7503
  var keys = Object.keys(object);
7504
7504
  if (Object.getOwnPropertySymbols) {
7505
7505
  var symbols = Object.getOwnPropertySymbols(object);
@@ -7507,19 +7507,19 @@ function ownKeys$5(object, enumerableOnly) {
7507
7507
  }
7508
7508
  return keys;
7509
7509
  }
7510
- function _object_spread_props$5(target, source) {
7510
+ function _object_spread_props$6(target, source) {
7511
7511
  source = source != null ? source : {};
7512
7512
  if (Object.getOwnPropertyDescriptors) {
7513
7513
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
7514
7514
  } else {
7515
- ownKeys$5(Object(source)).forEach(function(key) {
7515
+ ownKeys$6(Object(source)).forEach(function(key) {
7516
7516
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
7517
7517
  });
7518
7518
  }
7519
7519
  return target;
7520
7520
  }
7521
7521
  function _possible_constructor_return(self, call) {
7522
- if (call && (_type_of$1(call) === "object" || typeof call === "function")) {
7522
+ if (call && (_type_of$2(call) === "object" || typeof call === "function")) {
7523
7523
  return call;
7524
7524
  }
7525
7525
  return _assert_this_initialized(self);
@@ -7531,20 +7531,20 @@ function _set_prototype_of(o, p) {
7531
7531
  };
7532
7532
  return _set_prototype_of(o, p);
7533
7533
  }
7534
- function _to_consumable_array$2(arr) {
7535
- return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$2();
7534
+ function _to_consumable_array$3(arr) {
7535
+ return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$3();
7536
7536
  }
7537
- function _type_of$1(obj) {
7537
+ function _type_of$2(obj) {
7538
7538
  "@swc/helpers - typeof";
7539
7539
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
7540
7540
  }
7541
- function _unsupported_iterable_to_array$4(o, minLen) {
7541
+ function _unsupported_iterable_to_array$5(o, minLen) {
7542
7542
  if (!o) return;
7543
- if (typeof o === "string") return _array_like_to_array$4(o, minLen);
7543
+ if (typeof o === "string") return _array_like_to_array$5(o, minLen);
7544
7544
  var n = Object.prototype.toString.call(o).slice(8, -1);
7545
7545
  if (n === "Object" && o.constructor) n = o.constructor.name;
7546
7546
  if (n === "Map" || n === "Set") return Array.from(n);
7547
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
7547
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
7548
7548
  }
7549
7549
  function _is_native_reflect_construct() {
7550
7550
  try {
@@ -7757,7 +7757,7 @@ function _ts_generator$7(thisArg, body) {
7757
7757
  break;
7758
7758
  default:
7759
7759
  {
7760
- sfps = unique(_to_consumable_array$2(removeFromCompletionsArrayWithTaskResult(sfps, subtaskResult)).concat(_to_consumable_array$2(asArray(subtaskCompletion))));
7760
+ sfps = unique(_to_consumable_array$3(removeFromCompletionsArrayWithTaskResult(sfps, subtaskResult)).concat(_to_consumable_array$3(asArray(subtaskCompletion))));
7761
7761
  completedSubtasksSet1 = new Set(sfps);
7762
7762
  incompleteSubtasks = allKnownSubtasks.filter(function(x) {
7763
7763
  return !completedSubtasksSet1.has(x);
@@ -7767,10 +7767,10 @@ function _ts_generator$7(thisArg, body) {
7767
7767
  }
7768
7768
  }
7769
7769
  // configure the update metadata result
7770
- sd = _object_spread$5({}, subtaskData, subtaskUpdateMetadata);
7770
+ sd = _object_spread$6({}, subtaskData, subtaskUpdateMetadata);
7771
7771
  /**
7772
7772
  * This is updating the metadata for the NotificationTask, which has a nested data
7773
- */ baseUpdateMetadata = _object_spread_props$5(_object_spread$5({}, notificationTask.data), {
7773
+ */ baseUpdateMetadata = _object_spread_props$6(_object_spread$6({}, notificationTask.data), {
7774
7774
  sfps: sfps,
7775
7775
  sd: sd
7776
7776
  });
@@ -7782,7 +7782,7 @@ function _ts_generator$7(thisArg, body) {
7782
7782
  updateMetadata = _state.sent();
7783
7783
  if (updateMetadata) {
7784
7784
  // inject sfps and sd back in
7785
- updateMetadata = _object_spread_props$5(_object_spread$5({}, updateMetadata), {
7785
+ updateMetadata = _object_spread_props$6(_object_spread$6({}, updateMetadata), {
7786
7786
  sfps: sfps,
7787
7787
  sd: sd
7788
7788
  });
@@ -7909,7 +7909,7 @@ function _ts_generator$7(thisArg, body) {
7909
7909
  return _ts_generator$7(this, function(_state) {
7910
7910
  switch(_state.label){
7911
7911
  case 0:
7912
- baseInput = _object_spread_props$5(_object_spread$5({}, inputFunctionResult), {
7912
+ baseInput = _object_spread_props$6(_object_spread$6({}, inputFunctionResult), {
7913
7913
  notificationTask: notificationTask
7914
7914
  });
7915
7915
  target = baseInput.target;
@@ -7923,7 +7923,7 @@ function _ts_generator$7(thisArg, body) {
7923
7923
  2
7924
7924
  ];
7925
7925
  subtaskData = data.sd, completedSubtasks = data.sfps;
7926
- input = _object_spread_props$5(_object_spread$5({}, baseInput), {
7926
+ input = _object_spread_props$6(_object_spread$6({}, baseInput), {
7927
7927
  target: target,
7928
7928
  completedSubtasks: completedSubtasks !== null && completedSubtasks !== void 0 ? completedSubtasks : [],
7929
7929
  subtaskData: subtaskData
@@ -7969,7 +7969,7 @@ function _ts_generator$7(thisArg, body) {
7969
7969
  return _ts_generator$7(this, function(_state) {
7970
7970
  switch(_state.label){
7971
7971
  case 0:
7972
- cleanupFunctionInput = _object_spread_props$5(_object_spread$5({}, inputFunctionResult), {
7972
+ cleanupFunctionInput = _object_spread_props$6(_object_spread$6({}, inputFunctionResult), {
7973
7973
  notificationTask: notificationTask
7974
7974
  });
7975
7975
  target = cleanupFunctionInput.target;
@@ -7983,7 +7983,7 @@ function _ts_generator$7(thisArg, body) {
7983
7983
  5
7984
7984
  ];
7985
7985
  subtaskData = data.sd, completedSubtasks = data.sfps;
7986
- input = _object_spread_props$5(_object_spread$5({}, cleanupFunctionInput), {
7986
+ input = _object_spread_props$6(_object_spread$6({}, cleanupFunctionInput), {
7987
7987
  notificationTask: notificationTask,
7988
7988
  completedSubtasks: completedSubtasks !== null && completedSubtasks !== void 0 ? completedSubtasks : [],
7989
7989
  target: target,
@@ -8489,7 +8489,7 @@ function encodeImage(input) {
8489
8489
  })();
8490
8490
  }
8491
8491
 
8492
- function _array_like_to_array$3(arr, len) {
8492
+ function _array_like_to_array$4(arr, len) {
8493
8493
  if (len == null || len > arr.length) len = arr.length;
8494
8494
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
8495
8495
  return arr2;
@@ -8562,15 +8562,15 @@ function _non_iterable_rest$1() {
8562
8562
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
8563
8563
  }
8564
8564
  function _sliced_to_array$1(arr, i) {
8565
- return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$1();
8565
+ return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$1();
8566
8566
  }
8567
- function _unsupported_iterable_to_array$3(o, minLen) {
8567
+ function _unsupported_iterable_to_array$4(o, minLen) {
8568
8568
  if (!o) return;
8569
- if (typeof o === "string") return _array_like_to_array$3(o, minLen);
8569
+ if (typeof o === "string") return _array_like_to_array$4(o, minLen);
8570
8570
  var n = Object.prototype.toString.call(o).slice(8, -1);
8571
8571
  if (n === "Object" && o.constructor) n = o.constructor.name;
8572
8572
  if (n === "Map" || n === "Set") return Array.from(n);
8573
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
8573
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
8574
8574
  }
8575
8575
  function _ts_generator$5(thisArg, body) {
8576
8576
  var f, y, t, _ = {
@@ -8698,7 +8698,7 @@ var DEFAULT_COMPRESS_PDF_IMAGE_SIZE_THRESHOLD_BYTES = 100 * 1024;
8698
8698
  * ```
8699
8699
  */ function compressPdfImagesToTargetSize(input, config) {
8700
8700
  return _async_to_generator$5(function() {
8701
- var _config_imageMaxDimension, _config_imageQuality, _config_imageSizeThresholdBytes, targetSizeBytes, imageMaxDimension, imageQuality, imageSizeThresholdBytes, originalSizeBytes, pdfDoc, indirectObjects, imagesCompressed, imagesSkipped, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, ref, obj, candidate, compressedImage, err, outputBuffer, compressedSizeBytes, savedBytes, savedBuffer, result;
8701
+ var _config_imageMaxDimension, _config_imageQuality, _config_imageSizeThresholdBytes, targetSizeBytes, imageMaxDimension, imageQuality, imageSizeThresholdBytes, originalSizeBytes, pdfDoc, pageCount, indirectObjects, counters, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, ref, obj, err, outputBuffer, compressedSizeBytes, savedBytes, savedBuffer, result;
8702
8702
  return _ts_generator$5(this, function(_state) {
8703
8703
  switch(_state.label){
8704
8704
  case 0:
@@ -8716,111 +8716,72 @@ var DEFAULT_COMPRESS_PDF_IMAGE_SIZE_THRESHOLD_BYTES = 100 * 1024;
8716
8716
  ];
8717
8717
  case 1:
8718
8718
  pdfDoc = _state.sent();
8719
+ pageCount = pdfDoc.getPageCount();
8719
8720
  indirectObjects = pdfDoc.context.enumerateIndirectObjects();
8720
- imagesCompressed = 0;
8721
- imagesSkipped = 0;
8721
+ counters = {
8722
+ imagesCompressed: 0,
8723
+ imagesSkipped: 0,
8724
+ imageStreamCount: 0,
8725
+ imageStreamsByFilter: {}
8726
+ };
8722
8727
  _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
8723
8728
  _state.label = 2;
8724
8729
  case 2:
8725
8730
  _state.trys.push([
8726
8731
  2,
8727
- 9,
8728
- 10,
8729
- 11
8732
+ 7,
8733
+ 8,
8734
+ 9
8730
8735
  ]);
8731
8736
  _iterator = indirectObjects[Symbol.iterator]();
8732
8737
  _state.label = 3;
8733
8738
  case 3:
8734
8739
  if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
8735
8740
  3,
8736
- 8
8741
+ 6
8737
8742
  ];
8738
8743
  _step_value = _sliced_to_array$1(_step.value, 2), ref = _step_value[0], obj = _step_value[1];
8739
8744
  if (!_instanceof$1(obj, PDFRawStream)) {
8740
8745
  return [
8741
8746
  3,
8742
- 7
8743
- ];
8744
- }
8745
- candidate = isCompressibleImageStream(obj);
8746
- if (!candidate) {
8747
- return [
8748
- 3,
8749
- 7
8750
- ];
8751
- }
8752
- if (obj.contents.byteLength < imageSizeThresholdBytes) {
8753
- // tiny image — not worth recompressing
8754
- return [
8755
- 3,
8756
- 7
8747
+ 5
8757
8748
  ];
8758
8749
  }
8759
- _state.label = 4;
8760
- case 4:
8761
- _state.trys.push([
8762
- 4,
8763
- 6,
8764
- ,
8765
- 7
8766
- ]);
8767
8750
  return [
8768
8751
  4,
8769
- compressImageBufferToTargetSize(Buffer.from(obj.contents), {
8770
- targetSizeBytes: obj.contents.byteLength,
8771
- maxDimension: imageMaxDimension,
8772
- initialQuality: imageQuality,
8773
- format: 'jpeg'
8752
+ processPdfStream({
8753
+ pdfDoc: pdfDoc,
8754
+ ref: ref,
8755
+ obj: obj,
8756
+ counters: counters,
8757
+ imageMaxDimension: imageMaxDimension,
8758
+ imageQuality: imageQuality,
8759
+ imageSizeThresholdBytes: imageSizeThresholdBytes
8774
8760
  })
8775
8761
  ];
8776
- case 5:
8777
- compressedImage = _state.sent();
8778
- if (compressedImage.compressedSizeBytes >= obj.contents.byteLength) {
8779
- // no gain — leave it alone
8780
- return [
8781
- 3,
8782
- 7
8783
- ];
8784
- }
8785
- replaceImageStream({
8786
- pdfDoc: pdfDoc,
8787
- ref: ref,
8788
- newImageBytes: compressedImage.buffer,
8789
- newWidth: compressedImage.finalWidth,
8790
- newHeight: compressedImage.finalHeight
8791
- });
8792
- imagesCompressed += 1;
8793
- return [
8794
- 3,
8795
- 7
8796
- ];
8797
- case 6:
8762
+ case 4:
8798
8763
  _state.sent();
8799
- imagesSkipped += 1;
8800
- return [
8801
- 3,
8802
- 7
8803
- ];
8804
- case 7:
8764
+ _state.label = 5;
8765
+ case 5:
8805
8766
  _iteratorNormalCompletion = true;
8806
8767
  return [
8807
8768
  3,
8808
8769
  3
8809
8770
  ];
8810
- case 8:
8771
+ case 6:
8811
8772
  return [
8812
8773
  3,
8813
- 11
8774
+ 9
8814
8775
  ];
8815
- case 9:
8776
+ case 7:
8816
8777
  err = _state.sent();
8817
8778
  _didIteratorError = true;
8818
8779
  _iteratorError = err;
8819
8780
  return [
8820
8781
  3,
8821
- 11
8782
+ 9
8822
8783
  ];
8823
- case 10:
8784
+ case 8:
8824
8785
  try {
8825
8786
  if (!_iteratorNormalCompletion && _iterator.return != null) {
8826
8787
  _iterator.return();
@@ -8833,12 +8794,12 @@ var DEFAULT_COMPRESS_PDF_IMAGE_SIZE_THRESHOLD_BYTES = 100 * 1024;
8833
8794
  return [
8834
8795
  7
8835
8796
  ];
8836
- case 11:
8797
+ case 9:
8837
8798
  outputBuffer = input;
8838
8799
  compressedSizeBytes = originalSizeBytes;
8839
- if (!(imagesCompressed > 0)) return [
8800
+ if (!(counters.imagesCompressed > 0)) return [
8840
8801
  3,
8841
- 13
8802
+ 11
8842
8803
  ];
8843
8804
  return [
8844
8805
  4,
@@ -8846,22 +8807,25 @@ var DEFAULT_COMPRESS_PDF_IMAGE_SIZE_THRESHOLD_BYTES = 100 * 1024;
8846
8807
  useObjectStreams: true
8847
8808
  })
8848
8809
  ];
8849
- case 12:
8810
+ case 10:
8850
8811
  savedBytes = _state.sent();
8851
8812
  savedBuffer = Buffer.from(savedBytes);
8852
8813
  if (savedBuffer.byteLength < originalSizeBytes) {
8853
8814
  outputBuffer = savedBuffer;
8854
8815
  compressedSizeBytes = savedBuffer.byteLength;
8855
8816
  }
8856
- _state.label = 13;
8857
- case 13:
8817
+ _state.label = 11;
8818
+ case 11:
8858
8819
  result = {
8859
8820
  buffer: outputBuffer,
8860
8821
  originalSizeBytes: originalSizeBytes,
8861
8822
  compressedSizeBytes: compressedSizeBytes,
8862
- imagesCompressed: imagesCompressed,
8863
- imagesSkipped: imagesSkipped,
8864
- hitTarget: compressedSizeBytes <= targetSizeBytes
8823
+ imagesCompressed: counters.imagesCompressed,
8824
+ imagesSkipped: counters.imagesSkipped,
8825
+ hitTarget: compressedSizeBytes <= targetSizeBytes,
8826
+ pageCount: pageCount,
8827
+ imageStreamCount: counters.imageStreamCount,
8828
+ imageStreamsByFilter: counters.imageStreamsByFilter
8865
8829
  };
8866
8830
  return [
8867
8831
  2,
@@ -8871,6 +8835,109 @@ var DEFAULT_COMPRESS_PDF_IMAGE_SIZE_THRESHOLD_BYTES = 100 * 1024;
8871
8835
  });
8872
8836
  })();
8873
8837
  }
8838
+ function processPdfStream(input) {
8839
+ return _async_to_generator$5(function() {
8840
+ var pdfDoc, ref, obj, counters, imageMaxDimension, imageQuality, imageSizeThresholdBytes, _counters_imageStreamsByFilter_filterKey, filterKey, compressedImage;
8841
+ return _ts_generator$5(this, function(_state) {
8842
+ switch(_state.label){
8843
+ case 0:
8844
+ pdfDoc = input.pdfDoc, ref = input.ref, obj = input.obj, counters = input.counters, imageMaxDimension = input.imageMaxDimension, imageQuality = input.imageQuality, imageSizeThresholdBytes = input.imageSizeThresholdBytes;
8845
+ if (isImageStream(obj)) {
8846
+ counters.imageStreamCount += 1;
8847
+ filterKey = imageStreamFilterKey(obj);
8848
+ counters.imageStreamsByFilter[filterKey] = ((_counters_imageStreamsByFilter_filterKey = counters.imageStreamsByFilter[filterKey]) !== null && _counters_imageStreamsByFilter_filterKey !== void 0 ? _counters_imageStreamsByFilter_filterKey : 0) + 1;
8849
+ }
8850
+ if (!isCompressibleImageStream(obj)) {
8851
+ return [
8852
+ 2
8853
+ ];
8854
+ }
8855
+ if (obj.contents.byteLength < imageSizeThresholdBytes) {
8856
+ return [
8857
+ 2
8858
+ ]; // tiny image — not worth recompressing
8859
+ }
8860
+ _state.label = 1;
8861
+ case 1:
8862
+ _state.trys.push([
8863
+ 1,
8864
+ 3,
8865
+ ,
8866
+ 4
8867
+ ]);
8868
+ return [
8869
+ 4,
8870
+ compressImageBufferToTargetSize(Buffer.from(obj.contents), {
8871
+ targetSizeBytes: obj.contents.byteLength,
8872
+ maxDimension: imageMaxDimension,
8873
+ initialQuality: imageQuality,
8874
+ format: 'jpeg'
8875
+ })
8876
+ ];
8877
+ case 2:
8878
+ compressedImage = _state.sent();
8879
+ if (compressedImage.compressedSizeBytes >= obj.contents.byteLength) {
8880
+ return [
8881
+ 2
8882
+ ]; // no gain — leave it alone
8883
+ }
8884
+ replaceImageStream({
8885
+ pdfDoc: pdfDoc,
8886
+ ref: ref,
8887
+ newImageBytes: compressedImage.buffer,
8888
+ newWidth: compressedImage.finalWidth,
8889
+ newHeight: compressedImage.finalHeight
8890
+ });
8891
+ counters.imagesCompressed += 1;
8892
+ return [
8893
+ 3,
8894
+ 4
8895
+ ];
8896
+ case 3:
8897
+ _state.sent();
8898
+ counters.imagesSkipped += 1;
8899
+ return [
8900
+ 3,
8901
+ 4
8902
+ ];
8903
+ case 4:
8904
+ return [
8905
+ 2
8906
+ ];
8907
+ }
8908
+ });
8909
+ })();
8910
+ }
8911
+ function isImageStream(stream) {
8912
+ var dict = stream.dict;
8913
+ var type = dict.get(PDF_NAME_TYPE);
8914
+ var typeOk = type === undefined || pdfNameEquals(type, PDF_NAME_XOBJECT);
8915
+ var result = false;
8916
+ if (typeOk) {
8917
+ var subtype = dict.get(PDF_NAME_SUBTYPE);
8918
+ result = subtype !== undefined && pdfNameEquals(subtype, PDF_NAME_IMAGE);
8919
+ }
8920
+ return result;
8921
+ }
8922
+ function imageStreamFilterKey(stream) {
8923
+ var filter = stream.dict.get(PDF_NAME_FILTER);
8924
+ var result;
8925
+ if (filter === undefined) {
8926
+ result = 'none';
8927
+ } else if (_instanceof$1(filter, PDFArray)) {
8928
+ result = filter.asArray().map(function(entry) {
8929
+ return _instanceof$1(entry, PDFName) ? stripPdfNameSlash(entry.asString()) : 'unknown';
8930
+ }).join('+');
8931
+ } else if (_instanceof$1(filter, PDFName)) {
8932
+ result = stripPdfNameSlash(filter.asString());
8933
+ } else {
8934
+ result = 'unknown';
8935
+ }
8936
+ return result;
8937
+ }
8938
+ function stripPdfNameSlash(name) {
8939
+ return name.startsWith('/') ? name.slice(1) : name;
8940
+ }
8874
8941
  var PDF_NAME_TYPE = PDFName.of('Type');
8875
8942
  var PDF_NAME_XOBJECT = PDFName.of('XObject');
8876
8943
  var PDF_NAME_SUBTYPE = PDFName.of('Subtype');
@@ -9069,7 +9136,7 @@ function replaceImageStream(input) {
9069
9136
  });
9070
9137
  }
9071
9138
 
9072
- function _array_like_to_array$2(arr, len) {
9139
+ function _array_like_to_array$3(arr, len) {
9073
9140
  if (len == null || len > arr.length) len = arr.length;
9074
9141
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
9075
9142
  return arr2;
@@ -9111,7 +9178,7 @@ function _class_call_check$2(instance, Constructor) {
9111
9178
  throw new TypeError("Cannot call a class as a function");
9112
9179
  }
9113
9180
  }
9114
- function _define_property$4(obj, key, value) {
9181
+ function _define_property$5(obj, key, value) {
9115
9182
  if (key in obj) {
9116
9183
  Object.defineProperty(obj, key, {
9117
9184
  value: value,
@@ -9159,7 +9226,7 @@ function _iterable_to_array_limit(arr, i) {
9159
9226
  function _non_iterable_rest() {
9160
9227
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
9161
9228
  }
9162
- function _object_spread$4(target) {
9229
+ function _object_spread$5(target) {
9163
9230
  for(var i = 1; i < arguments.length; i++){
9164
9231
  var source = arguments[i] != null ? arguments[i] : {};
9165
9232
  var ownKeys = Object.keys(source);
@@ -9169,12 +9236,12 @@ function _object_spread$4(target) {
9169
9236
  }));
9170
9237
  }
9171
9238
  ownKeys.forEach(function(key) {
9172
- _define_property$4(target, key, source[key]);
9239
+ _define_property$5(target, key, source[key]);
9173
9240
  });
9174
9241
  }
9175
9242
  return target;
9176
9243
  }
9177
- function ownKeys$4(object, enumerableOnly) {
9244
+ function ownKeys$5(object, enumerableOnly) {
9178
9245
  var keys = Object.keys(object);
9179
9246
  if (Object.getOwnPropertySymbols) {
9180
9247
  var symbols = Object.getOwnPropertySymbols(object);
@@ -9182,27 +9249,27 @@ function ownKeys$4(object, enumerableOnly) {
9182
9249
  }
9183
9250
  return keys;
9184
9251
  }
9185
- function _object_spread_props$4(target, source) {
9252
+ function _object_spread_props$5(target, source) {
9186
9253
  source = source != null ? source : {};
9187
9254
  if (Object.getOwnPropertyDescriptors) {
9188
9255
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
9189
9256
  } else {
9190
- ownKeys$4(Object(source)).forEach(function(key) {
9257
+ ownKeys$5(Object(source)).forEach(function(key) {
9191
9258
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
9192
9259
  });
9193
9260
  }
9194
9261
  return target;
9195
9262
  }
9196
9263
  function _sliced_to_array(arr, i) {
9197
- return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest();
9264
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest();
9198
9265
  }
9199
- function _unsupported_iterable_to_array$2(o, minLen) {
9266
+ function _unsupported_iterable_to_array$3(o, minLen) {
9200
9267
  if (!o) return;
9201
- if (typeof o === "string") return _array_like_to_array$2(o, minLen);
9268
+ if (typeof o === "string") return _array_like_to_array$3(o, minLen);
9202
9269
  var n = Object.prototype.toString.call(o).slice(8, -1);
9203
9270
  if (n === "Object" && o.constructor) n = o.constructor.name;
9204
9271
  if (n === "Map" || n === "Set") return Array.from(n);
9205
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
9272
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
9206
9273
  }
9207
9274
  function _ts_generator$4(thisArg, body) {
9208
9275
  var f, y, t, _ = {
@@ -9346,6 +9413,7 @@ function _ts_generator$4(thisArg, body) {
9346
9413
  */ function storageFileServerActions(context) {
9347
9414
  return {
9348
9415
  createStorageFile: createStorageFileFactory(context),
9416
+ createStorageFileSignedUploadUrl: createStorageFileSignedUploadUrlFactory(context),
9349
9417
  initializeAllStorageFilesFromUploads: initializeAllStorageFilesFromUploadsFactory(context),
9350
9418
  initializeStorageFileFromUpload: initializeStorageFileFromUploadFactory(context),
9351
9419
  updateStorageFile: updateStorageFileFactory(context),
@@ -9394,6 +9462,152 @@ function _ts_generator$4(thisArg, body) {
9394
9462
  })();
9395
9463
  });
9396
9464
  }
9465
+ // Filenames must not contain slashes, spaces, or `..` parent-path segments.
9466
+ var _SIGNED_UPLOAD_URL_FILENAME_DISALLOWED_PATTERN = /[\\/ ]|\.{2}/;
9467
+ function _sanitizeSignedUploadUrlFilenameOrThrow(filename) {
9468
+ var trimmed = filename.trim();
9469
+ if (trimmed.length === 0 || trimmed.length > CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MAX_FILENAME_LENGTH) {
9470
+ throw badRequestError({
9471
+ message: 'filename has invalid length',
9472
+ code: 'INVALID_FILENAME'
9473
+ });
9474
+ }
9475
+ if (_SIGNED_UPLOAD_URL_FILENAME_DISALLOWED_PATTERN.test(trimmed)) {
9476
+ throw badRequestError({
9477
+ message: 'filename contains disallowed characters',
9478
+ code: 'INVALID_FILENAME'
9479
+ });
9480
+ }
9481
+ return trimmed.normalize('NFC');
9482
+ }
9483
+ function _clampSignedUploadUrlExpiresInMs(input) {
9484
+ var candidate = input !== null && input !== void 0 ? input : DEFAULT_CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_EXPIRES_IN_MS;
9485
+ return Math.min(Math.max(candidate, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MIN_EXPIRES_IN_MS), CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MAX_EXPIRES_IN_MS);
9486
+ }
9487
+ function _resolveSignedUploadUrlPolicyOrThrow(policies, purpose) {
9488
+ var policy = policies.find(function(p) {
9489
+ return p.purpose === purpose;
9490
+ });
9491
+ if (!policy) {
9492
+ throw badRequestError({
9493
+ message: 'purpose "'.concat(purpose, '" does not support signed upload URLs'),
9494
+ code: 'UNKNOWN_PURPOSE'
9495
+ });
9496
+ }
9497
+ return policy;
9498
+ }
9499
+ function _assertSignedUploadUrlContentTypeAllowed(policy, contentType) {
9500
+ if (!policy.allowedMimeTypes.includes(contentType)) {
9501
+ throw badRequestError({
9502
+ message: 'content-type "'.concat(contentType, '" is not allowed for purpose "').concat(policy.purpose, '"'),
9503
+ code: 'INVALID_CONTENT_TYPE'
9504
+ });
9505
+ }
9506
+ }
9507
+ function _assertSignedUploadUrlFileSizeAllowed(policy, fileSizeBytes) {
9508
+ if (fileSizeBytes > policy.maxFileSizeBytes) {
9509
+ throw badRequestError({
9510
+ message: "fileSizeBytes ".concat(fileSizeBytes, " exceeds policy max ").concat(policy.maxFileSizeBytes, ' for purpose "').concat(policy.purpose, '"'),
9511
+ code: 'FILE_TOO_LARGE'
9512
+ });
9513
+ }
9514
+ }
9515
+ function _resolveSignedUploadUrlFilenameOrThrow(policy, filename) {
9516
+ var resolved;
9517
+ if (policy.requiresFilenameInput) {
9518
+ if (!filename) {
9519
+ throw badRequestError({
9520
+ message: 'filename is required for purpose "'.concat(policy.purpose, '"'),
9521
+ code: 'MISSING_FILENAME'
9522
+ });
9523
+ }
9524
+ resolved = _sanitizeSignedUploadUrlFilenameOrThrow(filename);
9525
+ }
9526
+ return resolved;
9527
+ }
9528
+ /**
9529
+ * Factory for the `createStorageFileSignedUploadUrl` action.
9530
+ *
9531
+ * Issues a short-lived, content-type-pinned signed PUT URL into the caller's
9532
+ * `/uploads/u/{uid}/...` namespace. The path, content-type, and size cap are
9533
+ * derived from the per-purpose policy resolved from the
9534
+ * `storageFileSignedUploadPolicies` registry on the context, so the URL can
9535
+ * only write to a location that both `storage.rules` and the
9536
+ * `StorageFileInitializeFromUploadService` initializer accept.
9537
+ *
9538
+ * Minting a URL does NOT create a StorageFile document — `result.modelKeys` is
9539
+ * always empty. The document is created later by the upload-complete pipeline.
9540
+ *
9541
+ * @param context - The storage file server actions context. Must carry
9542
+ * `storageFileSignedUploadPolicies` — the list of `StorageFilePurposeUploadPolicy` entries to resolve by purpose.
9543
+ * @returns An async transform-and-validate function whose inner stage takes
9544
+ * `{ uid }` (the authenticated user) and returns the signed-upload-url
9545
+ * payload.
9546
+ */ function createStorageFileSignedUploadUrlFactory(context) {
9547
+ var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, storageService = context.storageService, storageFileSignedUploadPolicies = context.storageFileSignedUploadPolicies;
9548
+ return firebaseServerActionTransformFunctionFactory(createStorageFileSignedUploadUrlParamsType, function(params) {
9549
+ return _async_to_generator$4(function() {
9550
+ var policy, filename, expiresInMs, contentType;
9551
+ return _ts_generator$4(this, function(_state) {
9552
+ policy = _resolveSignedUploadUrlPolicyOrThrow(storageFileSignedUploadPolicies, params.purpose);
9553
+ _assertSignedUploadUrlContentTypeAllowed(policy, params.contentType);
9554
+ _assertSignedUploadUrlFileSizeAllowed(policy, params.fileSizeBytes);
9555
+ filename = _resolveSignedUploadUrlFilenameOrThrow(policy, params.filename);
9556
+ expiresInMs = _clampSignedUploadUrlExpiresInMs(params.expiresInMs);
9557
+ contentType = params.contentType;
9558
+ return [
9559
+ 2,
9560
+ function(param) {
9561
+ var uid = param.uid;
9562
+ return _async_to_generator$4(function() {
9563
+ var pathString, expiresAtDate, file, uploadUrl;
9564
+ return _ts_generator$4(this, function(_state) {
9565
+ switch(_state.label){
9566
+ case 0:
9567
+ pathString = policy.buildUploadPath({
9568
+ uid: uid,
9569
+ filename: filename
9570
+ });
9571
+ expiresAtDate = addMilliseconds(new Date(), expiresInMs);
9572
+ file = storageService.file({
9573
+ pathString: pathString
9574
+ });
9575
+ if (!file.getSignedUrl) {
9576
+ throw internalServerError('Signed url function appears to not be available.');
9577
+ }
9578
+ return [
9579
+ 4,
9580
+ file.getSignedUrl({
9581
+ action: 'write',
9582
+ expiresIn: expiresInMs,
9583
+ contentType: contentType
9584
+ })
9585
+ ];
9586
+ case 1:
9587
+ uploadUrl = _state.sent();
9588
+ return [
9589
+ 2,
9590
+ {
9591
+ modelKeys: [],
9592
+ uploadUrl: uploadUrl,
9593
+ uploadPath: pathString,
9594
+ expiresAt: expiresAtDate.getTime(),
9595
+ requiredHeaders: {
9596
+ 'content-type': contentType
9597
+ },
9598
+ maxFileSizeBytes: policy.maxFileSizeBytes,
9599
+ purpose: policy.purpose
9600
+ }
9601
+ ];
9602
+ }
9603
+ });
9604
+ })();
9605
+ }
9606
+ ];
9607
+ });
9608
+ })();
9609
+ });
9610
+ }
9397
9611
  /**
9398
9612
  * Factory for the `initializeAllStorageFilesFromUploads` action.
9399
9613
  *
@@ -9894,7 +10108,7 @@ function _ts_generator$4(thisArg, body) {
9894
10108
  },
9895
10109
  merge: function merge(existing, update) {
9896
10110
  var n = update.n === undefined ? existing.n : update.n;
9897
- return _object_spread_props$4(_object_spread$4({}, existing), {
10111
+ return _object_spread_props$5(_object_spread$5({}, existing), {
9898
10112
  n: n
9899
10113
  });
9900
10114
  }
@@ -10831,7 +11045,7 @@ function _ts_generator$4(thisArg, body) {
10831
11045
  inputNow = params.now, skipCreate = params.skipCreate, template = params.template;
10832
11046
  now = inputNow !== null && inputNow !== void 0 ? inputNow : new Date();
10833
11047
  storageFileGroupDocument = loadStorageFileGroupDocumentForReferencePair(params, storageFileGroupCollection.documentAccessorForTransaction(transaction));
10834
- storageFileGroupTemplate = _object_spread$4({
11048
+ storageFileGroupTemplate = _object_spread$5({
10835
11049
  o: firestoreDummyKey(),
10836
11050
  cat: now,
10837
11051
  s: true,
@@ -11553,7 +11767,7 @@ function _class_call_check$1(instance, Constructor) {
11553
11767
  throw new TypeError("Cannot call a class as a function");
11554
11768
  }
11555
11769
  }
11556
- function _define_property$3(obj, key, value) {
11770
+ function _define_property$4(obj, key, value) {
11557
11771
  if (key in obj) {
11558
11772
  Object.defineProperty(obj, key, {
11559
11773
  value: value,
@@ -11566,7 +11780,7 @@ function _define_property$3(obj, key, value) {
11566
11780
  }
11567
11781
  return obj;
11568
11782
  }
11569
- function _object_spread$3(target) {
11783
+ function _object_spread$4(target) {
11570
11784
  for(var i = 1; i < arguments.length; i++){
11571
11785
  var source = arguments[i] != null ? arguments[i] : {};
11572
11786
  var ownKeys = Object.keys(source);
@@ -11576,12 +11790,12 @@ function _object_spread$3(target) {
11576
11790
  }));
11577
11791
  }
11578
11792
  ownKeys.forEach(function(key) {
11579
- _define_property$3(target, key, source[key]);
11793
+ _define_property$4(target, key, source[key]);
11580
11794
  });
11581
11795
  }
11582
11796
  return target;
11583
11797
  }
11584
- function ownKeys$3(object, enumerableOnly) {
11798
+ function ownKeys$4(object, enumerableOnly) {
11585
11799
  var keys = Object.keys(object);
11586
11800
  if (Object.getOwnPropertySymbols) {
11587
11801
  var symbols = Object.getOwnPropertySymbols(object);
@@ -11589,12 +11803,12 @@ function ownKeys$3(object, enumerableOnly) {
11589
11803
  }
11590
11804
  return keys;
11591
11805
  }
11592
- function _object_spread_props$3(target, source) {
11806
+ function _object_spread_props$4(target, source) {
11593
11807
  source = source != null ? source : {};
11594
11808
  if (Object.getOwnPropertyDescriptors) {
11595
11809
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
11596
11810
  } else {
11597
- ownKeys$3(Object(source)).forEach(function(key) {
11811
+ ownKeys$4(Object(source)).forEach(function(key) {
11598
11812
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
11599
11813
  });
11600
11814
  }
@@ -11802,7 +12016,7 @@ var MAKE_TEMPLATE_FOR_STORAGEFILE_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_R
11802
12016
  initialized = true;
11803
12017
  return [
11804
12018
  4,
11805
- documentInTransaction.update(_object_spread_props$3(_object_spread$3({}, template), {
12019
+ documentInTransaction.update(_object_spread_props$4(_object_spread$4({}, template), {
11806
12020
  m: undefined,
11807
12021
  s: null,
11808
12022
  fi: false // set false
@@ -12054,6 +12268,148 @@ var MAKE_TEMPLATE_FOR_STORAGEFILE_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_R
12054
12268
  });
12055
12269
  }
12056
12270
 
12271
+ function _array_like_to_array$2(arr, len) {
12272
+ if (len == null || len > arr.length) len = arr.length;
12273
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
12274
+ return arr2;
12275
+ }
12276
+ function _array_without_holes$2(arr) {
12277
+ if (Array.isArray(arr)) return _array_like_to_array$2(arr);
12278
+ }
12279
+ function _define_property$3(obj, key, value) {
12280
+ if (key in obj) {
12281
+ Object.defineProperty(obj, key, {
12282
+ value: value,
12283
+ enumerable: true,
12284
+ configurable: true,
12285
+ writable: true
12286
+ });
12287
+ } else {
12288
+ obj[key] = value;
12289
+ }
12290
+ return obj;
12291
+ }
12292
+ function _iterable_to_array$2(iter) {
12293
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
12294
+ }
12295
+ function _non_iterable_spread$2() {
12296
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
12297
+ }
12298
+ function _object_spread$3(target) {
12299
+ for(var i = 1; i < arguments.length; i++){
12300
+ var source = arguments[i] != null ? arguments[i] : {};
12301
+ var ownKeys = Object.keys(source);
12302
+ if (typeof Object.getOwnPropertySymbols === "function") {
12303
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
12304
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
12305
+ }));
12306
+ }
12307
+ ownKeys.forEach(function(key) {
12308
+ _define_property$3(target, key, source[key]);
12309
+ });
12310
+ }
12311
+ return target;
12312
+ }
12313
+ function ownKeys$3(object, enumerableOnly) {
12314
+ var keys = Object.keys(object);
12315
+ if (Object.getOwnPropertySymbols) {
12316
+ var symbols = Object.getOwnPropertySymbols(object);
12317
+ keys.push.apply(keys, symbols);
12318
+ }
12319
+ return keys;
12320
+ }
12321
+ function _object_spread_props$3(target, source) {
12322
+ source = source != null ? source : {};
12323
+ if (Object.getOwnPropertyDescriptors) {
12324
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
12325
+ } else {
12326
+ ownKeys$3(Object(source)).forEach(function(key) {
12327
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
12328
+ });
12329
+ }
12330
+ return target;
12331
+ }
12332
+ function _to_consumable_array$2(arr) {
12333
+ return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread$2();
12334
+ }
12335
+ function _type_of$1(obj) {
12336
+ "@swc/helpers - typeof";
12337
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
12338
+ }
12339
+ function _unsupported_iterable_to_array$2(o, minLen) {
12340
+ if (!o) return;
12341
+ if (typeof o === "string") return _array_like_to_array$2(o, minLen);
12342
+ var n = Object.prototype.toString.call(o).slice(8, -1);
12343
+ if (n === "Object" && o.constructor) n = o.constructor.name;
12344
+ if (n === "Map" || n === "Set") return Array.from(n);
12345
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
12346
+ }
12347
+ /**
12348
+ * Builds the {@link McpToolDetailsBuilder} that customizes the MCP tool description and
12349
+ * input schema for the `storageFileCreateSignedUploadUrl` create-function.
12350
+ *
12351
+ * The factory captures the policy list once at wiring time; the returned builder is a pure
12352
+ * synchronous function called by the framework on every `tools/list` request.
12353
+ *
12354
+ * @param config - Factory config containing the upload policies that drive the description and `purpose` enum.
12355
+ * @returns A builder that emits the policy-aware tool description and an input schema with the `purpose` enum constrained to the configured purposes.
12356
+ *
12357
+ * @example
12358
+ * ```ts
12359
+ * const toolDetails = storageFileCreateSignedUploadUrlToolDetailsFactory({
12360
+ * policies: STORAGE_FILE_PURPOSE_UPLOAD_POLICIES
12361
+ * });
12362
+ * ```
12363
+ *
12364
+ * @__NO_SIDE_EFFECTS__
12365
+ */ function storageFileCreateSignedUploadUrlToolDetailsFactory(config) {
12366
+ var policies = config.policies;
12367
+ var purposeKeys = policies.map(function(policy) {
12368
+ return policy.purpose;
12369
+ });
12370
+ var description = buildUploadPolicyPurposeDescription(policies);
12371
+ return function(param) {
12372
+ var defaultInputSchema = param.defaultInputSchema;
12373
+ return {
12374
+ description: description,
12375
+ inputSchema: enrichSignedUploadUrlInputSchema(defaultInputSchema, purposeKeys)
12376
+ };
12377
+ };
12378
+ }
12379
+ function formatUploadPolicyMaxFileSize(maxFileSizeBytes) {
12380
+ var mib = maxFileSizeBytes / (1024 * 1024);
12381
+ return Number.isInteger(mib) ? "".concat(mib, " MiB") : "".concat(mib.toFixed(1), " MiB");
12382
+ }
12383
+ function buildUploadPolicyPurposeDescription(policies) {
12384
+ var lines = policies.map(function(policy) {
12385
+ var filenameNote = policy.requiresFilenameInput ? 'filename required' : 'filename derived from uid';
12386
+ return ' - "'.concat(policy.purpose, '": content-types ').concat(policy.allowedMimeTypes.join(', '), "; max ").concat(formatUploadPolicyMaxFileSize(policy.maxFileSizeBytes), "; ").concat(filenameNote);
12387
+ });
12388
+ return 'Issues a short-lived, content-type-pinned signed PUT URL for a StorageFile upload. The URL writes to "/uploads/u/{uid}/..." where the path, content-type, and size cap are pinned by the chosen purpose. PUT the bytes with a matching Content-Type header; the existing upload initializer then promotes the file to a StorageFile document.\n\nAllowed purposes:\n'.concat(lines.join('\n'));
12389
+ }
12390
+ function enrichSignedUploadUrlInputSchema(defaultInputSchema, purposeKeys) {
12391
+ var result = defaultInputSchema !== null && defaultInputSchema !== void 0 ? defaultInputSchema : undefined;
12392
+ if (defaultInputSchema != null && (typeof defaultInputSchema === "undefined" ? "undefined" : _type_of$1(defaultInputSchema)) === 'object') {
12393
+ var _base_properties;
12394
+ var base = defaultInputSchema;
12395
+ var purposeProperty = (_base_properties = base.properties) === null || _base_properties === void 0 ? void 0 : _base_properties.purpose;
12396
+ if (purposeProperty != null && (typeof purposeProperty === "undefined" ? "undefined" : _type_of$1(purposeProperty)) === 'object') {
12397
+ var quotedPurposes = purposeKeys.map(function(purpose) {
12398
+ return '"'.concat(purpose, '"');
12399
+ }).join(', ');
12400
+ result = _object_spread_props$3(_object_spread$3({}, base), {
12401
+ properties: _object_spread_props$3(_object_spread$3({}, base.properties), {
12402
+ purpose: _object_spread_props$3(_object_spread$3({}, purposeProperty), {
12403
+ enum: _to_consumable_array$2(purposeKeys),
12404
+ description: "One of: ".concat(quotedPurposes, ".")
12405
+ })
12406
+ })
12407
+ });
12408
+ }
12409
+ }
12410
+ return result;
12411
+ }
12412
+
12057
12413
  function _class_call_check(instance, Constructor) {
12058
12414
  if (!(instance instanceof Constructor)) {
12059
12415
  throw new TypeError("Cannot call a class as a function");
@@ -12143,17 +12499,26 @@ function _unsupported_iterable_to_array$1(o, minLen) {
12143
12499
  if (n === "Map" || n === "Set") return Array.from(n);
12144
12500
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
12145
12501
  }
12502
+ /**
12503
+ * NestJS injection token for the per-purpose `StorageFilePurposeUploadPolicy[]`
12504
+ * registry that the `createStorageFileSignedUploadUrl` factory consults.
12505
+ *
12506
+ * Apps bind this token via {@link appStorageFileModuleMetadata} by passing
12507
+ * `storageFileSignedUploadPolicies` in {@link ProvideAppStorageFileMetadataConfig}.
12508
+ */ var STORAGE_FILE_SIGNED_UPLOAD_POLICIES_TOKEN = 'STORAGE_FILE_SIGNED_UPLOAD_POLICIES';
12146
12509
  // MARK: Provider Factories
12147
12510
  /**
12148
12511
  * Factory that assembles the full {@link StorageFileServerActionsContext} by combining
12149
- * the base context with the upload initialization service.
12512
+ * the base context with the upload initialization service and the signed-upload policy registry.
12150
12513
  *
12151
12514
  * @param context - The base server actions context providing Firebase infrastructure.
12152
12515
  * @param storageFileInitializeFromUploadService - The service for initializing storage files from uploads.
12516
+ * @param storageFileSignedUploadPolicies - The per-purpose upload policy registry consulted by `createStorageFileSignedUploadUrl`.
12153
12517
  * @returns The fully assembled StorageFileServerActionsContext.
12154
- */ function storageFileServerActionsContextFactory(context, storageFileInitializeFromUploadService) {
12518
+ */ function storageFileServerActionsContextFactory(context, storageFileInitializeFromUploadService, storageFileSignedUploadPolicies) {
12155
12519
  return _object_spread_props$2(_object_spread$2({}, context), {
12156
- storageFileInitializeFromUploadService: storageFileInitializeFromUploadService
12520
+ storageFileInitializeFromUploadService: storageFileInitializeFromUploadService,
12521
+ storageFileSignedUploadPolicies: storageFileSignedUploadPolicies
12157
12522
  });
12158
12523
  }
12159
12524
  /**
@@ -12187,7 +12552,7 @@ function _unsupported_iterable_to_array$1(o, minLen) {
12187
12552
  * @param config - The module configuration including optional dependency module, imports, exports, and providers.
12188
12553
  * @returns The assembled {@link ModuleMetadata} for the storage file module.
12189
12554
  */ function appStorageFileModuleMetadata(config) {
12190
- var dependencyModule = config.dependencyModule, imports = config.imports, exports = config.exports, providers = config.providers;
12555
+ var dependencyModule = config.dependencyModule, imports = config.imports, exports = config.exports, providers = config.providers, storageFileSignedUploadPolicies = config.storageFileSignedUploadPolicies;
12191
12556
  var dependencyModuleImport = dependencyModule ? [
12192
12557
  dependencyModule
12193
12558
  ] : [];
@@ -12201,12 +12566,17 @@ function _unsupported_iterable_to_array$1(o, minLen) {
12201
12566
  StorageFileInitServerActions
12202
12567
  ].concat(_to_consumable_array$1(exports !== null && exports !== void 0 ? exports : [])),
12203
12568
  providers: [
12569
+ {
12570
+ provide: STORAGE_FILE_SIGNED_UPLOAD_POLICIES_TOKEN,
12571
+ useValue: storageFileSignedUploadPolicies
12572
+ },
12204
12573
  {
12205
12574
  provide: STORAGE_FILE_SERVER_ACTION_CONTEXT_TOKEN,
12206
12575
  useFactory: storageFileServerActionsContextFactory,
12207
12576
  inject: [
12208
12577
  BASE_STORAGE_FILE_SERVER_ACTION_CONTEXT_TOKEN,
12209
- StorageFileInitializeFromUploadService
12578
+ StorageFileInitializeFromUploadService,
12579
+ STORAGE_FILE_SIGNED_UPLOAD_POLICIES_TOKEN
12210
12580
  ]
12211
12581
  },
12212
12582
  {
@@ -13666,4 +14036,4 @@ function _ts_generator(thisArg, body) {
13666
14036
  };
13667
14037
  }
13668
14038
 
13669
- export { AbstractAppNotificationModule, BASE_NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, BASE_STORAGE_FILE_SERVER_ACTION_CONTEXT_TOKEN, DEFAULT_COMPRESS_IMAGE_FORMAT, DEFAULT_COMPRESS_IMAGE_INITIAL_QUALITY, DEFAULT_COMPRESS_IMAGE_MAX_DIMENSION, DEFAULT_COMPRESS_IMAGE_MIN_QUALITY, DEFAULT_COMPRESS_IMAGE_QUALITY_STEP, DEFAULT_COMPRESS_PDF_IMAGE_MAX_DIMENSION, DEFAULT_COMPRESS_PDF_IMAGE_QUALITY, DEFAULT_COMPRESS_PDF_IMAGE_SIZE_THRESHOLD_BYTES, DEFAULT_DOWNLOAD_MULTIPLE_STORAGE_FILES_MAX_PARALLEL_TASKS, DEFAULT_MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_MAX_BATCH_SIZE_PER_REQUEST, GlobalNotificationModule, KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY, MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE, MAKE_TEMPLATE_FOR_STORAGEFILE_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE, MutableNotificationExpediteService, NOTIFICATION_BOX_NOT_INITIALIZED_DELAY_MINUTES, NOTIFICATION_INIT_SERVER_ACTIONS_CONTEXT_CONFIG_TOKEN, NOTIFICATION_MAX_SEND_ATTEMPTS, NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, NOTIFICATION_TASK_MINIMUM_SET_AT_THROTTLE_TIME_MINUTES, NOTIFICATION_TASK_TYPE_FAILURE_DELAY_HOURS, NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS, NOTIFICATION_TASK_TYPE_MAX_SEND_ATTEMPTS, NOTIFICATION_TEMPLATE_SERVICE_CONFIGS_ARRAY_TOKEN, NOTIFICATION_TEMPLATE_SERVICE_DEFAULTS_OVERRIDE_TOKEN, NotificationExpediteService, NotificationInitServerActions, NotificationSendService, NotificationServerActions, NotificationTaskService, NotificationTaskSubTaskMissingRequiredDataTermination, NotificationTemplateService, SEND_QUEUE_NOTIFICATIONS_TASK_EXCESS_THRESHOLD, STORAGE_FILE_INIT_SERVER_ACTIONS_CONTEXT_CONFIG_TOKEN, STORAGE_FILE_SERVER_ACTION_CONTEXT_TOKEN, StorageFileInitServerActions, StorageFileInitializeFromUploadService, StorageFileServerActions, UNKNOWN_NOTIFICATION_TASK_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, UNKNOWN_NOTIFICATION_TASK_TYPE_HOURS_DELAY, UNKNOWN_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, UNKNOWN_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY, _initializeStorageFileFromUploadFileFactory, _processStorageFileInTransactionFactory, _syncStorageFileWithGroupsInTransactionFactory, allStorageFileGroupStorageFileProcessingPurposeSubtaskProcessors, appNotificationModuleMetadata, appStorageFileModuleMetadata, cleanupOldNotificationLoggedEventDaysFactory, cleanupSentNotificationsFactory, compressImageBufferToTargetSize, compressPdfImagesToTargetSize, createNotificationBoxFactory, createNotificationBoxInTransactionFactory, createNotificationIdRequiredError, createNotificationSummaryFactory, createNotificationUserFactory, createOrRunUniqueNotificationDocument, createStorageFileFactory, createStorageFileGroupFactory, createStorageFileGroupInTransactionFactory, createStorageFileGroupInputError, deleteAllQueuedStorageFilesFactory, deleteStorageFileFactory, downloadMultipleStorageFilesFactory, downloadStorageFileFactory, expandNotificationRecipients, exportMutableNotificationExpediteService, firestoreNotificationSummarySendService, ignoreSendNotificationTextSendService, initializeAllApplicableNotificationBoxesFactory, initializeAllApplicableNotificationSummariesFactory, initializeAllApplicableStorageFileGroupsFactory, initializeAllStorageFilesFromUploadsFactory, initializeNotificationBoxFactory, initializeNotificationBoxInTransactionFactory, initializeNotificationModelInTransaction, initializeNotificationSummaryFactory, initializeNotificationSummaryInTransactionFactory, initializeStorageFileFromUploadFactory, initializeStorageFileGroupFactory, initializeStorageFileGroupInTransactionFactory, initializeStorageFileModelInTransaction, mailgunNotificationEmailSendService, makeNewNotificationSummaryTemplate, markStorageFileForDeleteTemplate, notificationBoxDoesNotExist, notificationBoxExclusionTargetInvalidError, notificationBoxExistsForModelError, notificationBoxRecipientDoesNotExistsError, notificationBoxUnregistredModelTypeInitializationError, notificationExpediteServiceInstance, notificationInitServerActions, notificationInitServerActionsFactory, notificationModelAlreadyInitializedError, notificationServerActions, notificationServerActionsContextFactory, notificationServerActionsFactory, notificationTaskService, notificationTaskSubTaskMissingRequiredDataTermination, notificationTaskSubtaskNotificationTaskHandlerFactory, notificationTemplateServiceInstance, notificationUserBlockedFromBeingAddedToRecipientsError, notificationUserInvalidUidForCreateError, notificationUserLockedConfigFromBeingUpdatedError, processAllQueuedStorageFilesFactory, processStorageFileFactory, provideMutableNotificationExpediteService, queryAndFlagStorageFilesForDelete, regenerateAllFlaggedStorageFileGroupsContentFactory, regenerateStorageFileGroupContentFactory, resyncAllNotificationUsersFactory, resyncNotificationUserFactory, sendNotificationFactory, sendQueuedNotificationsFactory, storageFileAlreadyProcessedError, storageFileCannotBeDeletedYetError, storageFileGroupQueuedForInitializationError, storageFileGroupZipStorageFileProcessingPurposeSubtaskProcessor, storageFileInitServerActions, storageFileInitServerActionsFactory, storageFileInitializeFromUploadService, storageFileInitializeFromUploadServiceInitializerResultPermanentFailure, storageFileModelAlreadyInitializedError, storageFileNotFlaggedForDeletionError, storageFileNotFlaggedForGroupsSyncError, storageFileProcessingNotAllowedForInvalidStateError, storageFileProcessingNotAvailableForTypeError, storageFileProcessingNotQueuedForProcessingError, storageFileProcessingNotificationTaskHandler, storageFileProcessingNotificationTaskHandlerDefaultCleanup, storageFileServerActions, storageFileServerActionsContextFactory, storageFileServerActionsFactory, syncAllFlaggedStorageFilesWithGroupsFactory, syncStorageFileWithGroupsFactory, updateNotificationBoxFactory, updateNotificationBoxRecipientExclusionInTransactionFactory, updateNotificationBoxRecipientFactory, updateNotificationBoxRecipientInTransactionFactory, updateNotificationSummaryFactory, updateNotificationUserFactory, updateNotificationUserNotificationBoxRecipientConfig, updateStorageFileFactory, updateStorageFileGroupFactory, uploadedFileDoesNotExistError, uploadedFileInitializationDiscardedError, uploadedFileInitializationFailedError, uploadedFileIsNotAllowedToBeInitializedError };
14039
+ export { AbstractAppNotificationModule, BASE_NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, BASE_STORAGE_FILE_SERVER_ACTION_CONTEXT_TOKEN, DEFAULT_COMPRESS_IMAGE_FORMAT, DEFAULT_COMPRESS_IMAGE_INITIAL_QUALITY, DEFAULT_COMPRESS_IMAGE_MAX_DIMENSION, DEFAULT_COMPRESS_IMAGE_MIN_QUALITY, DEFAULT_COMPRESS_IMAGE_QUALITY_STEP, DEFAULT_COMPRESS_PDF_IMAGE_MAX_DIMENSION, DEFAULT_COMPRESS_PDF_IMAGE_QUALITY, DEFAULT_COMPRESS_PDF_IMAGE_SIZE_THRESHOLD_BYTES, DEFAULT_DOWNLOAD_MULTIPLE_STORAGE_FILES_MAX_PARALLEL_TASKS, DEFAULT_MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_MAX_BATCH_SIZE_PER_REQUEST, GlobalNotificationModule, KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY, MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE, MAKE_TEMPLATE_FOR_STORAGEFILE_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE, MutableNotificationExpediteService, NOTIFICATION_BOX_NOT_INITIALIZED_DELAY_MINUTES, NOTIFICATION_INIT_SERVER_ACTIONS_CONTEXT_CONFIG_TOKEN, NOTIFICATION_MAX_SEND_ATTEMPTS, NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, NOTIFICATION_TASK_MINIMUM_SET_AT_THROTTLE_TIME_MINUTES, NOTIFICATION_TASK_TYPE_FAILURE_DELAY_HOURS, NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS, NOTIFICATION_TASK_TYPE_MAX_SEND_ATTEMPTS, NOTIFICATION_TEMPLATE_SERVICE_CONFIGS_ARRAY_TOKEN, NOTIFICATION_TEMPLATE_SERVICE_DEFAULTS_OVERRIDE_TOKEN, NotificationExpediteService, NotificationInitServerActions, NotificationSendService, NotificationServerActions, NotificationTaskService, NotificationTaskSubTaskMissingRequiredDataTermination, NotificationTemplateService, SEND_QUEUE_NOTIFICATIONS_TASK_EXCESS_THRESHOLD, STORAGE_FILE_INIT_SERVER_ACTIONS_CONTEXT_CONFIG_TOKEN, STORAGE_FILE_SERVER_ACTION_CONTEXT_TOKEN, STORAGE_FILE_SIGNED_UPLOAD_POLICIES_TOKEN, StorageFileInitServerActions, StorageFileInitializeFromUploadService, StorageFileServerActions, UNKNOWN_NOTIFICATION_TASK_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, UNKNOWN_NOTIFICATION_TASK_TYPE_HOURS_DELAY, UNKNOWN_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, UNKNOWN_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY, _initializeStorageFileFromUploadFileFactory, _processStorageFileInTransactionFactory, _syncStorageFileWithGroupsInTransactionFactory, allStorageFileGroupStorageFileProcessingPurposeSubtaskProcessors, appNotificationModuleMetadata, appStorageFileModuleMetadata, cleanupOldNotificationLoggedEventDaysFactory, cleanupSentNotificationsFactory, compressImageBufferToTargetSize, compressPdfImagesToTargetSize, createNotificationBoxFactory, createNotificationBoxInTransactionFactory, createNotificationIdRequiredError, createNotificationSummaryFactory, createNotificationUserFactory, createOrRunUniqueNotificationDocument, createStorageFileFactory, createStorageFileGroupFactory, createStorageFileGroupInTransactionFactory, createStorageFileGroupInputError, createStorageFileSignedUploadUrlFactory, deleteAllQueuedStorageFilesFactory, deleteStorageFileFactory, downloadMultipleStorageFilesFactory, downloadStorageFileFactory, expandNotificationRecipients, exportMutableNotificationExpediteService, firestoreNotificationSummarySendService, ignoreSendNotificationTextSendService, initializeAllApplicableNotificationBoxesFactory, initializeAllApplicableNotificationSummariesFactory, initializeAllApplicableStorageFileGroupsFactory, initializeAllStorageFilesFromUploadsFactory, initializeNotificationBoxFactory, initializeNotificationBoxInTransactionFactory, initializeNotificationModelInTransaction, initializeNotificationSummaryFactory, initializeNotificationSummaryInTransactionFactory, initializeStorageFileFromUploadFactory, initializeStorageFileGroupFactory, initializeStorageFileGroupInTransactionFactory, initializeStorageFileModelInTransaction, mailgunNotificationEmailSendService, makeNewNotificationSummaryTemplate, markStorageFileForDeleteTemplate, notificationBoxDoesNotExist, notificationBoxExclusionTargetInvalidError, notificationBoxExistsForModelError, notificationBoxRecipientDoesNotExistsError, notificationBoxUnregistredModelTypeInitializationError, notificationExpediteServiceInstance, notificationInitServerActions, notificationInitServerActionsFactory, notificationModelAlreadyInitializedError, notificationServerActions, notificationServerActionsContextFactory, notificationServerActionsFactory, notificationTaskService, notificationTaskSubTaskMissingRequiredDataTermination, notificationTaskSubtaskNotificationTaskHandlerFactory, notificationTemplateServiceInstance, notificationUserBlockedFromBeingAddedToRecipientsError, notificationUserInvalidUidForCreateError, notificationUserLockedConfigFromBeingUpdatedError, processAllQueuedStorageFilesFactory, processStorageFileFactory, provideMutableNotificationExpediteService, queryAndFlagStorageFilesForDelete, regenerateAllFlaggedStorageFileGroupsContentFactory, regenerateStorageFileGroupContentFactory, resyncAllNotificationUsersFactory, resyncNotificationUserFactory, sendNotificationFactory, sendQueuedNotificationsFactory, storageFileAlreadyProcessedError, storageFileCannotBeDeletedYetError, storageFileCreateSignedUploadUrlToolDetailsFactory, storageFileGroupQueuedForInitializationError, storageFileGroupZipStorageFileProcessingPurposeSubtaskProcessor, storageFileInitServerActions, storageFileInitServerActionsFactory, storageFileInitializeFromUploadService, storageFileInitializeFromUploadServiceInitializerResultPermanentFailure, storageFileModelAlreadyInitializedError, storageFileNotFlaggedForDeletionError, storageFileNotFlaggedForGroupsSyncError, storageFileProcessingNotAllowedForInvalidStateError, storageFileProcessingNotAvailableForTypeError, storageFileProcessingNotQueuedForProcessingError, storageFileProcessingNotificationTaskHandler, storageFileProcessingNotificationTaskHandlerDefaultCleanup, storageFileServerActions, storageFileServerActionsContextFactory, storageFileServerActionsFactory, syncAllFlaggedStorageFilesWithGroupsFactory, syncStorageFileWithGroupsFactory, updateNotificationBoxFactory, updateNotificationBoxRecipientExclusionInTransactionFactory, updateNotificationBoxRecipientFactory, updateNotificationBoxRecipientInTransactionFactory, updateNotificationSummaryFactory, updateNotificationUserFactory, updateNotificationUserNotificationBoxRecipientConfig, updateStorageFileFactory, updateStorageFileGroupFactory, uploadedFileDoesNotExistError, uploadedFileInitializationDiscardedError, uploadedFileInitializationFailedError, uploadedFileIsNotAllowedToBeInitializedError };