@dereekb/firebase-server 13.12.9 → 13.14.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 +1 -0
- package/index.esm.js +1 -0
- package/mailgun/package.json +9 -9
- package/mcp/index.cjs.js +633 -95
- package/mcp/index.esm.js +628 -96
- package/mcp/package.json +11 -11
- package/mcp/src/lib/service/mcp.manifest.d.ts +13 -0
- package/mcp/src/lib/service/mcp.response-formatter.d.ts +10 -6
- package/mcp/src/lib/service/mcp.server.factory.d.ts +24 -0
- package/mcp/src/lib/service/mcp.tool-generator.d.ts +194 -13
- package/model/index.cjs.js +209 -0
- package/model/index.esm.js +208 -2
- package/model/package.json +9 -9
- package/model/src/lib/storagefile/storagefile.action.server.d.ts +61 -1
- package/oidc/index.cjs.js +1025 -283
- package/oidc/index.esm.js +1016 -285
- package/oidc/package.json +10 -10
- package/oidc/src/lib/controller/oidc.interaction.controller.d.ts +4 -1
- package/oidc/src/lib/controller/oidc.provider.controller.d.ts +17 -0
- package/oidc/src/lib/oidc.config.d.ts +60 -0
- package/oidc/src/lib/service/analytics/index.d.ts +4 -0
- package/oidc/src/lib/service/analytics/oidc.analytics.config.d.ts +46 -0
- package/oidc/src/lib/service/analytics/oidc.analytics.handler.d.ts +116 -0
- package/oidc/src/lib/service/analytics/oidc.analytics.module.d.ts +35 -0
- package/oidc/src/lib/service/analytics/oidc.analytics.service.d.ts +23 -0
- package/oidc/src/lib/service/index.d.ts +1 -0
- package/oidc/src/lib/service/oidc.account.service.d.ts +15 -0
- package/oidc/src/lib/service/oidc.client.service.d.ts +4 -0
- package/oidc/src/lib/service/oidc.interaction.service.d.ts +2 -2
- package/oidc/src/lib/service/oidc.service.d.ts +23 -1
- package/oidc/src/lib/service/oidc.session-ttl.d.ts +114 -0
- package/package.json +10 -10
- package/src/lib/nest/model/api.details.d.ts +117 -32
- package/test/index.cjs.js +11 -3
- package/test/index.esm.js +11 -3
- package/test/package.json +11 -11
- package/twilio/package.json +8 -8
- package/zoho/package.json +9 -9
package/model/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mapObjectKeysToLowercase, multiValueMapBuilder, batch, runAsyncTasksForValues, asArray, pushArrayItemsIntoArray, UNSET_INDEX_NUMBER, areEqualPOJOValues, performAsyncTasks, removeValuesAtIndexesFromArrayCopy, takeFront, makeModelMap, computeNextFreeIndexOnSortedValuesFunction, readIndexNumber, asPromise, dateOrMillisecondsToDate, filterOnlyUndefinedValues, iterablesAreSetEquivalent, mapIdentityFunction, makeValuesGroupMap, filterMaybeArrayValues, cutStringFunction, takeLast, separateValues, unique, addMilliseconds, mergeSlashPaths, ModelRelationUtility, isThrottled, isPast, unixDateTimeSecondsNumberFromDate, slashPathDetails, MS_IN_MINUTE, expirationDetails, dateFromDateOrTimeMillisecondsNumber, cachedGetter, MS_IN_HOUR, documentFileExtensionForMimeType, useCallback, ZIP_FILE_MIME_TYPE, MAP_IDENTITY, pushItemOrArrayItemsIntoArray, asDecisionFunction } from '@dereekb/util';
|
|
2
2
|
import { yearWeekCode, isSameDate, findMaxDate, findMinDate } from '@dereekb/date';
|
|
3
|
-
import { CREATE_NOTIFICATION_ID_REQUIRED_ERROR_CODE, NOTIFICATION_BOX_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_BOX_EXCLUSION_TARGET_INVALID_ERROR_CODE, NOTIFICATION_BOX_EXISTS_FOR_MODEL_ERROR_CODE, NOTIFICATION_BOX_RECIPIENT_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_MODEL_ALREADY_INITIALIZED_ERROR_CODE, NOTIFICATION_USER_BLOCKED_FROM_BEING_ADD_TO_RECIPIENTS_ERROR_CODE, NOTIFICATION_USER_INVALID_UID_FOR_CREATE_ERROR_CODE, NOTIFICATION_USER_LOCKED_CONFIG_FROM_BEING_UPDATED_ERROR_CODE, firestoreDummyKey, mergeNotificationBoxRecipients, mergeNotificationUserNotificationBoxRecipientConfigs, applyExclusionsToNotificationUserNotificationBoxRecipientConfigs, mergeNotificationBoxRecipientTemplateConfigs, effectiveNotificationBoxRecipientTemplateConfig, notificationSendExclusionCanSendFunction, mergeNotificationUserDefaultNotificationBoxRecipientConfig, DEFAULT_NOTIFICATION_TEMPLATE_TYPE, NotificationRecipientSendFlag, allowedNotificationRecipients, loadDocumentsForIds, getDocumentSnapshotDataPairsWithData, cleanupOldNotificationLoggedEventDaysParamsType, cleanupSentNotificationsParamsType, createNotificationBoxParamsType, createNotificationSummaryParamsType, createNotificationUserParamsType, resyncNotificationUserParamsType, sendNotificationParamsType, sendQueuedNotificationsParamsType, updateNotificationBoxParamsType, updateNotificationBoxRecipientParamsType, updateNotificationSummaryParamsType, updateNotificationUserParamsType, updateNotificationUserDefaultNotificationBoxRecipientConfig, effectiveNotificationBoxRecipientConfig, updateNotificationUserNotificationBoxRecipientConfigs, calculateNsForNotificationUserNotificationBoxRecipientConfigs, getDocumentSnapshotDataPairs, iterateFirestoreDocumentSnapshotPairs, notificationUsersFlaggedForNeedsSyncQuery, notificationSummaryIdForModel, loadNotificationBoxDocumentForReferencePair, updateNotificationUserNotificationSendExclusions, notificationBoxRecipientTemplateConfigArrayToRecord, updateNotificationRecipient, setIdAndKeyFromKeyIdRefOnDocumentData, inferKeyFromTwoWayFlatFirestoreModelKey, NotificationSendType, getDocumentSnapshotData, notificationSendFlagsImplyIsComplete, NotificationSendState, mergeNotificationSendMessagesResult, notificationsPastSendAtTimeQuery, loadDocumentsForDocumentReferencesFromValues, notificationLoggedEventDayId, shouldSaveNotificationToNotificationWeek, notificationsReadyForCleanupQuery, notificationLoggedEventDaysOlderThanQuery, initializeAllApplicableNotificationBoxesParamsType, initializeAllApplicableNotificationSummariesParamsType, initializeNotificationModelParamsType, firestoreModelKeyCollectionName, notificationBoxesFlaggedForNeedsInitializationQuery, notificationSummariesFlaggedForNeedsInitializationQuery, noContentNotificationMessageFunctionFactory, _createNotificationDocumentFromPair, createNotificationDocumentPair, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_SUBJECT_MAX_LENGTH, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_MESSAGE_MAX_LENGTH, sortNotificationItemsFunction, NOTIFICATION_SUMMARY_ITEM_LIMIT, NOTIFICATION_TASK_SUBTASK_CHECKPOINT_PROCESSING, NOTIFICATION_TASK_SUBTASK_CHECKPOINT_CLEANUP, completeSubtaskProcessingAndScheduleCleanupTaskResult, delayCompletion, notificationTaskComplete, notificationTaskDelayRetry, DEFAULT_NOTIFICATION_TASK_SUBTASK_CLEANUP_RETRY_DELAY, DEFAULT_NOTIFICATION_TASK_SUBTASK_CLEANUP_RETRY_ATTEMPTS, STORAGE_FILE_GROUP_CREATE_INPUT_ERROR_CODE, STORAGE_FILE_ALREADY_PROCESSED_ERROR_CODE, STORAGE_FILE_CANNOT_BE_DELETED_YET_ERROR_CODE, STORAGE_FILE_GROUP_QUEUED_FOR_INITIALIZATION_ERROR_CODE, STORAGE_FILE_MODEL_ALREADY_INITIALIZED_ERROR_CODE, STORAGE_FILE_NOT_FLAGGED_FOR_DELETION_ERROR_CODE, STORAGE_FILE_NOT_FLAGGED_FOR_GROUPS_SYNC_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_ALLOWED_FOR_INVALID_STATE_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_AVAILABLE_FOR_TYPE_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_QUEUED_FOR_PROCESSING_ERROR_CODE, UPLOADED_FILE_DOES_NOT_EXIST_ERROR_CODE, UPLOADED_FILE_INITIALIZATION_DISCARDED_ERROR_CODE, UPLOADED_FILE_INITIALIZATION_FAILED_ERROR_CODE, UPLOADED_FILE_NOT_ALLOWED_TO_BE_INITIALIZED_ERROR_CODE, createStorageFileParamsType, createStorageFileGroupParamsType, createStorageFileSignedUploadUrlParamsType, deleteAllQueuedStorageFilesParamsType, deleteStorageFileParamsType, downloadMultipleStorageFilesParamsType, downloadStorageFileParamsType, initializeAllStorageFilesFromUploadsParamsType, initializeStorageFileFromUploadParamsType, processAllQueuedStorageFilesParamsType, processStorageFileParamsType, regenerateAllFlaggedStorageFileGroupsContentParamsType, regenerateStorageFileGroupContentParamsType, syncAllFlaggedStorageFilesWithGroupsParamsType, syncStorageFileWithGroupsParamsType, updateStorageFileParamsType, updateStorageFileGroupParamsType, UPLOADS_FOLDER_PATH, iterateStorageListFilesByEachFile, StorageFileProcessingState, storageFilesQueuedForProcessingQuery, STORAGE_FILE_PROCESSING_STUCK_THROTTLE_CHECK_MS, StorageFileState, createNotificationDocument, storageFileProcessingNotificationTaskTemplate, storageFilesQueuedForDeleteQuery, loadStorageFileGroupDocumentForReferencePair, calculateStorageFileGroupEmbeddedFileUpdate, iterateFirestoreDocumentSnapshotPairBatches, storageFileFlaggedForSyncWithGroupsQuery, createStorageFileDocumentPairFactory, StorageFileCreationType, calculateStorageFileGroupRegeneration, storageFileGroupZipFileStoragePath, STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE, getDocumentSnapshotDataPair, storageFileGroupsFlaggedForContentRegenerationQuery, DEFAULT_CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_EXPIRES_IN_MS, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MIN_EXPIRES_IN_MS, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MAX_EXPIRES_IN_MS, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MAX_FILENAME_LENGTH, initializeAllApplicableStorageFileGroupsParamsType, initializeStorageFileModelParamsType, storageFileGroupsFlaggedForNeedsInitializationQuery, STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE_CREATE_ZIP_SUBTASK, storedFileReaderFactory, STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_TYPE, copyStoragePath, notificationSubtaskComplete, STORAGE_FILE_GROUP_ZIP_INFO_JSON_FILE_NAME, limitUploadFileTypeDeterminer, combineUploadFileTypeDeterminers, STORAGEFILE_RELATED_FILE_METADATA_KEY, storageFilePurposeAndUserQuery } from '@dereekb/firebase';
|
|
3
|
+
import { CREATE_NOTIFICATION_ID_REQUIRED_ERROR_CODE, NOTIFICATION_BOX_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_BOX_EXCLUSION_TARGET_INVALID_ERROR_CODE, NOTIFICATION_BOX_EXISTS_FOR_MODEL_ERROR_CODE, NOTIFICATION_BOX_RECIPIENT_DOES_NOT_EXIST_ERROR_CODE, NOTIFICATION_MODEL_ALREADY_INITIALIZED_ERROR_CODE, NOTIFICATION_USER_BLOCKED_FROM_BEING_ADD_TO_RECIPIENTS_ERROR_CODE, NOTIFICATION_USER_INVALID_UID_FOR_CREATE_ERROR_CODE, NOTIFICATION_USER_LOCKED_CONFIG_FROM_BEING_UPDATED_ERROR_CODE, firestoreDummyKey, mergeNotificationBoxRecipients, mergeNotificationUserNotificationBoxRecipientConfigs, applyExclusionsToNotificationUserNotificationBoxRecipientConfigs, mergeNotificationBoxRecipientTemplateConfigs, effectiveNotificationBoxRecipientTemplateConfig, notificationSendExclusionCanSendFunction, mergeNotificationUserDefaultNotificationBoxRecipientConfig, DEFAULT_NOTIFICATION_TEMPLATE_TYPE, NotificationRecipientSendFlag, allowedNotificationRecipients, loadDocumentsForIds, getDocumentSnapshotDataPairsWithData, cleanupOldNotificationLoggedEventDaysParamsType, cleanupSentNotificationsParamsType, createNotificationBoxParamsType, createNotificationSummaryParamsType, createNotificationUserParamsType, resyncNotificationUserParamsType, sendNotificationParamsType, sendQueuedNotificationsParamsType, updateNotificationBoxParamsType, updateNotificationBoxRecipientParamsType, updateNotificationSummaryParamsType, updateNotificationUserParamsType, updateNotificationUserDefaultNotificationBoxRecipientConfig, effectiveNotificationBoxRecipientConfig, updateNotificationUserNotificationBoxRecipientConfigs, calculateNsForNotificationUserNotificationBoxRecipientConfigs, getDocumentSnapshotDataPairs, iterateFirestoreDocumentSnapshotPairs, notificationUsersFlaggedForNeedsSyncQuery, notificationSummaryIdForModel, loadNotificationBoxDocumentForReferencePair, updateNotificationUserNotificationSendExclusions, notificationBoxRecipientTemplateConfigArrayToRecord, updateNotificationRecipient, setIdAndKeyFromKeyIdRefOnDocumentData, inferKeyFromTwoWayFlatFirestoreModelKey, NotificationSendType, getDocumentSnapshotData, notificationSendFlagsImplyIsComplete, NotificationSendState, mergeNotificationSendMessagesResult, notificationsPastSendAtTimeQuery, loadDocumentsForDocumentReferencesFromValues, notificationLoggedEventDayId, shouldSaveNotificationToNotificationWeek, notificationsReadyForCleanupQuery, notificationLoggedEventDaysOlderThanQuery, initializeAllApplicableNotificationBoxesParamsType, initializeAllApplicableNotificationSummariesParamsType, initializeNotificationModelParamsType, firestoreModelKeyCollectionName, notificationBoxesFlaggedForNeedsInitializationQuery, notificationSummariesFlaggedForNeedsInitializationQuery, noContentNotificationMessageFunctionFactory, _createNotificationDocumentFromPair, createNotificationDocumentPair, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_SUBJECT_MAX_LENGTH, NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_MESSAGE_MAX_LENGTH, sortNotificationItemsFunction, NOTIFICATION_SUMMARY_ITEM_LIMIT, NOTIFICATION_TASK_SUBTASK_CHECKPOINT_PROCESSING, NOTIFICATION_TASK_SUBTASK_CHECKPOINT_CLEANUP, completeSubtaskProcessingAndScheduleCleanupTaskResult, delayCompletion, notificationTaskComplete, notificationTaskDelayRetry, DEFAULT_NOTIFICATION_TASK_SUBTASK_CLEANUP_RETRY_DELAY, DEFAULT_NOTIFICATION_TASK_SUBTASK_CLEANUP_RETRY_ATTEMPTS, STORAGE_FILE_GROUP_CREATE_INPUT_ERROR_CODE, STORAGE_FILE_ALREADY_PROCESSED_ERROR_CODE, STORAGE_FILE_CANNOT_BE_DELETED_YET_ERROR_CODE, STORAGE_FILE_GROUP_QUEUED_FOR_INITIALIZATION_ERROR_CODE, STORAGE_FILE_MODEL_ALREADY_INITIALIZED_ERROR_CODE, STORAGE_FILE_NOT_FLAGGED_FOR_DELETION_ERROR_CODE, STORAGE_FILE_NOT_FLAGGED_FOR_GROUPS_SYNC_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_ALLOWED_FOR_INVALID_STATE_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_AVAILABLE_FOR_TYPE_ERROR_CODE, STORAGE_FILE_PROCESSING_NOT_QUEUED_FOR_PROCESSING_ERROR_CODE, UPLOADED_FILE_DOES_NOT_EXIST_ERROR_CODE, UPLOADED_FILE_INITIALIZATION_DISCARDED_ERROR_CODE, UPLOADED_FILE_INITIALIZATION_FAILED_ERROR_CODE, UPLOADED_FILE_NOT_ALLOWED_TO_BE_INITIALIZED_ERROR_CODE, createStorageFileParamsType, createStorageFileGroupParamsType, createStorageFileSignedUploadUrlParamsType, deleteAllQueuedStorageFilesParamsType, deleteStorageFileParamsType, downloadMultipleStorageFilesParamsType, downloadStorageFileParamsType, initializeAllStorageFilesFromUploadsParamsType, initializeStorageFileFromUploadParamsType, processAllQueuedStorageFilesParamsType, processStorageFileParamsType, readMultipleStorageFilesMetadataParamsType, readStorageFileMetadataParamsType, regenerateAllFlaggedStorageFileGroupsContentParamsType, regenerateStorageFileGroupContentParamsType, syncAllFlaggedStorageFilesWithGroupsParamsType, syncStorageFileWithGroupsParamsType, updateStorageFileParamsType, updateStorageFileGroupParamsType, UPLOADS_FOLDER_PATH, iterateStorageListFilesByEachFile, StorageFileProcessingState, storageFilesQueuedForProcessingQuery, STORAGE_FILE_PROCESSING_STUCK_THROTTLE_CHECK_MS, StorageFileState, createNotificationDocument, storageFileProcessingNotificationTaskTemplate, storageFilesQueuedForDeleteQuery, loadStorageFileGroupDocumentForReferencePair, calculateStorageFileGroupEmbeddedFileUpdate, iterateFirestoreDocumentSnapshotPairBatches, storageFileFlaggedForSyncWithGroupsQuery, createStorageFileDocumentPairFactory, StorageFileCreationType, calculateStorageFileGroupRegeneration, storageFileGroupZipFileStoragePath, STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE, getDocumentSnapshotDataPair, storageFileGroupsFlaggedForContentRegenerationQuery, DEFAULT_CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_EXPIRES_IN_MS, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MIN_EXPIRES_IN_MS, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MAX_EXPIRES_IN_MS, CREATE_STORAGE_FILE_SIGNED_UPLOAD_URL_MAX_FILENAME_LENGTH, initializeAllApplicableStorageFileGroupsParamsType, initializeStorageFileModelParamsType, storageFileGroupsFlaggedForNeedsInitializationQuery, STORAGE_FILE_GROUP_ZIP_STORAGE_FILE_PURPOSE_CREATE_ZIP_SUBTASK, storedFileReaderFactory, STORAGE_FILE_PROCESSING_NOTIFICATION_TASK_TYPE, copyStoragePath, notificationSubtaskComplete, STORAGE_FILE_GROUP_ZIP_INFO_JSON_FILE_NAME, limitUploadFileTypeDeterminer, combineUploadFileTypeDeterminers, STORAGEFILE_RELATED_FILE_METADATA_KEY, storageFilePurposeAndUserQuery } from '@dereekb/firebase';
|
|
4
4
|
import { preconditionConflictError, assertSnapshotData, internalServerError, badRequestError } from '@dereekb/firebase-server';
|
|
5
5
|
import { hoursToMilliseconds, addHours, isFuture, addMinutes, addSeconds, addDays } from 'date-fns';
|
|
6
6
|
import { Optional, Inject, Injectable, Module, Global } from '@nestjs/common';
|
|
@@ -9423,6 +9423,8 @@ function _ts_generator$4(thisArg, body) {
|
|
|
9423
9423
|
deleteStorageFile: deleteStorageFileFactory(context),
|
|
9424
9424
|
downloadStorageFile: downloadStorageFileFactory(context),
|
|
9425
9425
|
downloadMultipleStorageFiles: downloadMultipleStorageFilesFactory(context),
|
|
9426
|
+
readStorageFileMetadata: readStorageFileMetadataFactory(context),
|
|
9427
|
+
readMultipleStorageFilesMetadata: readMultipleStorageFilesMetadataFactory(context),
|
|
9426
9428
|
createStorageFileGroup: createStorageFileGroupFactory(context),
|
|
9427
9429
|
updateStorageFileGroup: updateStorageFileGroupFactory(context),
|
|
9428
9430
|
syncStorageFileWithGroups: syncStorageFileWithGroupsFactory(context),
|
|
@@ -11025,6 +11027,210 @@ function _resolveSignedUploadUrlFilenameOrThrow(policy, filename) {
|
|
|
11025
11027
|
})();
|
|
11026
11028
|
});
|
|
11027
11029
|
}
|
|
11030
|
+
/**
|
|
11031
|
+
* Default maximum number of concurrent metadata read operations when batch-reading StorageFile metadata.
|
|
11032
|
+
*/ var DEFAULT_READ_MULTIPLE_STORAGE_FILES_METADATA_MAX_PARALLEL_TASKS = 5;
|
|
11033
|
+
/**
|
|
11034
|
+
* Internal factory that reads the underlying Cloud Storage object metadata for one or more StorageFiles.
|
|
11035
|
+
*
|
|
11036
|
+
* Uses {@link performAsyncTasks} with concurrency limiting to avoid overwhelming Cloud Storage.
|
|
11037
|
+
* When the underlying object does not exist, the item resolves with `exists: false` rather than failing.
|
|
11038
|
+
* When `throwOnFirstError` is true, the first failure throws immediately (single-read behavior).
|
|
11039
|
+
* When false, failures are collected in the errors array (batch behavior).
|
|
11040
|
+
*
|
|
11041
|
+
* @param context - The storage file server actions context.
|
|
11042
|
+
* @returns An async function that processes a {@link ReadMultipleStorageFilesMetadataFactoryInput} and returns a {@link ReadMultipleStorageFilesMetadataResult}
|
|
11043
|
+
*/ function _readMultipleStorageFilesMetadataFactory(context) {
|
|
11044
|
+
var storageService = context.storageService, storageFileCollection = context.storageFileCollection;
|
|
11045
|
+
return function(input) {
|
|
11046
|
+
return _async_to_generator$4(function() {
|
|
11047
|
+
var items, throwOnFirstError, inputMaxParallelTasks, taskResult, success, errors;
|
|
11048
|
+
return _ts_generator$4(this, function(_state) {
|
|
11049
|
+
switch(_state.label){
|
|
11050
|
+
case 0:
|
|
11051
|
+
items = input.items, throwOnFirstError = input.throwOnFirstError, inputMaxParallelTasks = input.maxParallelTasks;
|
|
11052
|
+
return [
|
|
11053
|
+
4,
|
|
11054
|
+
performAsyncTasks(items, function(item) {
|
|
11055
|
+
return _async_to_generator$4(function() {
|
|
11056
|
+
var _item_storageFileDocument, storageFileDocument, storageFile, fileAccessor, exists, result, metadata;
|
|
11057
|
+
return _ts_generator$4(this, function(_state) {
|
|
11058
|
+
switch(_state.label){
|
|
11059
|
+
case 0:
|
|
11060
|
+
// Load document from key if not provided
|
|
11061
|
+
storageFileDocument = (_item_storageFileDocument = item.storageFileDocument) !== null && _item_storageFileDocument !== void 0 ? _item_storageFileDocument : storageFileCollection.documentAccessor().loadDocumentForKey(item.key);
|
|
11062
|
+
return [
|
|
11063
|
+
4,
|
|
11064
|
+
assertSnapshotData(storageFileDocument)
|
|
11065
|
+
];
|
|
11066
|
+
case 1:
|
|
11067
|
+
storageFile = _state.sent();
|
|
11068
|
+
fileAccessor = storageService.file(storageFile);
|
|
11069
|
+
return [
|
|
11070
|
+
4,
|
|
11071
|
+
fileAccessor.exists()
|
|
11072
|
+
];
|
|
11073
|
+
case 2:
|
|
11074
|
+
exists = _state.sent();
|
|
11075
|
+
if (!exists) return [
|
|
11076
|
+
3,
|
|
11077
|
+
4
|
|
11078
|
+
];
|
|
11079
|
+
return [
|
|
11080
|
+
4,
|
|
11081
|
+
fileAccessor.getMetadata()
|
|
11082
|
+
];
|
|
11083
|
+
case 3:
|
|
11084
|
+
metadata = _state.sent();
|
|
11085
|
+
result = {
|
|
11086
|
+
key: item.key,
|
|
11087
|
+
exists: true,
|
|
11088
|
+
metadata: metadata
|
|
11089
|
+
};
|
|
11090
|
+
return [
|
|
11091
|
+
3,
|
|
11092
|
+
5
|
|
11093
|
+
];
|
|
11094
|
+
case 4:
|
|
11095
|
+
result = {
|
|
11096
|
+
key: item.key,
|
|
11097
|
+
exists: false
|
|
11098
|
+
};
|
|
11099
|
+
_state.label = 5;
|
|
11100
|
+
case 5:
|
|
11101
|
+
return [
|
|
11102
|
+
2,
|
|
11103
|
+
result
|
|
11104
|
+
];
|
|
11105
|
+
}
|
|
11106
|
+
});
|
|
11107
|
+
})();
|
|
11108
|
+
}, {
|
|
11109
|
+
throwError: throwOnFirstError !== null && throwOnFirstError !== void 0 ? throwOnFirstError : false,
|
|
11110
|
+
maxParallelTasks: inputMaxParallelTasks !== null && inputMaxParallelTasks !== void 0 ? inputMaxParallelTasks : DEFAULT_READ_MULTIPLE_STORAGE_FILES_METADATA_MAX_PARALLEL_TASKS
|
|
11111
|
+
})
|
|
11112
|
+
];
|
|
11113
|
+
case 1:
|
|
11114
|
+
taskResult = _state.sent();
|
|
11115
|
+
success = taskResult.results.map(function(param) {
|
|
11116
|
+
var _param = _sliced_to_array(param, 2), result = _param[1];
|
|
11117
|
+
return result;
|
|
11118
|
+
});
|
|
11119
|
+
errors = taskResult.errors.map(function(param) {
|
|
11120
|
+
var _param = _sliced_to_array(param, 2), item = _param[0], error = _param[1];
|
|
11121
|
+
return {
|
|
11122
|
+
key: item.key,
|
|
11123
|
+
error: _instanceof(error, Error) ? error.message : 'Metadata read failed'
|
|
11124
|
+
};
|
|
11125
|
+
});
|
|
11126
|
+
return [
|
|
11127
|
+
2,
|
|
11128
|
+
{
|
|
11129
|
+
success: success,
|
|
11130
|
+
errors: errors
|
|
11131
|
+
}
|
|
11132
|
+
];
|
|
11133
|
+
}
|
|
11134
|
+
});
|
|
11135
|
+
})();
|
|
11136
|
+
};
|
|
11137
|
+
}
|
|
11138
|
+
/**
|
|
11139
|
+
* Factory for the `readStorageFileMetadata` action.
|
|
11140
|
+
*
|
|
11141
|
+
* Reads the underlying Cloud Storage object metadata for a single {@link StorageFile}.
|
|
11142
|
+
* Delegates to {@link _readMultipleStorageFilesMetadataFactory} with a single item and `throwOnFirstError: true`.
|
|
11143
|
+
*
|
|
11144
|
+
* @param context - The storage file server actions context.
|
|
11145
|
+
* @returns An async transform-and-validate function that reads a StorageFile's Cloud Storage metadata.
|
|
11146
|
+
*/ function readStorageFileMetadataFactory(context) {
|
|
11147
|
+
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
11148
|
+
var readMultipleStorageFilesMetadata = _readMultipleStorageFilesMetadataFactory(context);
|
|
11149
|
+
return firebaseServerActionTransformFunctionFactory(readStorageFileMetadataParamsType, function(params) {
|
|
11150
|
+
return _async_to_generator$4(function() {
|
|
11151
|
+
var key;
|
|
11152
|
+
return _ts_generator$4(this, function(_state) {
|
|
11153
|
+
key = params.key;
|
|
11154
|
+
return [
|
|
11155
|
+
2,
|
|
11156
|
+
function(storageFileDocument) {
|
|
11157
|
+
return _async_to_generator$4(function() {
|
|
11158
|
+
var result;
|
|
11159
|
+
return _ts_generator$4(this, function(_state) {
|
|
11160
|
+
switch(_state.label){
|
|
11161
|
+
case 0:
|
|
11162
|
+
return [
|
|
11163
|
+
4,
|
|
11164
|
+
readMultipleStorageFilesMetadata({
|
|
11165
|
+
items: [
|
|
11166
|
+
{
|
|
11167
|
+
key: key,
|
|
11168
|
+
storageFileDocument: storageFileDocument
|
|
11169
|
+
}
|
|
11170
|
+
],
|
|
11171
|
+
throwOnFirstError: true
|
|
11172
|
+
})
|
|
11173
|
+
];
|
|
11174
|
+
case 1:
|
|
11175
|
+
result = _state.sent();
|
|
11176
|
+
// success item structurally satisfies ReadStorageFileMetadataResult (extra `key` is ignored)
|
|
11177
|
+
return [
|
|
11178
|
+
2,
|
|
11179
|
+
result.success[0]
|
|
11180
|
+
];
|
|
11181
|
+
}
|
|
11182
|
+
});
|
|
11183
|
+
})();
|
|
11184
|
+
}
|
|
11185
|
+
];
|
|
11186
|
+
});
|
|
11187
|
+
})();
|
|
11188
|
+
});
|
|
11189
|
+
}
|
|
11190
|
+
/**
|
|
11191
|
+
* Factory for the `readMultipleStorageFilesMetadata` action.
|
|
11192
|
+
*
|
|
11193
|
+
* Reads the underlying Cloud Storage object metadata for multiple {@link StorageFile} documents in a single call.
|
|
11194
|
+
* By default, individual failures are collected in the errors array rather than failing the entire batch.
|
|
11195
|
+
* Set `throwOnFirstError` in params to throw on the first failure instead.
|
|
11196
|
+
*
|
|
11197
|
+
* @param context - The storage file server actions context.
|
|
11198
|
+
* @returns An async transform-and-validate function that reads Cloud Storage metadata for multiple files.
|
|
11199
|
+
*/ function readMultipleStorageFilesMetadataFactory(context) {
|
|
11200
|
+
var firebaseServerActionTransformFunctionFactory = context.firebaseServerActionTransformFunctionFactory;
|
|
11201
|
+
var readMultipleStorageFilesMetadata = _readMultipleStorageFilesMetadataFactory(context);
|
|
11202
|
+
return firebaseServerActionTransformFunctionFactory(readMultipleStorageFilesMetadataParamsType, function(params) {
|
|
11203
|
+
return _async_to_generator$4(function() {
|
|
11204
|
+
var files, throwOnFirstError;
|
|
11205
|
+
return _ts_generator$4(this, function(_state) {
|
|
11206
|
+
files = params.files, throwOnFirstError = params.throwOnFirstError;
|
|
11207
|
+
return [
|
|
11208
|
+
2,
|
|
11209
|
+
function(storageFileDocuments) {
|
|
11210
|
+
return _async_to_generator$4(function() {
|
|
11211
|
+
var items;
|
|
11212
|
+
return _ts_generator$4(this, function(_state) {
|
|
11213
|
+
items = files.map(function(file, i) {
|
|
11214
|
+
return {
|
|
11215
|
+
key: file.key,
|
|
11216
|
+
storageFileDocument: storageFileDocuments === null || storageFileDocuments === void 0 ? void 0 : storageFileDocuments[i]
|
|
11217
|
+
};
|
|
11218
|
+
});
|
|
11219
|
+
return [
|
|
11220
|
+
2,
|
|
11221
|
+
readMultipleStorageFilesMetadata({
|
|
11222
|
+
items: items,
|
|
11223
|
+
throwOnFirstError: throwOnFirstError !== null && throwOnFirstError !== void 0 ? throwOnFirstError : false
|
|
11224
|
+
})
|
|
11225
|
+
];
|
|
11226
|
+
});
|
|
11227
|
+
})();
|
|
11228
|
+
}
|
|
11229
|
+
];
|
|
11230
|
+
});
|
|
11231
|
+
})();
|
|
11232
|
+
});
|
|
11233
|
+
}
|
|
11028
11234
|
/**
|
|
11029
11235
|
* Internal factory that creates a function for creating a {@link StorageFileGroup} document
|
|
11030
11236
|
* within a Firestore transaction.
|
|
@@ -14036,4 +14242,4 @@ function _ts_generator(thisArg, body) {
|
|
|
14036
14242
|
};
|
|
14037
14243
|
}
|
|
14038
14244
|
|
|
14039
|
-
export { AbstractAppNotificationModule, BASE_NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, BASE_STORAGE_FILE_SERVER_ACTION_CONTEXT_TOKEN, DEFAULT_COMPRESS_IMAGE_FORMAT, DEFAULT_COMPRESS_IMAGE_INITIAL_QUALITY, DEFAULT_COMPRESS_IMAGE_MAX_DIMENSION, DEFAULT_COMPRESS_IMAGE_MIN_QUALITY, DEFAULT_COMPRESS_IMAGE_QUALITY_STEP, DEFAULT_COMPRESS_PDF_IMAGE_MAX_DIMENSION, DEFAULT_COMPRESS_PDF_IMAGE_QUALITY, DEFAULT_COMPRESS_PDF_IMAGE_SIZE_THRESHOLD_BYTES, DEFAULT_DOWNLOAD_MULTIPLE_STORAGE_FILES_MAX_PARALLEL_TASKS, DEFAULT_MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_MAX_BATCH_SIZE_PER_REQUEST, GlobalNotificationModule, KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY, MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE, MAKE_TEMPLATE_FOR_STORAGEFILE_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE, MutableNotificationExpediteService, NOTIFICATION_BOX_NOT_INITIALIZED_DELAY_MINUTES, NOTIFICATION_INIT_SERVER_ACTIONS_CONTEXT_CONFIG_TOKEN, NOTIFICATION_MAX_SEND_ATTEMPTS, NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, NOTIFICATION_TASK_MINIMUM_SET_AT_THROTTLE_TIME_MINUTES, NOTIFICATION_TASK_TYPE_FAILURE_DELAY_HOURS, NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS, NOTIFICATION_TASK_TYPE_MAX_SEND_ATTEMPTS, NOTIFICATION_TEMPLATE_SERVICE_CONFIGS_ARRAY_TOKEN, NOTIFICATION_TEMPLATE_SERVICE_DEFAULTS_OVERRIDE_TOKEN, NotificationExpediteService, NotificationInitServerActions, NotificationSendService, NotificationServerActions, NotificationTaskService, NotificationTaskSubTaskMissingRequiredDataTermination, NotificationTemplateService, SEND_QUEUE_NOTIFICATIONS_TASK_EXCESS_THRESHOLD, STORAGE_FILE_INIT_SERVER_ACTIONS_CONTEXT_CONFIG_TOKEN, STORAGE_FILE_SERVER_ACTION_CONTEXT_TOKEN, STORAGE_FILE_SIGNED_UPLOAD_POLICIES_TOKEN, StorageFileInitServerActions, StorageFileInitializeFromUploadService, StorageFileServerActions, UNKNOWN_NOTIFICATION_TASK_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, UNKNOWN_NOTIFICATION_TASK_TYPE_HOURS_DELAY, UNKNOWN_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, UNKNOWN_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY, _initializeStorageFileFromUploadFileFactory, _processStorageFileInTransactionFactory, _syncStorageFileWithGroupsInTransactionFactory, allStorageFileGroupStorageFileProcessingPurposeSubtaskProcessors, appNotificationModuleMetadata, appStorageFileModuleMetadata, cleanupOldNotificationLoggedEventDaysFactory, cleanupSentNotificationsFactory, compressImageBufferToTargetSize, compressPdfImagesToTargetSize, createNotificationBoxFactory, createNotificationBoxInTransactionFactory, createNotificationIdRequiredError, createNotificationSummaryFactory, createNotificationUserFactory, createOrRunUniqueNotificationDocument, createStorageFileFactory, createStorageFileGroupFactory, createStorageFileGroupInTransactionFactory, createStorageFileGroupInputError, createStorageFileSignedUploadUrlFactory, deleteAllQueuedStorageFilesFactory, deleteStorageFileFactory, downloadMultipleStorageFilesFactory, downloadStorageFileFactory, expandNotificationRecipients, exportMutableNotificationExpediteService, firestoreNotificationSummarySendService, ignoreSendNotificationTextSendService, initializeAllApplicableNotificationBoxesFactory, initializeAllApplicableNotificationSummariesFactory, initializeAllApplicableStorageFileGroupsFactory, initializeAllStorageFilesFromUploadsFactory, initializeNotificationBoxFactory, initializeNotificationBoxInTransactionFactory, initializeNotificationModelInTransaction, initializeNotificationSummaryFactory, initializeNotificationSummaryInTransactionFactory, initializeStorageFileFromUploadFactory, initializeStorageFileGroupFactory, initializeStorageFileGroupInTransactionFactory, initializeStorageFileModelInTransaction, mailgunNotificationEmailSendService, makeNewNotificationSummaryTemplate, markStorageFileForDeleteTemplate, notificationBoxDoesNotExist, notificationBoxExclusionTargetInvalidError, notificationBoxExistsForModelError, notificationBoxRecipientDoesNotExistsError, notificationBoxUnregistredModelTypeInitializationError, notificationExpediteServiceInstance, notificationInitServerActions, notificationInitServerActionsFactory, notificationModelAlreadyInitializedError, notificationServerActions, notificationServerActionsContextFactory, notificationServerActionsFactory, notificationTaskService, notificationTaskSubTaskMissingRequiredDataTermination, notificationTaskSubtaskNotificationTaskHandlerFactory, notificationTemplateServiceInstance, notificationUserBlockedFromBeingAddedToRecipientsError, notificationUserInvalidUidForCreateError, notificationUserLockedConfigFromBeingUpdatedError, processAllQueuedStorageFilesFactory, processStorageFileFactory, provideMutableNotificationExpediteService, queryAndFlagStorageFilesForDelete, regenerateAllFlaggedStorageFileGroupsContentFactory, regenerateStorageFileGroupContentFactory, resyncAllNotificationUsersFactory, resyncNotificationUserFactory, sendNotificationFactory, sendQueuedNotificationsFactory, storageFileAlreadyProcessedError, storageFileCannotBeDeletedYetError, storageFileCreateSignedUploadUrlToolDetailsFactory, storageFileGroupQueuedForInitializationError, storageFileGroupZipStorageFileProcessingPurposeSubtaskProcessor, storageFileInitServerActions, storageFileInitServerActionsFactory, storageFileInitializeFromUploadService, storageFileInitializeFromUploadServiceInitializerResultPermanentFailure, storageFileModelAlreadyInitializedError, storageFileNotFlaggedForDeletionError, storageFileNotFlaggedForGroupsSyncError, storageFileProcessingNotAllowedForInvalidStateError, storageFileProcessingNotAvailableForTypeError, storageFileProcessingNotQueuedForProcessingError, storageFileProcessingNotificationTaskHandler, storageFileProcessingNotificationTaskHandlerDefaultCleanup, storageFileServerActions, storageFileServerActionsContextFactory, storageFileServerActionsFactory, syncAllFlaggedStorageFilesWithGroupsFactory, syncStorageFileWithGroupsFactory, updateNotificationBoxFactory, updateNotificationBoxRecipientExclusionInTransactionFactory, updateNotificationBoxRecipientFactory, updateNotificationBoxRecipientInTransactionFactory, updateNotificationSummaryFactory, updateNotificationUserFactory, updateNotificationUserNotificationBoxRecipientConfig, updateStorageFileFactory, updateStorageFileGroupFactory, uploadedFileDoesNotExistError, uploadedFileInitializationDiscardedError, uploadedFileInitializationFailedError, uploadedFileIsNotAllowedToBeInitializedError };
|
|
14245
|
+
export { AbstractAppNotificationModule, BASE_NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, BASE_STORAGE_FILE_SERVER_ACTION_CONTEXT_TOKEN, DEFAULT_COMPRESS_IMAGE_FORMAT, DEFAULT_COMPRESS_IMAGE_INITIAL_QUALITY, DEFAULT_COMPRESS_IMAGE_MAX_DIMENSION, DEFAULT_COMPRESS_IMAGE_MIN_QUALITY, DEFAULT_COMPRESS_IMAGE_QUALITY_STEP, DEFAULT_COMPRESS_PDF_IMAGE_MAX_DIMENSION, DEFAULT_COMPRESS_PDF_IMAGE_QUALITY, DEFAULT_COMPRESS_PDF_IMAGE_SIZE_THRESHOLD_BYTES, DEFAULT_DOWNLOAD_MULTIPLE_STORAGE_FILES_MAX_PARALLEL_TASKS, DEFAULT_MAILGUN_NOTIFICATION_EMAIL_SEND_SERVICE_MAX_BATCH_SIZE_PER_REQUEST, DEFAULT_READ_MULTIPLE_STORAGE_FILES_METADATA_MAX_PARALLEL_TASKS, GlobalNotificationModule, KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, KNOWN_BUT_UNCONFIGURED_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY, MAKE_TEMPLATE_FOR_NOTIFICATION_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE, MAKE_TEMPLATE_FOR_STORAGEFILE_RELATED_MODEL_INITIALIZATION_FUNCTION_DELETE_RESPONSE, MutableNotificationExpediteService, NOTIFICATION_BOX_NOT_INITIALIZED_DELAY_MINUTES, NOTIFICATION_INIT_SERVER_ACTIONS_CONTEXT_CONFIG_TOKEN, NOTIFICATION_MAX_SEND_ATTEMPTS, NOTIFICATION_SERVER_ACTION_CONTEXT_TOKEN, NOTIFICATION_TASK_MINIMUM_SET_AT_THROTTLE_TIME_MINUTES, NOTIFICATION_TASK_TYPE_FAILURE_DELAY_HOURS, NOTIFICATION_TASK_TYPE_FAILURE_DELAY_MS, NOTIFICATION_TASK_TYPE_MAX_SEND_ATTEMPTS, NOTIFICATION_TEMPLATE_SERVICE_CONFIGS_ARRAY_TOKEN, NOTIFICATION_TEMPLATE_SERVICE_DEFAULTS_OVERRIDE_TOKEN, NotificationExpediteService, NotificationInitServerActions, NotificationSendService, NotificationServerActions, NotificationTaskService, NotificationTaskSubTaskMissingRequiredDataTermination, NotificationTemplateService, SEND_QUEUE_NOTIFICATIONS_TASK_EXCESS_THRESHOLD, STORAGE_FILE_INIT_SERVER_ACTIONS_CONTEXT_CONFIG_TOKEN, STORAGE_FILE_SERVER_ACTION_CONTEXT_TOKEN, STORAGE_FILE_SIGNED_UPLOAD_POLICIES_TOKEN, StorageFileInitServerActions, StorageFileInitializeFromUploadService, StorageFileServerActions, UNKNOWN_NOTIFICATION_TASK_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, UNKNOWN_NOTIFICATION_TASK_TYPE_HOURS_DELAY, UNKNOWN_NOTIFICATION_TEMPLATE_TYPE_DELETE_AFTER_RETRY_ATTEMPTS, UNKNOWN_NOTIFICATION_TEMPLATE_TYPE_HOURS_DELAY, _initializeStorageFileFromUploadFileFactory, _processStorageFileInTransactionFactory, _syncStorageFileWithGroupsInTransactionFactory, allStorageFileGroupStorageFileProcessingPurposeSubtaskProcessors, appNotificationModuleMetadata, appStorageFileModuleMetadata, cleanupOldNotificationLoggedEventDaysFactory, cleanupSentNotificationsFactory, compressImageBufferToTargetSize, compressPdfImagesToTargetSize, createNotificationBoxFactory, createNotificationBoxInTransactionFactory, createNotificationIdRequiredError, createNotificationSummaryFactory, createNotificationUserFactory, createOrRunUniqueNotificationDocument, createStorageFileFactory, createStorageFileGroupFactory, createStorageFileGroupInTransactionFactory, createStorageFileGroupInputError, createStorageFileSignedUploadUrlFactory, deleteAllQueuedStorageFilesFactory, deleteStorageFileFactory, downloadMultipleStorageFilesFactory, downloadStorageFileFactory, expandNotificationRecipients, exportMutableNotificationExpediteService, firestoreNotificationSummarySendService, ignoreSendNotificationTextSendService, initializeAllApplicableNotificationBoxesFactory, initializeAllApplicableNotificationSummariesFactory, initializeAllApplicableStorageFileGroupsFactory, initializeAllStorageFilesFromUploadsFactory, initializeNotificationBoxFactory, initializeNotificationBoxInTransactionFactory, initializeNotificationModelInTransaction, initializeNotificationSummaryFactory, initializeNotificationSummaryInTransactionFactory, initializeStorageFileFromUploadFactory, initializeStorageFileGroupFactory, initializeStorageFileGroupInTransactionFactory, initializeStorageFileModelInTransaction, mailgunNotificationEmailSendService, makeNewNotificationSummaryTemplate, markStorageFileForDeleteTemplate, notificationBoxDoesNotExist, notificationBoxExclusionTargetInvalidError, notificationBoxExistsForModelError, notificationBoxRecipientDoesNotExistsError, notificationBoxUnregistredModelTypeInitializationError, notificationExpediteServiceInstance, notificationInitServerActions, notificationInitServerActionsFactory, notificationModelAlreadyInitializedError, notificationServerActions, notificationServerActionsContextFactory, notificationServerActionsFactory, notificationTaskService, notificationTaskSubTaskMissingRequiredDataTermination, notificationTaskSubtaskNotificationTaskHandlerFactory, notificationTemplateServiceInstance, notificationUserBlockedFromBeingAddedToRecipientsError, notificationUserInvalidUidForCreateError, notificationUserLockedConfigFromBeingUpdatedError, processAllQueuedStorageFilesFactory, processStorageFileFactory, provideMutableNotificationExpediteService, queryAndFlagStorageFilesForDelete, readMultipleStorageFilesMetadataFactory, readStorageFileMetadataFactory, regenerateAllFlaggedStorageFileGroupsContentFactory, regenerateStorageFileGroupContentFactory, resyncAllNotificationUsersFactory, resyncNotificationUserFactory, sendNotificationFactory, sendQueuedNotificationsFactory, storageFileAlreadyProcessedError, storageFileCannotBeDeletedYetError, storageFileCreateSignedUploadUrlToolDetailsFactory, storageFileGroupQueuedForInitializationError, storageFileGroupZipStorageFileProcessingPurposeSubtaskProcessor, storageFileInitServerActions, storageFileInitServerActionsFactory, storageFileInitializeFromUploadService, storageFileInitializeFromUploadServiceInitializerResultPermanentFailure, storageFileModelAlreadyInitializedError, storageFileNotFlaggedForDeletionError, storageFileNotFlaggedForGroupsSyncError, storageFileProcessingNotAllowedForInvalidStateError, storageFileProcessingNotAvailableForTypeError, storageFileProcessingNotQueuedForProcessingError, storageFileProcessingNotificationTaskHandler, storageFileProcessingNotificationTaskHandlerDefaultCleanup, storageFileServerActions, storageFileServerActionsContextFactory, storageFileServerActionsFactory, syncAllFlaggedStorageFilesWithGroupsFactory, syncStorageFileWithGroupsFactory, updateNotificationBoxFactory, updateNotificationBoxRecipientExclusionInTransactionFactory, updateNotificationBoxRecipientFactory, updateNotificationBoxRecipientInTransactionFactory, updateNotificationSummaryFactory, updateNotificationUserFactory, updateNotificationUserNotificationBoxRecipientConfig, updateStorageFileFactory, updateStorageFileGroupFactory, uploadedFileDoesNotExistError, uploadedFileInitializationDiscardedError, uploadedFileInitializationFailedError, uploadedFileIsNotAllowedToBeInitializedError };
|
package/model/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase-server/model",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.14.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/analytics": "13.
|
|
6
|
-
"@dereekb/date": "13.
|
|
7
|
-
"@dereekb/firebase": "13.
|
|
8
|
-
"@dereekb/firebase-server": "13.
|
|
9
|
-
"@dereekb/model": "13.
|
|
10
|
-
"@dereekb/nestjs": "13.
|
|
11
|
-
"@dereekb/rxjs": "13.
|
|
12
|
-
"@dereekb/util": "13.
|
|
5
|
+
"@dereekb/analytics": "13.14.0",
|
|
6
|
+
"@dereekb/date": "13.14.0",
|
|
7
|
+
"@dereekb/firebase": "13.14.0",
|
|
8
|
+
"@dereekb/firebase-server": "13.14.0",
|
|
9
|
+
"@dereekb/model": "13.14.0",
|
|
10
|
+
"@dereekb/nestjs": "13.14.0",
|
|
11
|
+
"@dereekb/rxjs": "13.14.0",
|
|
12
|
+
"@dereekb/util": "13.14.0",
|
|
13
13
|
"@nestjs/common": "^11.1.19",
|
|
14
14
|
"@nestjs/config": "^4.0.4",
|
|
15
15
|
"archiver": "^7.0.1",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FirestoreContextReference, type InitializeStorageFileFromUploadParams, type AsyncStorageFileCreateAction, type StorageFileFirestoreCollections, type ProcessStorageFileParams, type StorageFileDocument, type ProcessStorageFileResult, type CreateStorageFileParams, type AsyncStorageFileUpdateAction, type UpdateStorageFileParams, type NotificationFirestoreCollections, type FirebaseStorageAccessorFile, type InitializeAllStorageFilesFromUploadsResult, type InitializeAllStorageFilesFromUploadsParams, type ProcessAllQueuedStorageFilesParams, type ProcessAllQueuedStorageFilesResult, type DeleteAllQueuedStorageFilesParams, type DeleteAllQueuedStorageFilesResult, type DeleteStorageFileParams, type AsyncStorageFileDeleteAction, type StorageFile, type DownloadStorageFileParams, type DownloadStorageFileResult, type DownloadMultipleStorageFilesParams, type DownloadMultipleStorageFilesResult, type DownloadMultipleStorageFileSuccessItem, type FirestoreModelKey, type SyncStorageFileWithGroupsParams, type SyncAllFlaggedStorageFilesWithGroupsParams, type SyncAllFlaggedStorageFilesWithGroupsResult, type SyncStorageFileWithGroupsResult, type RegenerateAllFlaggedStorageFileGroupsContentParams, type RegenerateAllFlaggedStorageFileGroupsContentResult, type RegenerateStorageFileGroupContentParams, type RegenerateStorageFileGroupContentResult, type StorageFileGroupDocument, type AsyncStorageFileGroupCreateAction, type CreateStorageFileGroupParams, type Transaction, type StorageFileGroup, type StorageFileGroupDocumentReferencePair, type StorageFileGroupId, type UpdateStorageFileGroupParams, type DownloadStorageFileOptions, type CreateStorageFileSignedUploadUrlParams, type CreateStorageFileSignedUploadUrlResult, type StorageFilePurposeUploadPolicy, type FirebaseAuthUserId, type AsyncFirebaseFunctionCreateAction } from '@dereekb/firebase';
|
|
1
|
+
import { type FirestoreContextReference, type InitializeStorageFileFromUploadParams, type AsyncStorageFileCreateAction, type StorageFileFirestoreCollections, type ProcessStorageFileParams, type StorageFileDocument, type ProcessStorageFileResult, type CreateStorageFileParams, type AsyncStorageFileUpdateAction, type UpdateStorageFileParams, type NotificationFirestoreCollections, type FirebaseStorageAccessorFile, type InitializeAllStorageFilesFromUploadsResult, type InitializeAllStorageFilesFromUploadsParams, type ProcessAllQueuedStorageFilesParams, type ProcessAllQueuedStorageFilesResult, type DeleteAllQueuedStorageFilesParams, type DeleteAllQueuedStorageFilesResult, type DeleteStorageFileParams, type AsyncStorageFileDeleteAction, type StorageFile, type DownloadStorageFileParams, type DownloadStorageFileResult, type DownloadMultipleStorageFilesParams, type DownloadMultipleStorageFilesResult, type DownloadMultipleStorageFileSuccessItem, type ReadStorageFileMetadataParams, type ReadStorageFileMetadataResult, type ReadMultipleStorageFilesMetadataParams, type ReadMultipleStorageFilesMetadataResult, type ReadMultipleStorageFileMetadataSuccessItem, type FirestoreModelKey, type SyncStorageFileWithGroupsParams, type SyncAllFlaggedStorageFilesWithGroupsParams, type SyncAllFlaggedStorageFilesWithGroupsResult, type SyncStorageFileWithGroupsResult, type RegenerateAllFlaggedStorageFileGroupsContentParams, type RegenerateAllFlaggedStorageFileGroupsContentResult, type RegenerateStorageFileGroupContentParams, type RegenerateStorageFileGroupContentResult, type StorageFileGroupDocument, type AsyncStorageFileGroupCreateAction, type CreateStorageFileGroupParams, type Transaction, type StorageFileGroup, type StorageFileGroupDocumentReferencePair, type StorageFileGroupId, type UpdateStorageFileGroupParams, type DownloadStorageFileOptions, type CreateStorageFileSignedUploadUrlParams, type CreateStorageFileSignedUploadUrlResult, type StorageFilePurposeUploadPolicy, type FirebaseAuthUserId, type AsyncFirebaseFunctionCreateAction } from '@dereekb/firebase';
|
|
2
2
|
import { type FirebaseServerStorageServiceRef, type FirebaseServerActionsContext, type FirebaseServerAuthServiceRef } from '@dereekb/firebase-server';
|
|
3
3
|
import { type TransformAndValidateFunctionResult } from '@dereekb/model';
|
|
4
4
|
import { type InjectionToken } from '@nestjs/common';
|
|
@@ -59,6 +59,8 @@ export declare abstract class StorageFileServerActions {
|
|
|
59
59
|
abstract deleteStorageFile(params: DeleteStorageFileParams): AsyncStorageFileDeleteAction<DeleteStorageFileParams>;
|
|
60
60
|
abstract downloadStorageFile(params: DownloadStorageFileParams): Promise<TransformAndValidateFunctionResult<DownloadStorageFileParams, (storageFileDocument?: Maybe<StorageFileDocument>) => Promise<DownloadStorageFileResult>>>;
|
|
61
61
|
abstract downloadMultipleStorageFiles(params: DownloadMultipleStorageFilesParams): Promise<TransformAndValidateFunctionResult<DownloadMultipleStorageFilesParams, (storageFileDocuments?: Maybe<StorageFileDocument[]>) => Promise<DownloadMultipleStorageFilesResult>>>;
|
|
62
|
+
abstract readStorageFileMetadata(params: ReadStorageFileMetadataParams): Promise<TransformAndValidateFunctionResult<ReadStorageFileMetadataParams, (storageFileDocument?: Maybe<StorageFileDocument>) => Promise<ReadStorageFileMetadataResult>>>;
|
|
63
|
+
abstract readMultipleStorageFilesMetadata(params: ReadMultipleStorageFilesMetadataParams): Promise<TransformAndValidateFunctionResult<ReadMultipleStorageFilesMetadataParams, (storageFileDocuments?: Maybe<StorageFileDocument[]>) => Promise<ReadMultipleStorageFilesMetadataResult>>>;
|
|
62
64
|
abstract createStorageFileGroup(params: CreateStorageFileGroupParams): AsyncStorageFileGroupCreateAction<CreateStorageFileGroupParams>;
|
|
63
65
|
abstract updateStorageFileGroup(params: UpdateStorageFileGroupParams): Promise<TransformAndValidateFunctionResult<UpdateStorageFileGroupParams, (storageFileGroupDocument: StorageFileGroupDocument) => Promise<StorageFileGroupDocument>>>;
|
|
64
66
|
abstract syncStorageFileWithGroups(params: SyncStorageFileWithGroupsParams): Promise<TransformAndValidateFunctionResult<SyncStorageFileWithGroupsParams, (storageFileDocument: StorageFileDocument) => Promise<SyncStorageFileWithGroupsResult>>>;
|
|
@@ -308,6 +310,64 @@ export declare function downloadStorageFileFactory(context: StorageFileServerAct
|
|
|
308
310
|
* @returns An async transform-and-validate function that generates signed download URLs for multiple files.
|
|
309
311
|
*/
|
|
310
312
|
export declare function downloadMultipleStorageFilesFactory(context: StorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<DownloadMultipleStorageFilesParams, (storageFileDocuments?: Maybe<StorageFileDocument[]>) => Promise<DownloadMultipleStorageFilesResult>, object, unknown>;
|
|
313
|
+
/**
|
|
314
|
+
* Per-item input for the internal multiple-metadata-read factory.
|
|
315
|
+
*/
|
|
316
|
+
export interface ReadMultipleStorageFilesMetadataFactoryInputItem {
|
|
317
|
+
readonly key: FirestoreModelKey;
|
|
318
|
+
readonly storageFileDocument?: Maybe<StorageFileDocument>;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Input configuration for {@link _readMultipleStorageFilesMetadataFactory}.
|
|
322
|
+
*
|
|
323
|
+
* @example
|
|
324
|
+
* ```ts
|
|
325
|
+
* const result = await readMultipleStorageFilesMetadata({
|
|
326
|
+
* items: [{ key: 'storageFile/abc' }],
|
|
327
|
+
* throwOnFirstError: true
|
|
328
|
+
* });
|
|
329
|
+
* ```
|
|
330
|
+
*/
|
|
331
|
+
export interface ReadMultipleStorageFilesMetadataFactoryInput {
|
|
332
|
+
readonly items: ReadMultipleStorageFilesMetadataFactoryInputItem[];
|
|
333
|
+
/**
|
|
334
|
+
* When true, throws on the first read failure instead of collecting errors.
|
|
335
|
+
*
|
|
336
|
+
* Used by the single-read path ({@link readStorageFileMetadataFactory}).
|
|
337
|
+
*/
|
|
338
|
+
readonly throwOnFirstError?: Maybe<boolean>;
|
|
339
|
+
/**
|
|
340
|
+
* Maximum number of concurrent metadata read operations.
|
|
341
|
+
*
|
|
342
|
+
* Defaults to {@link DEFAULT_READ_MULTIPLE_STORAGE_FILES_METADATA_MAX_PARALLEL_TASKS}.
|
|
343
|
+
*/
|
|
344
|
+
readonly maxParallelTasks?: Maybe<number>;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Default maximum number of concurrent metadata read operations when batch-reading StorageFile metadata.
|
|
348
|
+
*/
|
|
349
|
+
export declare const DEFAULT_READ_MULTIPLE_STORAGE_FILES_METADATA_MAX_PARALLEL_TASKS = 5;
|
|
350
|
+
/**
|
|
351
|
+
* Factory for the `readStorageFileMetadata` action.
|
|
352
|
+
*
|
|
353
|
+
* Reads the underlying Cloud Storage object metadata for a single {@link StorageFile}.
|
|
354
|
+
* Delegates to {@link _readMultipleStorageFilesMetadataFactory} with a single item and `throwOnFirstError: true`.
|
|
355
|
+
*
|
|
356
|
+
* @param context - The storage file server actions context.
|
|
357
|
+
* @returns An async transform-and-validate function that reads a StorageFile's Cloud Storage metadata.
|
|
358
|
+
*/
|
|
359
|
+
export declare function readStorageFileMetadataFactory(context: StorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<ReadStorageFileMetadataParams, (storageFileDocument?: Maybe<StorageFileDocument>) => Promise<ReadMultipleStorageFileMetadataSuccessItem>, object, unknown>;
|
|
360
|
+
/**
|
|
361
|
+
* Factory for the `readMultipleStorageFilesMetadata` action.
|
|
362
|
+
*
|
|
363
|
+
* Reads the underlying Cloud Storage object metadata for multiple {@link StorageFile} documents in a single call.
|
|
364
|
+
* By default, individual failures are collected in the errors array rather than failing the entire batch.
|
|
365
|
+
* Set `throwOnFirstError` in params to throw on the first failure instead.
|
|
366
|
+
*
|
|
367
|
+
* @param context - The storage file server actions context.
|
|
368
|
+
* @returns An async transform-and-validate function that reads Cloud Storage metadata for multiple files.
|
|
369
|
+
*/
|
|
370
|
+
export declare function readMultipleStorageFilesMetadataFactory(context: StorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<ReadMultipleStorageFilesMetadataParams, (storageFileDocuments?: Maybe<StorageFileDocument[]>) => Promise<ReadMultipleStorageFilesMetadataResult>, object, unknown>;
|
|
311
371
|
/**
|
|
312
372
|
* Used for creating a new NotificationBox within a transaction.
|
|
313
373
|
*
|