@dereekb/firebase-server 12.5.10 → 12.6.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/mailgun/package.json +1 -1
  3. package/model/package.json +1 -1
  4. package/model/src/lib/notification/index.d.ts +2 -2
  5. package/model/src/lib/notification/index.js +2 -2
  6. package/model/src/lib/notification/index.js.map +1 -1
  7. package/model/src/lib/notification/{notification.action.init.server.js → notification.action.init.service.js} +3 -3
  8. package/model/src/lib/notification/notification.action.init.service.js.map +1 -0
  9. package/model/src/lib/notification/{notification.action.server.d.ts → notification.action.service.d.ts} +1 -1
  10. package/model/src/lib/notification/{notification.action.server.js → notification.action.service.js} +2 -2
  11. package/model/src/lib/notification/notification.action.service.js.map +1 -0
  12. package/model/src/lib/notification/notification.expedite.service.d.ts +1 -1
  13. package/model/src/lib/notification/notification.module.d.ts +2 -2
  14. package/model/src/lib/notification/notification.module.js +12 -12
  15. package/model/src/lib/notification/notification.module.js.map +1 -1
  16. package/model/src/lib/storagefile/index.d.ts +1 -0
  17. package/model/src/lib/storagefile/index.js +1 -0
  18. package/model/src/lib/storagefile/index.js.map +1 -1
  19. package/model/src/lib/storagefile/storagefile.action.init.service.d.ts +62 -0
  20. package/model/src/lib/storagefile/storagefile.action.init.service.js +155 -0
  21. package/model/src/lib/storagefile/storagefile.action.init.service.js.map +1 -0
  22. package/model/src/lib/storagefile/storagefile.action.server.d.ts +79 -4
  23. package/model/src/lib/storagefile/storagefile.action.server.js +416 -97
  24. package/model/src/lib/storagefile/storagefile.action.server.js.map +1 -1
  25. package/model/src/lib/storagefile/storagefile.error.d.ts +5 -1
  26. package/model/src/lib/storagefile/storagefile.error.js +30 -2
  27. package/model/src/lib/storagefile/storagefile.error.js.map +1 -1
  28. package/model/src/lib/storagefile/storagefile.module.d.ts +4 -0
  29. package/model/src/lib/storagefile/storagefile.module.js +18 -4
  30. package/model/src/lib/storagefile/storagefile.module.js.map +1 -1
  31. package/model/src/lib/storagefile/storagefile.task.service.handler.d.ts +75 -5
  32. package/model/src/lib/storagefile/storagefile.task.service.handler.js +188 -5
  33. package/model/src/lib/storagefile/storagefile.task.service.handler.js.map +1 -1
  34. package/package.json +1 -1
  35. package/test/package.json +1 -1
  36. package/zoho/package.json +1 -1
  37. package/model/src/lib/notification/notification.action.init.server.js.map +0 -1
  38. package/model/src/lib/notification/notification.action.server.js.map +0 -1
  39. /package/model/src/lib/notification/{notification.action.init.server.d.ts → notification.action.init.service.d.ts} +0 -0
@@ -1,9 +1,10 @@
1
- import { type FirestoreContextReference, InitializeStorageFileFromUploadParams, type AsyncStorageFileCreateAction, type StorageFileFirestoreCollections, ProcessStorageFileParams, type StorageFileDocument, type ProcessStorageFileResult, CreateStorageFileParams, type AsyncStorageFileUpdateAction, UpdateStorageFileParams, type NotificationFirestoreCollections, type FirebaseStorageAccessorFile, type InitializeAllStorageFilesFromUploadsResult, InitializeAllStorageFilesFromUploadsParams, ProcessAllQueuedStorageFilesParams, type ProcessAllQueuedStorageFilesResult, DeleteAllQueuedStorageFilesParams, type DeleteAllQueuedStorageFilesResult, DeleteStorageFileParams, type AsyncStorageFileDeleteAction, DownloadStorageFileParams, type DownloadStorageFileResult } from '@dereekb/firebase';
1
+ import { type FirestoreContextReference, InitializeStorageFileFromUploadParams, type AsyncStorageFileCreateAction, type StorageFileFirestoreCollections, ProcessStorageFileParams, type StorageFileDocument, type ProcessStorageFileResult, CreateStorageFileParams, type AsyncStorageFileUpdateAction, UpdateStorageFileParams, type NotificationFirestoreCollections, type FirebaseStorageAccessorFile, type InitializeAllStorageFilesFromUploadsResult, InitializeAllStorageFilesFromUploadsParams, ProcessAllQueuedStorageFilesParams, type ProcessAllQueuedStorageFilesResult, DeleteAllQueuedStorageFilesParams, type DeleteAllQueuedStorageFilesResult, DeleteStorageFileParams, type AsyncStorageFileDeleteAction, type StorageFile, DownloadStorageFileParams, type DownloadStorageFileResult, SyncStorageFileWithGroupsParams, SyncAllFlaggedStorageFilesWithGroupsParams, type SyncAllFlaggedStorageFilesWithGroupsResult, type SyncStorageFileWithGroupsResult, RegenerateAllFlaggedStorageFileGroupsContentParams, type RegenerateAllFlaggedStorageFileGroupsContentResult, RegenerateStorageFileGroupContentParams, type RegenerateStorageFileGroupContentResult, type StorageFileGroupDocument, type AsyncStorageFileGroupCreateAction, CreateStorageFileGroupParams, type Transaction, type StorageFileGroup, type StorageFileGroupDocumentReferencePair, type StorageFileGroupId } 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';
5
- import { type NotificationExpediteServiceRef } from '../notification';
5
+ import { type NotificationExpediteServiceInstance, type NotificationExpediteServiceRef } from '../notification';
6
6
  import { type StorageFileInitializeFromUploadServiceRef } from './storagefile.upload.service';
