@dereekb/firebase 13.0.6 → 13.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -8,8 +8,7 @@ var model = require('@dereekb/model');
8
8
  var date = require('@dereekb/date');
9
9
  var functions = require('firebase/functions');
10
10
  var storage = require('firebase/storage');
11
- var classTransformer = require('class-transformer');
12
- var classValidator = require('class-validator');
11
+ var arktype = require('arktype');
13
12
  var fetch = require('@dereekb/util/fetch');
14
13
  var makeError = require('make-error');
15
14
  var dateFns = require('date-fns');
@@ -1093,6 +1092,61 @@ function documentReferenceFromDocument(document) {
1093
1092
  function documentReferencesFromDocuments(documents) {
1094
1093
  return documents.map(documentReferenceFromDocument);
1095
1094
  }
1095
+ /**
1096
+ * Creates a {@link LimitedFirestoreDocumentAccessorSnapshotCache} that wraps the given accessor
1097
+ * with an in-memory {@link Map} cache so that repeated loads for the same key return the cached
1098
+ * promise instead of re-reading from Firestore.
1099
+ *
1100
+ * The cache stores the promise itself (not the resolved value), which means concurrent requests
1101
+ * for the same key that arrive before the first read completes will also be deduplicated.
1102
+ *
1103
+ * The cache lives for the lifetime of the returned object and is never invalidated, so this is
1104
+ * best suited for short-lived scopes (e.g. a single request or batch operation) where stale reads
1105
+ * are acceptable.
1106
+ *
1107
+ * @param accessor - The accessor to wrap with caching behavior
1108
+ * @returns A {@link LimitedFirestoreDocumentAccessorSnapshotCache} backed by the given accessor
1109
+ *
1110
+ * @example
1111
+ * ```typescript
1112
+ * const cache = limitedFirestoreDocumentAccessorSnapshotCache(accessor);
1113
+ *
1114
+ * // First call reads from Firestore; second call returns cached result
1115
+ * const pair = await cache.getDocumentSnapshotDataPairForKey('users/abc123');
1116
+ * const samePair = await cache.getDocumentSnapshotDataPairForKey('users/abc123');
1117
+ *
1118
+ * // Batch fetch with automatic deduplication
1119
+ * const pairs = await cache.getDocumentSnapshotDataPairsWithDataForKeys(['users/abc', 'users/def']);
1120
+ *
1121
+ * // Access the underlying accessor directly
1122
+ * const doc = cache.accessor.loadDocumentForKey('users/xyz');
1123
+ * ```
1124
+ */
1125
+ function limitedFirestoreDocumentAccessorSnapshotCache(accessor) {
1126
+ const cache = new Map();
1127
+ function getDocumentSnapshotDataPairForKey(key) {
1128
+ let cached = cache.get(key);
1129
+ if (!cached) {
1130
+ const document = accessor.loadDocumentForKey(key);
1131
+ cached = getDocumentSnapshotDataPair(document);
1132
+ cache.set(key, cached);
1133
+ }
1134
+ return cached;
1135
+ }
1136
+ async function getDocumentSnapshotDataPairsForKeys(keys) {
1137
+ return Promise.all(keys.map((key) => getDocumentSnapshotDataPairForKey(key)));
1138
+ }
1139
+ async function getDocumentSnapshotDataPairsWithDataForKeys(keys) {
1140
+ const pairs = await getDocumentSnapshotDataPairsForKeys(keys);
1141
+ return util.filterMaybeArrayValues(pairs.map((pair) => (pair.data != null ? pair : undefined)));
1142
+ }
1143
+ return {
1144
+ accessor,
1145
+ getDocumentSnapshotDataPairForKey,
1146
+ getDocumentSnapshotDataPairsForKeys,
1147
+ getDocumentSnapshotDataPairsWithDataForKeys
1148
+ };
1149
+ }
1096
1150
 
1097
1151
  /**
1098
1152
  * Creates an Observable that emits arrays of document snapshots for multiple documents.
@@ -1142,7 +1196,7 @@ function mapLatestSnapshotsFromDocuments(documents, operator) {
1142
1196
  * @param documents - Array of document instances to stream data for
1143
1197
  * @returns Observable that emits arrays of document data whenever any document changes
1144
1198
  */
1145
- function latestDataFromDocuments(documents) {
1199
+ function streamDocumentSnapshotsData(documents) {
1146
1200
  return latestSnapshotsFromDocuments(documents).pipe(dataFromDocumentSnapshots());
1147
1201
  }
1148
1202
  /**
@@ -1200,6 +1254,11 @@ function streamDocumentSnapshotDataPairs(documents) {
1200
1254
  function streamDocumentSnapshotDataPairsWithData(documents) {
1201
1255
  return streamDocumentSnapshotDataPairs(documents).pipe(rxjs$1.map((pairs) => pairs.filter((pair) => pair.data != null)));
1202
1256
  }
1257
+ // MARK: Compat
1258
+ /**
1259
+ * @deprecated Use {@link streamDocumentSnapshotsData} instead.
1260
+ */
1261
+ const latestDataFromDocuments = streamDocumentSnapshotsData;
1203
1262
 
1204
1263
  // A set of copied types from @google-cloud/firestore and firebase/firestore to allow cross-compatability.
1205
1264
  /* eslint-disable */
@@ -2355,20 +2414,14 @@ function firebaseQueryItemAccumulator(iteration, mapItem) {
2355
2414
  }
2356
2415
 
2357
2416
  /**
2358
- * Creates a Firestore query constraint.
2417
+ * Creates a {@link FirestoreQueryConstraint} with the given type identifier and data.
2359
2418
  *
2360
- * @template T - Type of data stored in the constraint
2361
- * @param type - The constraint type identifier
2362
- * @param data - The constraint data
2363
- * @returns A Firestore query constraint object
2364
- */
2365
- /**
2366
- * Creates a Firestore query constraint.
2419
+ * This is the low-level factory used by all constraint builder functions (e.g., {@link where},
2420
+ * {@link limit}, {@link orderBy}). Most callers should use those typed builders instead.
2367
2421
  *
2368
- * @template T - Type of data stored in the constraint
2369
- * @param type - The constraint type identifier
2370
- * @param data - The constraint data
2371
- * @returns A Firestore query constraint object
2422
+ * @param type - The constraint type identifier (e.g., 'where', 'limit')
2423
+ * @param data - The constraint-specific configuration data
2424
+ * @returns A typed constraint object
2372
2425
  */
2373
2426
  function firestoreQueryConstraint(type, data) {
2374
2427
  return {
@@ -2868,6 +2921,17 @@ function filterDisallowedFirestoreItemPageIteratorInputConstraints(constraints)
2868
2921
  * This value is used when no itemsPerPage is explicitly specified in the configuration.
2869
2922
  */
2870
2923
  const DEFAULT_FIRESTORE_ITEM_PAGE_ITERATOR_ITEMS_PER_PAGE = 50;
2924
+ /**
2925
+ * Creates a {@link FirestoreItemPageIteratorDelegate} that handles cursor-based Firestore pagination.
2926
+ *
2927
+ * The delegate implements `loadItemsForPage` by:
2928
+ * 1. Retrieving the cursor document from the previous page's results
2929
+ * 2. Building a query with the configured constraints, `startAfter` cursor, and `limit`
2930
+ * 3. Executing the query and wrapping the results in a {@link FirestoreItemPageQueryResult}
2931
+ * with `reload()` and `stream()` capabilities
2932
+ *
2933
+ * @returns A delegate instance for use with {@link ItemPageIterator}
2934
+ */
2871
2935
  function makeFirestoreItemPageIteratorDelegate() {
2872
2936
  return {
2873
2937
  loadItemsForPage: (request) => {
@@ -3025,7 +3089,14 @@ function _firestoreItemPageIterationWithSnapshotIteration(snapshotIteration) {
3025
3089
  return result;
3026
3090
  }
3027
3091
  /**
3028
- * Creates a FirestoreFixedItemPageIterationFactoryFunction.
3092
+ * Creates a factory function for generating fixed-set Firestore pagination instances.
3093
+ *
3094
+ * The returned factory takes an array of document references and an optional filter,
3095
+ * producing a pagination instance that iterates over those specific documents in pages.
3096
+ *
3097
+ * @param baseConfig - Base pagination configuration (query reference, driver, page size)
3098
+ * @param documentAccessor - Accessor used to load document snapshots from the references
3099
+ * @returns A factory function that creates fixed-set pagination instances
3029
3100
  */
3030
3101
  function firestoreFixedItemPageIterationFactory(baseConfig, documentAccessor) {
3031
3102
  return (items, filter) => {
@@ -3042,7 +3113,17 @@ function firestoreFixedItemPageIterationFactory(baseConfig, documentAccessor) {
3042
3113
  };
3043
3114
  }
3044
3115
  /**
3045
- * Creates a FirestoreItemPageIterationInstance that iterates over the fixed
3116
+ * Creates a pagination instance that iterates over a fixed set of document references.
3117
+ *
3118
+ * Unlike {@link firestoreItemPageIteration} which queries Firestore dynamically, this function
3119
+ * paginates through a pre-determined list of document references. Each page loads the next
3120
+ * slice of references via the document accessor and produces a synthetic {@link QuerySnapshot}.
3121
+ *
3122
+ * This is useful for paginating over known document sets (e.g., from a pre-computed list
3123
+ * of references) without executing Firestore queries.
3124
+ *
3125
+ * @param config - Configuration including the document references, accessor, and pagination settings
3126
+ * @returns A pagination instance that pages through the fixed reference set
3046
3127
  */
3047
3128
  function firestoreFixedItemPageIteration(config) {
3048
3129
  const { items, documentAccessor } = config;
@@ -3259,24 +3340,47 @@ function readFirestoreModelKeyFromDocumentSnapshot(snapshot) {
3259
3340
  /**
3260
3341
  * @module Firestore Query Iteration
3261
3342
  *
3262
- * This module provides a comprehensive system for iterating through Firestore query results
3263
- * with support for pagination, batching, and parallelism. It enables efficient processing of
3264
- * large result sets by using cursor-based pagination (via "checkpoints") and various iteration
3265
- * strategies.
3343
+ * Provides a layered system for iterating through Firestore query results using
3344
+ * cursor-based pagination ("checkpoints"). Each layer adds convenience on top of the
3345
+ * one below:
3346
+ *
3347
+ * 1. **Checkpoints** ({@link iterateFirestoreDocumentSnapshotCheckpoints}) — core pagination engine
3348
+ * 2. **Batches** ({@link iterateFirestoreDocumentSnapshotBatches}) — subdivides checkpoints into fixed-size batches
3349
+ * 3. **Snapshots** ({@link iterateFirestoreDocumentSnapshots}) — processes individual snapshots
3350
+ * 4. **Pairs** ({@link iterateFirestoreDocumentSnapshotPairs}) — loads typed document wrappers per snapshot
3351
+ *
3352
+ * Batch variants with document pairs are also available:
3353
+ * - {@link iterateFirestoreDocumentSnapshotPairBatches} — batch processing with typed document access
3354
+ *
3355
+ * All functions support configurable limits (`limitPerCheckpoint`, `totalSnapshotsLimit`),
3356
+ * concurrency (`maxParallelCheckpoints`), rate limiting (`waitBetweenCheckpoints`),
3357
+ * snapshot filtering, and repeat cursor detection.
3266
3358
  */
3267
3359
  /**
3268
- * Iterates through the results of a Firestore query by each FirestoreDocumentSnapshotDataPairWithData.
3360
+ * Iterates through Firestore query results, loading each snapshot as a
3361
+ * {@link FirestoreDocumentSnapshotDataPairWithData} before processing.
3269
3362
  *
3270
- * This function efficiently handles pagination through potentially large result sets by using
3271
- * the checkpoint system to load documents in batches. For each document snapshot, it loads the
3272
- * associated data using the provided document accessor, then passes the combined pair to the
3273
- * processing function.
3363
+ * Built on {@link iterateFirestoreDocumentSnapshots}, this adds an automatic document
3364
+ * loading step: each raw snapshot is resolved through the `documentAccessor` to produce
3365
+ * a pair containing both the typed {@link FirestoreDocument} and its snapshot data.
3366
+ * This is the highest-level iteration function — use it when your callback needs
3367
+ * document-level operations (updates, deletes) alongside the snapshot data.
3274
3368
  *
3275
- * @template T - The document data type
3276
- * @template R - The result type of processing each snapshot pair
3277
- * @template D - The FirestoreDocument implementation type (defaults to FirestoreDocument<T>)
3278
- * @param config - Configuration for the iteration, including the document accessor and processing function
3279
- * @returns A promise that resolves to the result of the iteration, including statistics about checkpoints and snapshots processed
3369
+ * @param config - Iteration config including the document accessor and per-pair callback
3370
+ * @returns Checkpoint-level statistics (total checkpoints, snapshots visited, limit status)
3371
+ *
3372
+ * @example
3373
+ * ```typescript
3374
+ * const result = await iterateFirestoreDocumentSnapshotPairs({
3375
+ * queryFactory,
3376
+ * constraintsFactory: [where('status', '==', 'pending')],
3377
+ * limitPerCheckpoint: 100,
3378
+ * documentAccessor: collection.documentAccessor(),
3379
+ * iterateSnapshotPair: async (pair) => {
3380
+ * await pair.document.accessor.set({ ...pair.data, status: 'processed' });
3381
+ * }
3382
+ * });
3383
+ * ```
3280
3384
  */
3281
3385
  async function iterateFirestoreDocumentSnapshotPairs(config) {
3282
3386
  const { iterateSnapshotPair, documentAccessor } = config;
@@ -3290,16 +3394,32 @@ async function iterateFirestoreDocumentSnapshotPairs(config) {
3290
3394
  });
3291
3395
  }
3292
3396
  /**
3293
- * Iterates through the results of a Firestore query by each document snapshot by itself.
3397
+ * Iterates through Firestore query results, processing each document snapshot individually.
3294
3398
  *
3295
- * This function efficiently handles pagination through potentially large result sets by using
3296
- * the checkpoint system to load documents in batches. Each document snapshot is then processed
3297
- * individually using the provided processing function.
3399
+ * Built on {@link iterateFirestoreDocumentSnapshotBatches} with `maxParallelCheckpoints: 1`,
3400
+ * this unwraps each checkpoint's snapshots and processes them one-by-one via
3401
+ * {@link performAsyncTasks} (sequential by default). Use `snapshotsPerformTasksConfig`
3402
+ * to enable parallel snapshot processing within each checkpoint.
3298
3403
  *
3299
- * @template T - The document data type
3300
- * @template R - The result type of processing each snapshot
3301
- * @param config - Configuration for the iteration, including the snapshot processing function
3302
- * @returns A promise that resolves to the result of the iteration, including statistics about checkpoints and snapshots processed
3404
+ * For document-level operations (needing the typed {@link FirestoreDocument} wrapper),
3405
+ * use {@link iterateFirestoreDocumentSnapshotPairs} instead.
3406
+ *
3407
+ * @param config - Iteration config including the per-snapshot callback
3408
+ * @returns Checkpoint-level statistics (total checkpoints, snapshots visited, limit status)
3409
+ *
3410
+ * @example
3411
+ * ```typescript
3412
+ * const result = await iterateFirestoreDocumentSnapshots({
3413
+ * queryFactory,
3414
+ * constraintsFactory: [where('active', '==', true)],
3415
+ * limitPerCheckpoint: 200,
3416
+ * totalSnapshotsLimit: 1000,
3417
+ * iterateSnapshot: async (snapshot) => {
3418
+ * const data = snapshot.data();
3419
+ * await externalApi.sync(data);
3420
+ * }
3421
+ * });
3422
+ * ```
3303
3423
  */
3304
3424
  async function iterateFirestoreDocumentSnapshots(config) {
3305
3425
  const { iterateSnapshot, performTasksConfig, snapshotsPerformTasksConfig } = config;
@@ -3316,10 +3436,32 @@ async function iterateFirestoreDocumentSnapshots(config) {
3316
3436
  });
3317
3437
  }
3318
3438
  /**
3319
- * Iterates through the results of a Firestore query by each FirestoreDocumentSnapshotDataPair.
3439
+ * Iterates through Firestore query results in batches, loading each batch as
3440
+ * {@link FirestoreDocumentSnapshotDataPairWithData} instances before processing.
3320
3441
  *
3321
- * @param config
3322
- * @returns
3442
+ * Built on {@link iterateFirestoreDocumentSnapshotBatches} with `maxParallelCheckpoints: 1`.
3443
+ * Each batch of raw snapshots is resolved through the `documentAccessor` to produce
3444
+ * typed document-snapshot pairs. Use this when you need batch-level operations with
3445
+ * typed document access (e.g., bulk updates, batch writes).
3446
+ *
3447
+ * @param config - Iteration config including the document accessor and per-batch callback
3448
+ * @returns Checkpoint-level statistics (total checkpoints, snapshots visited, limit status)
3449
+ *
3450
+ * @example
3451
+ * ```typescript
3452
+ * const result = await iterateFirestoreDocumentSnapshotPairBatches({
3453
+ * queryFactory,
3454
+ * constraintsFactory: [where('needsMigration', '==', true)],
3455
+ * limitPerCheckpoint: 500,
3456
+ * batchSize: 50,
3457
+ * documentAccessor: collection.documentAccessor(),
3458
+ * iterateSnapshotPairsBatch: async (pairs, batchIndex) => {
3459
+ * const writeBatch = firestore.batch();
3460
+ * pairs.forEach((pair) => writeBatch.update(pair.document.documentRef, { migrated: true }));
3461
+ * await writeBatch.commit();
3462
+ * }
3463
+ * });
3464
+ * ```
3323
3465
  */
3324
3466
  async function iterateFirestoreDocumentSnapshotPairBatches(config) {
3325
3467
  const { iterateSnapshotPairsBatch, documentAccessor } = config;
@@ -3340,10 +3482,32 @@ async function iterateFirestoreDocumentSnapshotPairBatches(config) {
3340
3482
  */
3341
3483
  const DEFAULT_ITERATE_FIRESTORE_DOCUMENT_SNAPSHOT_BATCHES_BATCH_SIZE = 25;
3342
3484
  /**
3343
- * Iterates through the results of a Firestore query by each document snapshot.
3485
+ * Iterates through Firestore query results by subdividing each checkpoint into smaller batches.
3344
3486
  *
3345
- * @param config
3346
- * @returns
3487
+ * Built on {@link iterateFirestoreDocumentSnapshotCheckpoints}, this function takes each
3488
+ * checkpoint's snapshots and splits them into batches (default size: 25). Batches are
3489
+ * processed via {@link performAsyncTasks}, sequential by default. Use this when operations
3490
+ * have size limits (e.g., Firestore batch writes) or benefit from controlled chunk sizes.
3491
+ *
3492
+ * For per-snapshot processing, use {@link iterateFirestoreDocumentSnapshots}.
3493
+ * For batch processing with typed document pairs, use {@link iterateFirestoreDocumentSnapshotPairBatches}.
3494
+ *
3495
+ * @param config - Iteration config including batch size and per-batch callback
3496
+ * @returns Checkpoint-level statistics (total checkpoints, snapshots visited, limit status)
3497
+ *
3498
+ * @example
3499
+ * ```typescript
3500
+ * const result = await iterateFirestoreDocumentSnapshotBatches({
3501
+ * queryFactory,
3502
+ * constraintsFactory: [where('type', '==', 'order')],
3503
+ * limitPerCheckpoint: 500,
3504
+ * batchSize: 100,
3505
+ * iterateSnapshotBatch: async (snapshots, batchIndex) => {
3506
+ * const data = snapshots.map((s) => s.data());
3507
+ * await analytics.trackBatch(data);
3508
+ * }
3509
+ * });
3510
+ * ```
3347
3511
  */
3348
3512
  async function iterateFirestoreDocumentSnapshotBatches(config) {
3349
3513
  const { iterateSnapshotBatch, batchSizeForSnapshots: inputBatchSizeForSnapshots, performTasksConfig, batchSize: inputBatchSize } = config;
@@ -3369,29 +3533,75 @@ async function iterateFirestoreDocumentSnapshotBatches(config) {
3369
3533
  });
3370
3534
  }
3371
3535
  /**
3372
- * Creates a IterateFirestoreDocumentSnapshotCheckpointsFilterCheckpointSnapshotsFunction that filters out any repeat documents.
3536
+ * Creates a checkpoint filter that deduplicates documents across checkpoints.
3537
+ *
3538
+ * Repeat documents can appear when a document is updated during iteration and
3539
+ * re-matches the query in a subsequent checkpoint. This factory returns a stateful
3540
+ * filter that tracks seen document keys and removes duplicates.
3373
3541
  *
3374
- * Repeat documents can occur in cases where the document is updated and the query matches it again for a different reason.
3375
- * This utility function creates a filter that prevents processing the same document multiple times.
3542
+ * The filter maintains state across checkpoints use a single instance for the
3543
+ * entire iteration run. Pair with `handleRepeatCursor: false` to also terminate
3544
+ * iteration when cursor-level repeats are detected.
3376
3545
  *
3377
- * @param readKeyFunction - Function that extracts a unique key from a document snapshot, defaults to document ID
3378
- * @returns A filter function that prevents duplicate document processing
3546
+ * @param readKeyFunction - Extracts a unique key from each snapshot; defaults to `snapshot.id`
3547
+ * @returns A stateful filter function suitable for `filterCheckpointSnapshots`
3548
+ *
3549
+ * @example
3550
+ * ```typescript
3551
+ * const result = await iterateFirestoreDocumentSnapshotCheckpoints({
3552
+ * queryFactory,
3553
+ * constraintsFactory: [orderBy('updatedAt')],
3554
+ * limitPerCheckpoint: 100,
3555
+ * filterCheckpointSnapshots: filterRepeatCheckpointSnapshots(),
3556
+ * handleRepeatCursor: false,
3557
+ * iterateCheckpoint: async (snapshots) => {
3558
+ * return snapshots.map((s) => s.data());
3559
+ * }
3560
+ * });
3561
+ * ```
3379
3562
  */
3380
3563
  function filterRepeatCheckpointSnapshots(readKeyFunction = (x) => x.id) {
3381
3564
  const allowOnceFilter = util.allowValueOnceFilter(readKeyFunction);
3382
3565
  return async (snapshots) => snapshots.filter(allowOnceFilter);
3383
3566
  }
3384
3567
  /**
3385
- * Iterates through the results of a Firestore query in several batches.
3568
+ * Core cursor-based pagination engine for iterating through Firestore query results.
3386
3569
  *
3387
- * This is the core pagination function that handles cursor-based iteration through
3388
- * potentially large Firestore query results. It manages cursor documents, checkpoint
3389
- * processing, parallel execution, and various limit controls.
3570
+ * This is the foundational function in the Firestore iteration hierarchy. It drives
3571
+ * sequential cursor-based pagination: each "checkpoint" executes a Firestore query,
3572
+ * uses the last document as a `startAfter` cursor for the next query, and passes
3573
+ * results to the `iterateCheckpoint` callback.
3390
3574
  *
3391
- * @template T - The document data type
3392
- * @template R - The result type of the iteration
3393
- * @param config - Complete configuration for the pagination and processing behavior
3394
- * @returns Promise resolving to statistics about the iteration
3575
+ * The iteration loop continues until one of these conditions is met:
3576
+ * - A query returns no results (no more matching documents)
3577
+ * - The `totalSnapshotsLimit` is reached
3578
+ * - A repeat cursor is detected and `handleRepeatCursor` returns `false`
3579
+ * - The effective `limitPerCheckpoint` calculates to 0 remaining
3580
+ *
3581
+ * Higher-level functions build on this:
3582
+ * - {@link iterateFirestoreDocumentSnapshotBatches} — subdivides checkpoints into smaller batches
3583
+ * - {@link iterateFirestoreDocumentSnapshots} — processes one snapshot at a time
3584
+ * - {@link iterateFirestoreDocumentSnapshotPairs} — loads typed document wrappers per snapshot
3585
+ *
3586
+ * @param config - Complete configuration for pagination, processing, and termination behavior
3587
+ * @returns Statistics including total checkpoints executed, snapshots visited, and whether the limit was hit
3588
+ *
3589
+ * @example
3590
+ * ```typescript
3591
+ * const result = await iterateFirestoreDocumentSnapshotCheckpoints({
3592
+ * queryFactory,
3593
+ * constraintsFactory: [where('createdAt', '<=', cutoffDate), orderBy('createdAt')],
3594
+ * limitPerCheckpoint: 200,
3595
+ * totalSnapshotsLimit: 5000,
3596
+ * handleRepeatCursor: false,
3597
+ * iterateCheckpoint: async (snapshots, querySnapshot) => {
3598
+ * return snapshots.map((s) => ({ id: s.id, data: s.data() }));
3599
+ * },
3600
+ * useCheckpointResult: (result) => {
3601
+ * console.log(`Checkpoint ${result.i}: processed ${result.docSnapshots.length} docs`);
3602
+ * }
3603
+ * });
3604
+ * ```
3395
3605
  */
3396
3606
  async function iterateFirestoreDocumentSnapshotCheckpoints(config) {
3397
3607
  const { iterateCheckpoint, filterCheckpointSnapshots: inputFilterCheckpointSnapshot, handleRepeatCursor: inputHandleRepeatCursor, waitBetweenCheckpoints, useCheckpointResult, constraintsFactory: inputConstraintsFactory, dynamicConstraints: inputDynamicConstraints, queryFactory, maxParallelCheckpoints = 1, limitPerCheckpoint: inputLimitPerCheckpoint, totalSnapshotsLimit: inputTotalSnapshotsLimit } = config;
@@ -3494,13 +3704,20 @@ async function iterateFirestoreDocumentSnapshotCheckpoints(config) {
3494
3704
  }
3495
3705
  // MARK: Utility
3496
3706
  /**
3497
- * Creates a filter that allows each document snapshot to be processed only once based on its path.
3707
+ * Creates a stateful filter that allows each document snapshot through only once,
3708
+ * keyed by its full Firestore model path.
3498
3709
  *
3499
- * This utility helps prevent duplicate processing of documents by tracking which ones have
3500
- * already been seen based on their path.
3710
+ * Unlike {@link filterRepeatCheckpointSnapshots} which uses document ID by default,
3711
+ * this filter uses the full document path ({@link readFirestoreModelKeyFromDocumentSnapshot}),
3712
+ * making it suitable for cross-collection iteration where document IDs alone may collide.
3501
3713
  *
3502
- * @template T - The document snapshot type
3503
- * @returns A filter function that only allows each unique document to pass once
3714
+ * @returns A reusable filter function that passes each unique document path exactly once
3715
+ *
3716
+ * @example
3717
+ * ```typescript
3718
+ * const onceFilter = allowDocumentSnapshotWithPathOnceFilter();
3719
+ * const uniqueSnapshots = allSnapshots.filter(onceFilter);
3720
+ * ```
3504
3721
  */
3505
3722
  function allowDocumentSnapshotWithPathOnceFilter() {
3506
3723
  return util.allowValueOnceFilter(readFirestoreModelKeyFromDocumentSnapshot);
@@ -5226,62 +5443,15 @@ const DBX_FIREBASE_SERVER_NO_AUTH_ERROR_CODE = 'NO_AUTH';
5226
5443
  */
5227
5444
  const DBX_FIREBASE_SERVER_NO_UID_ERROR_CODE = 'NO_USER_UID';
5228
5445
 
5229
- /******************************************************************************
5230
- Copyright (c) Microsoft Corporation.
5231
-
5232
- Permission to use, copy, modify, and/or distribute this software for any
5233
- purpose with or without fee is hereby granted.
5234
-
5235
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
5236
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
5237
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
5238
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
5239
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
5240
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
5241
- PERFORMANCE OF THIS SOFTWARE.
5242
- ***************************************************************************** */
5243
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
5244
-
5245
-
5246
- function __decorate(decorators, target, key, desc) {
5247
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5248
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5249
- 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;
5250
- return c > 3 && r && Object.defineProperty(target, key, r), r;
5251
- }
5252
-
5253
- function __metadata(metadataKey, metadataValue) {
5254
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
5255
- }
5256
-
5257
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
5258
- var e = new Error(message);
5259
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
5260
- };
5261
-
5262
5446
  exports.ScheduledFunctionDevelopmentFunctionTypeEnum = void 0;
5263
5447
  (function (ScheduledFunctionDevelopmentFunctionTypeEnum) {
5264
5448
  ScheduledFunctionDevelopmentFunctionTypeEnum["LIST"] = "list";
5265
5449
  ScheduledFunctionDevelopmentFunctionTypeEnum["RUN"] = "run";
5266
5450
  })(exports.ScheduledFunctionDevelopmentFunctionTypeEnum || (exports.ScheduledFunctionDevelopmentFunctionTypeEnum = {}));
5267
- class ScheduledFunctionDevelopmentFirebaseFunctionParams {
5268
- type;
5269
- /**
5270
- * Name of function to run.
5271
- */
5272
- run;
5273
- }
5274
- __decorate([
5275
- classTransformer.Expose(),
5276
- classValidator.IsEnum(exports.ScheduledFunctionDevelopmentFunctionTypeEnum),
5277
- __metadata("design:type", String)
5278
- ], ScheduledFunctionDevelopmentFirebaseFunctionParams.prototype, "type", void 0);
5279
- __decorate([
5280
- classTransformer.Expose(),
5281
- classValidator.IsString(),
5282
- classValidator.IsOptional(),
5283
- __metadata("design:type", String)
5284
- ], ScheduledFunctionDevelopmentFirebaseFunctionParams.prototype, "run", void 0);
5451
+ const scheduledFunctionDevelopmentFirebaseFunctionParamsType = arktype.type({
5452
+ type: "'list' | 'run'",
5453
+ 'run?': 'string'
5454
+ });
5285
5455
  class ScheduledFunctionDevelopmentFirebaseFunctionListEntry {
5286
5456
  name;
5287
5457
  }
@@ -5308,101 +5478,30 @@ function firebaseModelLoader(getFirestoreCollection) {
5308
5478
  }
5309
5479
 
5310
5480
  /**
5311
- * isFirestoreModelKey validator
5312
- */
5313
- function IsFirestoreModelKey(validationOptions) {
5314
- return function (object, propertyName) {
5315
- classValidator.registerDecorator({
5316
- name: 'isFirestoreModelKey',
5317
- target: object.constructor,
5318
- propertyName: propertyName,
5319
- options: validationOptions,
5320
- validator: {
5321
- validate: isFirestoreModelKey,
5322
- defaultMessage: classValidator.buildMessage((eachPrefix, args) => eachPrefix + `$property value of "${args?.value}" is not a FirestoreModelKey.`, validationOptions)
5323
- }
5324
- });
5325
- };
5326
- }
5481
+ * ArkType schema for a FirestoreModelKey (full path like "collection/12345").
5482
+ */
5483
+ const firestoreModelKeyType = arktype.type('string > 0').narrow((val, ctx) => isFirestoreModelKey(val) || ctx.mustBe('a valid FirestoreModelKey'));
5327
5484
  /**
5328
- * isFirestoreModelId validator
5485
+ * ArkType schema for a FirestoreModelId (document ID like "12345").
5329
5486
  */
5330
- function IsFirestoreModelId(validationOptions) {
5331
- return function (object, propertyName) {
5332
- classValidator.registerDecorator({
5333
- name: 'isFirestoreModelId',
5334
- target: object.constructor,
5335
- propertyName: propertyName,
5336
- options: validationOptions,
5337
- validator: {
5338
- validate: isFirestoreModelId,
5339
- defaultMessage: classValidator.buildMessage((eachPrefix, args) => eachPrefix + `$property value of "${args?.value}" is not a FirestoreModelId.`, validationOptions)
5340
- }
5341
- });
5342
- };
5343
- }
5487
+ const firestoreModelIdType = arktype.type('string > 0').narrow((val, ctx) => isFirestoreModelId(val) || ctx.mustBe('a valid FirestoreModelId'));
5344
5488
  /**
5345
- * isFirestoreModelIdOrKey validator
5489
+ * ArkType schema for a FirestoreModelId or FirestoreModelKey.
5346
5490
  */
5347
- function IsFirestoreModelIdOrKey(validationOptions) {
5348
- return function (object, propertyName) {
5349
- classValidator.registerDecorator({
5350
- name: 'isFirestoreModelIdOrKey',
5351
- target: object.constructor,
5352
- propertyName: propertyName,
5353
- options: validationOptions,
5354
- validator: {
5355
- validate: isFirestoreModelIdOrKey,
5356
- defaultMessage: classValidator.buildMessage((eachPrefix, args) => eachPrefix + `$property value of "${args?.value}" is not a FirestoreModelId or FirestoreModelKey.`, validationOptions)
5357
- }
5358
- });
5359
- };
5360
- }
5491
+ const firestoreModelIdOrKeyType = arktype.type('string > 0').narrow((val, ctx) => isFirestoreModelIdOrKey(val) || ctx.mustBe('a valid FirestoreModelId or FirestoreModelKey'));
5361
5492
 
5362
- /**
5363
- * Simple annotated params that implements FirestoreModelKeyRef.
5364
- */
5365
- class TargetModelParams {
5366
- key;
5367
- }
5368
- __decorate([
5369
- classTransformer.Expose(),
5370
- classValidator.IsNotEmpty(),
5371
- IsFirestoreModelKey(),
5372
- __metadata("design:type", String)
5373
- ], TargetModelParams.prototype, "key", void 0);
5374
- class InferredTargetModelParams {
5375
- key;
5376
- }
5377
- __decorate([
5378
- classTransformer.Expose(),
5379
- classValidator.IsOptional(),
5380
- classValidator.IsNotEmpty(),
5381
- IsFirestoreModelKey(),
5382
- __metadata("design:type", String)
5383
- ], InferredTargetModelParams.prototype, "key", void 0);
5384
- /**
5385
- * Simple annotated params that implements FirestoreModelKeyRef but key is a FirestoreModelId.
5386
- */
5387
- class TargetModelIdParams {
5388
- key;
5389
- }
5390
- __decorate([
5391
- classTransformer.Expose(),
5392
- classValidator.IsNotEmpty(),
5393
- IsFirestoreModelId(),
5394
- __metadata("design:type", String)
5395
- ], TargetModelIdParams.prototype, "key", void 0);
5396
- class InferredTargetModelIdParams {
5397
- key;
5398
- }
5399
- __decorate([
5400
- classTransformer.Expose(),
5401
- classValidator.IsOptional(),
5402
- classValidator.IsNotEmpty(),
5403
- IsFirestoreModelId(),
5404
- __metadata("design:type", String)
5405
- ], InferredTargetModelIdParams.prototype, "key", void 0);
5493
+ const targetModelParamsType = arktype.type({
5494
+ key: firestoreModelKeyType
5495
+ });
5496
+ const inferredTargetModelParamsType = arktype.type({
5497
+ 'key?': firestoreModelKeyType
5498
+ });
5499
+ const targetModelIdParamsType = arktype.type({
5500
+ key: firestoreModelIdType
5501
+ });
5502
+ const inferredTargetModelIdParamsType = arktype.type({
5503
+ 'key?': firestoreModelIdType
5504
+ });
5406
5505
 
5407
5506
  /**
5408
5507
  * Abstract AbstractModelPermissionService implementation for FirebaseModelsPermissionService.
@@ -6775,582 +6874,95 @@ const NOTIFICATION_SUBJECT_MIN_LENGTH = 2;
6775
6874
  const NOTIFICATION_SUBJECT_MAX_LENGTH = 100;
6776
6875
  const NOTIFICATION_MESSAGE_MIN_LENGTH = 2;
6777
6876
  const NOTIFICATION_MESSAGE_MAX_LENGTH = 1000;
6778
- /**
6779
- * Config entries are inserted, unless marked as remove.
6780
- */
6781
- class NotificationBoxRecipientTemplateConfigArrayEntryParam {
6782
- type;
6783
- sd;
6784
- se;
6785
- st;
6786
- sp;
6787
- sn;
6788
- /**
6789
- * If true, removes this configuration
6790
- */
6791
- remove;
6792
- }
6793
- __decorate([
6794
- classTransformer.Expose(),
6795
- classValidator.IsString(),
6796
- __metadata("design:type", String)
6797
- ], NotificationBoxRecipientTemplateConfigArrayEntryParam.prototype, "type", void 0);
6798
- __decorate([
6799
- classTransformer.Expose(),
6800
- classValidator.IsOptional(),
6801
- classValidator.IsBoolean(),
6802
- __metadata("design:type", Object)
6803
- ], NotificationBoxRecipientTemplateConfigArrayEntryParam.prototype, "sd", void 0);
6804
- __decorate([
6805
- classTransformer.Expose(),
6806
- classValidator.IsOptional(),
6807
- classValidator.IsBoolean(),
6808
- __metadata("design:type", Object)
6809
- ], NotificationBoxRecipientTemplateConfigArrayEntryParam.prototype, "se", void 0);
6810
- __decorate([
6811
- classTransformer.Expose(),
6812
- classValidator.IsOptional(),
6813
- classValidator.IsBoolean(),
6814
- __metadata("design:type", Object)
6815
- ], NotificationBoxRecipientTemplateConfigArrayEntryParam.prototype, "st", void 0);
6816
- __decorate([
6817
- classTransformer.Expose(),
6818
- classValidator.IsOptional(),
6819
- classValidator.IsBoolean(),
6820
- __metadata("design:type", Object)
6821
- ], NotificationBoxRecipientTemplateConfigArrayEntryParam.prototype, "sp", void 0);
6822
- __decorate([
6823
- classTransformer.Expose(),
6824
- classValidator.IsOptional(),
6825
- classValidator.IsBoolean(),
6826
- __metadata("design:type", Object)
6827
- ], NotificationBoxRecipientTemplateConfigArrayEntryParam.prototype, "sn", void 0);
6828
- __decorate([
6829
- classTransformer.Expose(),
6830
- classValidator.IsOptional(),
6831
- classValidator.IsBoolean(),
6832
- __metadata("design:type", Object)
6833
- ], NotificationBoxRecipientTemplateConfigArrayEntryParam.prototype, "remove", void 0);
6834
- /**
6835
- * Used for creating a new NotificationUser for a user.
6836
- */
6837
- class CreateNotificationUserParams {
6838
- /**
6839
- * UID of the user to create the NotificationUser for.
6840
- */
6841
- uid;
6842
- }
6843
- __decorate([
6844
- classTransformer.Expose(),
6845
- classValidator.IsOptional(),
6846
- IsFirestoreModelId(),
6847
- __metadata("design:type", String)
6848
- ], CreateNotificationUserParams.prototype, "uid", void 0);
6849
- /**
6850
- * Used for updating the global or default config on a NotificationUser.
6851
- */
6852
- class UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams {
6853
- /**
6854
- * NotificationBox recipient to update. Is ignored if UID is provided and matches a user. Used for external recipients/users.
6855
- */
6856
- i;
6857
- /**
6858
- * Override email address
6859
- */
6860
- e;
6861
- /**
6862
- * Override phone number
6863
- */
6864
- t;
6865
- /**
6866
- * Array of configs that correspond with "c"
6867
- */
6868
- configs;
6869
- lk;
6870
- bk;
6871
- f;
6872
- }
6873
- __decorate([
6874
- classTransformer.Expose(),
6875
- classValidator.IsOptional(),
6876
- classValidator.IsNumber(),
6877
- __metadata("design:type", Object)
6878
- ], UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams.prototype, "i", void 0);
6879
- __decorate([
6880
- classTransformer.Expose(),
6881
- classValidator.IsOptional(),
6882
- classValidator.IsEmail(),
6883
- __metadata("design:type", Object)
6884
- ], UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams.prototype, "e", void 0);
6885
- __decorate([
6886
- classTransformer.Expose(),
6887
- classValidator.IsOptional(),
6888
- model.IsE164PhoneNumber(),
6889
- __metadata("design:type", Object)
6890
- ], UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams.prototype, "t", void 0);
6891
- __decorate([
6892
- classTransformer.Expose(),
6893
- classValidator.IsOptional(),
6894
- classValidator.IsArray(),
6895
- classValidator.ValidateNested({ each: true }),
6896
- classTransformer.Type(() => NotificationBoxRecipientTemplateConfigArrayEntryParam),
6897
- __metadata("design:type", Object)
6898
- ], UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams.prototype, "configs", void 0);
6899
- __decorate([
6900
- classTransformer.Expose(),
6901
- classValidator.IsBoolean(),
6902
- classValidator.IsOptional(),
6903
- __metadata("design:type", Object)
6904
- ], UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams.prototype, "lk", void 0);
6905
- __decorate([
6906
- classTransformer.Expose(),
6907
- classValidator.IsBoolean(),
6908
- classValidator.IsOptional(),
6909
- __metadata("design:type", Object)
6910
- ], UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams.prototype, "bk", void 0);
6911
- __decorate([
6912
- classTransformer.Expose(),
6913
- classValidator.IsOptional(),
6914
- classValidator.IsEnum(exports.NotificationBoxRecipientFlag),
6915
- __metadata("design:type", Object)
6916
- ], UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams.prototype, "f", void 0);
6917
- class UpdateNotificationBoxRecipientLikeParams {
6918
- /**
6919
- * Override email address
6920
- */
6921
- e;
6922
- /**
6923
- * Override phone number
6924
- */
6925
- t;
6926
- /**
6927
- * Notification summary id
6928
- */
6929
- s;
6930
- /**
6931
- * Array of configs
6932
- */
6933
- configs;
6934
- }
6935
- __decorate([
6936
- classTransformer.Expose(),
6937
- classValidator.IsOptional(),
6938
- classValidator.IsEmail(),
6939
- __metadata("design:type", Object)
6940
- ], UpdateNotificationBoxRecipientLikeParams.prototype, "e", void 0);
6941
- __decorate([
6942
- classTransformer.Expose(),
6943
- classValidator.IsOptional(),
6944
- model.IsE164PhoneNumber(),
6945
- __metadata("design:type", Object)
6946
- ], UpdateNotificationBoxRecipientLikeParams.prototype, "t", void 0);
6947
- __decorate([
6948
- classTransformer.Expose(),
6949
- classValidator.IsOptional(),
6950
- classValidator.IsPhoneNumber(),
6951
- __metadata("design:type", Object)
6952
- ], UpdateNotificationBoxRecipientLikeParams.prototype, "s", void 0);
6953
- __decorate([
6954
- classTransformer.Expose(),
6955
- classValidator.IsOptional(),
6956
- classValidator.IsArray(),
6957
- classValidator.ValidateNested({ each: true }),
6958
- classTransformer.Type(() => NotificationBoxRecipientTemplateConfigArrayEntryParam),
6959
- __metadata("design:type", Object)
6960
- ], UpdateNotificationBoxRecipientLikeParams.prototype, "configs", void 0);
6961
- /**
6962
- * Used for updating the target NotificationUserNotificationBoxRecipientConfig.
6963
- */
6964
- class UpdateNotificationUserNotificationBoxRecipientParams extends UpdateNotificationBoxRecipientLikeParams {
6965
- /**
6966
- * NotificationBox config to update
6967
- */
6968
- nb;
6969
- rm;
6970
- lk;
6971
- bk;
6972
- f;
6973
- /**
6974
- * Whether or not to delete this configuration entirely.
6975
- *
6976
- * Will only delete if rm is true and ns is false. Is ignored otherwise.
6977
- */
6978
- deleteRemovedConfig;
6979
- }
6980
- __decorate([
6981
- classTransformer.Expose(),
6982
- IsFirestoreModelId(),
6983
- __metadata("design:type", String)
6984
- ], UpdateNotificationUserNotificationBoxRecipientParams.prototype, "nb", void 0);
6985
- __decorate([
6986
- classTransformer.Expose(),
6987
- classValidator.IsOptional(),
6988
- classValidator.IsBoolean(),
6989
- __metadata("design:type", Object)
6990
- ], UpdateNotificationUserNotificationBoxRecipientParams.prototype, "rm", void 0);
6991
- __decorate([
6992
- classTransformer.Expose(),
6993
- classValidator.IsOptional(),
6994
- classValidator.IsBoolean(),
6995
- __metadata("design:type", Object)
6996
- ], UpdateNotificationUserNotificationBoxRecipientParams.prototype, "lk", void 0);
6997
- __decorate([
6998
- classTransformer.Expose(),
6999
- classValidator.IsOptional(),
7000
- classValidator.IsBoolean(),
7001
- __metadata("design:type", Object)
7002
- ], UpdateNotificationUserNotificationBoxRecipientParams.prototype, "bk", void 0);
7003
- __decorate([
7004
- classTransformer.Expose(),
7005
- classValidator.IsOptional(),
7006
- classValidator.IsEnum(() => exports.NotificationBoxRecipientFlag),
7007
- __metadata("design:type", Object)
7008
- ], UpdateNotificationUserNotificationBoxRecipientParams.prototype, "f", void 0);
7009
- __decorate([
7010
- classTransformer.Expose(),
7011
- classValidator.IsOptional(),
7012
- classValidator.IsBoolean(),
7013
- __metadata("design:type", Object)
7014
- ], UpdateNotificationUserNotificationBoxRecipientParams.prototype, "deleteRemovedConfig", void 0);
7015
- /**
7016
- * Used for updating the NotificationUser.
7017
- */
7018
- class UpdateNotificationUserParams extends TargetModelParams {
7019
- // TODO: update configs...
7020
- gc;
7021
- dc;
7022
- bc;
7023
- }
7024
- __decorate([
7025
- classTransformer.Expose(),
7026
- classValidator.IsOptional(),
7027
- classValidator.ValidateNested(),
7028
- classTransformer.Type(() => UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams),
7029
- __metadata("design:type", Object)
7030
- ], UpdateNotificationUserParams.prototype, "gc", void 0);
7031
- __decorate([
7032
- classTransformer.Expose(),
7033
- classValidator.IsOptional(),
7034
- classValidator.ValidateNested(),
7035
- classTransformer.Type(() => UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams),
7036
- __metadata("design:type", Object)
7037
- ], UpdateNotificationUserParams.prototype, "dc", void 0);
7038
- __decorate([
7039
- classTransformer.Expose(),
7040
- classValidator.IsOptional(),
7041
- classValidator.IsArray(),
7042
- classValidator.ValidateNested({ each: true }),
7043
- classTransformer.Type(() => UpdateNotificationUserNotificationBoxRecipientParams),
7044
- __metadata("design:type", Object)
7045
- ], UpdateNotificationUserParams.prototype, "bc", void 0);
7046
- class ResyncNotificationUserParams extends TargetModelParams {
7047
- }
7048
- class ResyncAllNotificationUserParams {
7049
- }
7050
- /**
7051
- * Used for creating a new NotificationSummary for a model.
7052
- */
7053
- class CreateNotificationSummaryParams {
7054
- /**
7055
- * Model to create the NotificationSummary for.
7056
- */
7057
- model;
7058
- }
7059
- __decorate([
7060
- classTransformer.Expose(),
7061
- classValidator.IsNotEmpty(),
7062
- IsFirestoreModelKey(),
7063
- __metadata("design:type", String)
7064
- ], CreateNotificationSummaryParams.prototype, "model", void 0);
7065
- /**
7066
- * Used for updating the NotificationSummary.
7067
- */
7068
- class UpdateNotificationSummaryParams extends TargetModelParams {
7069
- /**
7070
- * Updates the "rat" time to now.
7071
- */
7072
- flagAllRead;
7073
- /**
7074
- * Sets the "rat" time to the given date, or clears it.
7075
- */
7076
- setReadAtTime;
7077
- }
7078
- __decorate([
7079
- classTransformer.Expose(),
7080
- classValidator.IsOptional(),
7081
- classValidator.IsBoolean(),
7082
- __metadata("design:type", Object)
7083
- ], UpdateNotificationSummaryParams.prototype, "flagAllRead", void 0);
7084
- __decorate([
7085
- classTransformer.Expose(),
7086
- classValidator.IsOptional(),
7087
- classValidator.IsDate(),
7088
- classTransformer.Type(() => Date),
7089
- __metadata("design:type", Object)
7090
- ], UpdateNotificationSummaryParams.prototype, "setReadAtTime", void 0);
7091
- /**
7092
- * Used for creating or initializing a new NotificationBox for a model.
7093
- *
7094
- * Mainly used for testing. Not exposed to the API.
7095
- *
7096
- * The preferred way is to create a NotificationBox through a Notification.
7097
- */
7098
- class CreateNotificationBoxParams {
7099
- model;
7100
- }
7101
- __decorate([
7102
- classTransformer.Expose(),
7103
- classValidator.IsNotEmpty(),
7104
- IsFirestoreModelKey(),
7105
- __metadata("design:type", String)
7106
- ], CreateNotificationBoxParams.prototype, "model", void 0);
7107
- /**
7108
- * Used for initializing an uninitialized model like NotificationBox or NotificationSummary.
7109
- */
7110
- class InitializeNotificationModelParams extends TargetModelParams {
7111
- /**
7112
- * Whether or not to throw an error if the notification has already been sent or is being sent.
7113
- */
7114
- throwErrorIfAlreadyInitialized;
7115
- }
7116
- __decorate([
7117
- classTransformer.Expose(),
7118
- classValidator.IsBoolean(),
7119
- classValidator.IsOptional(),
7120
- __metadata("design:type", Boolean)
7121
- ], InitializeNotificationModelParams.prototype, "throwErrorIfAlreadyInitialized", void 0);
7122
- class InitializeAllApplicableNotificationBoxesParams {
7123
- }
7124
- class InitializeAllApplicableNotificationSummariesParams {
7125
- }
7126
- /**
7127
- * Used for updating the NotificationBox.
7128
- */
7129
- class UpdateNotificationBoxParams extends TargetModelParams {
7130
- }
7131
- /**
7132
- * Used to create/update a notification box recipient.
7133
- */
7134
- class UpdateNotificationBoxRecipientParams extends UpdateNotificationBoxRecipientLikeParams {
7135
- /**
7136
- * NotificationBox key to update.
7137
- */
7138
- key;
7139
- /**
7140
- * NotificationBox recipient to update. Is ignored if UID is provided and matches a user. Used for external recipients/users.
7141
- */
7142
- i;
7143
- /**
7144
- * Notification recipient to update by UID, if applicable.
7145
- */
7146
- uid;
7147
- /**
7148
- * Whether or not to create the user if they currently do not exist. Defaults to false.
7149
- */
7150
- insert;
7151
- /**
7152
- * Whether or not to enable/disable the recipient from recieving items from this box.
7153
- */
7154
- enabled;
7155
- /**
7156
- * Whether or not to remove the user if they exist. Defaults to false.
7157
- */
7158
- remove;
7159
- /**
7160
- * If true, the target recipient will have this NotificationBox added to their exclusion list.
7161
- * If false, the target recipient will have this NotificationBox removed from their exclusion list.
7162
- *
7163
- * If set, the other functions are ignored.
7164
- *
7165
- * If targeting the user by the index, the NotificationBox must exist, and the user must have a uid, otherwise an error will be thrown.
7166
- */
7167
- setExclusion;
7168
- }
7169
- __decorate([
7170
- classTransformer.Expose(),
7171
- classValidator.IsNotEmpty(),
7172
- IsFirestoreModelKey(),
7173
- __metadata("design:type", String)
7174
- ], UpdateNotificationBoxRecipientParams.prototype, "key", void 0);
7175
- __decorate([
7176
- classTransformer.Expose(),
7177
- classValidator.IsOptional(),
7178
- classValidator.IsNumber(),
7179
- __metadata("design:type", Object)
7180
- ], UpdateNotificationBoxRecipientParams.prototype, "i", void 0);
7181
- __decorate([
7182
- classTransformer.Expose(),
7183
- classValidator.IsOptional(),
7184
- IsFirestoreModelId(),
7185
- __metadata("design:type", Object)
7186
- ], UpdateNotificationBoxRecipientParams.prototype, "uid", void 0);
7187
- __decorate([
7188
- classTransformer.Expose(),
7189
- classValidator.IsOptional(),
7190
- classValidator.IsBoolean(),
7191
- __metadata("design:type", Object)
7192
- ], UpdateNotificationBoxRecipientParams.prototype, "insert", void 0);
7193
- __decorate([
7194
- classTransformer.Expose(),
7195
- classValidator.IsOptional(),
7196
- classValidator.IsBoolean(),
7197
- __metadata("design:type", Object)
7198
- ], UpdateNotificationBoxRecipientParams.prototype, "enabled", void 0);
7199
- __decorate([
7200
- classTransformer.Expose(),
7201
- classValidator.IsOptional(),
7202
- classValidator.IsBoolean(),
7203
- __metadata("design:type", Object)
7204
- ], UpdateNotificationBoxRecipientParams.prototype, "remove", void 0);
7205
- __decorate([
7206
- classTransformer.Expose(),
7207
- classValidator.IsOptional(),
7208
- classValidator.IsBoolean(),
7209
- __metadata("design:type", Object)
7210
- ], UpdateNotificationBoxRecipientParams.prototype, "setExclusion", void 0);
7211
- class NotificationRecipientParams {
7212
- /**
7213
- * User to send the notification to.
7214
- */
7215
- uid;
7216
- /**
7217
- * Recipient Name
7218
- */
7219
- un;
7220
- /**
7221
- * Email address
7222
- */
7223
- e;
7224
- /**
7225
- * Phone number
7226
- */
7227
- p;
7228
- }
7229
- __decorate([
7230
- classTransformer.Expose(),
7231
- classValidator.IsOptional(),
7232
- IsFirestoreModelId(),
7233
- __metadata("design:type", Object)
7234
- ], NotificationRecipientParams.prototype, "uid", void 0);
7235
- __decorate([
7236
- classTransformer.Expose(),
7237
- classValidator.IsOptional(),
7238
- classValidator.IsString(),
7239
- classValidator.MinLength(NOTIFICATION_RECIPIENT_NAME_MIN_LENGTH),
7240
- classValidator.MaxLength(NOTIFICATION_RECIPIENT_NAME_MAX_LENGTH),
7241
- __metadata("design:type", Object)
7242
- ], NotificationRecipientParams.prototype, "un", void 0);
7243
- __decorate([
7244
- classTransformer.Expose(),
7245
- classValidator.IsOptional(),
7246
- classValidator.IsEmail(),
7247
- __metadata("design:type", Object)
7248
- ], NotificationRecipientParams.prototype, "e", void 0);
7249
- __decorate([
7250
- classTransformer.Expose(),
7251
- classValidator.IsOptional(),
7252
- classValidator.IsPhoneNumber(),
7253
- __metadata("design:type", Object)
7254
- ], NotificationRecipientParams.prototype, "p", void 0);
7255
- /**
7256
- * Used for sending the notification immediately, if it has not already been sent.
7257
- */
7258
- class SendNotificationParams extends TargetModelParams {
7259
- /**
7260
- * Whether or not to ignore the send at time. Defaults to false.
7261
- *
7262
- * If true, the send at time will be ignored and the notification will be sent immediately.
7263
- */
7264
- ignoreSendAtThrottle;
7265
- /**
7266
- * Whether or not to throw an error if the notification has already been sent or is being sent.
7267
- *
7268
- * Defaults to false.
7269
- */
7270
- throwErrorIfSent;
7271
- }
7272
- __decorate([
7273
- classTransformer.Expose(),
7274
- classValidator.IsOptional(),
7275
- classValidator.IsBoolean(),
7276
- __metadata("design:type", Object)
7277
- ], SendNotificationParams.prototype, "ignoreSendAtThrottle", void 0);
7278
- __decorate([
7279
- classTransformer.Expose(),
7280
- classValidator.IsOptional(),
7281
- classValidator.IsBoolean(),
7282
- __metadata("design:type", Object)
7283
- ], SendNotificationParams.prototype, "throwErrorIfSent", void 0);
7284
- /**
7285
- * Params class used for subscribing a system user to a NotificationBox for a model.
7286
- */
7287
- class AbstractSubscribeToNotificationBoxParams extends TargetModelParams {
7288
- /**
7289
- * Notification recipient to subscribe to notifications
7290
- */
7291
- uid;
7292
- }
7293
- __decorate([
7294
- classTransformer.Expose(),
7295
- IsFirestoreModelId(),
7296
- __metadata("design:type", String)
7297
- ], AbstractSubscribeToNotificationBoxParams.prototype, "uid", void 0);
7298
- class AbstractSubscribeOrUnsubscribeToNotificationBoxParams extends AbstractSubscribeToNotificationBoxParams {
7299
- /**
7300
- * If true, unsubscribes from the notification box instead.
7301
- */
7302
- unsubscribe;
7303
- }
7304
- __decorate([
7305
- classTransformer.Expose(),
7306
- classValidator.IsOptional(),
7307
- classValidator.IsBoolean(),
7308
- __metadata("design:type", Object)
7309
- ], AbstractSubscribeOrUnsubscribeToNotificationBoxParams.prototype, "unsubscribe", void 0);
7310
- /**
7311
- * Used for sending queued notifications in the system.
7312
- */
7313
- class SendQueuedNotificationsParams {
7314
- /**
7315
- * The max number of send loops to run.
7316
- *
7317
- * No limit by default.
7318
- */
7319
- maxSendNotificationLoops;
7320
- /**
7321
- * The max number of parallel send tasks to run.
7322
- *
7323
- * Defaults to 5.
7324
- */
7325
- maxParellelSendTasks;
7326
- /**
7327
- * The threshold to use when to log a warning for an excessive of notification loops.
7328
- */
7329
- sendNotificationLoopsTaskExcessThreshold;
7330
- }
7331
- __decorate([
7332
- classTransformer.Expose(),
7333
- classValidator.IsOptional(),
7334
- classValidator.IsNumber(),
7335
- __metadata("design:type", Object)
7336
- ], SendQueuedNotificationsParams.prototype, "maxSendNotificationLoops", void 0);
7337
- __decorate([
7338
- classTransformer.Expose(),
7339
- classValidator.IsOptional(),
7340
- classValidator.IsNumber(),
7341
- __metadata("design:type", Object)
7342
- ], SendQueuedNotificationsParams.prototype, "maxParellelSendTasks", void 0);
7343
- __decorate([
7344
- classTransformer.Expose(),
7345
- classValidator.IsOptional(),
7346
- classValidator.IsNumber(),
7347
- __metadata("design:type", Object)
7348
- ], SendQueuedNotificationsParams.prototype, "sendNotificationLoopsTaskExcessThreshold", void 0);
7349
- /**
7350
- * Used for sending queued notifications in the system.
7351
- */
7352
- class CleanupSentNotificationsParams {
7353
- }
6877
+ const notificationBoxRecipientTemplateConfigArrayEntryParamType = arktype.type({
6878
+ type: 'string > 0',
6879
+ 'sd?': model.clearable('boolean'),
6880
+ 'se?': model.clearable('boolean'),
6881
+ 'st?': model.clearable('boolean'),
6882
+ 'sp?': model.clearable('boolean'),
6883
+ 'sn?': model.clearable('boolean'),
6884
+ 'remove?': model.clearable('boolean')
6885
+ });
6886
+ const createNotificationUserParamsType = arktype.type({
6887
+ uid: firestoreModelIdType
6888
+ });
6889
+ const updateNotificationUserDefaultNotificationBoxRecipientConfigParamsType = arktype.type({
6890
+ 'i?': model.clearable('number'),
6891
+ 'e?': model.clearable('string.email'),
6892
+ 't?': model.clearable(model.e164PhoneNumberType),
6893
+ 'configs?': model.clearable(notificationBoxRecipientTemplateConfigArrayEntryParamType.array()),
6894
+ 'lk?': model.clearable('boolean'),
6895
+ 'bk?': model.clearable('boolean'),
6896
+ 'f?': model.clearable(arktype.type.enumerated(exports.NotificationBoxRecipientFlag.ENABLED, exports.NotificationBoxRecipientFlag.DISABLED, exports.NotificationBoxRecipientFlag.OPT_OUT))
6897
+ });
6898
+ const updateNotificationBoxRecipientLikeParamsType = arktype.type({
6899
+ 'e?': model.clearable('string.email'),
6900
+ 't?': model.clearable(model.e164PhoneNumberType),
6901
+ 's?': model.clearable('string'),
6902
+ 'configs?': model.clearable(notificationBoxRecipientTemplateConfigArrayEntryParamType.array())
6903
+ });
6904
+ const updateNotificationUserNotificationBoxRecipientParamsType = updateNotificationBoxRecipientLikeParamsType.merge({
6905
+ nb: firestoreModelIdType,
6906
+ 'rm?': model.clearable('boolean'),
6907
+ 'lk?': model.clearable('boolean'),
6908
+ 'bk?': model.clearable('boolean'),
6909
+ 'f?': model.clearable(arktype.type.enumerated(exports.NotificationBoxRecipientFlag.ENABLED, exports.NotificationBoxRecipientFlag.DISABLED, exports.NotificationBoxRecipientFlag.OPT_OUT)),
6910
+ 'deleteRemovedConfig?': model.clearable('boolean')
6911
+ });
6912
+ const updateNotificationUserParamsType = targetModelParamsType.merge({
6913
+ 'gc?': model.clearable(updateNotificationUserDefaultNotificationBoxRecipientConfigParamsType),
6914
+ 'dc?': model.clearable(updateNotificationUserDefaultNotificationBoxRecipientConfigParamsType),
6915
+ 'bc?': model.clearable(updateNotificationUserNotificationBoxRecipientParamsType.array())
6916
+ });
6917
+ const resyncNotificationUserParamsType = targetModelParamsType;
6918
+ const resyncAllNotificationUserParamsType = arktype.type({});
6919
+ const createNotificationSummaryParamsType = arktype.type({
6920
+ model: firestoreModelKeyType
6921
+ });
6922
+ const updateNotificationSummaryParamsType = targetModelParamsType.merge({
6923
+ 'flagAllRead?': model.clearable('boolean'),
6924
+ 'setReadAtTime?': model.clearable('string.date.parse')
6925
+ });
6926
+ const createNotificationBoxParamsType = arktype.type({
6927
+ model: firestoreModelKeyType
6928
+ });
6929
+ const initializeNotificationModelParamsType = targetModelParamsType.merge({
6930
+ 'throwErrorIfAlreadyInitialized?': 'boolean'
6931
+ });
6932
+ const initializeAllApplicableNotificationBoxesParamsType = arktype.type({});
6933
+ const initializeAllApplicableNotificationSummariesParamsType = arktype.type({});
6934
+ const updateNotificationBoxParamsType = targetModelParamsType;
6935
+ const updateNotificationBoxRecipientParamsType = updateNotificationBoxRecipientLikeParamsType.merge({
6936
+ key: firestoreModelKeyType,
6937
+ 'i?': model.clearable('number'),
6938
+ 'uid?': model.clearable(firestoreModelIdType),
6939
+ 'insert?': model.clearable('boolean'),
6940
+ 'enabled?': model.clearable('boolean'),
6941
+ 'remove?': model.clearable('boolean'),
6942
+ 'setExclusion?': model.clearable('boolean')
6943
+ });
6944
+ const notificationRecipientParamsType = arktype.type({
6945
+ 'uid?': model.clearable(firestoreModelIdType),
6946
+ 'un?': model.clearable(`string >= ${NOTIFICATION_RECIPIENT_NAME_MIN_LENGTH} & string <= ${NOTIFICATION_RECIPIENT_NAME_MAX_LENGTH}`),
6947
+ 'e?': model.clearable('string.email'),
6948
+ 'p?': model.clearable('string')
6949
+ });
6950
+ const sendNotificationParamsType = targetModelParamsType.merge({
6951
+ 'ignoreSendAtThrottle?': model.clearable('boolean'),
6952
+ 'throwErrorIfSent?': model.clearable('boolean')
6953
+ });
6954
+ const abstractSubscribeToNotificationBoxParamsType = targetModelParamsType.merge({
6955
+ uid: firestoreModelIdType
6956
+ });
6957
+ const abstractSubscribeOrUnsubscribeToNotificationBoxParamsType = abstractSubscribeToNotificationBoxParamsType.merge({
6958
+ 'unsubscribe?': model.clearable('boolean')
6959
+ });
6960
+ const sendQueuedNotificationsParamsType = arktype.type({
6961
+ 'maxSendNotificationLoops?': model.clearable('number'),
6962
+ 'maxParellelSendTasks?': model.clearable('number'),
6963
+ 'sendNotificationLoopsTaskExcessThreshold?': model.clearable('number')
6964
+ });
6965
+ const cleanupSentNotificationsParamsType = arktype.type({});
7354
6966
  const notificationFunctionTypeConfigMap = {};
7355
6967
  const notificationBoxModelCrudFunctionsConfig = {
7356
6968
  notificationUser: ['update:_,resync'],
@@ -8281,325 +7893,61 @@ const STORAGE_FILE_GROUP_QUEUED_FOR_INITIALIZATION_ERROR_CODE = 'STORAGE_FILE_GR
8281
7893
  */
8282
7894
  const STORAGE_FILE_GROUP_CREATE_INPUT_ERROR_CODE = 'STORAGE_FILE_GROUP_CREATE_INPUT_ERROR';
8283
7895
 
8284
- /**
8285
- * Used for directly create a new StorageFile.
8286
- */
8287
- class CreateStorageFileParams {
8288
- }
8289
- /**
8290
- * Initializes all StorageFiles in the uploads folder.
8291
- */
8292
- class InitializeAllStorageFilesFromUploadsParams {
8293
- /**
8294
- * The maximum number of files to initialize at once.
8295
- */
8296
- maxFilesToInitialize;
8297
- /**
8298
- * The specific folder under the uploads folder to search for files and initialize
8299
- */
8300
- folderPath;
8301
- /**
8302
- * Overrides the default uploads folder path.
8303
- */
8304
- overrideUploadsFolderPath;
8305
- }
8306
- __decorate([
8307
- classTransformer.Expose(),
8308
- classValidator.IsNumber(),
8309
- classValidator.IsOptional(),
8310
- __metadata("design:type", Object)
8311
- ], InitializeAllStorageFilesFromUploadsParams.prototype, "maxFilesToInitialize", void 0);
8312
- __decorate([
8313
- classTransformer.Expose(),
8314
- classValidator.IsString(),
8315
- classValidator.IsOptional(),
8316
- __metadata("design:type", Object)
8317
- ], InitializeAllStorageFilesFromUploadsParams.prototype, "folderPath", void 0);
8318
- __decorate([
8319
- classTransformer.Expose(),
8320
- classValidator.IsString(),
8321
- classValidator.IsOptional(),
8322
- __metadata("design:type", Object)
8323
- ], InitializeAllStorageFilesFromUploadsParams.prototype, "overrideUploadsFolderPath", void 0);
8324
- /**
8325
- * Initializes a StorageFile from the document at the given path.
8326
- */
8327
- class InitializeStorageFileFromUploadParams {
8328
- /**
8329
- * Specific bucketId to use.
8330
- *
8331
- * If not defined, the default bucket will be used.
8332
- */
8333
- bucketId;
8334
- pathString;
8335
- /**
8336
- * Whether or not to attempt to expedite the processing of the created StorageFile, if it is queued for processing.
8337
- *
8338
- * If it cannot be processed, this argument will have no effect.
8339
- */
8340
- expediteProcessing;
8341
- }
8342
- __decorate([
8343
- classTransformer.Expose(),
8344
- classValidator.IsOptional(),
8345
- classValidator.IsString(),
8346
- __metadata("design:type", Object)
8347
- ], InitializeStorageFileFromUploadParams.prototype, "bucketId", void 0);
8348
- __decorate([
8349
- classTransformer.Expose(),
8350
- classValidator.IsString(),
8351
- __metadata("design:type", String)
8352
- ], InitializeStorageFileFromUploadParams.prototype, "pathString", void 0);
8353
- __decorate([
8354
- classTransformer.Expose(),
8355
- classValidator.IsBoolean(),
8356
- classValidator.IsOptional(),
8357
- __metadata("design:type", Boolean)
8358
- ], InitializeStorageFileFromUploadParams.prototype, "expediteProcessing", void 0);
8359
- class ProcessStorageFileParams extends TargetModelParams {
8360
- /**
8361
- * If set, will start/run the processing immediately instead of waiting for the next scheduled run.
8362
- */
8363
- runImmediately;
8364
- /**
8365
- * If set, will check and retry processing if the StorageFile is in a failed processing state.
8366
- */
8367
- checkRetryProcessing;
8368
- /**
8369
- * Used with checkRetryProcessing.
8370
- *
8371
- * If set, will forcibly create a new processing task even if the existing processing task appears to be ok, or if processing was already marked complete.
8372
- */
8373
- forceRestartProcessing;
8374
- /**
8375
- * If set, will start the processing again if the StorageFile is in a successful processing state.
8376
- */
8377
- processAgainIfSuccessful;
8378
- }
8379
- __decorate([
8380
- classTransformer.Expose(),
8381
- classValidator.IsBoolean(),
8382
- classValidator.IsOptional(),
8383
- __metadata("design:type", Object)
8384
- ], ProcessStorageFileParams.prototype, "runImmediately", void 0);
8385
- __decorate([
8386
- classTransformer.Expose(),
8387
- classValidator.IsBoolean(),
8388
- classValidator.IsOptional(),
8389
- __metadata("design:type", Object)
8390
- ], ProcessStorageFileParams.prototype, "checkRetryProcessing", void 0);
8391
- __decorate([
8392
- classTransformer.Expose(),
8393
- classValidator.IsBoolean(),
8394
- classValidator.IsOptional(),
8395
- __metadata("design:type", Object)
8396
- ], ProcessStorageFileParams.prototype, "forceRestartProcessing", void 0);
8397
- __decorate([
8398
- classTransformer.Expose(),
8399
- classValidator.IsBoolean(),
8400
- classValidator.IsOptional(),
8401
- __metadata("design:type", Object)
8402
- ], ProcessStorageFileParams.prototype, "processAgainIfSuccessful", void 0);
8403
- /**
8404
- * Processes all StorageFiles that are queued for processing.
8405
- */
8406
- class ProcessAllQueuedStorageFilesParams {
8407
- }
8408
- class UpdateStorageFileParams extends TargetModelParams {
8409
- /**
8410
- * Sets the delete at time for the given StorageFileDocument, and queues the file for deletion.
8411
- */
8412
- sdat;
8413
- }
8414
- __decorate([
8415
- classTransformer.Expose(),
8416
- classValidator.IsDate(),
8417
- classValidator.IsOptional(),
8418
- classTransformer.Type(() => Date),
8419
- __metadata("design:type", Object)
8420
- ], UpdateStorageFileParams.prototype, "sdat", void 0);
8421
- class DeleteStorageFileParams extends TargetModelParams {
8422
- /**
8423
- * If true, will force the deletion of the StorageFile even if it is not queued for deletion.
8424
- */
8425
- force;
8426
- }
8427
- __decorate([
8428
- classTransformer.Expose(),
8429
- classValidator.IsBoolean(),
8430
- classValidator.IsOptional(),
8431
- __metadata("design:type", Object)
8432
- ], DeleteStorageFileParams.prototype, "force", void 0);
8433
- /**
8434
- * Processes all StorageFiles that are queued for processing.
8435
- */
8436
- class DeleteAllQueuedStorageFilesParams {
8437
- }
8438
- class DownloadStorageFileParams extends TargetModelParams {
8439
- /**
8440
- * Date to expire the download URL.
8441
- */
8442
- expiresAt;
8443
- /**
8444
- * Duration in milliseconds to expire the download URL from now.
8445
- */
8446
- expiresIn;
8447
- /**
8448
- * The content disposition for the response to use.
8449
- */
8450
- responseDisposition;
8451
- /**
8452
- * The content type for the response to use.
8453
- *
8454
- * Only available to admins.
8455
- */
8456
- responseContentType;
8457
- /**
8458
- * Whether or not an admin is creating the link.
8459
- *
8460
- * Allows a longer expiration.
8461
- */
8462
- asAdmin;
8463
- }
8464
- __decorate([
8465
- classTransformer.Expose(),
8466
- classValidator.IsDate(),
8467
- classValidator.IsOptional(),
8468
- classTransformer.Type(() => Date),
8469
- __metadata("design:type", Object)
8470
- ], DownloadStorageFileParams.prototype, "expiresAt", void 0);
8471
- __decorate([
8472
- classTransformer.Expose(),
8473
- classValidator.Min(0),
8474
- classValidator.IsNumber(),
8475
- classValidator.IsOptional(),
8476
- __metadata("design:type", Object)
8477
- ], DownloadStorageFileParams.prototype, "expiresIn", void 0);
8478
- __decorate([
8479
- classTransformer.Expose(),
8480
- classValidator.IsOptional(),
8481
- classValidator.IsString(),
8482
- __metadata("design:type", Object)
8483
- ], DownloadStorageFileParams.prototype, "responseDisposition", void 0);
8484
- __decorate([
8485
- classTransformer.Expose(),
8486
- classValidator.IsOptional(),
8487
- classValidator.IsString(),
8488
- classValidator.IsMimeType(),
8489
- __metadata("design:type", Object)
8490
- ], DownloadStorageFileParams.prototype, "responseContentType", void 0);
8491
- __decorate([
8492
- classTransformer.Expose(),
8493
- classValidator.IsBoolean(),
8494
- classValidator.IsOptional(),
8495
- __metadata("design:type", Object)
8496
- ], DownloadStorageFileParams.prototype, "asAdmin", void 0);
8497
- /**
8498
- * Used for creating or initializing a new StorageFileGroup for a StorageFile.
8499
- *
8500
- * Mainly used for testing. Not exposed to the API.
8501
- *
8502
- * The preferred way is to create a StorageFileGroup through a StorageFile.
8503
- */
8504
- class CreateStorageFileGroupParams {
8505
- /**
8506
- * ModelKey to use for creating the StorageFileGroup.
8507
- */
8508
- model;
8509
- /**
8510
- * StorageFileId to use for creating the StorageFileGroup.
8511
- */
8512
- storageFileId;
8513
- }
8514
- __decorate([
8515
- classTransformer.Expose(),
8516
- classValidator.IsOptional(),
8517
- classValidator.IsNotEmpty(),
8518
- IsFirestoreModelKey(),
8519
- __metadata("design:type", Object)
8520
- ], CreateStorageFileGroupParams.prototype, "model", void 0);
8521
- __decorate([
8522
- classTransformer.Expose(),
8523
- classValidator.IsNotEmpty(),
8524
- IsFirestoreModelId(),
8525
- __metadata("design:type", Object)
8526
- ], CreateStorageFileGroupParams.prototype, "storageFileId", void 0);
8527
- class SyncStorageFileWithGroupsParams extends TargetModelParams {
8528
- /**
8529
- * If true, will force syncing even if the StorageFile is not flagged for a resync.
8530
- */
8531
- force;
8532
- }
8533
- __decorate([
8534
- classTransformer.Expose(),
8535
- classValidator.IsBoolean(),
8536
- classValidator.IsOptional(),
8537
- __metadata("design:type", Boolean)
8538
- ], SyncStorageFileWithGroupsParams.prototype, "force", void 0);
8539
- class SyncAllFlaggedStorageFilesWithGroupsParams {
8540
- }
8541
- class UpdateStorageFileGroupParams extends TargetModelParams {
8542
- /**
8543
- * Entries to update, if selected.
8544
- */
8545
- entries;
8546
- }
8547
- __decorate([
8548
- classTransformer.Expose(),
8549
- classValidator.IsArray(),
8550
- classValidator.IsOptional(),
8551
- classTransformer.Type(() => UpdateStorageFileGroupEntryParams),
8552
- classValidator.ValidateNested({ each: true }),
8553
- __metadata("design:type", Object)
8554
- ], UpdateStorageFileGroupParams.prototype, "entries", void 0);
8555
- class UpdateStorageFileGroupEntryParams {
8556
- s;
8557
- n;
8558
- }
8559
- __decorate([
8560
- classTransformer.Expose(),
8561
- classValidator.IsNotEmpty(),
8562
- IsFirestoreModelId(),
8563
- __metadata("design:type", String)
8564
- ], UpdateStorageFileGroupEntryParams.prototype, "s", void 0);
8565
- __decorate([
8566
- classTransformer.Expose(),
8567
- classValidator.IsString(),
8568
- classValidator.IsOptional(),
8569
- classValidator.IsNotEmpty(),
8570
- __metadata("design:type", Object)
8571
- ], UpdateStorageFileGroupEntryParams.prototype, "n", void 0);
8572
- class RegenerateStorageFileGroupContentParams extends TargetModelParams {
8573
- /**
8574
- * If true, will force syncing even if the StorageFile is not flagged for a resync.
8575
- */
8576
- force;
8577
- }
8578
- __decorate([
8579
- classTransformer.Expose(),
8580
- classValidator.IsBoolean(),
8581
- classValidator.IsOptional(),
8582
- __metadata("design:type", Boolean)
8583
- ], RegenerateStorageFileGroupContentParams.prototype, "force", void 0);
8584
- class RegenerateAllFlaggedStorageFileGroupsContentParams {
8585
- }
8586
- /**
8587
- * Used for initializing an uninitialized model like NotificationBox or NotificationSummary.
8588
- */
8589
- class InitializeStorageFileModelParams extends TargetModelParams {
8590
- /**
8591
- * Whether or not to throw an error if the notification has already been sent or is being sent.
8592
- */
8593
- throwErrorIfAlreadyInitialized;
8594
- }
8595
- __decorate([
8596
- classTransformer.Expose(),
8597
- classValidator.IsBoolean(),
8598
- classValidator.IsOptional(),
8599
- __metadata("design:type", Boolean)
8600
- ], InitializeStorageFileModelParams.prototype, "throwErrorIfAlreadyInitialized", void 0);
8601
- class InitializeAllApplicableStorageFileGroupsParams {
8602
- }
7896
+ const createStorageFileParamsType = arktype.type({});
7897
+ const initializeAllStorageFilesFromUploadsParamsType = arktype.type({
7898
+ 'maxFilesToInitialize?': model.clearable('number'),
7899
+ 'folderPath?': model.clearable('string'),
7900
+ 'overrideUploadsFolderPath?': model.clearable('string')
7901
+ });
7902
+ const initializeStorageFileFromUploadParamsType = arktype.type({
7903
+ 'bucketId?': model.clearable('string'),
7904
+ pathString: 'string > 0',
7905
+ 'expediteProcessing?': 'boolean'
7906
+ });
7907
+ const processStorageFileParamsType = targetModelParamsType.merge({
7908
+ 'runImmediately?': model.clearable('boolean'),
7909
+ 'checkRetryProcessing?': model.clearable('boolean'),
7910
+ 'forceRestartProcessing?': model.clearable('boolean'),
7911
+ 'processAgainIfSuccessful?': model.clearable('boolean')
7912
+ });
7913
+ const processAllQueuedStorageFilesParamsType = arktype.type({});
7914
+ const updateStorageFileParamsType = targetModelParamsType.merge({
7915
+ 'sdat?': model.clearable('string.date.parse')
7916
+ });
7917
+ const deleteStorageFileParamsType = targetModelParamsType.merge({
7918
+ 'force?': model.clearable('boolean')
7919
+ });
7920
+ const deleteAllQueuedStorageFilesParamsType = arktype.type({});
7921
+ const downloadStorageFileParamsType = targetModelParamsType.merge({
7922
+ 'expiresAt?': model.clearable('string.date.parse'),
7923
+ 'expiresIn?': model.clearable('number >= 0'),
7924
+ 'responseDisposition?': model.clearable('string'),
7925
+ 'responseContentType?': model.clearable('string'),
7926
+ 'asAdmin?': model.clearable('boolean')
7927
+ });
7928
+ const createStorageFileGroupParamsType = arktype.type({
7929
+ 'model?': model.clearable(firestoreModelKeyType),
7930
+ 'storageFileId?': model.clearable(firestoreModelIdType)
7931
+ });
7932
+ const syncStorageFileWithGroupsParamsType = targetModelParamsType.merge({
7933
+ 'force?': 'boolean'
7934
+ });
7935
+ const syncAllFlaggedStorageFilesWithGroupsParamsType = arktype.type({});
7936
+ const updateStorageFileGroupEntryParamsType = arktype.type({
7937
+ s: firestoreModelIdType,
7938
+ 'n?': model.clearable('string > 0')
7939
+ });
7940
+ const updateStorageFileGroupParamsType = targetModelParamsType.merge({
7941
+ 'entries?': model.clearable(updateStorageFileGroupEntryParamsType.array())
7942
+ });
7943
+ const regenerateStorageFileGroupContentParamsType = targetModelParamsType.merge({
7944
+ 'force?': 'boolean'
7945
+ });
7946
+ const regenerateAllFlaggedStorageFileGroupsContentParamsType = arktype.type({});
7947
+ const initializeStorageFileModelParamsType = targetModelParamsType.merge({
7948
+ 'throwErrorIfAlreadyInitialized?': 'boolean'
7949
+ });
7950
+ const initializeAllApplicableStorageFileGroupsParamsType = arktype.type({});
8603
7951
  const storageFileFunctionTypeConfigMap = {};
8604
7952
  const storageFileModelCrudFunctionsConfig = {
8605
7953
  storageFile: ['create:_,fromUpload,allFromUpload', 'update:_,process,syncWithGroups', 'delete:_', 'read:download'],
@@ -9463,20 +8811,12 @@ exports.ALL_USER_UPLOADS_FOLDER_PATH = ALL_USER_UPLOADS_FOLDER_PATH;
9463
8811
  exports.AbstractFirestoreDocument = AbstractFirestoreDocument;
9464
8812
  exports.AbstractFirestoreDocumentDataAccessorWrapper = AbstractFirestoreDocumentDataAccessorWrapper;
9465
8813
  exports.AbstractFirestoreDocumentWithParent = AbstractFirestoreDocumentWithParent;
9466
- exports.AbstractSubscribeOrUnsubscribeToNotificationBoxParams = AbstractSubscribeOrUnsubscribeToNotificationBoxParams;
9467
- exports.AbstractSubscribeToNotificationBoxParams = AbstractSubscribeToNotificationBoxParams;
9468
8814
  exports.AppNotificationTemplateTypeInfoRecordService = AppNotificationTemplateTypeInfoRecordService;
9469
8815
  exports.BASE_MODEL_STORAGE_FILE_PATH = BASE_MODEL_STORAGE_FILE_PATH;
9470
8816
  exports.CALL_MODEL_APP_FUNCTION_KEY = CALL_MODEL_APP_FUNCTION_KEY;
9471
8817
  exports.COPY_USER_RELATED_DATA_ACCESSOR_FACTORY_FUNCTION = COPY_USER_RELATED_DATA_ACCESSOR_FACTORY_FUNCTION;
9472
8818
  exports.CREATE_NOTIFICATION_ID_REQUIRED_ERROR_CODE = CREATE_NOTIFICATION_ID_REQUIRED_ERROR_CODE;
9473
- exports.CleanupSentNotificationsParams = CleanupSentNotificationsParams;
9474
8819
  exports.ContextGrantedModelRolesReaderInstance = ContextGrantedModelRolesReaderInstance;
9475
- exports.CreateNotificationBoxParams = CreateNotificationBoxParams;
9476
- exports.CreateNotificationSummaryParams = CreateNotificationSummaryParams;
9477
- exports.CreateNotificationUserParams = CreateNotificationUserParams;
9478
- exports.CreateStorageFileGroupParams = CreateStorageFileGroupParams;
9479
- exports.CreateStorageFileParams = CreateStorageFileParams;
9480
8820
  exports.DBX_FIREBASE_SERVER_NO_AUTH_ERROR_CODE = DBX_FIREBASE_SERVER_NO_AUTH_ERROR_CODE;
9481
8821
  exports.DBX_FIREBASE_SERVER_NO_UID_ERROR_CODE = DBX_FIREBASE_SERVER_NO_UID_ERROR_CODE;
9482
8822
  exports.DEFAULT_DATE_CELL_RANGE_VALUE = DEFAULT_DATE_CELL_RANGE_VALUE;
@@ -9494,9 +8834,6 @@ exports.DEFAULT_QUERY_CHANGE_WATCHER_DELAY = DEFAULT_QUERY_CHANGE_WATCHER_DELAY;
9494
8834
  exports.DEFAULT_SINGLE_ITEM_FIRESTORE_COLLECTION_DOCUMENT_IDENTIFIER = DEFAULT_SINGLE_ITEM_FIRESTORE_COLLECTION_DOCUMENT_IDENTIFIER;
9495
8835
  exports.DEFAULT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL = DEFAULT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL;
9496
8836
  exports.DEFAULT_WEBSITE_LINK = DEFAULT_WEBSITE_LINK;
9497
- exports.DeleteAllQueuedStorageFilesParams = DeleteAllQueuedStorageFilesParams;
9498
- exports.DeleteStorageFileParams = DeleteStorageFileParams;
9499
- exports.DownloadStorageFileParams = DownloadStorageFileParams;
9500
8837
  exports.EMPTY_STORAGE_FILE_PURPOSE_SUBGROUP = EMPTY_STORAGE_FILE_PURPOSE_SUBGROUP;
9501
8838
  exports.EXACT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL = EXACT_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL;
9502
8839
  exports.FIREBASE_AUTH_NETWORK_REQUEST_ERROR = FIREBASE_AUTH_NETWORK_REQUEST_ERROR;
@@ -9539,18 +8876,6 @@ exports.FirebaseDevelopmentFunctions = FirebaseDevelopmentFunctions;
9539
8876
  exports.FirebaseModelPermissionServiceInstance = FirebaseModelPermissionServiceInstance;
9540
8877
  exports.FirebaseServerError = FirebaseServerError;
9541
8878
  exports.HIGH_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL = HIGH_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL;
9542
- exports.InferredTargetModelIdParams = InferredTargetModelIdParams;
9543
- exports.InferredTargetModelParams = InferredTargetModelParams;
9544
- exports.InitializeAllApplicableNotificationBoxesParams = InitializeAllApplicableNotificationBoxesParams;
9545
- exports.InitializeAllApplicableNotificationSummariesParams = InitializeAllApplicableNotificationSummariesParams;
9546
- exports.InitializeAllApplicableStorageFileGroupsParams = InitializeAllApplicableStorageFileGroupsParams;
9547
- exports.InitializeAllStorageFilesFromUploadsParams = InitializeAllStorageFilesFromUploadsParams;
9548
- exports.InitializeNotificationModelParams = InitializeNotificationModelParams;
9549
- exports.InitializeStorageFileFromUploadParams = InitializeStorageFileFromUploadParams;
9550
- exports.InitializeStorageFileModelParams = InitializeStorageFileModelParams;
9551
- exports.IsFirestoreModelId = IsFirestoreModelId;
9552
- exports.IsFirestoreModelIdOrKey = IsFirestoreModelIdOrKey;
9553
- exports.IsFirestoreModelKey = IsFirestoreModelKey;
9554
8879
  exports.LOW_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL = LOW_UPLOADED_FILE_TYPE_DETERMINATION_LEVEL;
9555
8880
  exports.MAX_FIRESTORE_MAP_ZOOM_LEVEL_VALUE = MAX_FIRESTORE_MAP_ZOOM_LEVEL_VALUE;
9556
8881
  exports.MIN_FIRESTORE_MAP_ZOOM_LEVEL_VALUE = MIN_FIRESTORE_MAP_ZOOM_LEVEL_VALUE;
@@ -9579,21 +8904,13 @@ exports.NOTIFICATION_USER_INVALID_UID_FOR_CREATE_ERROR_CODE = NOTIFICATION_USER_
9579
8904
  exports.NOTIFICATION_USER_LOCKED_CONFIG_FROM_BEING_UPDATED_ERROR_CODE = NOTIFICATION_USER_LOCKED_CONFIG_FROM_BEING_UPDATED_ERROR_CODE;
9580
8905
  exports.NOTIFICATION_WEEK_NOTIFICATION_ITEM_LIMIT = NOTIFICATION_WEEK_NOTIFICATION_ITEM_LIMIT;
9581
8906
  exports.NotificationBoxDocument = NotificationBoxDocument;
9582
- exports.NotificationBoxRecipientTemplateConfigArrayEntryParam = NotificationBoxRecipientTemplateConfigArrayEntryParam;
9583
8907
  exports.NotificationDocument = NotificationDocument;
9584
8908
  exports.NotificationFirestoreCollections = NotificationFirestoreCollections;
9585
8909
  exports.NotificationFunctions = NotificationFunctions;
9586
- exports.NotificationRecipientParams = NotificationRecipientParams;
9587
8910
  exports.NotificationSummaryDocument = NotificationSummaryDocument;
9588
8911
  exports.NotificationUserDocument = NotificationUserDocument;
9589
8912
  exports.NotificationWeekDocument = NotificationWeekDocument;
9590
- exports.ProcessAllQueuedStorageFilesParams = ProcessAllQueuedStorageFilesParams;
9591
- exports.ProcessStorageFileParams = ProcessStorageFileParams;
9592
8913
  exports.RUN_DEV_FUNCTION_APP_FUNCTION_KEY = RUN_DEV_FUNCTION_APP_FUNCTION_KEY;
9593
- exports.RegenerateAllFlaggedStorageFileGroupsContentParams = RegenerateAllFlaggedStorageFileGroupsContentParams;
9594
- exports.RegenerateStorageFileGroupContentParams = RegenerateStorageFileGroupContentParams;
9595
- exports.ResyncAllNotificationUserParams = ResyncAllNotificationUserParams;
9596
- exports.ResyncNotificationUserParams = ResyncNotificationUserParams;
9597
8914
  exports.SCHEDULED_FUNCTION_DEV_FUNCTION_SPECIFIER = SCHEDULED_FUNCTION_DEV_FUNCTION_SPECIFIER;
9598
8915
  exports.STORAGEFILE_RELATED_FILE_METADATA_KEY = STORAGEFILE_RELATED_FILE_METADATA_KEY;
9599
8916
  exports.STORAGE_FILE_ALREADY_PROCESSED_ERROR_CODE = STORAGE_FILE_ALREADY_PROCESSED_ERROR_CODE;
@@ -9615,36 +8932,21 @@ exports.STORAGE_FILE_PROCESSING_NOT_QUEUED_FOR_PROCESSING_ERROR_CODE = STORAGE_F
9615
8932
  exports.STORAGE_FILE_PROCESSING_STUCK_THROTTLE_CHECK_MS = STORAGE_FILE_PROCESSING_STUCK_THROTTLE_CHECK_MS;
9616
8933
  exports.STORAGE_FILE_UPLOAD_USER_ROLE = STORAGE_FILE_UPLOAD_USER_ROLE;
9617
8934
  exports.ScheduledFunctionDevelopmentFirebaseFunctionListEntry = ScheduledFunctionDevelopmentFirebaseFunctionListEntry;
9618
- exports.ScheduledFunctionDevelopmentFirebaseFunctionParams = ScheduledFunctionDevelopmentFirebaseFunctionParams;
9619
- exports.SendNotificationParams = SendNotificationParams;
9620
- exports.SendQueuedNotificationsParams = SendQueuedNotificationsParams;
9621
8935
  exports.StorageFileDocument = StorageFileDocument;
9622
8936
  exports.StorageFileFirestoreCollections = StorageFileFirestoreCollections;
9623
8937
  exports.StorageFileFunctions = StorageFileFunctions;
9624
8938
  exports.StorageFileGroupDocument = StorageFileGroupDocument;
9625
8939
  exports.StorageFileUploadStreamUnsupportedError = StorageFileUploadStreamUnsupportedError;
9626
- exports.SyncAllFlaggedStorageFilesWithGroupsParams = SyncAllFlaggedStorageFilesWithGroupsParams;
9627
- exports.SyncStorageFileWithGroupsParams = SyncStorageFileWithGroupsParams;
9628
8940
  exports.SystemStateDocument = SystemStateDocument;
9629
8941
  exports.SystemStateFirestoreCollections = SystemStateFirestoreCollections;
9630
- exports.TargetModelIdParams = TargetModelIdParams;
9631
- exports.TargetModelParams = TargetModelParams;
9632
8942
  exports.UPLOADED_FILE_DOES_NOT_EXIST_ERROR_CODE = UPLOADED_FILE_DOES_NOT_EXIST_ERROR_CODE;
9633
8943
  exports.UPLOADED_FILE_INITIALIZATION_DISCARDED_ERROR_CODE = UPLOADED_FILE_INITIALIZATION_DISCARDED_ERROR_CODE;
9634
8944
  exports.UPLOADED_FILE_INITIALIZATION_FAILED_ERROR_CODE = UPLOADED_FILE_INITIALIZATION_FAILED_ERROR_CODE;
9635
8945
  exports.UPLOADED_FILE_NOT_ALLOWED_TO_BE_INITIALIZED_ERROR_CODE = UPLOADED_FILE_NOT_ALLOWED_TO_BE_INITIALIZED_ERROR_CODE;
9636
8946
  exports.UPLOADS_FOLDER_PATH = UPLOADS_FOLDER_PATH;
9637
- exports.UpdateNotificationBoxParams = UpdateNotificationBoxParams;
9638
- exports.UpdateNotificationBoxRecipientLikeParams = UpdateNotificationBoxRecipientLikeParams;
9639
- exports.UpdateNotificationBoxRecipientParams = UpdateNotificationBoxRecipientParams;
9640
- exports.UpdateNotificationSummaryParams = UpdateNotificationSummaryParams;
9641
- exports.UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams = UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams;
9642
- exports.UpdateNotificationUserNotificationBoxRecipientParams = UpdateNotificationUserNotificationBoxRecipientParams;
9643
- exports.UpdateNotificationUserParams = UpdateNotificationUserParams;
9644
- exports.UpdateStorageFileGroupEntryParams = UpdateStorageFileGroupEntryParams;
9645
- exports.UpdateStorageFileGroupParams = UpdateStorageFileGroupParams;
9646
- exports.UpdateStorageFileParams = UpdateStorageFileParams;
9647
8947
  exports._createNotificationDocumentFromPair = _createNotificationDocumentFromPair;
8948
+ exports.abstractSubscribeOrUnsubscribeToNotificationBoxParamsType = abstractSubscribeOrUnsubscribeToNotificationBoxParamsType;
8949
+ exports.abstractSubscribeToNotificationBoxParamsType = abstractSubscribeToNotificationBoxParamsType;
9648
8950
  exports.addConstraintToBuilder = addConstraintToBuilder;
9649
8951
  exports.addOrReplaceLimitInConstraints = addOrReplaceLimitInConstraints;
9650
8952
  exports.allChildDocumentsUnderParent = allChildDocumentsUnderParent;
@@ -9673,6 +8975,7 @@ exports.canQueueStorageFileForProcessing = canQueueStorageFileForProcessing;
9673
8975
  exports.childFirestoreModelKey = childFirestoreModelKey;
9674
8976
  exports.childFirestoreModelKeyPath = childFirestoreModelKeyPath;
9675
8977
  exports.childFirestoreModelKeys = childFirestoreModelKeys;
8978
+ exports.cleanupSentNotificationsParamsType = cleanupSentNotificationsParamsType;
9676
8979
  exports.clientFirebaseFirestoreContextFactory = clientFirebaseFirestoreContextFactory;
9677
8980
  exports.clientFirebaseStorageContextFactory = clientFirebaseStorageContextFactory;
9678
8981
  exports.combineUploadFileTypeDeterminers = combineUploadFileTypeDeterminers;
@@ -9686,16 +8989,23 @@ exports.copyDocumentIdToFieldModifierFunction = copyDocumentIdToFieldModifierFun
9686
8989
  exports.copyStoragePath = copyStoragePath;
9687
8990
  exports.copyUserRelatedDataAccessorFactoryFunction = copyUserRelatedDataAccessorFactoryFunction;
9688
8991
  exports.copyUserRelatedDataModifierConfig = copyUserRelatedDataModifierConfig;
8992
+ exports.createNotificationBoxParamsType = createNotificationBoxParamsType;
9689
8993
  exports.createNotificationDocument = createNotificationDocument;
9690
8994
  exports.createNotificationDocumentIfSending = createNotificationDocumentIfSending;
9691
8995
  exports.createNotificationDocumentPair = createNotificationDocumentPair;
8996
+ exports.createNotificationSummaryParamsType = createNotificationSummaryParamsType;
9692
8997
  exports.createNotificationTaskTemplate = createNotificationTaskTemplate;
9693
8998
  exports.createNotificationTemplate = createNotificationTemplate;
8999
+ exports.createNotificationUserParamsType = createNotificationUserParamsType;
9694
9000
  exports.createStorageFileDocumentPair = createStorageFileDocumentPair;
9695
9001
  exports.createStorageFileDocumentPairFactory = createStorageFileDocumentPairFactory;
9002
+ exports.createStorageFileGroupParamsType = createStorageFileGroupParamsType;
9003
+ exports.createStorageFileParamsType = createStorageFileParamsType;
9696
9004
  exports.dataFromDocumentSnapshots = dataFromDocumentSnapshots;
9697
9005
  exports.dataFromSnapshotStream = dataFromSnapshotStream;
9698
9006
  exports.delayCompletion = delayCompletion;
9007
+ exports.deleteAllQueuedStorageFilesParamsType = deleteAllQueuedStorageFilesParamsType;
9008
+ exports.deleteStorageFileParamsType = deleteStorageFileParamsType;
9699
9009
  exports.determineByFileName = determineByFileName;
9700
9010
  exports.determineByFilePath = determineByFilePath;
9701
9011
  exports.determineByFolderName = determineByFolderName;
@@ -9710,6 +9020,7 @@ exports.documentDataWithIdAndKey = documentDataWithIdAndKey;
9710
9020
  exports.documentReferenceFromDocument = documentReferenceFromDocument;
9711
9021
  exports.documentReferencesFromDocuments = documentReferencesFromDocuments;
9712
9022
  exports.documentReferencesFromSnapshot = documentReferencesFromSnapshot;
9023
+ exports.downloadStorageFileParamsType = downloadStorageFileParamsType;
9713
9024
  exports.effectiveNotificationBoxRecipientConfig = effectiveNotificationBoxRecipientConfig;
9714
9025
  exports.effectiveNotificationBoxRecipientTemplateConfig = effectiveNotificationBoxRecipientTemplateConfig;
9715
9026
  exports.endAt = endAt;
@@ -9791,7 +9102,9 @@ exports.firestoreModelIdFromDocument = firestoreModelIdFromDocument;
9791
9102
  exports.firestoreModelIdFromEmail = firestoreModelIdFromEmail;
9792
9103
  exports.firestoreModelIdGrantedRoleArrayMap = firestoreModelIdGrantedRoleArrayMap;
9793
9104
  exports.firestoreModelIdGrantedRoleMap = firestoreModelIdGrantedRoleMap;
9105
+ exports.firestoreModelIdOrKeyType = firestoreModelIdOrKeyType;
9794
9106
  exports.firestoreModelIdString = firestoreModelIdString;
9107
+ exports.firestoreModelIdType = firestoreModelIdType;
9795
9108
  exports.firestoreModelIdentity = firestoreModelIdentity;
9796
9109
  exports.firestoreModelIdentityTypeMap = firestoreModelIdentityTypeMap;
9797
9110
  exports.firestoreModelIdsFromDocuments = firestoreModelIdsFromDocuments;
@@ -9817,6 +9130,7 @@ exports.firestoreModelKeyPartPairsKeyPath = firestoreModelKeyPartPairsKeyPath;
9817
9130
  exports.firestoreModelKeyPartPairsPaths = firestoreModelKeyPartPairsPaths;
9818
9131
  exports.firestoreModelKeyPath = firestoreModelKeyPath;
9819
9132
  exports.firestoreModelKeyString = firestoreModelKeyString;
9133
+ exports.firestoreModelKeyType = firestoreModelKeyType;
9820
9134
  exports.firestoreModelKeyTypePair = firestoreModelKeyTypePair;
9821
9135
  exports.firestoreModelKeys = firestoreModelKeys;
9822
9136
  exports.firestoreModelKeysFromDocuments = firestoreModelKeysFromDocuments;
@@ -9881,6 +9195,15 @@ exports.incrementUpdateWithAccessorFunction = incrementUpdateWithAccessorFunctio
9881
9195
  exports.inferKeyFromTwoWayFlatFirestoreModelKey = inferKeyFromTwoWayFlatFirestoreModelKey;
9882
9196
  exports.inferNotificationBoxRelatedModelKey = inferNotificationBoxRelatedModelKey;
9883
9197
  exports.inferStorageFileGroupRelatedModelKey = inferStorageFileGroupRelatedModelKey;
9198
+ exports.inferredTargetModelIdParamsType = inferredTargetModelIdParamsType;
9199
+ exports.inferredTargetModelParamsType = inferredTargetModelParamsType;
9200
+ exports.initializeAllApplicableNotificationBoxesParamsType = initializeAllApplicableNotificationBoxesParamsType;
9201
+ exports.initializeAllApplicableNotificationSummariesParamsType = initializeAllApplicableNotificationSummariesParamsType;
9202
+ exports.initializeAllApplicableStorageFileGroupsParamsType = initializeAllApplicableStorageFileGroupsParamsType;
9203
+ exports.initializeAllStorageFilesFromUploadsParamsType = initializeAllStorageFilesFromUploadsParamsType;
9204
+ exports.initializeNotificationModelParamsType = initializeNotificationModelParamsType;
9205
+ exports.initializeStorageFileFromUploadParamsType = initializeStorageFileFromUploadParamsType;
9206
+ exports.initializeStorageFileModelParamsType = initializeStorageFileModelParamsType;
9884
9207
  exports.interceptAccessorFactoryFunction = interceptAccessorFactoryFunction;
9885
9208
  exports.isAdminInFirebaseModelContext = isAdminInFirebaseModelContext;
9886
9209
  exports.isClientFirebaseError = isClientFirebaseError;
@@ -9907,6 +9230,7 @@ exports.limit = limit;
9907
9230
  exports.limitToLast = limitToLast;
9908
9231
  exports.limitUploadFileTypeDeterminer = limitUploadFileTypeDeterminer;
9909
9232
  exports.limitedFirestoreDocumentAccessorFactory = limitedFirestoreDocumentAccessorFactory;
9233
+ exports.limitedFirestoreDocumentAccessorSnapshotCache = limitedFirestoreDocumentAccessorSnapshotCache;
9910
9234
  exports.loadAllFirestoreDocumentSnapshot = loadAllFirestoreDocumentSnapshot;
9911
9235
  exports.loadAllFirestoreDocumentSnapshotPairs = loadAllFirestoreDocumentSnapshotPairs;
9912
9236
  exports.loadDocumentsForDocumentReferences = loadDocumentsForDocumentReferences;
@@ -9948,6 +9272,7 @@ exports.notificationBoxFirestoreCollection = notificationBoxFirestoreCollection;
9948
9272
  exports.notificationBoxIdForModel = notificationBoxIdForModel;
9949
9273
  exports.notificationBoxIdentity = notificationBoxIdentity;
9950
9274
  exports.notificationBoxModelCrudFunctionsConfig = notificationBoxModelCrudFunctionsConfig;
9275
+ exports.notificationBoxRecipientTemplateConfigArrayEntryParamType = notificationBoxRecipientTemplateConfigArrayEntryParamType;
9951
9276
  exports.notificationBoxRecipientTemplateConfigArrayToRecord = notificationBoxRecipientTemplateConfigArrayToRecord;
9952
9277
  exports.notificationBoxRecipientTemplateConfigRecordToArray = notificationBoxRecipientTemplateConfigRecordToArray;
9953
9278
  exports.notificationBoxesFlaggedForNeedsInitializationQuery = notificationBoxesFlaggedForNeedsInitializationQuery;
@@ -9961,6 +9286,7 @@ exports.notificationFunctionMap = notificationFunctionMap;
9961
9286
  exports.notificationFunctionTypeConfigMap = notificationFunctionTypeConfigMap;
9962
9287
  exports.notificationIdentity = notificationIdentity;
9963
9288
  exports.notificationMessageFunction = notificationMessageFunction;
9289
+ exports.notificationRecipientParamsType = notificationRecipientParamsType;
9964
9290
  exports.notificationSendExclusionCanSendFunction = notificationSendExclusionCanSendFunction;
9965
9291
  exports.notificationSendFlagsImplyIsComplete = notificationSendFlagsImplyIsComplete;
9966
9292
  exports.notificationSubtaskComplete = notificationSubtaskComplete;
@@ -10015,10 +9341,19 @@ exports.optionalFirestoreUnitedStatesAddress = optionalFirestoreUnitedStatesAddr
10015
9341
  exports.optionalFirestoreUnixDateTimeSecondsNumber = optionalFirestoreUnixDateTimeSecondsNumber;
10016
9342
  exports.orderBy = orderBy;
10017
9343
  exports.orderByDocumentId = orderByDocumentId;
9344
+ exports.processAllQueuedStorageFilesParamsType = processAllQueuedStorageFilesParamsType;
9345
+ exports.processStorageFileParamsType = processStorageFileParamsType;
10018
9346
  exports.readFirestoreModelKey = readFirestoreModelKey;
10019
9347
  exports.readFirestoreModelKeyFromDocumentSnapshot = readFirestoreModelKeyFromDocumentSnapshot;
9348
+ exports.regenerateAllFlaggedStorageFileGroupsContentParamsType = regenerateAllFlaggedStorageFileGroupsContentParamsType;
9349
+ exports.regenerateStorageFileGroupContentParamsType = regenerateStorageFileGroupContentParamsType;
10020
9350
  exports.replaceConstraints = replaceConstraints;
9351
+ exports.resyncAllNotificationUserParamsType = resyncAllNotificationUserParamsType;
9352
+ exports.resyncNotificationUserParamsType = resyncNotificationUserParamsType;
9353
+ exports.scheduledFunctionDevelopmentFirebaseFunctionParamsType = scheduledFunctionDevelopmentFirebaseFunctionParamsType;
10021
9354
  exports.selectFromFirebaseModelsService = selectFromFirebaseModelsService;
9355
+ exports.sendNotificationParamsType = sendNotificationParamsType;
9356
+ exports.sendQueuedNotificationsParamsType = sendQueuedNotificationsParamsType;
10022
9357
  exports.separateConstraints = separateConstraints;
10023
9358
  exports.setIdAndKeyFromKeyIdRefOnDocumentData = setIdAndKeyFromKeyIdRefOnDocumentData;
10024
9359
  exports.setIdAndKeyFromSnapshotOnDocumentData = setIdAndKeyFromSnapshotOnDocumentData;
@@ -10064,20 +9399,35 @@ exports.storagePathFactory = storagePathFactory;
10064
9399
  exports.storedFileReaderFactory = storedFileReaderFactory;
10065
9400
  exports.streamDocumentSnapshotDataPairs = streamDocumentSnapshotDataPairs;
10066
9401
  exports.streamDocumentSnapshotDataPairsWithData = streamDocumentSnapshotDataPairsWithData;
9402
+ exports.streamDocumentSnapshotsData = streamDocumentSnapshotsData;
10067
9403
  exports.streamFromOnSnapshot = streamFromOnSnapshot;
9404
+ exports.syncAllFlaggedStorageFilesWithGroupsParamsType = syncAllFlaggedStorageFilesWithGroupsParamsType;
9405
+ exports.syncStorageFileWithGroupsParamsType = syncStorageFileWithGroupsParamsType;
10068
9406
  exports.systemStateCollectionReference = systemStateCollectionReference;
10069
9407
  exports.systemStateConverter = systemStateConverter;
10070
9408
  exports.systemStateFirestoreCollection = systemStateFirestoreCollection;
10071
9409
  exports.systemStateIdentity = systemStateIdentity;
9410
+ exports.targetModelIdParamsType = targetModelIdParamsType;
9411
+ exports.targetModelParamsType = targetModelParamsType;
10072
9412
  exports.twoWayFlatFirestoreModelKey = twoWayFlatFirestoreModelKey;
10073
9413
  exports.unreadNotificationItems = unreadNotificationItems;
10074
9414
  exports.unsupportedFirestoreDriverFunctionError = unsupportedFirestoreDriverFunctionError;
9415
+ exports.updateNotificationBoxParamsType = updateNotificationBoxParamsType;
9416
+ exports.updateNotificationBoxRecipientLikeParamsType = updateNotificationBoxRecipientLikeParamsType;
9417
+ exports.updateNotificationBoxRecipientParamsType = updateNotificationBoxRecipientParamsType;
10075
9418
  exports.updateNotificationBoxRecipientTemplateConfigRecord = updateNotificationBoxRecipientTemplateConfigRecord;
10076
9419
  exports.updateNotificationRecipient = updateNotificationRecipient;
9420
+ exports.updateNotificationSummaryParamsType = updateNotificationSummaryParamsType;
10077
9421
  exports.updateNotificationUserDefaultNotificationBoxRecipientConfig = updateNotificationUserDefaultNotificationBoxRecipientConfig;
9422
+ exports.updateNotificationUserDefaultNotificationBoxRecipientConfigParamsType = updateNotificationUserDefaultNotificationBoxRecipientConfigParamsType;
10078
9423
  exports.updateNotificationUserNotificationBoxRecipientConfigIfChanged = updateNotificationUserNotificationBoxRecipientConfigIfChanged;
10079
9424
  exports.updateNotificationUserNotificationBoxRecipientConfigs = updateNotificationUserNotificationBoxRecipientConfigs;
9425
+ exports.updateNotificationUserNotificationBoxRecipientParamsType = updateNotificationUserNotificationBoxRecipientParamsType;
10080
9426
  exports.updateNotificationUserNotificationSendExclusions = updateNotificationUserNotificationSendExclusions;
9427
+ exports.updateNotificationUserParamsType = updateNotificationUserParamsType;
9428
+ exports.updateStorageFileGroupEntryParamsType = updateStorageFileGroupEntryParamsType;
9429
+ exports.updateStorageFileGroupParamsType = updateStorageFileGroupParamsType;
9430
+ exports.updateStorageFileParamsType = updateStorageFileParamsType;
10081
9431
  exports.updateWithAccessorUpdateAndConverterFunction = updateWithAccessorUpdateAndConverterFunction;
10082
9432
  exports.uploadFileWithStream = uploadFileWithStream;
10083
9433
  exports.useContextAuth = useContextAuth;