@dereekb/firebase-server 13.11.14 → 13.11.15
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 +229 -199
- package/index.esm.js +230 -200
- package/mailgun/package.json +9 -9
- package/model/index.cjs.js +259 -270
- package/model/index.esm.js +259 -270
- package/model/package.json +9 -9
- package/model/src/lib/mailgun/notification.send.service.mailgun.d.ts +3 -3
- package/model/src/lib/notification/notification.action.server.d.ts +34 -34
- package/model/src/lib/notification/notification.action.server.init.d.ts +17 -17
- package/model/src/lib/notification/notification.config.service.d.ts +7 -7
- package/model/src/lib/notification/notification.create.run.d.ts +3 -3
- package/model/src/lib/notification/notification.error.d.ts +14 -14
- package/model/src/lib/notification/notification.expedite.service.d.ts +7 -7
- package/model/src/lib/notification/notification.module.d.ts +13 -13
- package/model/src/lib/notification/notification.send.service.notificationsummary.d.ts +2 -2
- package/model/src/lib/notification/notification.send.service.text.d.ts +1 -1
- package/model/src/lib/notification/notification.task.service.handler.d.ts +2 -2
- package/model/src/lib/notification/notification.task.service.util.d.ts +3 -3
- package/model/src/lib/notification/notification.task.subtask.handler.d.ts +3 -3
- package/model/src/lib/notification/notification.util.d.ts +8 -8
- package/model/src/lib/storagefile/storagefile.action.server.d.ts +43 -44
- package/model/src/lib/storagefile/storagefile.action.server.init.d.ts +11 -11
- package/model/src/lib/storagefile/storagefile.error.d.ts +15 -15
- package/model/src/lib/storagefile/storagefile.module.d.ts +10 -10
- package/model/src/lib/storagefile/storagefile.task.service.handler.d.ts +6 -6
- package/model/src/lib/storagefile/storagefile.upload.service.initializer.d.ts +5 -5
- package/model/src/lib/storagefile/storagefile.util.d.ts +2 -2
- package/oidc/index.cjs.js +219 -219
- package/oidc/index.esm.js +219 -219
- package/oidc/package.json +10 -10
- package/oidc/src/lib/controller/oidc.interaction.controller.d.ts +44 -25
- package/oidc/src/lib/controller/oidc.provider.controller.d.ts +1 -1
- package/oidc/src/lib/controller/oidc.wellknown.controller.d.ts +3 -3
- package/oidc/src/lib/middleware/oauth-cors.module.d.ts +1 -1
- package/oidc/src/lib/model/jwks/jwks.d.ts +6 -6
- package/oidc/src/lib/model/jwks/jwks.query.d.ts +5 -5
- package/oidc/src/lib/model/oidc/oidcmodel.action.server.d.ts +12 -12
- package/oidc/src/lib/model/oidc/oidcmodel.module.d.ts +5 -5
- package/oidc/src/lib/oidc.config.d.ts +1 -1
- package/oidc/src/lib/oidc.module.d.ts +8 -8
- package/oidc/src/lib/service/oidc.account.service.d.ts +4 -4
- package/oidc/src/lib/service/oidc.adapter.service.d.ts +4 -4
- package/oidc/src/lib/service/oidc.client.service.d.ts +3 -3
- package/oidc/src/lib/service/oidc.config.service.d.ts +1 -1
- package/oidc/src/lib/service/oidc.encryption.service.d.ts +4 -4
- package/oidc/src/lib/service/oidc.interaction.service.d.ts +14 -14
- package/oidc/src/lib/service/oidc.jwks.service.d.ts +6 -6
- package/oidc/src/lib/service/oidc.service.d.ts +5 -5
- package/package.json +10 -10
- package/src/lib/auth/auth.service.d.ts +8 -8
- package/src/lib/auth/auth.util.d.ts +1 -1
- package/src/lib/env/env.config.d.ts +5 -4
- package/src/lib/firestore/driver.accessor.batch.d.ts +2 -1
- package/src/lib/firestore/driver.accessor.d.ts +1 -1
- package/src/lib/firestore/driver.accessor.default.d.ts +2 -1
- package/src/lib/firestore/driver.accessor.transaction.d.ts +2 -1
- package/src/lib/firestore/snapshot/snapshot.field.encrypt.d.ts +10 -6
- package/src/lib/function/type.d.ts +4 -4
- package/src/lib/nest/analytics/analytics.module.d.ts +6 -5
- package/src/lib/nest/app.d.ts +4 -4
- package/src/lib/nest/app.module.d.ts +3 -2
- package/src/lib/nest/auth/auth.module.d.ts +4 -3
- package/src/lib/nest/controller/model/model.api.controller.d.ts +1 -0
- package/src/lib/nest/controller/model/model.api.get.service.d.ts +1 -1
- package/src/lib/nest/controller/model/model.api.module.d.ts +4 -3
- package/src/lib/nest/development/development.function.d.ts +1 -1
- package/src/lib/nest/development/development.schedule.function.error.d.ts +2 -2
- package/src/lib/nest/env/env.util.d.ts +2 -2
- package/src/lib/nest/firestore/firestore.module.d.ts +16 -15
- package/src/lib/nest/function/call.d.ts +6 -6
- package/src/lib/nest/function/context.d.ts +7 -6
- package/src/lib/nest/function/v2/blocking.d.ts +8 -6
- package/src/lib/nest/function/v2/call.d.ts +7 -5
- package/src/lib/nest/function/v2/event.d.ts +3 -2
- package/src/lib/nest/function/v2/schedule.d.ts +3 -2
- package/src/lib/nest/function/v2/taskqueue.d.ts +2 -1
- package/src/lib/nest/model/analytics.emit.d.ts +5 -5
- package/src/lib/nest/model/api.details.d.ts +4 -4
- package/src/lib/nest/model/query.model.function.d.ts +3 -3
- package/src/lib/nest/nest.provider.d.ts +7 -7
- package/src/lib/nest/storage/storage.module.d.ts +6 -5
- package/src/lib/storage/driver.accessor.d.ts +10 -10
- package/test/index.cjs.js +48 -57
- package/test/index.esm.js +48 -57
- package/test/package.json +11 -11
- package/test/src/lib/firebase/firebase.admin.auth.d.ts +18 -18
- package/test/src/lib/firebase/firebase.admin.collection.d.ts +7 -7
- package/test/src/lib/firebase/firebase.admin.d.ts +2 -2
- package/test/src/lib/firebase/firebase.admin.function.d.ts +2 -2
- package/test/src/lib/firebase/firebase.admin.nest.function.callable.context.d.ts +1 -1
- package/test/src/lib/firebase/firebase.admin.nest.function.cloud.context.d.ts +3 -3
- package/test/src/lib/firebase/firebase.d.ts +6 -5
- package/test/src/lib/firebase/firebase.function.d.ts +31 -31
- package/test/src/lib/firestore/firestore.d.ts +2 -2
- package/test/src/lib/oidc/oidc.test.fixture.d.ts +1 -1
- package/test/src/lib/oidc/oidc.test.flow.d.ts +1 -1
- package/test/src/lib/storage/storage.d.ts +2 -2
- package/zoho/index.cjs.js +2 -2
- package/zoho/index.esm.js +2 -2
- package/zoho/package.json +9 -9
- package/zoho/src/lib/zoho.accounts.firebase.d.ts +1 -1
- package/zoho/src/lib/zoho.accounts.firebase.system.d.ts +1 -1
package/model/index.cjs.js
CHANGED
|
@@ -186,7 +186,7 @@ function _ts_generator$h(thisArg, body) {
|
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
var
|
|
189
|
+
var DEFAULT_MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_MAX_BATCH_SIZE_PER_REQUEST = 50;
|
|
190
190
|
/**
|
|
191
191
|
* Creates a {@link NotificationEmailSendService} that sends notification emails via Mailgun.
|
|
192
192
|
*
|
|
@@ -194,8 +194,8 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
194
194
|
* converts each batch to a {@link MailgunTemplateEmailRequest} using the configured template builders,
|
|
195
195
|
* and dispatches them through the Mailgun API.
|
|
196
196
|
*
|
|
197
|
-
* @param config -
|
|
198
|
-
* @returns
|
|
197
|
+
* @param config - Service configuration including the Mailgun service, template builders, and batch size.
|
|
198
|
+
* @returns A {@link NotificationEmailSendService} that batches and sends emails through Mailgun.
|
|
199
199
|
*
|
|
200
200
|
* @example
|
|
201
201
|
* ```ts
|
|
@@ -213,7 +213,7 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
213
213
|
*/ function mailgunNotificationEmailSendService(config) {
|
|
214
214
|
var mailgunService = config.mailgunService, defaultSendTemplateName = config.defaultSendTemplateName, inputMaxBatchSizePerRequest = config.maxBatchSizePerRequest, inputMessageBuilders = config.messageBuilders;
|
|
215
215
|
var lowercaseKeysMessageBuilders = util.mapObjectKeysToLowercase(inputMessageBuilders);
|
|
216
|
-
var maxBatchSizePerRequest = inputMaxBatchSizePerRequest !== null && inputMaxBatchSizePerRequest !== void 0 ? inputMaxBatchSizePerRequest :
|
|
216
|
+
var maxBatchSizePerRequest = inputMaxBatchSizePerRequest !== null && inputMaxBatchSizePerRequest !== void 0 ? inputMaxBatchSizePerRequest : DEFAULT_MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_MAX_BATCH_SIZE_PER_REQUEST;
|
|
217
217
|
var sendService = {
|
|
218
218
|
buildSendInstanceForEmailNotificationMessages: function buildSendInstanceForEmailNotificationMessages(notificationMessages) {
|
|
219
219
|
return _async_to_generator$h(function() {
|
|
@@ -329,7 +329,7 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
329
329
|
*
|
|
330
330
|
* Thrown when attempting to create a {@link Notification} document without providing the mandatory ID field.
|
|
331
331
|
*
|
|
332
|
-
* @returns
|
|
332
|
+
* @returns A precondition conflict error with the notification ID required error code.
|
|
333
333
|
*/ function createNotificationIdRequiredError() {
|
|
334
334
|
return firebaseServer.preconditionConflictError({
|
|
335
335
|
message: "The required id was not present when attempting to create a Notification.",
|
|
@@ -342,7 +342,7 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
342
342
|
* Thrown during initialization when `throwErrorIfAlreadyInitialized` is true and the model's
|
|
343
343
|
* setup flag (`s`) indicates it was previously initialized.
|
|
344
344
|
*
|
|
345
|
-
* @returns
|
|
345
|
+
* @returns A precondition conflict error with the already-initialized error code.
|
|
346
346
|
*/ function notificationModelAlreadyInitializedError() {
|
|
347
347
|
return firebaseServer.preconditionConflictError({
|
|
348
348
|
message: "This model has already been initialized.",
|
|
@@ -354,8 +354,8 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
354
354
|
*
|
|
355
355
|
* Thrown when the model key's collection name does not match any registered notification model type.
|
|
356
356
|
*
|
|
357
|
-
* @param key -
|
|
358
|
-
* @returns
|
|
357
|
+
* @param key - The Firestore model key that has no registered notification model type.
|
|
358
|
+
* @returns A precondition conflict error with the unregistered model type error code.
|
|
359
359
|
*/ function notificationBoxUnregistredModelTypeInitializationError(key) {
|
|
360
360
|
return firebaseServer.preconditionConflictError({
|
|
361
361
|
message: "This NotificationBox is associated with an unregistered model type.",
|
|
@@ -370,7 +370,7 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
370
370
|
*
|
|
371
371
|
* Thrown when an operation requires a NotificationBox but none has been created for the given model key.
|
|
372
372
|
*
|
|
373
|
-
* @returns
|
|
373
|
+
* @returns A precondition conflict error with the box-not-found error code.
|
|
374
374
|
*/ function notificationBoxDoesNotExist() {
|
|
375
375
|
return firebaseServer.preconditionConflictError({
|
|
376
376
|
message: "A NotificationBox does not exist for this model.",
|
|
@@ -383,7 +383,7 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
383
383
|
* Thrown when the target recipient on the {@link NotificationBox} does not exist on the box
|
|
384
384
|
* or does not have a UID, making it ineligible for exclusion.
|
|
385
385
|
*
|
|
386
|
-
* @returns
|
|
386
|
+
* @returns A precondition conflict error with the invalid exclusion target error code.
|
|
387
387
|
*/ function notificationBoxExclusionTargetInvalidError() {
|
|
388
388
|
return firebaseServer.preconditionConflictError({
|
|
389
389
|
message: "The target for exclusion is invalid. The target recipient on the NotificationBox must be exist on the NotificationBox and have a uid to be excluded.",
|
|
@@ -395,7 +395,7 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
395
395
|
*
|
|
396
396
|
* Thrown when attempting to create a duplicate NotificationBox for a model that already has one.
|
|
397
397
|
*
|
|
398
|
-
* @returns
|
|
398
|
+
* @returns A precondition conflict error with the box-exists error code.
|
|
399
399
|
*/ function notificationBoxExistsForModelError() {
|
|
400
400
|
return firebaseServer.preconditionConflictError({
|
|
401
401
|
message: "A NotificationBox already exists for this model.",
|
|
@@ -408,7 +408,7 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
408
408
|
* Thrown when attempting to update a recipient that is not registered on the box
|
|
409
409
|
* and `insert=true` was not passed to allow creating a new recipient entry.
|
|
410
410
|
*
|
|
411
|
-
* @returns
|
|
411
|
+
* @returns A precondition conflict error with the recipient-not-found error code.
|
|
412
412
|
*/ function notificationBoxRecipientDoesNotExistsError() {
|
|
413
413
|
return firebaseServer.preconditionConflictError({
|
|
414
414
|
message: "An existing NotificationBox recipient for the target does not exist. You must pass insert=true to create a new recipient.",
|
|
@@ -420,8 +420,8 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
420
420
|
*
|
|
421
421
|
* Thrown during {@link NotificationUser} creation when the provided UID cannot be found in Firebase Auth.
|
|
422
422
|
*
|
|
423
|
-
* @param uid -
|
|
424
|
-
* @returns
|
|
423
|
+
* @param uid - The Firebase Auth user ID that was not found.
|
|
424
|
+
* @returns A precondition conflict error with the invalid-uid error code.
|
|
425
425
|
*/ function notificationUserInvalidUidForCreateError(uid) {
|
|
426
426
|
return firebaseServer.preconditionConflictError({
|
|
427
427
|
message: "The user with the uid '".concat(uid, "' does not exist. Cannot create a NotificationUser for them."),
|
|
@@ -437,8 +437,8 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
437
437
|
* Thrown when a {@link NotificationUser} has the `bk` (blocked-from-add) flag set on their config
|
|
438
438
|
* and an operation attempts to insert them into a {@link NotificationBox}'s recipient list.
|
|
439
439
|
*
|
|
440
|
-
* @param uid -
|
|
441
|
-
* @returns
|
|
440
|
+
* @param uid - The Firebase Auth user ID of the blocked user.
|
|
441
|
+
* @returns A precondition conflict error with the blocked-from-add error code.
|
|
442
442
|
*/ function notificationUserBlockedFromBeingAddedToRecipientsError(uid) {
|
|
443
443
|
return firebaseServer.preconditionConflictError({
|
|
444
444
|
message: "The user with the uid '".concat(uid, "' has blocked themselves from from being added recipients."),
|
|
@@ -454,8 +454,8 @@ var MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST =
|
|
|
454
454
|
* Thrown when a {@link NotificationUser} has the `lk` (locked) flag set on their config
|
|
455
455
|
* and an operation attempts to modify their recipient settings on a {@link NotificationBox}.
|
|
456
456
|
*
|
|
457
|
-
* @param uid -
|
|
458
|
-
* @returns
|
|
457
|
+
* @param uid - The Firebase Auth user ID of the locked user.
|
|
458
|
+
* @returns A precondition conflict error with the locked-config error code.
|
|
459
459
|
*/ function notificationUserLockedConfigFromBeingUpdatedError(uid) {
|
|
460
460
|
return firebaseServer.preconditionConflictError({
|
|
461
461
|
message: "The user with the uid '".concat(uid, "' has locked their config from being updated."),
|
|
@@ -673,8 +673,8 @@ function _ts_generator$g(thisArg, body) {
|
|
|
673
673
|
* Sets the creation timestamp to now, associates the summary with the given model key,
|
|
674
674
|
* and initializes with an empty notifications array.
|
|
675
675
|
*
|
|
676
|
-
* @param model -
|
|
677
|
-
* @returns
|
|
676
|
+
* @param model - The model key to associate the summary with.
|
|
677
|
+
* @returns A blank {@link NotificationSummary} with creation timestamp and empty notifications.
|
|
678
678
|
*
|
|
679
679
|
* @example
|
|
680
680
|
* ```ts
|
|
@@ -697,8 +697,8 @@ function _ts_generator$g(thisArg, body) {
|
|
|
697
697
|
*
|
|
698
698
|
* Recipients are each configurable and may be defined with as little info as a single contact info, or have multiple contact info pieces associated with them.
|
|
699
699
|
*
|
|
700
|
-
* @param input -
|
|
701
|
-
* @returns
|
|
700
|
+
* @param input - The notification, box, auth service, and recipient configuration.
|
|
701
|
+
* @returns Channel-specific recipient lists (email, text, notification summary) ready for delivery.
|
|
702
702
|
*/ function expandNotificationRecipients(input) {
|
|
703
703
|
return _async_to_generator$g(function() {
|
|
704
704
|
var _ref, notificationUserAccessor, authService, notification, notificationBox, inputGlobalRecipients, recipientFlagOverride, inputNotificationSummaryIdForUid, inputOnlySendToExplicitlyEnabledRecipients, inputOnlyTextExplicitlyEnabledRecipients, notificationBoxId, notificationSummaryIdForUid, notificationTemplateType, recipientFlag, onlyTextExplicitlyEnabledRecipients, onlySendToExplicitlyEnabledRecipients, onlyEmailExplicitlyEnabledRecipients, onlySendNotificationSummaryExplicitlyEnabledRecipients, _allowedNotificationRecipients, canSendToGlobalRecipients, canSendToBoxRecipients, canSendToExplicitRecipients, initialExplicitRecipients, initialGlobalRecipients, explicitRecipients, globalRecipients, explicitAndGlobalRecipients, allBoxRecipientConfigs, recipientUids, relevantBoxRecipientConfigs, nonNotificationBoxUidRecipientConfigs, otherNotificationUserUidOptOuts, otherNotificationUserUidSendExclusions, notificationUserRecipientConfigs, nonNotificationBoxRecipientUids, notificationUserDocuments, notificationUsers, otherRecipientConfigs, explicitOtherRecipientEmailAddresses, explicitOtherRecipientTextNumbers, explicitOtherRecipientNotificationSummaryIds, allUserDetails, userDetailsMap, _internal, emails, emailUidsSet, texts, textUidsSet, notificationSummaries, notificationSummaryKeysSet, notificationSummaryUidsSet, result;
|
|
@@ -1100,10 +1100,10 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1100
1100
|
*
|
|
1101
1101
|
* Also re-applies send exclusions to the updated config array.
|
|
1102
1102
|
*
|
|
1103
|
-
* @param input -
|
|
1104
|
-
* @returns
|
|
1105
|
-
* @throws
|
|
1106
|
-
* @throws
|
|
1103
|
+
* @param input - The current state and intended change.
|
|
1104
|
+
* @returns The updated box config array and notification box recipient, if changes occurred.
|
|
1105
|
+
* @throws {Error} NotificationUserBlockedFromBeingAddedToRecipientsError when inserting a blocked user.
|
|
1106
|
+
* @throws {Error} NotificationUserLockedConfigFromBeingUpdatedError when updating a locked user's config.
|
|
1107
1107
|
*/ function updateNotificationUserNotificationBoxRecipientConfig(input) {
|
|
1108
1108
|
var _notificationUser_bc_currentNotificationUserBoxIndex;
|
|
1109
1109
|
var notificationBoxId = input.notificationBoxId, notificationUserId = input.notificationUserId, notificationUser = input.notificationUser, insertingRecipientIntoNotificationBox = input.insertingRecipientIntoNotificationBox, removeRecipientFromNotificationBox = input.removeRecipientFromNotificationBox, notificationBoxRecipient = input.notificationBoxRecipient;
|
|
@@ -1197,9 +1197,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1197
1197
|
* If `removeFromCompletedCheckpoints` is set, removes only those specific checkpoints.
|
|
1198
1198
|
* Otherwise, returns the original array unchanged.
|
|
1199
1199
|
*
|
|
1200
|
-
* @param inputCompletions -
|
|
1201
|
-
* @param handleTaskResult -
|
|
1202
|
-
* @returns
|
|
1200
|
+
* @param inputCompletions - The current list of completed checkpoint strings.
|
|
1201
|
+
* @param handleTaskResult - The handler result containing removal instructions.
|
|
1202
|
+
* @returns The filtered completions array with specified checkpoints removed.
|
|
1203
1203
|
*
|
|
1204
1204
|
* @example
|
|
1205
1205
|
* ```ts
|
|
@@ -1494,8 +1494,8 @@ function _ts_generator$f(thisArg, body) {
|
|
|
1494
1494
|
* Creates a concrete {@link NotificationServerActions} implementation by wiring each action
|
|
1495
1495
|
* to its factory function using the provided context.
|
|
1496
1496
|
*
|
|
1497
|
-
* @param context -
|
|
1498
|
-
* @returns
|
|
1497
|
+
* @param context - The fully assembled notification server actions context.
|
|
1498
|
+
* @returns A fully wired {@link NotificationServerActions} instance.
|
|
1499
1499
|
*
|
|
1500
1500
|
* @example
|
|
1501
1501
|
* ```ts
|
|
@@ -1527,8 +1527,8 @@ function _ts_generator$f(thisArg, body) {
|
|
|
1527
1527
|
* Validates the UID exists in Firebase Auth, then creates a new {@link NotificationUser} document
|
|
1528
1528
|
* with empty default and global configs. Throws if the UID is not found in Auth.
|
|
1529
1529
|
*
|
|
1530
|
-
* @param context -
|
|
1531
|
-
* @returns
|
|
1530
|
+
* @param context - The notification server actions context with auth and collection access.
|
|
1531
|
+
* @returns A transform-and-validate function that creates a new notification user document.
|
|
1532
1532
|
*/ function createNotificationUserFactory(context) {
|
|
1533
1533
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationUserCollection = context.notificationUserCollection, authService = context.authService;
|
|
1534
1534
|
return firebaseServerActionTransformFunctionFactory(firebase.createNotificationUserParamsType, function(params) {
|
|
@@ -1594,8 +1594,8 @@ function _ts_generator$f(thisArg, body) {
|
|
|
1594
1594
|
* box configs (`bc`). When the global config changes, iterates all box configs to propagate
|
|
1595
1595
|
* effective recipient changes and marks affected entries for sync.
|
|
1596
1596
|
*
|
|
1597
|
-
* @param context -
|
|
1598
|
-
* @returns
|
|
1597
|
+
* @param context - The notification server actions context with Firestore and collection access.
|
|
1598
|
+
* @returns A transform-and-validate function that updates an existing notification user document.
|
|
1599
1599
|
*/ function updateNotificationUserFactory(context) {
|
|
1600
1600
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationUserCollection = context.notificationUserCollection, appNotificationTemplateTypeInfoRecordService = context.appNotificationTemplateTypeInfoRecordService;
|
|
1601
1601
|
return firebaseServerActionTransformFunctionFactory(firebase.updateNotificationUserParamsType, function(params) {
|
|
@@ -1636,26 +1636,29 @@ function _ts_generator$f(thisArg, body) {
|
|
|
1636
1636
|
updateTemplate.gc = nextGc;
|
|
1637
1637
|
// iterate and update any box config that has the effective recipient change
|
|
1638
1638
|
updateTemplate.bc = notificationUser.bc.map(function(currentConfig) {
|
|
1639
|
+
var updatedConfig = currentConfig;
|
|
1639
1640
|
// check item isn't already marked for sync or marked as removed
|
|
1640
|
-
if (currentConfig.ns
|
|
1641
|
-
|
|
1641
|
+
if (currentConfig.ns !== true && currentConfig.rm !== true) {
|
|
1642
|
+
var currentEffectiveRecipient = firebase.effectiveNotificationBoxRecipientConfig({
|
|
1643
|
+
uid: notificationUser.uid,
|
|
1644
|
+
appNotificationTemplateTypeInfoRecordService: appNotificationTemplateTypeInfoRecordService,
|
|
1645
|
+
gc: notificationUser.gc,
|
|
1646
|
+
boxConfig: currentConfig
|
|
1647
|
+
});
|
|
1648
|
+
var nextEffectiveRecipient = firebase.effectiveNotificationBoxRecipientConfig({
|
|
1649
|
+
uid: notificationUser.uid,
|
|
1650
|
+
appNotificationTemplateTypeInfoRecordService: appNotificationTemplateTypeInfoRecordService,
|
|
1651
|
+
gc: nextGc,
|
|
1652
|
+
boxConfig: currentConfig
|
|
1653
|
+
});
|
|
1654
|
+
var effectiveConfigChanged = !util.areEqualPOJOValues(currentEffectiveRecipient, nextEffectiveRecipient);
|
|
1655
|
+
if (effectiveConfigChanged) {
|
|
1656
|
+
updatedConfig = _object_spread_props$a(_object_spread$b({}, currentConfig), {
|
|
1657
|
+
ns: true
|
|
1658
|
+
});
|
|
1659
|
+
}
|
|
1642
1660
|
}
|
|
1643
|
-
|
|
1644
|
-
uid: notificationUser.uid,
|
|
1645
|
-
appNotificationTemplateTypeInfoRecordService: appNotificationTemplateTypeInfoRecordService,
|
|
1646
|
-
gc: notificationUser.gc,
|
|
1647
|
-
boxConfig: currentConfig
|
|
1648
|
-
});
|
|
1649
|
-
var nextEffectiveRecipient = firebase.effectiveNotificationBoxRecipientConfig({
|
|
1650
|
-
uid: notificationUser.uid,
|
|
1651
|
-
appNotificationTemplateTypeInfoRecordService: appNotificationTemplateTypeInfoRecordService,
|
|
1652
|
-
gc: nextGc,
|
|
1653
|
-
boxConfig: currentConfig
|
|
1654
|
-
});
|
|
1655
|
-
var effectiveConfigChanged = !util.areEqualPOJOValues(currentEffectiveRecipient, nextEffectiveRecipient);
|
|
1656
|
-
return effectiveConfigChanged ? _object_spread_props$a(_object_spread$b({}, currentConfig), {
|
|
1657
|
-
ns: true
|
|
1658
|
-
}) : currentConfig;
|
|
1661
|
+
return updatedConfig;
|
|
1659
1662
|
});
|
|
1660
1663
|
}
|
|
1661
1664
|
}
|
|
@@ -1716,8 +1719,8 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
1716
1719
|
* and merging the user's preferences back into the box's recipient list. Handles removed entries
|
|
1717
1720
|
* and cleans up stale box references.
|
|
1718
1721
|
*
|
|
1719
|
-
* @param context -
|
|
1720
|
-
* @returns
|
|
1722
|
+
* @param context - The notification server actions context with Firestore and collection access.
|
|
1723
|
+
* @returns A transform-and-validate function that resyncs a notification user's box configurations.
|
|
1721
1724
|
*/ function resyncNotificationUserFactory(context) {
|
|
1722
1725
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationBoxCollection = context.notificationBoxCollection, notificationUserCollection = context.notificationUserCollection, appNotificationTemplateTypeInfoRecordService = context.appNotificationTemplateTypeInfoRecordService;
|
|
1723
1726
|
return firebaseServerActionTransformFunctionFactory(firebase.resyncNotificationUserParamsType, function() {
|
|
@@ -1953,8 +1956,8 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
1953
1956
|
* for entries with `ns=true`, then calling the resync logic for each in parallel
|
|
1954
1957
|
* (up to 5 concurrent tasks). Loops until no more flagged users are found.
|
|
1955
1958
|
*
|
|
1956
|
-
* @param context -
|
|
1957
|
-
* @returns
|
|
1959
|
+
* @param context - The notification server actions context with collection access.
|
|
1960
|
+
* @returns An async function that resyncs all flagged notification users and returns aggregate results.
|
|
1958
1961
|
*/ function resyncAllNotificationUsersFactory(context) {
|
|
1959
1962
|
var notificationUserCollection = context.notificationUserCollection;
|
|
1960
1963
|
var resyncNotificationUser = resyncNotificationUserFactory(context);
|
|
@@ -2041,8 +2044,8 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2041
2044
|
* Creates a new {@link NotificationSummary} document for a model, generating the summary ID
|
|
2042
2045
|
* from the model key and initializing it with a blank template.
|
|
2043
2046
|
*
|
|
2044
|
-
* @param context -
|
|
2045
|
-
* @returns
|
|
2047
|
+
* @param context - The notification server actions context with collection access.
|
|
2048
|
+
* @returns A transform-and-validate function that creates a new notification summary document.
|
|
2046
2049
|
*/ function createNotificationSummaryFactory(context) {
|
|
2047
2050
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationSummaryCollection = context.notificationSummaryCollection;
|
|
2048
2051
|
return firebaseServerActionTransformFunctionFactory(firebase.createNotificationSummaryParamsType, function(params) {
|
|
@@ -2086,8 +2089,8 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2086
2089
|
* Updates an existing {@link NotificationSummary} document's owner or setup flag.
|
|
2087
2090
|
* Runs within a Firestore transaction to ensure consistency.
|
|
2088
2091
|
*
|
|
2089
|
-
* @param context -
|
|
2090
|
-
* @returns
|
|
2092
|
+
* @param context - The notification server actions context.
|
|
2093
|
+
* @returns A transform-and-validate function that updates an existing notification summary document.
|
|
2091
2094
|
*/ function updateNotificationSummaryFactory(context) {
|
|
2092
2095
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
2093
2096
|
return firebaseServerActionTransformFunctionFactory(firebase.updateNotificationSummaryParamsType, function(params) {
|
|
@@ -2143,8 +2146,8 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2143
2146
|
* Checks for existing boxes and throws if one already exists for the model.
|
|
2144
2147
|
* Also syncs initial recipients with their corresponding {@link NotificationUser} documents.
|
|
2145
2148
|
*
|
|
2146
|
-
* @param context -
|
|
2147
|
-
* @returns
|
|
2149
|
+
* @param context - The base notification server actions context with collection access.
|
|
2150
|
+
* @returns An async function that creates a notification box within a transaction and returns the document and template.
|
|
2148
2151
|
*/ function createNotificationBoxInTransactionFactory(context) {
|
|
2149
2152
|
var notificationBoxCollection = context.notificationBoxCollection;
|
|
2150
2153
|
return function(params, transaction) {
|
|
@@ -2194,8 +2197,8 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2194
2197
|
* Wraps {@link createNotificationBoxInTransactionFactory} in a Firestore transaction
|
|
2195
2198
|
* and follows the transform-and-validate pattern.
|
|
2196
2199
|
*
|
|
2197
|
-
* @param context -
|
|
2198
|
-
* @returns
|
|
2200
|
+
* @param context - The notification server actions context with Firestore and collection access.
|
|
2201
|
+
* @returns A transform-and-validate function that creates a new notification box document.
|
|
2199
2202
|
*/ function createNotificationBoxFactory(context) {
|
|
2200
2203
|
var firestoreContext = context.firestoreContext, notificationBoxCollection = context.notificationBoxCollection, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
2201
2204
|
var createNotificationBoxInTransaction = createNotificationBoxInTransactionFactory(context);
|
|
@@ -2258,8 +2261,8 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2258
2261
|
* Currently a no-op placeholder that returns the document unchanged.
|
|
2259
2262
|
* Reserved for future box-level update logic.
|
|
2260
2263
|
*
|
|
2261
|
-
* @param context -
|
|
2262
|
-
* @returns
|
|
2264
|
+
* @param context - The notification server actions context (destructured for the transform factory)
|
|
2265
|
+
* @returns A transform-and-validate function that returns the notification box document unchanged.
|
|
2263
2266
|
*/ function updateNotificationBoxFactory(context) {
|
|
2264
2267
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
2265
2268
|
return firebaseServerActionTransformFunctionFactory(firebase.updateNotificationBoxParamsType, function() {
|
|
@@ -2289,8 +2292,8 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2289
2292
|
* Manages the exclusion list (`x`) on both the box recipient and the corresponding
|
|
2290
2293
|
* {@link NotificationUser}'s send exclusion array, keeping them in sync.
|
|
2291
2294
|
*
|
|
2292
|
-
* @param context -
|
|
2293
|
-
* @returns
|
|
2295
|
+
* @param context - The base notification server actions context with collection access.
|
|
2296
|
+
* @returns An async function that updates recipient exclusions within a transaction.
|
|
2294
2297
|
*/ function updateNotificationBoxRecipientExclusionInTransactionFactory(context) {
|
|
2295
2298
|
var notificationBoxCollection = context.notificationBoxCollection, notificationUserCollection = context.notificationUserCollection;
|
|
2296
2299
|
return function(input, transaction) {
|
|
@@ -2383,8 +2386,8 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2383
2386
|
* Syncs changes with the recipient's {@link NotificationUser} document and manages
|
|
2384
2387
|
* recipient index assignment via a sorted-values free-index calculator.
|
|
2385
2388
|
*
|
|
2386
|
-
* @param context -
|
|
2387
|
-
* @returns
|
|
2389
|
+
* @param context - The base notification server actions context with auth and collection access.
|
|
2390
|
+
* @returns An async function that updates a recipient on a notification box within a transaction.
|
|
2388
2391
|
*/ function updateNotificationBoxRecipientInTransactionFactory(context) {
|
|
2389
2392
|
var authService = context.authService, notificationBoxCollection = context.notificationBoxCollection, notificationUserCollection = context.notificationUserCollection;
|
|
2390
2393
|
var createNotificationBoxInTransaction = createNotificationBoxInTransactionFactory(context);
|
|
@@ -2631,8 +2634,8 @@ var MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
|
2631
2634
|
* Wraps the in-transaction recipient update logic, handling both recipient changes
|
|
2632
2635
|
* and send exclusion updates in a single Firestore transaction.
|
|
2633
2636
|
*
|
|
2634
|
-
* @param context -
|
|
2635
|
-
* @returns
|
|
2637
|
+
* @param context - The notification server actions context with Firestore and collection access.
|
|
2638
|
+
* @returns A transform-and-validate function that updates a recipient on a notification box.
|
|
2636
2639
|
*/ function updateNotificationBoxRecipientFactory(context) {
|
|
2637
2640
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
2638
2641
|
var updateNotificationBoxRecipientInTransaction = updateNotificationBoxRecipientInTransactionFactory(context);
|
|
@@ -2735,8 +2738,8 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = dateFns.hoursToMilliseconds(NOTIFI
|
|
|
2735
2738
|
* Supports throttling via `sendAt` time, configurable send flags, and task-based
|
|
2736
2739
|
* async workflows for notifications that require multi-step processing.
|
|
2737
2740
|
*
|
|
2738
|
-
* @param context -
|
|
2739
|
-
* @returns
|
|
2741
|
+
* @param context - The notification server actions context with template, send, and task services.
|
|
2742
|
+
* @returns A transform-and-validate function that processes and sends a notification document.
|
|
2740
2743
|
*/ function sendNotificationFactory(context) {
|
|
2741
2744
|
var appNotificationTemplateTypeInfoRecordService = context.appNotificationTemplateTypeInfoRecordService, notificationSendService = context.notificationSendService, notificationTaskService = context.notificationTaskService, notificationTemplateService = context.notificationTemplateService, authService = context.authService, notificationBoxCollection = context.notificationBoxCollection, notificationCollectionGroup = context.notificationCollectionGroup, notificationUserCollection = context.notificationUserCollection, firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
2742
2745
|
var createNotificationBoxInTransaction = createNotificationBoxInTransactionFactory(context);
|
|
@@ -3948,8 +3951,8 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = dateFns.hoursToMilliseconds(NOTIFI
|
|
|
3948
3951
|
* Continues processing batches until no more queued notifications are found
|
|
3949
3952
|
* or the time budget is exhausted.
|
|
3950
3953
|
*
|
|
3951
|
-
* @param context -
|
|
3952
|
-
* @returns
|
|
3954
|
+
* @param context - The notification server actions context with collection group and send factory access.
|
|
3955
|
+
* @returns A transform-and-validate function that processes all queued notifications and returns aggregate results.
|
|
3953
3956
|
*/ function sendQueuedNotificationsFactory(context) {
|
|
3954
3957
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationCollectionGroup = context.notificationCollectionGroup;
|
|
3955
3958
|
var sendNotification = sendNotificationFactory(context);
|
|
@@ -4118,8 +4121,8 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = dateFns.hoursToMilliseconds(NOTIFI
|
|
|
4118
4121
|
* past the retention window) and deletes them in batches. Continues until no more
|
|
4119
4122
|
* cleanup-eligible notifications are found.
|
|
4120
4123
|
*
|
|
4121
|
-
* @param context -
|
|
4122
|
-
* @returns
|
|
4124
|
+
* @param context - The notification server actions context with Firestore and collection access.
|
|
4125
|
+
* @returns A transform-and-validate function that cleans up sent notification documents and returns aggregate results.
|
|
4123
4126
|
*/ function cleanupSentNotificationsFactory(context) {
|
|
4124
4127
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationCollectionGroup = context.notificationCollectionGroup, notificationBoxCollection = context.notificationBoxCollection, notificationWeekCollectionFactory = context.notificationWeekCollectionFactory, notificationLoggedEventDayCollectionFactory = context.notificationLoggedEventDayCollectionFactory, notificationLoggedEventDayPagedItemsCollectionFactory = context.notificationLoggedEventDayPagedItemsCollectionFactory;
|
|
4125
4128
|
return firebaseServerActionTransformFunctionFactory(firebase.cleanupSentNotificationsParamsType, function() {
|
|
@@ -4514,8 +4517,8 @@ var NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS = dateFns.hoursToMilliseconds(NOTIFI
|
|
|
4514
4517
|
* For each old day, all docs in the day's paged subcollection are deleted before the wrapper doc
|
|
4515
4518
|
* itself, so a partial failure leaves the index pointing at zero pages rather than orphaned ones.
|
|
4516
4519
|
*
|
|
4517
|
-
* @param context -
|
|
4518
|
-
* @returns
|
|
4520
|
+
* @param context - The notification server actions context with paged-items collection access.
|
|
4521
|
+
* @returns A transform-and-validate function that purges old logged-event days and returns aggregate counts.
|
|
4519
4522
|
*/ function cleanupOldNotificationLoggedEventDaysFactory(context) {
|
|
4520
4523
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationLoggedEventDayCollectionGroup = context.notificationLoggedEventDayCollectionGroup, notificationLoggedEventDayPagedItemsCollectionFactory = context.notificationLoggedEventDayPagedItemsCollectionFactory;
|
|
4521
4524
|
function deleteOldLoggedEventDay(dayDocument) {
|
|
@@ -4826,8 +4829,8 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
4826
4829
|
* Creates a concrete {@link NotificationInitServerActions} implementation by wiring each
|
|
4827
4830
|
* initialization action to its factory function.
|
|
4828
4831
|
*
|
|
4829
|
-
* @param context -
|
|
4830
|
-
* @returns
|
|
4832
|
+
* @param context - The initialization context with template functions and Firestore access.
|
|
4833
|
+
* @returns A fully wired {@link NotificationInitServerActions} instance.
|
|
4831
4834
|
*
|
|
4832
4835
|
* @example
|
|
4833
4836
|
* ```ts
|
|
@@ -4853,9 +4856,9 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
4853
4856
|
*
|
|
4854
4857
|
* Skips initialization if the model is already initialized, optionally throwing an error.
|
|
4855
4858
|
*
|
|
4856
|
-
* @param input -
|
|
4857
|
-
* @returns
|
|
4858
|
-
* @throws
|
|
4859
|
+
* @param input - The document, transaction, template function, and options.
|
|
4860
|
+
* @returns An object with `initialized` and `alreadyInitialized` boolean flags.
|
|
4861
|
+
* @throws {Error} NotificationModelAlreadyInitializedError when `throwErrorIfAlreadyInitialized` is true.
|
|
4859
4862
|
*/ function initializeNotificationModelInTransaction(input) {
|
|
4860
4863
|
return _async_to_generator$e(function() {
|
|
4861
4864
|
var makeTemplateFunction, throwErrorIfAlreadyInitialized, transaction, documentInTransaction, notificationBox, initialized, alreadyInitialized, flatModelKey, modelKey, modelCollectionName, _$input, template;
|
|
@@ -4957,8 +4960,8 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
4957
4960
|
* Loads the box document in the transaction, reads its current data, and delegates
|
|
4958
4961
|
* to {@link initializeNotificationModelInTransaction} with the box-specific template function.
|
|
4959
4962
|
*
|
|
4960
|
-
* @param context -
|
|
4961
|
-
* @returns
|
|
4963
|
+
* @param context - The initialization context with collection references and template functions.
|
|
4964
|
+
* @returns An async function that initializes a notification box given params, document, and transaction.
|
|
4962
4965
|
*/ function initializeNotificationBoxInTransactionFactory(context) {
|
|
4963
4966
|
var notificationBoxCollection = context.notificationBoxCollection, makeTemplateForNotificationBoxInitialization = context.makeTemplateForNotificationBoxInitialization;
|
|
4964
4967
|
return function(params, notificationBoxDocument, transaction) {
|
|
@@ -4996,8 +4999,8 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
4996
4999
|
* Wraps the in-transaction initialization in a Firestore transaction
|
|
4997
5000
|
* and follows the transform-and-validate pattern.
|
|
4998
5001
|
*
|
|
4999
|
-
* @param context -
|
|
5000
|
-
* @returns
|
|
5002
|
+
* @param context - The initialization context with Firestore access and template functions.
|
|
5003
|
+
* @returns A transform-and-validate function that initializes a single notification box.
|
|
5001
5004
|
*/ function initializeNotificationBoxFactory(context) {
|
|
5002
5005
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
5003
5006
|
var initializeNotificationBoxInTransaction = initializeNotificationBoxInTransactionFactory(context);
|
|
@@ -5039,8 +5042,8 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5039
5042
|
* by querying for entries with `s=true` (setup needed), then initializing each in
|
|
5040
5043
|
* parallel (up to 5 concurrent tasks). Loops until no more flagged boxes are found.
|
|
5041
5044
|
*
|
|
5042
|
-
* @param context -
|
|
5043
|
-
* @returns
|
|
5045
|
+
* @param context - The initialization context with Firestore access and collection references.
|
|
5046
|
+
* @returns A transform-and-validate function that batch-initializes all applicable notification boxes.
|
|
5044
5047
|
*/ function initializeAllApplicableNotificationBoxesFactory(context) {
|
|
5045
5048
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationBoxCollection = context.notificationBoxCollection;
|
|
5046
5049
|
var initializeNotificationBoxInTransaction = initializeNotificationBoxInTransactionFactory(context);
|
|
@@ -5054,7 +5057,7 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5054
5057
|
var notificationBoxesVisited, notificationBoxesSucceeded, notificationBoxesFailed, notificationBoxesAlreadyInitialized, initializeNotificationBoxParams, initializeNotificationBoxesResults, found, result;
|
|
5055
5058
|
function initializeNotificationBoxes() {
|
|
5056
5059
|
return _async_to_generator$e(function() {
|
|
5057
|
-
var query, notificationBoxDocuments
|
|
5060
|
+
var query, notificationBoxDocuments;
|
|
5058
5061
|
return _ts_generator$e(this, function(_state) {
|
|
5059
5062
|
switch(_state.label){
|
|
5060
5063
|
case 0:
|
|
@@ -5066,7 +5069,7 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5066
5069
|
case 1:
|
|
5067
5070
|
notificationBoxDocuments = _state.sent();
|
|
5068
5071
|
return [
|
|
5069
|
-
|
|
5072
|
+
2,
|
|
5070
5073
|
util.performAsyncTasks(notificationBoxDocuments, function(notificationBoxDocument) {
|
|
5071
5074
|
return _async_to_generator$e(function() {
|
|
5072
5075
|
return _ts_generator$e(this, function(_state) {
|
|
@@ -5082,12 +5085,6 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5082
5085
|
maxParallelTasks: 5
|
|
5083
5086
|
})
|
|
5084
5087
|
];
|
|
5085
|
-
case 2:
|
|
5086
|
-
result = _state.sent();
|
|
5087
|
-
return [
|
|
5088
|
-
2,
|
|
5089
|
-
result
|
|
5090
|
-
];
|
|
5091
5088
|
}
|
|
5092
5089
|
});
|
|
5093
5090
|
})();
|
|
@@ -5159,8 +5156,8 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5159
5156
|
* Loads the summary document in the transaction, reads its current data, and delegates
|
|
5160
5157
|
* to {@link initializeNotificationModelInTransaction} with the summary-specific template function.
|
|
5161
5158
|
*
|
|
5162
|
-
* @param context -
|
|
5163
|
-
* @returns
|
|
5159
|
+
* @param context - The initialization context with collection references and template functions.
|
|
5160
|
+
* @returns An async function that initializes a notification summary given params, document, and transaction.
|
|
5164
5161
|
*/ function initializeNotificationSummaryInTransactionFactory(context) {
|
|
5165
5162
|
var notificationSummaryCollection = context.notificationSummaryCollection, makeTemplateForNotificationSummaryInitialization = context.makeTemplateForNotificationSummaryInitialization;
|
|
5166
5163
|
return function(params, notificationSummaryDocument, transaction) {
|
|
@@ -5198,8 +5195,8 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5198
5195
|
* Wraps the in-transaction summary initialization in a Firestore transaction
|
|
5199
5196
|
* and follows the transform-and-validate pattern.
|
|
5200
5197
|
*
|
|
5201
|
-
* @param context -
|
|
5202
|
-
* @returns
|
|
5198
|
+
* @param context - The initialization context with Firestore access and template functions.
|
|
5199
|
+
* @returns A transform-and-validate function that initializes a single notification summary.
|
|
5203
5200
|
*/ function initializeNotificationSummaryFactory(context) {
|
|
5204
5201
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
5205
5202
|
var initializeNotificationSummaryInTransaction = initializeNotificationSummaryInTransactionFactory(context);
|
|
@@ -5241,8 +5238,8 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5241
5238
|
* by querying for entries with `s=true` (setup needed), then initializing each in
|
|
5242
5239
|
* parallel (up to 5 concurrent tasks). Loops until no more flagged summaries are found.
|
|
5243
5240
|
*
|
|
5244
|
-
* @param context -
|
|
5245
|
-
* @returns
|
|
5241
|
+
* @param context - The initialization context with Firestore access and collection references.
|
|
5242
|
+
* @returns A transform-and-validate function that batch-initializes all applicable notification summaries.
|
|
5246
5243
|
*/ function initializeAllApplicableNotificationSummariesFactory(context) {
|
|
5247
5244
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, notificationSummaryCollection = context.notificationSummaryCollection;
|
|
5248
5245
|
var initializeNotificationSummaryInTransaction = initializeNotificationSummaryInTransactionFactory(context);
|
|
@@ -5256,7 +5253,7 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5256
5253
|
var notificationSummariesVisited, notificationSummariesSucceeded, notificationSummariesFailed, notificationSummariesAlreadyInitialized, initializeNotificationSummaryParams, initializeNotificationSummariesResults, found, result;
|
|
5257
5254
|
function initializeNotificationSummaries() {
|
|
5258
5255
|
return _async_to_generator$e(function() {
|
|
5259
|
-
var query, notificationSummaryDocuments
|
|
5256
|
+
var query, notificationSummaryDocuments;
|
|
5260
5257
|
return _ts_generator$e(this, function(_state) {
|
|
5261
5258
|
switch(_state.label){
|
|
5262
5259
|
case 0:
|
|
@@ -5268,7 +5265,7 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5268
5265
|
case 1:
|
|
5269
5266
|
notificationSummaryDocuments = _state.sent();
|
|
5270
5267
|
return [
|
|
5271
|
-
|
|
5268
|
+
2,
|
|
5272
5269
|
util.performAsyncTasks(notificationSummaryDocuments, function(notificationSummaryDocument) {
|
|
5273
5270
|
return _async_to_generator$e(function() {
|
|
5274
5271
|
return _ts_generator$e(this, function(_state) {
|
|
@@ -5284,12 +5281,6 @@ var MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_
|
|
|
5284
5281
|
maxParallelTasks: 5
|
|
5285
5282
|
})
|
|
5286
5283
|
];
|
|
5287
|
-
case 2:
|
|
5288
|
-
result = _state.sent();
|
|
5289
|
-
return [
|
|
5290
|
-
2,
|
|
5291
|
-
result
|
|
5292
|
-
];
|
|
5293
5284
|
}
|
|
5294
5285
|
});
|
|
5295
5286
|
})();
|
|
@@ -5582,8 +5573,8 @@ function _ts_generator$d(thisArg, body) {
|
|
|
5582
5573
|
/**
|
|
5583
5574
|
* Returns the default factory and optional type-specific config for the given template type.
|
|
5584
5575
|
*
|
|
5585
|
-
* @param type -
|
|
5586
|
-
* @returns
|
|
5576
|
+
* @param type - The notification template type to look up.
|
|
5577
|
+
* @returns A tuple of [defaultFactory, typeConfig] where either may be undefined.
|
|
5587
5578
|
*/ key: "configPairForType",
|
|
5588
5579
|
value: function configPairForType(type) {
|
|
5589
5580
|
return [
|
|
@@ -5597,8 +5588,8 @@ function _ts_generator$d(thisArg, body) {
|
|
|
5597
5588
|
* Creates a {@link NotificationTemplateServiceInstance} scoped to a single template type,
|
|
5598
5589
|
* pre-wired with the resolved factory for that type.
|
|
5599
5590
|
*
|
|
5600
|
-
* @param type -
|
|
5601
|
-
* @returns
|
|
5591
|
+
* @param type - The notification template type.
|
|
5592
|
+
* @returns A new {@link NotificationTemplateServiceInstance} bound to the given type.
|
|
5602
5593
|
*/ key: "templateInstanceForType",
|
|
5603
5594
|
value: function templateInstanceForType(type) {
|
|
5604
5595
|
return notificationTemplateServiceInstance(this, type);
|
|
@@ -5618,9 +5609,9 @@ exports.NotificationTemplateService = __decorate([
|
|
|
5618
5609
|
* Resolves the factory from the service's type-specific config first, falling back to
|
|
5619
5610
|
* a no-content default factory when no config is registered for the type.
|
|
5620
5611
|
*
|
|
5621
|
-
* @param service -
|
|
5622
|
-
* @param type -
|
|
5623
|
-
* @returns
|
|
5612
|
+
* @param service - The parent template service.
|
|
5613
|
+
* @param type - The template type to bind.
|
|
5614
|
+
* @returns A {@link NotificationTemplateServiceInstance} with the resolved factory for the type.
|
|
5624
5615
|
*
|
|
5625
5616
|
* @example
|
|
5626
5617
|
* ```ts
|
|
@@ -5841,9 +5832,9 @@ function _ts_generator$c(thisArg, body) {
|
|
|
5841
5832
|
*
|
|
5842
5833
|
* Does not support Firestore transactions, as running should occur outside of a transaction.
|
|
5843
5834
|
*
|
|
5844
|
-
* @param input -
|
|
5845
|
-
* @returns
|
|
5846
|
-
* @throws Error
|
|
5835
|
+
* @param input - Creation and run configuration.
|
|
5836
|
+
* @returns The creation pair result with optional send/enqueue outcomes.
|
|
5837
|
+
* @throws {Error} If the notification template is not flagged as unique.
|
|
5847
5838
|
*
|
|
5848
5839
|
* @example
|
|
5849
5840
|
* ```ts
|
|
@@ -6200,9 +6191,9 @@ function _ts_generator$b(thisArg, body) {
|
|
|
6200
6191
|
};
|
|
6201
6192
|
/**
|
|
6202
6193
|
* Creates a new NotificationExpediteServiceInstance with the input NotificationExpediteService.
|
|
6203
|
-
|
|
6204
|
-
* @param notificationExpediteService -
|
|
6205
|
-
* @returns
|
|
6194
|
+
*
|
|
6195
|
+
* @param notificationExpediteService - The expedite service to use for sending.
|
|
6196
|
+
* @returns A new {@link NotificationExpediteServiceInstance} with an internal queue.
|
|
6206
6197
|
*/ function notificationExpediteServiceInstance(notificationExpediteService) {
|
|
6207
6198
|
var _documentsToSend = [];
|
|
6208
6199
|
var initialize = function initialize() {
|
|
@@ -6261,7 +6252,7 @@ function _ts_generator$b(thisArg, body) {
|
|
|
6261
6252
|
/**
|
|
6262
6253
|
* Returns the configured NotificationServerActions instance.
|
|
6263
6254
|
*
|
|
6264
|
-
* @returns
|
|
6255
|
+
* @returns The current {@link NotificationServerActions} instance.
|
|
6265
6256
|
*/ key: "getNotificationServerActions",
|
|
6266
6257
|
value: function getNotificationServerActions() {
|
|
6267
6258
|
return this._notificationServerActions;
|
|
@@ -6271,7 +6262,7 @@ function _ts_generator$b(thisArg, body) {
|
|
|
6271
6262
|
/**
|
|
6272
6263
|
* Sets the NotificationServerActions instance to use.
|
|
6273
6264
|
*
|
|
6274
|
-
* @param notificationServerActions -
|
|
6265
|
+
* @param notificationServerActions - The actions instance to configure.
|
|
6275
6266
|
*/ key: "setNotificationServerActions",
|
|
6276
6267
|
value: function setNotificationServerActions(notificationServerActions) {
|
|
6277
6268
|
this._notificationServerActions = notificationServerActions;
|
|
@@ -6320,7 +6311,7 @@ exports.MutableNotificationExpediteService = __decorate([
|
|
|
6320
6311
|
*
|
|
6321
6312
|
* This should generally be used in the global module of an app.
|
|
6322
6313
|
*
|
|
6323
|
-
* @returns
|
|
6314
|
+
* @returns Array of NestJS providers for both MutableNotificationExpediteService and NotificationExpediteService.
|
|
6324
6315
|
*/ function provideMutableNotificationExpediteService() {
|
|
6325
6316
|
return [
|
|
6326
6317
|
exports.MutableNotificationExpediteService,
|
|
@@ -6335,7 +6326,7 @@ exports.MutableNotificationExpediteService = __decorate([
|
|
|
6335
6326
|
*
|
|
6336
6327
|
* This should generally be used in the global module of an app.
|
|
6337
6328
|
*
|
|
6338
|
-
* @returns
|
|
6329
|
+
* @returns The abstract classes to export from the NestJS module.
|
|
6339
6330
|
*/ function exportMutableNotificationExpediteService() {
|
|
6340
6331
|
return [
|
|
6341
6332
|
NotificationExpediteService,
|
|
@@ -6425,12 +6416,12 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
6425
6416
|
* Factory that assembles the full {@link NotificationServerActionsContext} by combining
|
|
6426
6417
|
* the base context with the template, send, task, and expedite services.
|
|
6427
6418
|
*
|
|
6428
|
-
* @param context -
|
|
6429
|
-
* @param notificationTemplateService -
|
|
6430
|
-
* @param notificationSendService -
|
|
6431
|
-
* @param notificationTaskService -
|
|
6432
|
-
* @param notificationsExpediteService -
|
|
6433
|
-
* @returns
|
|
6419
|
+
* @param context - The base server actions context.
|
|
6420
|
+
* @param notificationTemplateService - Resolves message factories for notification template types.
|
|
6421
|
+
* @param notificationSendService - Handles sending notification messages.
|
|
6422
|
+
* @param notificationTaskService - Handles notification task dispatch.
|
|
6423
|
+
* @param notificationsExpediteService - Expedites immediate notification delivery.
|
|
6424
|
+
* @returns The assembled {@link NotificationServerActionsContext}
|
|
6434
6425
|
*/ // eslint-disable-next-line @typescript-eslint/max-params
|
|
6435
6426
|
function notificationServerActionsContextFactory(context, notificationTemplateService, notificationSendService, notificationTaskService, notificationsExpediteService) {
|
|
6436
6427
|
return _object_spread_props$7(_object_spread$7({}, context), {
|
|
@@ -6443,8 +6434,8 @@ function notificationServerActionsContextFactory(context, notificationTemplateSe
|
|
|
6443
6434
|
/**
|
|
6444
6435
|
* Factory that creates a {@link NotificationServerActions} instance from the assembled context.
|
|
6445
6436
|
*
|
|
6446
|
-
* @param context -
|
|
6447
|
-
* @returns
|
|
6437
|
+
* @param context - The assembled notification server actions context.
|
|
6438
|
+
* @returns A new {@link NotificationServerActions} instance.
|
|
6448
6439
|
*/ function notificationServerActionsFactory(context) {
|
|
6449
6440
|
return notificationServerActions(context);
|
|
6450
6441
|
}
|
|
@@ -6452,9 +6443,9 @@ function notificationServerActionsContextFactory(context, notificationTemplateSe
|
|
|
6452
6443
|
* Factory that creates a {@link NotificationInitServerActions} instance by merging the
|
|
6453
6444
|
* server actions context with the init-specific configuration.
|
|
6454
6445
|
*
|
|
6455
|
-
* @param context -
|
|
6456
|
-
* @param notificationInitServerActionsContextConfig -
|
|
6457
|
-
* @returns
|
|
6446
|
+
* @param context - The assembled notification server actions context.
|
|
6447
|
+
* @param notificationInitServerActionsContextConfig - Init-specific configuration.
|
|
6448
|
+
* @returns A new {@link NotificationInitServerActions} instance.
|
|
6458
6449
|
*/ function notificationInitServerActionsFactory(context, notificationInitServerActionsContextConfig) {
|
|
6459
6450
|
return notificationInitServerActions(_object_spread$7({}, context, notificationInitServerActionsContextConfig));
|
|
6460
6451
|
}
|
|
@@ -6470,8 +6461,8 @@ function notificationServerActionsContextFactory(context, notificationTemplateSe
|
|
|
6470
6461
|
*
|
|
6471
6462
|
* Be sure the class that delares the module using this function also extends AbstractAppNotificationModule.
|
|
6472
6463
|
*
|
|
6473
|
-
* @param config -
|
|
6474
|
-
* @returns
|
|
6464
|
+
* @param config - Module metadata configuration including dependency module and additional providers.
|
|
6465
|
+
* @returns The assembled {@link ModuleMetadata} for the notification module.
|
|
6475
6466
|
*/ function appNotificationModuleMetadata(config$1) {
|
|
6476
6467
|
var dependencyModule = config$1.dependencyModule, imports = config$1.imports, exports$1 = config$1.exports, providers = config$1.providers;
|
|
6477
6468
|
var dependencyModuleImport = dependencyModule ? [
|
|
@@ -6793,8 +6784,8 @@ function _ts_generator$a(thisArg, body) {
|
|
|
6793
6784
|
*
|
|
6794
6785
|
* Each summary update runs in a Firestore transaction to prevent concurrent write conflicts.
|
|
6795
6786
|
*
|
|
6796
|
-
* @param config -
|
|
6797
|
-
* @returns
|
|
6787
|
+
* @param config - Service configuration including Firestore context and collection references.
|
|
6788
|
+
* @returns A {@link NotificationSummarySendService} backed by Firestore.
|
|
6798
6789
|
*
|
|
6799
6790
|
* @example
|
|
6800
6791
|
* ```ts
|
|
@@ -7115,7 +7106,7 @@ function _ts_generator$9(thisArg, body) {
|
|
|
7115
7106
|
* Useful as a placeholder when your app's notification pipeline is fully wired for SMS
|
|
7116
7107
|
* but actual delivery is not yet enabled, avoiding the need for conditional logic elsewhere.
|
|
7117
7108
|
*
|
|
7118
|
-
* @returns
|
|
7109
|
+
* @returns A no-op {@link NotificationTextSendService} that ignores all messages.
|
|
7119
7110
|
*
|
|
7120
7111
|
* @example
|
|
7121
7112
|
* ```ts
|
|
@@ -7295,8 +7286,8 @@ function _ts_generator$8(thisArg, body) {
|
|
|
7295
7286
|
* finds the next uncompleted checkpoint in the flow and executes its handler function.
|
|
7296
7287
|
* If all checkpoints are complete, the task is marked as done.
|
|
7297
7288
|
*
|
|
7298
|
-
* @param config -
|
|
7299
|
-
* @returns
|
|
7289
|
+
* @param config - Handler configurations and optional validation list.
|
|
7290
|
+
* @returns A {@link NotificationTaskService} that dispatches tasks to the registered handlers.
|
|
7300
7291
|
*
|
|
7301
7292
|
* @example
|
|
7302
7293
|
* ```ts
|
|
@@ -7678,8 +7669,8 @@ function _ts_generator$7(thisArg, body) {
|
|
|
7678
7669
|
* This is the primary entry point for building complex, multi-step notification task handlers
|
|
7679
7670
|
* such as storage file processing or other async workflows.
|
|
7680
7671
|
*
|
|
7681
|
-
* @param factoryConfig -
|
|
7682
|
-
* @returns
|
|
7672
|
+
* @param factoryConfig - Shared configuration including the input function, cleanup logic, and task type.
|
|
7673
|
+
* @returns A factory function that produces {@link NotificationTaskServiceTaskHandlerConfig} entries.
|
|
7683
7674
|
*
|
|
7684
7675
|
* @example
|
|
7685
7676
|
* ```ts
|
|
@@ -7703,8 +7694,9 @@ function _ts_generator$7(thisArg, body) {
|
|
|
7703
7694
|
var processorFunctionForConfig = /**
|
|
7704
7695
|
* Structure is similar to notificationTaskService(), but contained to handle the subtasks.
|
|
7705
7696
|
*
|
|
7706
|
-
* @param processorConfig -
|
|
7707
|
-
* @returns
|
|
7697
|
+
* @param processorConfig - The processor configuration with target, flow, and cleanup.
|
|
7698
|
+
* @returns A processor with process and optional cleanup functions.
|
|
7699
|
+
* @throws {Error} When `processorConfig.flow` is empty or contains more than one non-subtask entry.
|
|
7708
7700
|
*/ function processorFunctionForConfig(processorConfig) {
|
|
7709
7701
|
var inputFlows = processorConfig.flow, cleanup = processorConfig.cleanup, processorAllowRunMultipleParts = processorConfig.allowRunMultipleParts;
|
|
7710
7702
|
var _separateValues = util.separateValues(inputFlows, function(x) {
|
|
@@ -8102,7 +8094,7 @@ function _ts_generator$7(thisArg, body) {
|
|
|
8102
8094
|
/**
|
|
8103
8095
|
* Creates a NotificationTaskSubTaskMissingRequiredDataTermination.
|
|
8104
8096
|
*
|
|
8105
|
-
* @returns
|
|
8097
|
+
* @returns A new {@link NotificationTaskSubTaskMissingRequiredDataTermination} error instance.
|
|
8106
8098
|
*/ function notificationTaskSubTaskMissingRequiredDataTermination() {
|
|
8107
8099
|
return new NotificationTaskSubTaskMissingRequiredDataTermination();
|
|
8108
8100
|
}
|
|
@@ -8891,30 +8883,28 @@ var PDF_NAME_SMASK = pdfLib.PDFName.of('SMask');
|
|
|
8891
8883
|
var PDF_NAME_MASK = pdfLib.PDFName.of('Mask');
|
|
8892
8884
|
function isCompressibleImageStream(stream) {
|
|
8893
8885
|
var dict = stream.dict;
|
|
8886
|
+
var result = false;
|
|
8894
8887
|
// Must be Type /XObject (when present) and Subtype /Image
|
|
8895
8888
|
var type = dict.get(PDF_NAME_TYPE);
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
isDct = filter.size() === 1 && pdfNameEquals(filter.get(0), PDF_NAME_DCTDECODE);
|
|
8913
|
-
} else {
|
|
8914
|
-
isDct = pdfNameEquals(filter, PDF_NAME_DCTDECODE);
|
|
8889
|
+
var typeOk = type === undefined || pdfNameEquals(type, PDF_NAME_XOBJECT);
|
|
8890
|
+
if (typeOk) {
|
|
8891
|
+
var subtype = dict.get(PDF_NAME_SUBTYPE);
|
|
8892
|
+
var subtypeOk = subtype !== undefined && pdfNameEquals(subtype, PDF_NAME_IMAGE);
|
|
8893
|
+
// Skip images with masks; replacing them risks breaking the mask alignment.
|
|
8894
|
+
var hasMask = dict.get(PDF_NAME_SMASK) !== undefined || dict.get(PDF_NAME_MASK) !== undefined;
|
|
8895
|
+
if (subtypeOk && !hasMask) {
|
|
8896
|
+
// Only DCTDecode (JPEG) streams in v1.
|
|
8897
|
+
var filter = dict.get(PDF_NAME_FILTER);
|
|
8898
|
+
if (filter !== undefined) {
|
|
8899
|
+
if (_instanceof$1(filter, pdfLib.PDFArray)) {
|
|
8900
|
+
result = filter.size() === 1 && pdfNameEquals(filter.get(0), PDF_NAME_DCTDECODE);
|
|
8901
|
+
} else {
|
|
8902
|
+
result = pdfNameEquals(filter, PDF_NAME_DCTDECODE);
|
|
8903
|
+
}
|
|
8904
|
+
}
|
|
8915
8905
|
}
|
|
8916
8906
|
}
|
|
8917
|
-
return
|
|
8907
|
+
return result;
|
|
8918
8908
|
}
|
|
8919
8909
|
function pdfNameEquals(candidate, name) {
|
|
8920
8910
|
return _instanceof$1(candidate, pdfLib.PDFName) && candidate.asString() === name.asString();
|
|
@@ -8939,7 +8929,7 @@ function replaceImageStream(input) {
|
|
|
8939
8929
|
/**
|
|
8940
8930
|
* Creates an error indicating that a storage file model has already been initialized.
|
|
8941
8931
|
*
|
|
8942
|
-
* @returns
|
|
8932
|
+
* @returns A precondition-conflict HttpsError with the STORAGE_FILE_MODEL_ALREADY_INITIALIZED error code.
|
|
8943
8933
|
*/ function storageFileModelAlreadyInitializedError() {
|
|
8944
8934
|
return firebaseServer.preconditionConflictError({
|
|
8945
8935
|
message: "This model has already been initialized.",
|
|
@@ -8949,7 +8939,7 @@ function replaceImageStream(input) {
|
|
|
8949
8939
|
/**
|
|
8950
8940
|
* Creates an error indicating that the StorageFile is not flagged for group sync.
|
|
8951
8941
|
*
|
|
8952
|
-
* @returns
|
|
8942
|
+
* @returns A precondition-conflict HttpsError with the STORAGE_FILE_NOT_FLAGGED_FOR_GROUPS_SYNC error code.
|
|
8953
8943
|
*/ function storageFileNotFlaggedForGroupsSyncError() {
|
|
8954
8944
|
return firebaseServer.preconditionConflictError({
|
|
8955
8945
|
message: "This StorageFile has not been flagged for sync with its groups.",
|
|
@@ -8959,7 +8949,7 @@ function replaceImageStream(input) {
|
|
|
8959
8949
|
/**
|
|
8960
8950
|
* Creates an error indicating that the target uploaded file does not exist in storage.
|
|
8961
8951
|
*
|
|
8962
|
-
* @returns
|
|
8952
|
+
* @returns A precondition-conflict HttpsError with the UPLOADED_FILE_DOES_NOT_EXIST error code.
|
|
8963
8953
|
*/ function uploadedFileDoesNotExistError() {
|
|
8964
8954
|
return firebaseServer.preconditionConflictError({
|
|
8965
8955
|
message: "The target uploaded file does not exist.",
|
|
@@ -8969,7 +8959,7 @@ function replaceImageStream(input) {
|
|
|
8969
8959
|
/**
|
|
8970
8960
|
* Creates an error indicating that the file is not allowed to be initialized (rejected by the check function).
|
|
8971
8961
|
*
|
|
8972
|
-
* @returns
|
|
8962
|
+
* @returns A precondition-conflict HttpsError with the UPLOADED_FILE_NOT_ALLOWED_TO_BE_INITIALIZED error code.
|
|
8973
8963
|
*/ function uploadedFileIsNotAllowedToBeInitializedError() {
|
|
8974
8964
|
return firebaseServer.preconditionConflictError({
|
|
8975
8965
|
message: "The target uploaded file is not allowed to be initialized.",
|
|
@@ -8979,8 +8969,8 @@ function replaceImageStream(input) {
|
|
|
8979
8969
|
/**
|
|
8980
8970
|
* Creates an error indicating that the file initialization failed with the given result type.
|
|
8981
8971
|
*
|
|
8982
|
-
* @param data -
|
|
8983
|
-
* @returns
|
|
8972
|
+
* @param data - Error data containing the result type that caused the failure.
|
|
8973
|
+
* @returns An internal-server HttpsError with the UPLOADED_FILE_INITIALIZATION_FAILED error code and the result type.
|
|
8984
8974
|
*/ function uploadedFileInitializationFailedError(data) {
|
|
8985
8975
|
return firebaseServer.internalServerError({
|
|
8986
8976
|
message: 'The target uploaded file initialization failed with result type "'.concat(data.resultType, '".'),
|
|
@@ -8993,7 +8983,7 @@ function replaceImageStream(input) {
|
|
|
8993
8983
|
/**
|
|
8994
8984
|
* Creates an error indicating that the initialization result was discarded (e.g., the created file no longer exists).
|
|
8995
8985
|
*
|
|
8996
|
-
* @returns
|
|
8986
|
+
* @returns An internal-server HttpsError with the UPLOADED_FILE_INITIALIZATION_DISCARDED error code.
|
|
8997
8987
|
*/ function uploadedFileInitializationDiscardedError() {
|
|
8998
8988
|
return firebaseServer.internalServerError({
|
|
8999
8989
|
message: "The target uploaded file initialization was discarded.",
|
|
@@ -9003,7 +8993,7 @@ function replaceImageStream(input) {
|
|
|
9003
8993
|
/**
|
|
9004
8994
|
* Creates an error indicating that the StorageFile is not in a valid state for processing.
|
|
9005
8995
|
*
|
|
9006
|
-
* @returns
|
|
8996
|
+
* @returns A precondition-conflict HttpsError with the STORAGE_FILE_PROCESSING_NOT_ALLOWED_FOR_INVALID_STATE error code.
|
|
9007
8997
|
*/ function storageFileProcessingNotAllowedForInvalidStateError() {
|
|
9008
8998
|
return firebaseServer.preconditionConflictError({
|
|
9009
8999
|
message: "The target StorageFileDocument must be in an OK state to be processed and processing not flagged as SHOULD_NOT_PROCESS.",
|
|
@@ -9013,7 +9003,7 @@ function replaceImageStream(input) {
|
|
|
9013
9003
|
/**
|
|
9014
9004
|
* Creates an error indicating that the StorageFile is not queued for processing.
|
|
9015
9005
|
*
|
|
9016
|
-
* @returns
|
|
9006
|
+
* @returns A precondition-conflict HttpsError with the STORAGE_FILE_PROCESSING_NOT_QUEUED_FOR_PROCESSING error code.
|
|
9017
9007
|
*/ function storageFileProcessingNotQueuedForProcessingError() {
|
|
9018
9008
|
return firebaseServer.preconditionConflictError({
|
|
9019
9009
|
message: "The target StorageFileDocument is not queued for processing.",
|
|
@@ -9023,7 +9013,7 @@ function replaceImageStream(input) {
|
|
|
9023
9013
|
/**
|
|
9024
9014
|
* Creates an error indicating that no processor is configured for the StorageFile's type.
|
|
9025
9015
|
*
|
|
9026
|
-
* @returns
|
|
9016
|
+
* @returns A precondition-conflict HttpsError with the STORAGE_FILE_PROCESSING_NOT_AVAILABLE_FOR_TYPE error code.
|
|
9027
9017
|
*/ function storageFileProcessingNotAvailableForTypeError() {
|
|
9028
9018
|
return firebaseServer.preconditionConflictError({
|
|
9029
9019
|
message: "The target StorageFileDocument is not available for processing.",
|
|
@@ -9033,7 +9023,7 @@ function replaceImageStream(input) {
|
|
|
9033
9023
|
/**
|
|
9034
9024
|
* Creates an error indicating that the StorageFile has already finished processing.
|
|
9035
9025
|
*
|
|
9036
|
-
* @returns
|
|
9026
|
+
* @returns A precondition-conflict HttpsError with the STORAGE_FILE_ALREADY_PROCESSED error code.
|
|
9037
9027
|
*/ function storageFileAlreadyProcessedError() {
|
|
9038
9028
|
return firebaseServer.preconditionConflictError({
|
|
9039
9029
|
message: "The target StorageFileDocument has already finished processing.",
|
|
@@ -9043,7 +9033,7 @@ function replaceImageStream(input) {
|
|
|
9043
9033
|
/**
|
|
9044
9034
|
* Creates an error indicating that the StorageFile is not flagged for deletion.
|
|
9045
9035
|
*
|
|
9046
|
-
* @returns
|
|
9036
|
+
* @returns A precondition-conflict HttpsError with the STORAGE_FILE_NOT_FLAGGED_FOR_DELETION error code.
|
|
9047
9037
|
*/ function storageFileNotFlaggedForDeletionError() {
|
|
9048
9038
|
return firebaseServer.preconditionConflictError({
|
|
9049
9039
|
message: "The target StorageFileDocument is not flagged for deletion.",
|
|
@@ -9053,7 +9043,7 @@ function replaceImageStream(input) {
|
|
|
9053
9043
|
/**
|
|
9054
9044
|
* Creates an error indicating that the StorageFile's scheduled deletion time has not yet passed.
|
|
9055
9045
|
*
|
|
9056
|
-
* @returns
|
|
9046
|
+
* @returns A precondition-conflict HttpsError with the STORAGE_FILE_CANNOT_BE_DELETED_YET error code.
|
|
9057
9047
|
*/ function storageFileCannotBeDeletedYetError() {
|
|
9058
9048
|
return firebaseServer.preconditionConflictError({
|
|
9059
9049
|
message: "The target StorageFileDocument cannot be deleted yet.",
|
|
@@ -9063,7 +9053,7 @@ function replaceImageStream(input) {
|
|
|
9063
9053
|
/**
|
|
9064
9054
|
* Creates an error indicating that the StorageFileGroup is still queued for initialization and cannot be operated on.
|
|
9065
9055
|
*
|
|
9066
|
-
* @returns
|
|
9056
|
+
* @returns A precondition-conflict HttpsError with the STORAGE_FILE_GROUP_QUEUED_FOR_INITIALIZATION error code.
|
|
9067
9057
|
*/ function storageFileGroupQueuedForInitializationError() {
|
|
9068
9058
|
return firebaseServer.preconditionConflictError({
|
|
9069
9059
|
message: "The target StorageFileGroupDocument is queued for initialization.",
|
|
@@ -9073,7 +9063,7 @@ function replaceImageStream(input) {
|
|
|
9073
9063
|
/**
|
|
9074
9064
|
* Creates an error indicating that the required model key or storageFileId is missing when creating a StorageFileGroup.
|
|
9075
9065
|
*
|
|
9076
|
-
* @returns
|
|
9066
|
+
* @returns A precondition-conflict HttpsError with the STORAGE_FILE_GROUP_CREATE_INPUT error code.
|
|
9077
9067
|
*/ function createStorageFileGroupInputError() {
|
|
9078
9068
|
return firebaseServer.preconditionConflictError({
|
|
9079
9069
|
message: "The model or storageFileId is required for creating a StorageFileGroup.",
|
|
@@ -9345,10 +9335,9 @@ function _ts_generator$4(thisArg, body) {
|
|
|
9345
9335
|
* Creates a concrete {@link StorageFileServerActions} implementation by wiring each action
|
|
9346
9336
|
* to its factory function using the provided context.
|
|
9347
9337
|
*
|
|
9348
|
-
* @param context -
|
|
9349
|
-
*
|
|
9350
|
-
* @
|
|
9351
|
-
* @returns a concrete {@link StorageFileServerActions} with all action methods wired to their factories
|
|
9338
|
+
* @param context - The fully assembled storage file server actions context.
|
|
9339
|
+
* @param context - The fully assembled storage file server actions context.
|
|
9340
|
+
* @returns A concrete {@link StorageFileServerActions} with all action methods wired to their factories.
|
|
9352
9341
|
*
|
|
9353
9342
|
* @example
|
|
9354
9343
|
* ```ts
|
|
@@ -9382,8 +9371,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
9382
9371
|
*
|
|
9383
9372
|
* Creates a new {@link StorageFile} document using the provided template data.
|
|
9384
9373
|
*
|
|
9385
|
-
* @param context -
|
|
9386
|
-
* @returns
|
|
9374
|
+
* @param context - The base server actions context providing Firestore and storage access.
|
|
9375
|
+
* @returns An async transform-and-validate function that creates a StorageFile document.
|
|
9387
9376
|
*/ function createStorageFileFactory(context) {
|
|
9388
9377
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
9389
9378
|
return firebaseServerActionTransformFunctionFactory(firebase.createStorageFileParamsType, function(params) {
|
|
@@ -9414,8 +9403,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
9414
9403
|
* initializes each one via the upload service, and cleans up the source upload
|
|
9415
9404
|
* on success. Failed initializations are logged but do not halt the batch.
|
|
9416
9405
|
*
|
|
9417
|
-
* @param context -
|
|
9418
|
-
* @returns
|
|
9406
|
+
* @param context - The storage file server actions context with storage service and upload initialization.
|
|
9407
|
+
* @returns An async transform-and-validate function that returns batch initialization results.
|
|
9419
9408
|
*/ function initializeAllStorageFilesFromUploadsFactory(context) {
|
|
9420
9409
|
var storageService = context.storageService, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
9421
9410
|
var _initializeStorageFileFromUploadFile = _initializeStorageFileFromUploadFileFactory(context);
|
|
@@ -9515,8 +9504,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
9515
9504
|
* Validates the file exists and is allowed, runs the upload initializer, deletes the upload source
|
|
9516
9505
|
* on success, and optionally expedites processing of the created storage file.
|
|
9517
9506
|
*
|
|
9518
|
-
* @param context -
|
|
9519
|
-
* @returns
|
|
9507
|
+
* @param context - The storage file server actions context.
|
|
9508
|
+
* @returns An async function that accepts an upload file input and returns the created StorageFileDocument.
|
|
9520
9509
|
*/ function _initializeStorageFileFromUploadFileFactory(context) {
|
|
9521
9510
|
var firestoreContext = context.firestoreContext, storageFileInitializeFromUploadService = context.storageFileInitializeFromUploadService, notificationExpediteService = context.notificationExpediteService;
|
|
9522
9511
|
var processStorageFileInTransaction = _processStorageFileInTransactionFactory(context);
|
|
@@ -9782,8 +9771,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
9782
9771
|
* Validates the file exists and is allowed, runs the type determiner and initializer,
|
|
9783
9772
|
* then cleans up the upload source on success.
|
|
9784
9773
|
*
|
|
9785
|
-
* @param context -
|
|
9786
|
-
* @returns
|
|
9774
|
+
* @param context - The storage file server actions context with storage and upload services.
|
|
9775
|
+
* @returns An async transform-and-validate function that creates a StorageFile from an upload.
|
|
9787
9776
|
*/ function initializeStorageFileFromUploadFactory(context) {
|
|
9788
9777
|
var storageService = context.storageService, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
9789
9778
|
var _initializeStorageFileFromUploadFile = _initializeStorageFileFromUploadFileFactory(context);
|
|
@@ -9822,8 +9811,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
9822
9811
|
*
|
|
9823
9812
|
* Updates an existing {@link StorageFile} document with the provided schedule-delete-at time.
|
|
9824
9813
|
*
|
|
9825
|
-
* @param context -
|
|
9826
|
-
* @returns
|
|
9814
|
+
* @param context - The base server actions context providing Firestore access.
|
|
9815
|
+
* @returns An async transform-and-validate function that updates a StorageFile document.
|
|
9827
9816
|
*/ function updateStorageFileFactory(context) {
|
|
9828
9817
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
9829
9818
|
return firebaseServerActionTransformFunctionFactory(firebase.updateStorageFileParamsType, function(params) {
|
|
@@ -9867,8 +9856,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
9867
9856
|
* Updates embedded file entries within a {@link StorageFileGroup} document inside a
|
|
9868
9857
|
* Firestore transaction, merging display name changes into the existing entries.
|
|
9869
9858
|
*
|
|
9870
|
-
* @param context -
|
|
9871
|
-
* @returns
|
|
9859
|
+
* @param context - The storage file server actions context.
|
|
9860
|
+
* @returns An async transform-and-validate function that updates a StorageFileGroup document.
|
|
9872
9861
|
*/ function updateStorageFileGroupFactory(context) {
|
|
9873
9862
|
var firestoreContext = context.firestoreContext, storageFileGroupCollection = context.storageFileGroupCollection, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
9874
9863
|
return firebaseServerActionTransformFunctionFactory(firebase.updateStorageFileGroupParamsType, function(params) {
|
|
@@ -9952,8 +9941,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
9952
9941
|
* processing notification task for each file and optionally expedites delivery.
|
|
9953
9942
|
* Handles stuck-processing detection with a throttle check.
|
|
9954
9943
|
*
|
|
9955
|
-
* @param context -
|
|
9956
|
-
* @returns
|
|
9944
|
+
* @param context - The storage file server actions context.
|
|
9945
|
+
* @returns An async transform-and-validate function that returns batch processing results.
|
|
9957
9946
|
*/ function processAllQueuedStorageFilesFactory(context) {
|
|
9958
9947
|
var storageFileCollection = context.storageFileCollection, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
9959
9948
|
var processStorageFile = processStorageFileFactory(context);
|
|
@@ -10047,8 +10036,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
10047
10036
|
* Creates or restarts a notification task for the file based on its current processing state,
|
|
10048
10037
|
* handling stuck-processing detection, forced restarts, and re-processing of already-successful files.
|
|
10049
10038
|
*
|
|
10050
|
-
* @param context -
|
|
10051
|
-
* @returns
|
|
10039
|
+
* @param context - The storage file server actions context.
|
|
10040
|
+
* @returns An async function that processes a storage file within a transaction.
|
|
10052
10041
|
*/ function _processStorageFileInTransactionFactory(context) {
|
|
10053
10042
|
var storageFileCollection = context.storageFileCollection, notificationCollectionGroup = context.notificationCollectionGroup;
|
|
10054
10043
|
return function(input, transaction) {
|
|
@@ -10322,8 +10311,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
10322
10311
|
* Processes a single {@link StorageFile} by creating a notification task for it
|
|
10323
10312
|
* and marking it as processing. Validates the file is in a valid state for processing.
|
|
10324
10313
|
*
|
|
10325
|
-
* @param context -
|
|
10326
|
-
* @returns
|
|
10314
|
+
* @param context - The storage file server actions context.
|
|
10315
|
+
* @returns An async transform-and-validate function that processes a single StorageFile.
|
|
10327
10316
|
*/ function processStorageFileFactory(context) {
|
|
10328
10317
|
var firestoreContext = context.firestoreContext, notificationExpediteService = context.notificationExpediteService, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
10329
10318
|
var processStorageFileInTransaction = _processStorageFileInTransactionFactory(context);
|
|
@@ -10408,8 +10397,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
10408
10397
|
* scheduled delete time has passed. Removes both the Firestore document and
|
|
10409
10398
|
* the associated file in Cloud Storage.
|
|
10410
10399
|
*
|
|
10411
|
-
* @param context -
|
|
10412
|
-
* @returns
|
|
10400
|
+
* @param context - The storage file server actions context.
|
|
10401
|
+
* @returns An async transform-and-validate function that returns batch deletion results.
|
|
10413
10402
|
*/ function deleteAllQueuedStorageFilesFactory(context) {
|
|
10414
10403
|
var storageFileCollection = context.storageFileCollection, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
10415
10404
|
var deleteStorageFile = deleteStorageFileFactory(context);
|
|
@@ -10505,8 +10494,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
10505
10494
|
* Deletes a single {@link StorageFile} document and its associated Cloud Storage file.
|
|
10506
10495
|
* Validates the file is flagged for deletion and the scheduled delete time has passed.
|
|
10507
10496
|
*
|
|
10508
|
-
* @param context -
|
|
10509
|
-
* @returns
|
|
10497
|
+
* @param context - The storage file server actions context.
|
|
10498
|
+
* @returns An async transform-and-validate function that deletes a StorageFile and its storage object.
|
|
10510
10499
|
*/ function deleteStorageFileFactory(context) {
|
|
10511
10500
|
var firestoreContext = context.firestoreContext, storageService = context.storageService, storageFileCollection = context.storageFileCollection, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
10512
10501
|
var syncStorageFileWithGroupsInTransaction = _syncStorageFileWithGroupsInTransactionFactory(context);
|
|
@@ -10606,8 +10595,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
10606
10595
|
* When `throwOnFirstError` is true, the first failure throws immediately (single-download behavior).
|
|
10607
10596
|
* When false, failures are collected in the errors array (batch behavior).
|
|
10608
10597
|
*
|
|
10609
|
-
* @param context -
|
|
10610
|
-
* @returns
|
|
10598
|
+
* @param context - The storage file server actions context.
|
|
10599
|
+
* @returns An async function that processes a {@link DownloadMultipleStorageFilesFactoryInput} and returns a {@link DownloadMultipleStorageFilesResult}
|
|
10611
10600
|
*/ function _downloadMultipleStorageFilesFactory(context) {
|
|
10612
10601
|
var storageService = context.storageService, storageFileCollection = context.storageFileCollection;
|
|
10613
10602
|
return function(input) {
|
|
@@ -10721,8 +10710,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
10721
10710
|
* Generates a signed download URL for a {@link StorageFile}'s associated Cloud Storage file.
|
|
10722
10711
|
* Delegates to {@link _downloadMultipleStorageFilesFactory} with a single item and `throwOnFirstError: true`.
|
|
10723
10712
|
*
|
|
10724
|
-
* @param context -
|
|
10725
|
-
* @returns
|
|
10713
|
+
* @param context - The storage file server actions context.
|
|
10714
|
+
* @returns An async transform-and-validate function that generates a signed download URL.
|
|
10726
10715
|
*/ function downloadStorageFileFactory(context) {
|
|
10727
10716
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
10728
10717
|
var downloadMultipleStorageFiles = _downloadMultipleStorageFilesFactory(context);
|
|
@@ -10778,8 +10767,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
10778
10767
|
* By default, individual failures are collected in the errors array rather than failing the entire batch.
|
|
10779
10768
|
* Set `throwOnFirstError` in params to throw on the first failure instead.
|
|
10780
10769
|
*
|
|
10781
|
-
* @param context -
|
|
10782
|
-
* @returns
|
|
10770
|
+
* @param context - The storage file server actions context.
|
|
10771
|
+
* @returns An async transform-and-validate function that generates signed download URLs for multiple files.
|
|
10783
10772
|
*/ function downloadMultipleStorageFilesFactory(context) {
|
|
10784
10773
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
10785
10774
|
var downloadMultipleStorageFiles = _downloadMultipleStorageFilesFactory(context);
|
|
@@ -10831,8 +10820,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
10831
10820
|
* The created group is flagged for initialization (`s=true`) and uses a dummy owner key
|
|
10832
10821
|
* that will be set during the initialization step.
|
|
10833
10822
|
*
|
|
10834
|
-
* @param context -
|
|
10835
|
-
* @returns
|
|
10823
|
+
* @param context - The storage file server actions context.
|
|
10824
|
+
* @returns An async function that creates a StorageFileGroup within a transaction.
|
|
10836
10825
|
*/ function createStorageFileGroupInTransactionFactory(context) {
|
|
10837
10826
|
var storageFileGroupCollection = context.storageFileGroupCollection;
|
|
10838
10827
|
return function(params, transaction) {
|
|
@@ -10880,8 +10869,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
10880
10869
|
* Creates a new {@link StorageFileGroup} document within a Firestore transaction,
|
|
10881
10870
|
* associating it with a model key or storage file.
|
|
10882
10871
|
*
|
|
10883
|
-
* @param context -
|
|
10884
|
-
* @returns
|
|
10872
|
+
* @param context - The storage file server actions context.
|
|
10873
|
+
* @returns An async transform-and-validate function that creates a new StorageFileGroup.
|
|
10885
10874
|
*/ function createStorageFileGroupFactory(context) {
|
|
10886
10875
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
10887
10876
|
var createStorageFileGroupInTransaction = createStorageFileGroupInTransactionFactory(context);
|
|
@@ -10939,8 +10928,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
10939
10928
|
* Adds the storage file to groups it is missing from, removes it from groups when requested,
|
|
10940
10929
|
* and optionally creates new groups for references that do not yet exist.
|
|
10941
10930
|
*
|
|
10942
|
-
* @param context -
|
|
10943
|
-
* @returns
|
|
10931
|
+
* @param context - The storage file server actions context.
|
|
10932
|
+
* @returns An async function that syncs a storage file with its groups within a transaction.
|
|
10944
10933
|
*/ function _syncStorageFileWithGroupsInTransactionFactory(context) {
|
|
10945
10934
|
var storageFileCollection = context.storageFileCollection, storageFileGroupCollection = context.storageFileGroupCollection;
|
|
10946
10935
|
var createStorageFileGroupInTransaction = createStorageFileGroupInTransactionFactory(context);
|
|
@@ -11137,8 +11126,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
11137
11126
|
* Syncs a single {@link StorageFile}'s embedded data into its associated {@link StorageFileGroup}
|
|
11138
11127
|
* documents and clears the sync flag on completion.
|
|
11139
11128
|
*
|
|
11140
|
-
* @param context -
|
|
11141
|
-
* @returns
|
|
11129
|
+
* @param context - The storage file server actions context.
|
|
11130
|
+
* @returns An async transform-and-validate function that syncs a StorageFile with its groups.
|
|
11142
11131
|
*/ function syncStorageFileWithGroupsFactory(context) {
|
|
11143
11132
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
11144
11133
|
var syncStorageFileWithGroupsInTransaction = _syncStorageFileWithGroupsInTransactionFactory(context);
|
|
@@ -11183,8 +11172,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
11183
11172
|
* updating their associated {@link StorageFileGroup} documents and flagging
|
|
11184
11173
|
* groups for content regeneration when changes occur.
|
|
11185
11174
|
*
|
|
11186
|
-
* @param context -
|
|
11187
|
-
* @returns
|
|
11175
|
+
* @param context - The storage file server actions context.
|
|
11176
|
+
* @returns An async transform-and-validate function that returns batch sync results.
|
|
11188
11177
|
*/ function syncAllFlaggedStorageFilesWithGroupsFactory(context) {
|
|
11189
11178
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, storageFileCollection = context.storageFileCollection;
|
|
11190
11179
|
var syncStorageFileWithGroups = syncStorageFileWithGroupsFactory(context);
|
|
@@ -11301,8 +11290,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
11301
11290
|
* Regenerates the content of a single {@link StorageFileGroup}, including building a ZIP
|
|
11302
11291
|
* archive from the group's embedded files and updating the group's content metadata.
|
|
11303
11292
|
*
|
|
11304
|
-
* @param context -
|
|
11305
|
-
* @returns
|
|
11293
|
+
* @param context - The storage file server actions context.
|
|
11294
|
+
* @returns An async transform-and-validate function that regenerates a StorageFileGroup's content.
|
|
11306
11295
|
*/ function regenerateStorageFileGroupContentFactory(context) {
|
|
11307
11296
|
var firestoreContext = context.firestoreContext, storageService = context.storageService, storageFileCollection = context.storageFileCollection, storageFileGroupCollection = context.storageFileGroupCollection, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
11308
11297
|
var processStorageFileInTransaction = _processStorageFileInTransactionFactory(context);
|
|
@@ -11443,8 +11432,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
11443
11432
|
* Batch-processes all {@link StorageFileGroup} documents flagged for content regeneration,
|
|
11444
11433
|
* rebuilding their ZIP archives and updating content metadata.
|
|
11445
11434
|
*
|
|
11446
|
-
* @param context -
|
|
11447
|
-
* @returns
|
|
11435
|
+
* @param context - The storage file server actions context.
|
|
11436
|
+
* @returns An async transform-and-validate function that returns batch regeneration results.
|
|
11448
11437
|
*/ function regenerateAllFlaggedStorageFileGroupsContentFactory(context) {
|
|
11449
11438
|
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, storageFileGroupCollection = context.storageFileGroupCollection;
|
|
11450
11439
|
var regenerateStorageFileGroupContent = regenerateStorageFileGroupContentFactory(context);
|
|
@@ -11732,8 +11721,8 @@ var MAKE_TEMPLATE_FOR_STORAGEFILE_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_R
|
|
|
11732
11721
|
* Creates a concrete {@link StorageFileInitServerActions} implementation by wiring each
|
|
11733
11722
|
* initialization action to its factory function.
|
|
11734
11723
|
*
|
|
11735
|
-
* @param context -
|
|
11736
|
-
* @returns
|
|
11724
|
+
* @param context - The initialization context with template function and Firestore access.
|
|
11725
|
+
* @returns A {@link StorageFileInitServerActions} wired to the provided context.
|
|
11737
11726
|
*/ function storageFileInitServerActions(context) {
|
|
11738
11727
|
return {
|
|
11739
11728
|
initializeStorageFileGroup: initializeStorageFileGroupFactory(context),
|
|
@@ -11748,9 +11737,9 @@ var MAKE_TEMPLATE_FOR_STORAGEFILE_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_R
|
|
|
11748
11737
|
* - Returns `null`/`undefined` → marks the model as invalid (`fi=true`)
|
|
11749
11738
|
* - Returns `false` → deletes the document entirely
|
|
11750
11739
|
*
|
|
11751
|
-
* @param input -
|
|
11752
|
-
* @returns
|
|
11753
|
-
* @throws
|
|
11740
|
+
* @param input - The document, transaction, template function, and options.
|
|
11741
|
+
* @returns An object indicating whether the document was initialized or was already initialized.
|
|
11742
|
+
* @throws {Error} StorageFileModelAlreadyInitializedError when `throwErrorIfAlreadyInitialized` is true.
|
|
11754
11743
|
*/ function initializeStorageFileModelInTransaction(input) {
|
|
11755
11744
|
return _async_to_generator$3(function() {
|
|
11756
11745
|
var makeTemplateFunction, throwErrorIfAlreadyInitialized, transaction, documentInTransaction, storageFileModel, initialized, alreadyInitialized, flatModelKey, modelKey, modelCollectionName, _$input, template;
|
|
@@ -11852,8 +11841,8 @@ var MAKE_TEMPLATE_FOR_STORAGEFILE_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_R
|
|
|
11852
11841
|
* Applies the app-specific template function, restricting the template to only the `o` (owner)
|
|
11853
11842
|
* and content flag properties, and always flags the group for content regeneration.
|
|
11854
11843
|
*
|
|
11855
|
-
* @param context -
|
|
11856
|
-
* @returns
|
|
11844
|
+
* @param context - The initialization context providing collection access and the template function.
|
|
11845
|
+
* @returns An async function that initializes a storage file group document within a transaction.
|
|
11857
11846
|
*/ function initializeStorageFileGroupInTransactionFactory(context) {
|
|
11858
11847
|
var storageFileGroupCollection = context.storageFileGroupCollection, makeTemplateForStorageFileGroupInitialization = context.makeTemplateForStorageFileGroupInitialization;
|
|
11859
11848
|
return function(params, storageFileGroupDocument, transaction) {
|
|
@@ -11915,8 +11904,8 @@ var MAKE_TEMPLATE_FOR_STORAGEFILE_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_R
|
|
|
11915
11904
|
* Wraps the in-transaction group initialization in a Firestore transaction
|
|
11916
11905
|
* and follows the transform-and-validate pattern.
|
|
11917
11906
|
*
|
|
11918
|
-
* @param context -
|
|
11919
|
-
* @returns
|
|
11907
|
+
* @param context - The initialization context with Firestore access and template function.
|
|
11908
|
+
* @returns A transform-and-validate function for single storage file group initialization.
|
|
11920
11909
|
*/ function initializeStorageFileGroupFactory(context) {
|
|
11921
11910
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
11922
11911
|
var initializeStorageFileGroupInTransaction = initializeStorageFileGroupInTransactionFactory(context);
|
|
@@ -11958,8 +11947,8 @@ var MAKE_TEMPLATE_FOR_STORAGEFILE_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_R
|
|
|
11958
11947
|
* initializing each in parallel (up to 5 concurrent tasks). Loops until no more
|
|
11959
11948
|
* flagged groups are found.
|
|
11960
11949
|
*
|
|
11961
|
-
* @param context -
|
|
11962
|
-
* @returns
|
|
11950
|
+
* @param context - The initialization context with Firestore access, collection, and template function.
|
|
11951
|
+
* @returns A transform-and-validate function for batch storage file group initialization.
|
|
11963
11952
|
*/ function initializeAllApplicableStorageFileGroupsFactory(context) {
|
|
11964
11953
|
var firestoreContext = context.firestoreContext, firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory, storageFileGroupCollection = context.storageFileGroupCollection;
|
|
11965
11954
|
var initializeStorageFileGroupInTransaction = initializeStorageFileGroupInTransactionFactory(context);
|
|
@@ -12161,9 +12150,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
12161
12150
|
* Factory that assembles the full {@link StorageFileServerActionsContext} by combining
|
|
12162
12151
|
* the base context with the upload initialization service.
|
|
12163
12152
|
*
|
|
12164
|
-
* @param context -
|
|
12165
|
-
* @param storageFileInitializeFromUploadService -
|
|
12166
|
-
* @returns
|
|
12153
|
+
* @param context - The base server actions context providing Firebase infrastructure.
|
|
12154
|
+
* @param storageFileInitializeFromUploadService - The service for initializing storage files from uploads.
|
|
12155
|
+
* @returns The fully assembled StorageFileServerActionsContext.
|
|
12167
12156
|
*/ function storageFileServerActionsContextFactory(context, storageFileInitializeFromUploadService) {
|
|
12168
12157
|
return _object_spread_props$2(_object_spread$2({}, context), {
|
|
12169
12158
|
storageFileInitializeFromUploadService: storageFileInitializeFromUploadService
|
|
@@ -12172,8 +12161,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
12172
12161
|
/**
|
|
12173
12162
|
* Factory that creates a {@link StorageFileServerActions} instance from the assembled context.
|
|
12174
12163
|
*
|
|
12175
|
-
* @param context -
|
|
12176
|
-
* @returns
|
|
12164
|
+
* @param context - The fully assembled storage file server actions context.
|
|
12165
|
+
* @returns A concrete StorageFileServerActions instance.
|
|
12177
12166
|
*/ function storageFileServerActionsFactory(context) {
|
|
12178
12167
|
return storageFileServerActions(context);
|
|
12179
12168
|
}
|
|
@@ -12181,9 +12170,9 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
12181
12170
|
* Factory that creates a {@link StorageFileInitServerActions} instance by merging the
|
|
12182
12171
|
* server actions context with the init-specific configuration.
|
|
12183
12172
|
*
|
|
12184
|
-
* @param context -
|
|
12185
|
-
* @param storageFileInitServerActionsContextConfig -
|
|
12186
|
-
* @returns
|
|
12173
|
+
* @param context - The storage file server actions context.
|
|
12174
|
+
* @param storageFileInitServerActionsContextConfig - Init-specific configuration with the template function.
|
|
12175
|
+
* @returns A concrete StorageFileInitServerActions instance.
|
|
12187
12176
|
*/ function storageFileInitServerActionsFactory(context, storageFileInitServerActionsContextConfig) {
|
|
12188
12177
|
return storageFileInitServerActions(_object_spread$2({}, context, storageFileInitServerActionsContextConfig));
|
|
12189
12178
|
}
|
|
@@ -12197,8 +12186,8 @@ function _unsupported_iterable_to_array$1(o, minLen) {
|
|
|
12197
12186
|
*
|
|
12198
12187
|
* Be sure the class that delares the module using this function also extends AbstractAppStorageFileModule.
|
|
12199
12188
|
*
|
|
12200
|
-
* @param config -
|
|
12201
|
-
* @returns
|
|
12189
|
+
* @param config - The module configuration including optional dependency module, imports, exports, and providers.
|
|
12190
|
+
* @returns The assembled {@link ModuleMetadata} for the storage file module.
|
|
12202
12191
|
*/ function appStorageFileModuleMetadata(config$1) {
|
|
12203
12192
|
var dependencyModule = config$1.dependencyModule, imports = config$1.imports, exports = config$1.exports, providers = config$1.providers;
|
|
12204
12193
|
var dependencyModuleImport = dependencyModule ? [
|
|
@@ -12372,7 +12361,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
12372
12361
|
/**
|
|
12373
12362
|
* Performs a query and flags the matching StorageFiles for deletion.
|
|
12374
12363
|
*
|
|
12375
|
-
* @param input The input for the query and flagging.
|
|
12364
|
+
* @param input - The input for the query and flagging.
|
|
12376
12365
|
* @returns The result of the query and flagging.
|
|
12377
12366
|
*/ function queryAndFlagStorageFilesForDelete(input) {
|
|
12378
12367
|
return _async_to_generator$2(function() {
|
|
@@ -12443,7 +12432,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
12443
12432
|
/**
|
|
12444
12433
|
* Creates a template for updating a StorageFile to be queued for deletion at the input time.
|
|
12445
12434
|
*
|
|
12446
|
-
* @param queueForDeleteTime When to delete the StorageFile. If true or unset, the StorageFile will be flagged to be deleted immediately.
|
|
12435
|
+
* @param queueForDeleteTime - When to delete the StorageFile. If true or unset, the StorageFile will be flagged to be deleted immediately.
|
|
12447
12436
|
* @returns The update template for the StorageFile.
|
|
12448
12437
|
*/ function markStorageFileForDeleteTemplate(queueForDeleteTime) {
|
|
12449
12438
|
var updateTemplate = {
|
|
@@ -12667,8 +12656,8 @@ var storageFileProcessingNotificationTaskHandlerDefaultCleanup = function storag
|
|
|
12667
12656
|
* determines its purpose, and dispatches to the appropriate purpose-specific processor.
|
|
12668
12657
|
* Includes optional StorageFileGroup processors (e.g., ZIP generation) by default.
|
|
12669
12658
|
*
|
|
12670
|
-
* @param config -
|
|
12671
|
-
* @returns
|
|
12659
|
+
* @param config - Handler configuration including processors, storage accessor, and Firestore collections.
|
|
12660
|
+
* @returns A NotificationTaskServiceTaskHandlerConfig wired for storage file processing.
|
|
12672
12661
|
*/ function storageFileProcessingNotificationTaskHandler(config) {
|
|
12673
12662
|
var inputProcessors = config.processors, storageAccessor = config.storageAccessor, storageFileFirestoreCollections = config.storageFileFirestoreCollections, allStorageFileGroupProcessorConfig = config.allStorageFileGroupProcessorConfig;
|
|
12674
12663
|
var storageFileDocumentAccessor = storageFileFirestoreCollections.storageFileCollection.documentAccessor();
|
|
@@ -12824,8 +12813,8 @@ var storageFileProcessingNotificationTaskHandlerDefaultCleanup = function storag
|
|
|
12824
12813
|
/**
|
|
12825
12814
|
* Assembles all built-in StorageFileGroup subtask processors, such as ZIP generation.
|
|
12826
12815
|
*
|
|
12827
|
-
* @param config -
|
|
12828
|
-
* @returns
|
|
12816
|
+
* @param config - Configuration controlling which group processors to include.
|
|
12817
|
+
* @returns The subtask processor configs for StorageFileGroup processing purposes.
|
|
12829
12818
|
*/ function allStorageFileGroupStorageFileProcessingPurposeSubtaskProcessors(config) {
|
|
12830
12819
|
var excludeZipProcessing = config.excludeZipProcessing;
|
|
12831
12820
|
var processors = [];
|
|
@@ -12840,8 +12829,8 @@ var storageFileProcessingNotificationTaskHandlerDefaultCleanup = function storag
|
|
|
12840
12829
|
* This processor streams all files in the group into a ZIP archive, attaches an info JSON
|
|
12841
12830
|
* manifest, and uploads the result to the group's designated storage path.
|
|
12842
12831
|
*
|
|
12843
|
-
* @param config -
|
|
12844
|
-
* @returns
|
|
12832
|
+
* @param config - Configuration providing Firestore collections, storage accessor, and ZIP options.
|
|
12833
|
+
* @returns A subtask processor config targeting the StorageFileGroup ZIP purpose.
|
|
12845
12834
|
*/ function storageFileGroupZipStorageFileProcessingPurposeSubtaskProcessor(config) {
|
|
12846
12835
|
var _ref;
|
|
12847
12836
|
var storageFileFirestoreCollections = config.storageFileFirestoreCollections, storageAccessor = config.storageAccessor, zip = config.zip;
|
|
@@ -13378,9 +13367,9 @@ function _ts_generator(thisArg, body) {
|
|
|
13378
13367
|
* Convenience factory for creating a permanent failure result, indicating the file
|
|
13379
13368
|
* should be discarded and any created intermediate files cleaned up.
|
|
13380
13369
|
*
|
|
13381
|
-
* @param error -
|
|
13382
|
-
* @param createdFile -
|
|
13383
|
-
* @returns
|
|
13370
|
+
* @param error - The error that caused the permanent failure.
|
|
13371
|
+
* @param createdFile - Optional path to a file that was created before the error and should be deleted.
|
|
13372
|
+
* @returns A permanent failure result with the error and optional created file reference.
|
|
13384
13373
|
*/ function storageFileInitializeFromUploadServiceInitializerResultPermanentFailure(error, createdFile) {
|
|
13385
13374
|
return {
|
|
13386
13375
|
error: error,
|
|
@@ -13399,8 +13388,8 @@ function _ts_generator(thisArg, body) {
|
|
|
13399
13388
|
* 3. The created file is linked back to the StorageFile document via custom metadata
|
|
13400
13389
|
* 4. Optionally, previous files for the same purpose/user are flagged for deletion
|
|
13401
13390
|
*
|
|
13402
|
-
* @param config -
|
|
13403
|
-
* @returns
|
|
13391
|
+
* @param config - Service configuration including determiners, initializers, and storage references.
|
|
13392
|
+
* @returns A {@link StorageFileInitializeFromUploadService} with type detection and upload initialization.
|
|
13404
13393
|
*
|
|
13405
13394
|
* @example
|
|
13406
13395
|
* ```ts
|
|
@@ -13690,9 +13679,9 @@ exports.DEFAULT_COMPRESS_PDF_IMAGE_MAX_DIMENSION = DEFAULT_COMPRESS_PDF_IMAGE_MA
|
|
|
13690
13679
|
exports.DEFAULT_COMPRESS_PDF_IMAGE_QUALITY = DEFAULT_COMPRESS_PDF_IMAGE_QUALITY;
|
|
13691
13680
|
exports.DEFAULT_COMPRESS_PDF_IMAGE_SIZE_THRESHOLD_BYTES = DEFAULT_COMPRESS_PDF_IMAGE_SIZE_THRESHOLD_BYTES;
|
|
13692
13681
|
exports.DEFAULT_DOWNLOAD_MULTIPLE_STORAGE_FILES_MAX_PARALLEL_TASKS = DEFAULT_DOWNLOAD_MULTIPLE_STORAGE_FILES_MAX_PARALLEL_TASKS;
|
|
13682
|
+
exports.DEFAULT_MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_MAX_BATCH_SIZE_PER_REQUEST = DEFAULT_MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_MAX_BATCH_SIZE_PER_REQUEST;
|
|
13693
13683
|
exports.KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS = KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS;
|
|
13694
13684
|
exports.KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY = KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY;
|
|
13695
|
-
exports.MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST = MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_DEFAULT_MAX_BATCH_SIZE_PER_REQUEST;
|
|
13696
13685
|
exports.MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE = MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE;
|
|
13697
13686
|
exports.MAKE_TEMPLATE_FOR_STORAGEFILE_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE = MAKE_TEMPLATE_FOR_STORAGEFILE_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE;
|
|
13698
13687
|
exports.NOTIFICATION_BOX_NOT_INITIALIZED_DELAY_MINUTES = NOTIFICATION_BOX_NOT_INITIALIZED_DELAY_MINUTES;
|