7
+ import { type Maybe } from '@dereekb/util';
7
8
  /**
8
9
  * Injection token for the BaseStorageFileServerActionsContext
9
10
  */
@@ -25,7 +26,12 @@ export declare abstract class StorageFileServerActions {
25
26
  abstract processStorageFile(params: ProcessStorageFileParams): Promise<TransformAndValidateFunctionResult<ProcessStorageFileParams, (storageFileDocument: StorageFileDocument) => Promise<ProcessStorageFileResult>>>;
26
27
  abstract deleteAllQueuedStorageFiles(params: DeleteAllQueuedStorageFilesParams): Promise<TransformAndValidateFunctionResult<DeleteAllQueuedStorageFilesParams, () => Promise<DeleteAllQueuedStorageFilesResult>>>;
27
28
  abstract deleteStorageFile(params: DeleteStorageFileParams): AsyncStorageFileDeleteAction<DeleteStorageFileParams>;
28
- abstract downloadStorageFile(params: DownloadStorageFileParams): Promise<TransformAndValidateFunctionResult<DownloadStorageFileParams, (storageFileDocument: StorageFileDocument) => Promise<DownloadStorageFileResult>>>;
29
+ abstract downloadStorageFile(params: DownloadStorageFileParams): Promise<TransformAndValidateFunctionResult<DownloadStorageFileParams, (storageFileDocument?: Maybe<StorageFileDocument>) => Promise<DownloadStorageFileResult>>>;
30
+ abstract createStorageFileGroup(params: CreateStorageFileGroupParams): AsyncStorageFileGroupCreateAction<CreateStorageFileGroupParams>;
31
+ abstract syncStorageFileWithGroups(params: SyncStorageFileWithGroupsParams): Promise<TransformAndValidateFunctionResult<SyncStorageFileWithGroupsParams, (storageFileDocument: StorageFileDocument) => Promise<SyncStorageFileWithGroupsResult>>>;
32
+ abstract syncAllFlaggedStorageFilesWithGroups(params: SyncAllFlaggedStorageFilesWithGroupsParams): Promise<TransformAndValidateFunctionResult<SyncAllFlaggedStorageFilesWithGroupsParams, () => Promise<SyncAllFlaggedStorageFilesWithGroupsResult>>>;
33
+ abstract regenerateStorageFileGroupContent(params: RegenerateStorageFileGroupContentParams): Promise<TransformAndValidateFunctionResult<RegenerateStorageFileGroupContentParams, (storageFileGroupDocument: StorageFileGroupDocument) => Promise<RegenerateStorageFileGroupContentResult>>>;
34
+ abstract regenerateAllFlaggedStorageFileGroupsContent(params: RegenerateAllFlaggedStorageFileGroupsContentParams): Promise<TransformAndValidateFunctionResult<RegenerateAllFlaggedStorageFileGroupsContentParams, () => Promise<RegenerateAllFlaggedStorageFileGroupsContentResult>>>;
29
35
  }
30
36
  export declare function storageFileServerActions(context: StorageFileServerActionsContext): StorageFileServerActions;
