@dereekb/firebase-server 13.0.6 → 13.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +12 -26
- package/index.cjs.js.map +1 -1
- package/index.esm.js +13 -27
- package/index.esm.js.map +1 -1
- package/mailgun/package.json +8 -8
- package/model/index.cjs.js +34 -40
- package/model/index.esm.js +35 -41
- package/model/package.json +8 -8
- package/model/src/lib/notification/notification.action.init.service.d.ts +1 -1
- package/model/src/lib/notification/notification.action.service.d.ts +3 -3
- package/model/src/lib/notification/notification.expedite.service.d.ts +4 -4
- package/model/src/lib/storagefile/storagefile.action.init.service.d.ts +1 -1
- package/model/src/lib/storagefile/storagefile.action.server.d.ts +1 -1
- package/package.json +10 -10
- package/src/lib/nest/function/context.d.ts +9 -12
- package/test/package.json +8 -8
- package/zoho/package.json +8 -8
package/model/index.cjs.js
CHANGED
|
@@ -667,7 +667,7 @@ function notificationServerActions(context) {
|
|
|
667
667
|
// MARK: Actions
|
|
668
668
|
function createNotificationUserFactory(context) {
|
|
669
669
|
const { firebaseServerActionTransformFunctionFactory, notificationUserCollection, authService } = context;
|
|
670
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
670
|
+
return firebaseServerActionTransformFunctionFactory(firebase.createNotificationUserParamsType, async (params) => {
|
|
671
671
|
const { uid } = params;
|
|
672
672
|
return async () => {
|
|
673
673
|
// assert they exist in the auth system
|
|
@@ -696,7 +696,7 @@ function createNotificationUserFactory(context) {
|
|
|
696
696
|
}
|
|
697
697
|
function updateNotificationUserFactory(context) {
|
|
698
698
|
const { firestoreContext, firebaseServerActionTransformFunctionFactory, notificationUserCollection, appNotificationTemplateTypeInfoRecordService } = context;
|
|
699
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
699
|
+
return firebaseServerActionTransformFunctionFactory(firebase.updateNotificationUserParamsType, async (params) => {
|
|
700
700
|
const { gc: inputGc, dc: inputDc, bc: inputBc } = params;
|
|
701
701
|
return async (notificationUserDocument) => {
|
|
702
702
|
await firestoreContext.runTransaction(async (transaction) => {
|
|
@@ -760,7 +760,7 @@ function updateNotificationUserFactory(context) {
|
|
|
760
760
|
const MAX_NOTIFICATION_BOXES_TO_UPDATE_PER_BATCH = 50;
|
|
761
761
|
function resyncNotificationUserFactory(context) {
|
|
762
762
|
const { firestoreContext, firebaseServerActionTransformFunctionFactory, notificationBoxCollection, notificationUserCollection, appNotificationTemplateTypeInfoRecordService } = context;
|
|
763
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
763
|
+
return firebaseServerActionTransformFunctionFactory(firebase.resyncNotificationUserParamsType, async () => {
|
|
764
764
|
return async (notificationUserDocument) => {
|
|
765
765
|
// run updates in batches
|
|
766
766
|
let notificationBoxesUpdated = 0;
|
|
@@ -929,7 +929,7 @@ function resyncAllNotificationUsersFactory(context) {
|
|
|
929
929
|
}
|
|
930
930
|
function createNotificationSummaryFactory(context) {
|
|
931
931
|
const { firebaseServerActionTransformFunctionFactory, notificationSummaryCollection } = context;
|
|
932
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
932
|
+
return firebaseServerActionTransformFunctionFactory(firebase.createNotificationSummaryParamsType, async (params) => {
|
|
933
933
|
const { model } = params;
|
|
934
934
|
return async () => {
|
|
935
935
|
const notificationSummaryId = firebase.notificationSummaryIdForModel(model);
|
|
@@ -942,7 +942,7 @@ function createNotificationSummaryFactory(context) {
|
|
|
942
942
|
}
|
|
943
943
|
function updateNotificationSummaryFactory(context) {
|
|
944
944
|
const { firebaseServerActionTransformFunctionFactory } = context;
|
|
945
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
945
|
+
return firebaseServerActionTransformFunctionFactory(firebase.updateNotificationSummaryParamsType, async (params) => {
|
|
946
946
|
const { setReadAtTime, flagAllRead } = params;
|
|
947
947
|
return async (notificationSummaryDocument) => {
|
|
948
948
|
let updateTemplate;
|
|
@@ -985,7 +985,7 @@ function createNotificationBoxInTransactionFactory(context) {
|
|
|
985
985
|
function createNotificationBoxFactory(context) {
|
|
986
986
|
const { firestoreContext, notificationBoxCollection, firebaseServerActionTransformFunctionFactory } = context;
|
|
987
987
|
const createNotificationBoxInTransaction = createNotificationBoxInTransactionFactory(context);
|
|
988
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
988
|
+
return firebaseServerActionTransformFunctionFactory(firebase.createNotificationBoxParamsType, async (params) => {
|
|
989
989
|
const { model } = params;
|
|
990
990
|
return async () => {
|
|
991
991
|
const result = await firestoreContext.runTransaction(async (transaction) => {
|
|
@@ -997,7 +997,7 @@ function createNotificationBoxFactory(context) {
|
|
|
997
997
|
});
|
|
998
998
|
}
|
|
999
999
|
function updateNotificationBoxFactory({ firebaseServerActionTransformFunctionFactory }) {
|
|
1000
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
1000
|
+
return firebaseServerActionTransformFunctionFactory(firebase.updateNotificationBoxParamsType, async () => {
|
|
1001
1001
|
return async (notificationBoxDocument) => {
|
|
1002
1002
|
// does nothing currently.
|
|
1003
1003
|
return notificationBoxDocument;
|
|
@@ -1197,7 +1197,7 @@ function updateNotificationBoxRecipientFactory(context) {
|
|
|
1197
1197
|
const { firestoreContext, firebaseServerActionTransformFunctionFactory } = context;
|
|
1198
1198
|
const updateNotificationBoxRecipientInTransaction = updateNotificationBoxRecipientInTransactionFactory(context);
|
|
1199
1199
|
const updateNotificationBoxRecipientExclusionInTransaction = updateNotificationBoxRecipientExclusionInTransactionFactory(context);
|
|
1200
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
1200
|
+
return firebaseServerActionTransformFunctionFactory(firebase.updateNotificationBoxRecipientParamsType, async (params) => {
|
|
1201
1201
|
return async (notificationBoxDocument) => {
|
|
1202
1202
|
await firestoreContext.runTransaction(async (transaction) => {
|
|
1203
1203
|
if (params.setExclusion != null) {
|
|
@@ -1237,7 +1237,7 @@ function sendNotificationFactory(context) {
|
|
|
1237
1237
|
const { appNotificationTemplateTypeInfoRecordService, notificationSendService, notificationTaskService, notificationTemplateService, authService, notificationBoxCollection, notificationCollectionGroup, notificationUserCollection, firestoreContext, firebaseServerActionTransformFunctionFactory } = context;
|
|
1238
1238
|
const createNotificationBoxInTransaction = createNotificationBoxInTransactionFactory(context);
|
|
1239
1239
|
const notificationUserAccessor = notificationUserCollection.documentAccessor();
|
|
1240
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
1240
|
+
return firebaseServerActionTransformFunctionFactory(firebase.sendNotificationParamsType, async (params) => {
|
|
1241
1241
|
const { ignoreSendAtThrottle } = params;
|
|
1242
1242
|
return async (inputNotificationDocument) => {
|
|
1243
1243
|
const now = new Date();
|
|
@@ -1889,7 +1889,7 @@ const SEND_QUEUE_NOTIFICATIONS_TASK_EXCESS_THRESHOLD = 5000;
|
|
|
1889
1889
|
function sendQueuedNotificationsFactory(context) {
|
|
1890
1890
|
const { firebaseServerActionTransformFunctionFactory, notificationCollectionGroup } = context;
|
|
1891
1891
|
const sendNotification = sendNotificationFactory(context);
|
|
1892
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
1892
|
+
return firebaseServerActionTransformFunctionFactory(firebase.sendQueuedNotificationsParamsType, async (params) => {
|
|
1893
1893
|
const { maxSendNotificationLoops } = params;
|
|
1894
1894
|
const maxLoops = maxSendNotificationLoops ?? Number.MAX_SAFE_INTEGER;
|
|
1895
1895
|
const sendNotificationLoopsTaskExcessThreshold = params.sendNotificationLoopsTaskExcessThreshold ?? SEND_QUEUE_NOTIFICATIONS_TASK_EXCESS_THRESHOLD;
|
|
@@ -1981,7 +1981,7 @@ function sendQueuedNotificationsFactory(context) {
|
|
|
1981
1981
|
}
|
|
1982
1982
|
function cleanupSentNotificationsFactory(context) {
|
|
1983
1983
|
const { firestoreContext, firebaseServerActionTransformFunctionFactory, notificationCollectionGroup, notificationBoxCollection, notificationWeekCollectionFactory } = context;
|
|
1984
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
1984
|
+
return firebaseServerActionTransformFunctionFactory(firebase.cleanupSentNotificationsParamsType, async () => {
|
|
1985
1985
|
return async () => {
|
|
1986
1986
|
let notificationBoxesUpdatesCount = 0;
|
|
1987
1987
|
let notificationsDeleted = 0;
|
|
@@ -2169,7 +2169,7 @@ function initializeNotificationBoxInTransactionFactory(context) {
|
|
|
2169
2169
|
function initializeNotificationBoxFactory(context) {
|
|
2170
2170
|
const { firestoreContext, firebaseServerActionTransformFunctionFactory } = context;
|
|
2171
2171
|
const initializeNotificationBoxInTransaction = initializeNotificationBoxInTransactionFactory(context);
|
|
2172
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
2172
|
+
return firebaseServerActionTransformFunctionFactory(firebase.initializeNotificationModelParamsType, async (params) => {
|
|
2173
2173
|
return async (notificationBoxDocument) => {
|
|
2174
2174
|
await firestoreContext.runTransaction((transaction) => initializeNotificationBoxInTransaction(params, notificationBoxDocument, transaction));
|
|
2175
2175
|
return notificationBoxDocument;
|
|
@@ -2179,7 +2179,7 @@ function initializeNotificationBoxFactory(context) {
|
|
|
2179
2179
|
function initializeAllApplicableNotificationBoxesFactory(context) {
|
|
2180
2180
|
const { firestoreContext, firebaseServerActionTransformFunctionFactory, notificationBoxCollection, notificationCollectionGroup } = context;
|
|
2181
2181
|
const initializeNotificationBoxInTransaction = initializeNotificationBoxInTransactionFactory(context);
|
|
2182
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
2182
|
+
return firebaseServerActionTransformFunctionFactory(firebase.initializeAllApplicableNotificationBoxesParamsType, async () => {
|
|
2183
2183
|
return async () => {
|
|
2184
2184
|
let notificationBoxesVisited = 0;
|
|
2185
2185
|
let notificationBoxesSucceeded = 0;
|
|
@@ -2245,7 +2245,7 @@ function initializeNotificationSummaryInTransactionFactory(context) {
|
|
|
2245
2245
|
function initializeNotificationSummaryFactory(context) {
|
|
2246
2246
|
const { firestoreContext, firebaseServerActionTransformFunctionFactory } = context;
|
|
2247
2247
|
const initializeNotificationSummaryInTransaction = initializeNotificationSummaryInTransactionFactory(context);
|
|
2248
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
2248
|
+
return firebaseServerActionTransformFunctionFactory(firebase.initializeNotificationModelParamsType, async (params) => {
|
|
2249
2249
|
return async (notificationSummaryDocument) => {
|
|
2250
2250
|
await firestoreContext.runTransaction((transaction) => initializeNotificationSummaryInTransaction(params, notificationSummaryDocument, transaction));
|
|
2251
2251
|
return notificationSummaryDocument;
|
|
@@ -2255,7 +2255,7 @@ function initializeNotificationSummaryFactory(context) {
|
|
|
2255
2255
|
function initializeAllApplicableNotificationSummariesFactory(context) {
|
|
2256
2256
|
const { firestoreContext, firebaseServerActionTransformFunctionFactory, notificationSummaryCollection, notificationCollectionGroup } = context;
|
|
2257
2257
|
const initializeNotificationSummaryInTransaction = initializeNotificationSummaryInTransactionFactory(context);
|
|
2258
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
2258
|
+
return firebaseServerActionTransformFunctionFactory(firebase.initializeAllApplicableNotificationSummariesParamsType, async () => {
|
|
2259
2259
|
return async () => {
|
|
2260
2260
|
let notificationSummariesVisited = 0;
|
|
2261
2261
|
let notificationSummariesSucceeded = 0;
|
|
@@ -2332,10 +2332,6 @@ function __param(paramIndex, decorator) {
|
|
|
2332
2332
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
2333
2333
|
}
|
|
2334
2334
|
|
|
2335
|
-
function __metadata(metadataKey, metadataValue) {
|
|
2336
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
2337
|
-
}
|
|
2338
|
-
|
|
2339
2335
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
2340
2336
|
var e = new Error(message);
|
|
2341
2337
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
@@ -2376,8 +2372,7 @@ exports.NotificationTemplateService = class NotificationTemplateService {
|
|
|
2376
2372
|
exports.NotificationTemplateService = __decorate([
|
|
2377
2373
|
__param(0, common.Optional()),
|
|
2378
2374
|
__param(0, common.Inject(NOTIFICATION_TEMPLATE_SERVICE_DEFAULTS_OVERRIDE_TOKEN)),
|
|
2379
|
-
__param(1, common.Inject(NOTIFICATION_TEMPLATE_SERVICE_CONFIGS_ARRAY_TOKEN))
|
|
2380
|
-
__metadata("design:paramtypes", [Object, Object])
|
|
2375
|
+
__param(1, common.Inject(NOTIFICATION_TEMPLATE_SERVICE_CONFIGS_ARRAY_TOKEN))
|
|
2381
2376
|
], exports.NotificationTemplateService);
|
|
2382
2377
|
/**
|
|
2383
2378
|
* Creates a NotificationTemplateServiceInstance.
|
|
@@ -2643,8 +2638,7 @@ exports.AbstractAppNotificationModule = class AbstractAppNotificationModule {
|
|
|
2643
2638
|
exports.AbstractAppNotificationModule = __decorate([
|
|
2644
2639
|
common.Module({}),
|
|
2645
2640
|
__param(0, common.Inject(exports.MutableNotificationExpediteService)),
|
|
2646
|
-
__param(1, common.Inject(NotificationServerActions))
|
|
2647
|
-
__metadata("design:paramtypes", [exports.MutableNotificationExpediteService, NotificationServerActions])
|
|
2641
|
+
__param(1, common.Inject(NotificationServerActions))
|
|
2648
2642
|
], exports.AbstractAppNotificationModule);
|
|
2649
2643
|
/**
|
|
2650
2644
|
* Pre-configured global provider for MutableNotificationExpediteService/NotificationExpediteService.
|
|
@@ -3210,7 +3204,7 @@ function storageFileServerActions(context) {
|
|
|
3210
3204
|
// MARK: Actions
|
|
3211
3205
|
function createStorageFileFactory(context) {
|
|
3212
3206
|
const { storageFileCollection, firestoreContext, firebaseServerActionTransformFunctionFactory } = context;
|
|
3213
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
3207
|
+
return firebaseServerActionTransformFunctionFactory(firebase.createStorageFileParamsType, async (params) => {
|
|
3214
3208
|
return async () => {
|
|
3215
3209
|
const storageFileDocument = null;
|
|
3216
3210
|
// TODO: check the file exists, and pull the metadata, and create the document
|
|
@@ -3221,7 +3215,7 @@ function createStorageFileFactory(context) {
|
|
|
3221
3215
|
function initializeAllStorageFilesFromUploadsFactory(context) {
|
|
3222
3216
|
const { storageService, firebaseServerActionTransformFunctionFactory } = context;
|
|
3223
3217
|
const _initializeStorageFileFromUploadFile = _initializeStorageFileFromUploadFileFactory(context);
|
|
3224
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
3218
|
+
return firebaseServerActionTransformFunctionFactory(firebase.initializeAllStorageFilesFromUploadsParamsType, async (params) => {
|
|
3225
3219
|
const { folderPath, maxFilesToInitialize, overrideUploadsFolderPath } = params;
|
|
3226
3220
|
const fullPath = util.mergeSlashPaths([overrideUploadsFolderPath ?? firebase.UPLOADS_FOLDER_PATH, folderPath]); // only targets the uploads folder
|
|
3227
3221
|
return async () => {
|
|
@@ -3367,7 +3361,7 @@ function _initializeStorageFileFromUploadFileFactory(context) {
|
|
|
3367
3361
|
function initializeStorageFileFromUploadFactory(context) {
|
|
3368
3362
|
const { storageService, firebaseServerActionTransformFunctionFactory } = context;
|
|
3369
3363
|
const _initializeStorageFileFromUploadFile = _initializeStorageFileFromUploadFileFactory(context);
|
|
3370
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
3364
|
+
return firebaseServerActionTransformFunctionFactory(firebase.initializeStorageFileFromUploadParamsType, async (params) => {
|
|
3371
3365
|
const { bucketId, pathString, expediteProcessing } = params;
|
|
3372
3366
|
return async () => {
|
|
3373
3367
|
const file = storageService.file(bucketId == null ? pathString : { bucketId, pathString });
|
|
@@ -3377,7 +3371,7 @@ function initializeStorageFileFromUploadFactory(context) {
|
|
|
3377
3371
|
}
|
|
3378
3372
|
function updateStorageFileFactory(context) {
|
|
3379
3373
|
const { storageFileCollection, firestoreContext, firebaseServerActionTransformFunctionFactory } = context;
|
|
3380
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
3374
|
+
return firebaseServerActionTransformFunctionFactory(firebase.updateStorageFileParamsType, async (params) => {
|
|
3381
3375
|
const { sdat } = params;
|
|
3382
3376
|
return async (storageFileDocument) => {
|
|
3383
3377
|
const updateTemplate = {
|
|
@@ -3390,7 +3384,7 @@ function updateStorageFileFactory(context) {
|
|
|
3390
3384
|
}
|
|
3391
3385
|
function updateStorageFileGroupFactory(context) {
|
|
3392
3386
|
const { firestoreContext, storageFileGroupCollection, firebaseServerActionTransformFunctionFactory } = context;
|
|
3393
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
3387
|
+
return firebaseServerActionTransformFunctionFactory(firebase.updateStorageFileGroupParamsType, async (params) => {
|
|
3394
3388
|
const { entries } = params;
|
|
3395
3389
|
return async (storageFileGroupDocument) => {
|
|
3396
3390
|
await firestoreContext.runTransaction(async (transaction) => {
|
|
@@ -3422,7 +3416,7 @@ function updateStorageFileGroupFactory(context) {
|
|
|
3422
3416
|
function processAllQueuedStorageFilesFactory(context) {
|
|
3423
3417
|
const { storageFileCollection, firebaseServerActionTransformFunctionFactory } = context;
|
|
3424
3418
|
const processStorageFile = processStorageFileFactory(context);
|
|
3425
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
3419
|
+
return firebaseServerActionTransformFunctionFactory(firebase.processAllQueuedStorageFilesParamsType, async (params) => {
|
|
3426
3420
|
return async () => {
|
|
3427
3421
|
let storageFilesVisited = 0;
|
|
3428
3422
|
let storageFilesProcessStarted = 0;
|
|
@@ -3547,7 +3541,7 @@ function _processStorageFileInTransactionFactory(context) {
|
|
|
3547
3541
|
function processStorageFileFactory(context) {
|
|
3548
3542
|
const { firestoreContext, notificationExpediteService, firebaseServerActionTransformFunctionFactory } = context;
|
|
3549
3543
|
const processStorageFileInTransaction = _processStorageFileInTransactionFactory(context);
|
|
3550
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
3544
|
+
return firebaseServerActionTransformFunctionFactory(firebase.processStorageFileParamsType, async (params) => {
|
|
3551
3545
|
const { runImmediately } = params;
|
|
3552
3546
|
return async (storageFileDocument) => {
|
|
3553
3547
|
const expediteInstance = notificationExpediteService.expediteInstance();
|
|
@@ -3575,7 +3569,7 @@ function processStorageFileFactory(context) {
|
|
|
3575
3569
|
function deleteAllQueuedStorageFilesFactory(context) {
|
|
3576
3570
|
const { storageFileCollection, firebaseServerActionTransformFunctionFactory } = context;
|
|
3577
3571
|
const deleteStorageFile = deleteStorageFileFactory(context);
|
|
3578
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
3572
|
+
return firebaseServerActionTransformFunctionFactory(firebase.deleteAllQueuedStorageFilesParamsType, async (params) => {
|
|
3579
3573
|
return async () => {
|
|
3580
3574
|
let storageFilesVisited = 0;
|
|
3581
3575
|
let storageFilesDeleted = 0;
|
|
@@ -3617,7 +3611,7 @@ function deleteAllQueuedStorageFilesFactory(context) {
|
|
|
3617
3611
|
function deleteStorageFileFactory(context) {
|
|
3618
3612
|
const { firestoreContext, storageService, storageFileCollection, firebaseServerActionTransformFunctionFactory } = context;
|
|
3619
3613
|
const syncStorageFileWithGroupsInTransaction = _syncStorageFileWithGroupsInTransactionFactory(context);
|
|
3620
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
3614
|
+
return firebaseServerActionTransformFunctionFactory(firebase.deleteStorageFileParamsType, async (params) => {
|
|
3621
3615
|
const { force } = params;
|
|
3622
3616
|
return async (inputStorageFileDocument) => {
|
|
3623
3617
|
await firestoreContext.runTransaction(async (transaction) => {
|
|
@@ -3644,7 +3638,7 @@ function deleteStorageFileFactory(context) {
|
|
|
3644
3638
|
}
|
|
3645
3639
|
function downloadStorageFileFactory(context) {
|
|
3646
3640
|
const { storageService, firebaseServerActionTransformFunctionFactory, storageFileCollection } = context;
|
|
3647
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
3641
|
+
return firebaseServerActionTransformFunctionFactory(firebase.downloadStorageFileParamsType, async (params) => {
|
|
3648
3642
|
const { key: targetStorageFileDocumentKey, asAdmin, expiresAt, expiresIn: inputExpiresIn, responseDisposition, responseContentType } = params;
|
|
3649
3643
|
return async (storageFileDocument) => {
|
|
3650
3644
|
// if the StorageFileDocument was not provided, set it from the target key
|
|
@@ -3711,7 +3705,7 @@ function createStorageFileGroupInTransactionFactory(context) {
|
|
|
3711
3705
|
function createStorageFileGroupFactory(context) {
|
|
3712
3706
|
const { firestoreContext, firebaseServerActionTransformFunctionFactory } = context;
|
|
3713
3707
|
const createStorageFileGroupInTransaction = createStorageFileGroupInTransactionFactory(context);
|
|
3714
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
3708
|
+
return firebaseServerActionTransformFunctionFactory(firebase.createStorageFileGroupParamsType, async (params) => {
|
|
3715
3709
|
const { model, storageFileId } = params;
|
|
3716
3710
|
const storageFileGroupRelatedModelKey = model ? model : storageFileId ? firebase.inferKeyFromTwoWayFlatFirestoreModelKey(storageFileId) : undefined;
|
|
3717
3711
|
if (!storageFileGroupRelatedModelKey) {
|
|
@@ -3796,7 +3790,7 @@ function _syncStorageFileWithGroupsInTransactionFactory(context) {
|
|
|
3796
3790
|
function syncStorageFileWithGroupsFactory(context) {
|
|
3797
3791
|
const { firestoreContext, storageFileCollection, storageFileGroupCollection, firebaseServerActionTransformFunctionFactory } = context;
|
|
3798
3792
|
const syncStorageFileWithGroupsInTransaction = _syncStorageFileWithGroupsInTransactionFactory(context);
|
|
3799
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
3793
|
+
return firebaseServerActionTransformFunctionFactory(firebase.syncStorageFileWithGroupsParamsType, async (params) => {
|
|
3800
3794
|
const { force } = params;
|
|
3801
3795
|
return async (storageFileDocument) => {
|
|
3802
3796
|
return firestoreContext.runTransaction(async (transaction) => syncStorageFileWithGroupsInTransaction({ storageFileDocument, force }, transaction));
|
|
@@ -3806,7 +3800,7 @@ function syncStorageFileWithGroupsFactory(context) {
|
|
|
3806
3800
|
function syncAllFlaggedStorageFilesWithGroupsFactory(context) {
|
|
3807
3801
|
const { firebaseServerActionTransformFunctionFactory, storageFileCollection } = context;
|
|
3808
3802
|
const syncStorageFileWithGroups = syncStorageFileWithGroupsFactory(context);
|
|
3809
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
3803
|
+
return firebaseServerActionTransformFunctionFactory(firebase.syncAllFlaggedStorageFilesWithGroupsParamsType, async (params) => {
|
|
3810
3804
|
return async () => {
|
|
3811
3805
|
const syncStorageFileWithGroupsInstance = await syncStorageFileWithGroups({
|
|
3812
3806
|
key: firebase.firestoreDummyKey(),
|
|
@@ -3850,7 +3844,7 @@ function syncAllFlaggedStorageFilesWithGroupsFactory(context) {
|
|
|
3850
3844
|
function regenerateStorageFileGroupContentFactory(context) {
|
|
3851
3845
|
const { firestoreContext, storageService, storageFileCollection, storageFileGroupCollection, firebaseServerActionTransformFunctionFactory } = context;
|
|
3852
3846
|
const processStorageFileInTransaction = _processStorageFileInTransactionFactory(context);
|
|
3853
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
3847
|
+
return firebaseServerActionTransformFunctionFactory(firebase.regenerateStorageFileGroupContentParamsType, async (params) => {
|
|
3854
3848
|
const { force } = params;
|
|
3855
3849
|
const createStorageFileDocumentPair = firebase.createStorageFileDocumentPairFactory({
|
|
3856
3850
|
defaultCreationType: firebase.StorageFileCreationType.FOR_STORAGE_FILE_GROUP
|
|
@@ -3910,7 +3904,7 @@ function regenerateStorageFileGroupContentFactory(context) {
|
|
|
3910
3904
|
function regenerateAllFlaggedStorageFileGroupsContentFactory(context) {
|
|
3911
3905
|
const { firebaseServerActionTransformFunctionFactory, storageFileGroupCollection } = context;
|
|
3912
3906
|
const regenerateStorageFileGroupContent = regenerateStorageFileGroupContentFactory(context);
|
|
3913
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
3907
|
+
return firebaseServerActionTransformFunctionFactory(firebase.regenerateAllFlaggedStorageFileGroupsContentParamsType, async (params) => {
|
|
3914
3908
|
return async () => {
|
|
3915
3909
|
const regenerateStorageFileGroupContentInstance = await regenerateStorageFileGroupContent({
|
|
3916
3910
|
key: firebase.firestoreDummyKey()
|
|
@@ -4027,7 +4021,7 @@ function initializeStorageFileGroupInTransactionFactory(context) {
|
|
|
4027
4021
|
function initializeStorageFileGroupFactory(context) {
|
|
4028
4022
|
const { firestoreContext, firebaseServerActionTransformFunctionFactory } = context;
|
|
4029
4023
|
const initializeStorageFileGroupInTransaction = initializeStorageFileGroupInTransactionFactory(context);
|
|
4030
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
4024
|
+
return firebaseServerActionTransformFunctionFactory(firebase.initializeStorageFileModelParamsType, async (params) => {
|
|
4031
4025
|
return async (storageFileGroupDocument) => {
|
|
4032
4026
|
await firestoreContext.runTransaction((transaction) => initializeStorageFileGroupInTransaction(params, storageFileGroupDocument, transaction));
|
|
4033
4027
|
return storageFileGroupDocument;
|
|
@@ -4037,7 +4031,7 @@ function initializeStorageFileGroupFactory(context) {
|
|
|
4037
4031
|
function initializeAllApplicableStorageFileGroupsFactory(context) {
|
|
4038
4032
|
const { firestoreContext, firebaseServerActionTransformFunctionFactory, storageFileGroupCollection } = context;
|
|
4039
4033
|
const initializeStorageFileGroupInTransaction = initializeStorageFileGroupInTransactionFactory(context);
|
|
4040
|
-
return firebaseServerActionTransformFunctionFactory(firebase.
|
|
4034
|
+
return firebaseServerActionTransformFunctionFactory(firebase.initializeAllApplicableStorageFileGroupsParamsType, async () => {
|
|
4041
4035
|
return async () => {
|
|
4042
4036
|
let storageFileGroupsVisited = 0;
|
|
4043
4037
|
let storageFileGroupsSucceeded = 0;
|