31
37
  export declare function createStorageFileFactory(context: BaseStorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<CreateStorageFileParams, () => Promise<any>, object, unknown>;
@@ -37,7 +43,76 @@ export declare function _initializeStorageFileFromUploadFileFactory(context: Sto
37
43
  export declare function initializeStorageFileFromUploadFactory(context: StorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<InitializeStorageFileFromUploadParams, () => Promise<StorageFileDocument>, object, unknown>;
38
44
  export declare function updateStorageFileFactory(context: BaseStorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<UpdateStorageFileParams, (storageFileDocument: StorageFileDocument) => Promise<StorageFileDocument>, object, unknown>;
39
45
  export declare function processAllQueuedStorageFilesFactory(context: StorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<ProcessAllQueuedStorageFilesParams, () => Promise<ProcessAllQueuedStorageFilesResult>, object, unknown>;
46
+ export interface ProcessStorageFileInTransactionInput {
47
+ /**
48
+ * The StorageFileDocument to update.
49
+ */
50
+ readonly storageFileDocument: StorageFileDocument;
51
+ /**
52
+ * The storage file, if already loaded in this transaction.
53
+ */
54
+ readonly storageFile?: StorageFile;
55
+ /**
56
+ * Input params to use.
57
+ */
58
+ readonly params?: Maybe<Pick<ProcessStorageFileParams, 'checkRetryProcessing' | 'forceRestartProcessing' | 'processAgainIfSuccessful'>>;
59
+ /**
60
+ * The expedite instance to enqueue a create result into, if applicable.
61
+ */
62
+ readonly expediteInstance?: Maybe<NotificationExpediteServiceInstance>;
63
+ }
64
+ export declare function _processStorageFileInTransactionFactory(context: StorageFileServerActionsContext): (input: ProcessStorageFileInTransactionInput, transaction: Transaction) => Promise<void>;
40
65
  export declare function processStorageFileFactory(context: StorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<ProcessStorageFileParams, (storageFileDocument: StorageFileDocument) => Promise<ProcessStorageFileResult>, object, unknown>;
41
66
  export declare function deleteAllQueuedStorageFilesFactory(context: StorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<DeleteAllQueuedStorageFilesParams, () => Promise<DeleteAllQueuedStorageFilesResult>, object, unknown>;
42
67
  export declare function deleteStorageFileFactory(context: StorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<DeleteStorageFileParams, (inputStorageFileDocument: StorageFileDocument) => Promise<void>, object, unknown>;
43
- export declare function downloadStorageFileFactory(context: StorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<DownloadStorageFileParams, (storageFileDocument: StorageFileDocument) => Promise<DownloadStorageFileResult>, object, unknown>;
68
+ export declare function downloadStorageFileFactory(context: StorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<DownloadStorageFileParams, (storageFileDocument?: Maybe<StorageFileDocument>) => Promise<DownloadStorageFileResult>, object, unknown>;
69
+ /**
70
+ * Used for creating a new NotificationBox within a transaction.
71
+ *
72
+ * Used for new models.
73
+ */
74
+ export interface CreateStorageFileGroupInTransactionInput extends StorageFileGroupDocumentReferencePair {
75
+ /**
76
+ * Now date to use.
77
+ */
78
+ readonly now?: Maybe<Date>;
79
+ /**
80
+ * If true, skips calling create
81
+ */
82
+ readonly skipCreate?: Maybe<boolean>;
83
+ /**
84
+ * Template values to use for the created StorageFileGroup
85
+ */
86
+ readonly template?: Maybe<Pick<StorageFileGroup, 'f' | 're'>>;
87
+ }
88
+ export declare function createStorageFileGroupInTransactionFactory(context: StorageFileServerActionsContext): (params: CreateStorageFileGroupInTransactionInput, transaction: Transaction) => Promise<{
89
+ storageFileGroupTemplate: StorageFileGroup;
90
+ storageFileGroupDocument: StorageFileGroupDocument;
91
+ }>;
92
+ export declare function createStorageFileGroupFactory(context: StorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<CreateStorageFileGroupParams, () => Promise<StorageFileGroupDocument>, object, unknown>;
93
+ export interface SyncStorageFileWithGroupsInTransactionInput {
94
+ readonly storageFileDocument: StorageFileDocument;
95
+ /**
96
+ * The loaded StorageFile. Must be loaded within the transaction.
97
+ */
98
+ readonly storageFile?: Maybe<StorageFile>;
99
+ /**
100
+ * If true, ignores the StorageFile gs flag and forces the sync to run.
101
+ */
102
+ readonly force?: Maybe<boolean>;
103
+ /**
104
+ * If true, removes all the storage file groups instead of adding them.
105
+ */
106
+ readonly removeAllStorageFileGroups?: Maybe<true | StorageFileGroupId[]>;
107
+ /**
108
+ * If true, will not update the StorageFileDocument.
109
+ *
110
+ * Defaults to false
111
+ */
112
+ readonly skipStorageFileUpdate?: Maybe<boolean>;
113
+ }
114
+ export declare function _syncStorageFileWithGroupsInTransactionFactory(context: StorageFileServerActionsContext): (input: SyncStorageFileWithGroupsInTransactionInput, transaction: Transaction) => Promise<SyncStorageFileWithGroupsResult>;
115
+ export declare function syncStorageFileWithGroupsFactory(context: StorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<SyncStorageFileWithGroupsParams, (storageFileDocument: StorageFileDocument) => Promise<SyncStorageFileWithGroupsResult>, object, unknown>;
116
+ export declare function syncAllFlaggedStorageFilesWithGroupsFactory(context: StorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<SyncAllFlaggedStorageFilesWithGroupsParams, () => Promise<SyncAllFlaggedStorageFilesWithGroupsResult>, object, unknown>;
117
+ export declare function regenerateStorageFileGroupContentFactory(context: StorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<RegenerateStorageFileGroupContentParams, (storageFileGroupDocument: StorageFileGroupDocument) => Promise<RegenerateStorageFileGroupContentResult>, object, unknown>;
118
+ export declare function regenerateAllFlaggedStorageFileGroupsContentFactory(context: StorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<RegenerateAllFlaggedStorageFileGroupsContentParams, () => Promise<RegenerateAllFlaggedStorageFileGroupsContentResult>, object, unknown>;