@dereekb/firebase-server 13.42.0 → 14.0.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/calcom/index.esm.js +57 -96
- package/calcom/package.json +11 -11
- package/discord/index.esm.js +48 -74
- package/discord/package.json +11 -11
- package/index.esm.js +336 -583
- package/mailgun/index.esm.js +20 -32
- package/mailgun/package.json +9 -9
- package/mcp/index.esm.js +131 -185
- package/mcp/package.json +14 -14
- package/model/index.esm.js +19560 -16566
- package/model/package.json +14 -14
- package/model/src/lib/calendar/calendar.action.server.d.ts +9 -7
- package/model/src/lib/calendar/calendar.module.d.ts +1 -4
- package/model/src/lib/formspace/formspace.action.server.d.ts +266 -0
- package/model/src/lib/formspace/formspace.error.d.ts +112 -0
- package/model/src/lib/formspace/formspace.module.d.ts +57 -0
- package/model/src/lib/formspace/formspace.task.service.handler.d.ts +98 -0
- package/model/src/lib/formspace/formspace.upload.initializer.d.ts +89 -0
- package/model/src/lib/formspace/formspace.validation.d.ts +174 -0
- package/model/src/lib/formspace/index.d.ts +6 -0
- package/model/src/lib/index.d.ts +1 -0
- package/model/src/lib/storagefile/storagefile.action.server.d.ts +11 -4
- package/model/src/lib/storagefile/storagefile.task.service.handler.d.ts +3 -3
- package/model/src/lib/storagefile/storagefile.upload.service.initializer.d.ts +16 -0
- package/oidc/index.esm.js +144 -251
- package/oidc/package.json +14 -14
- package/package.json +24 -24
- package/src/lib/function/type.d.ts +0 -9
- package/src/lib/nest/app.d.ts +0 -4
- package/src/lib/nest/development/development.app.function.d.ts +2 -2
- package/src/lib/nest/model/analytics.handler.d.ts +0 -8
- package/src/lib/nest/model/api.details.d.ts +0 -8
- package/src/lib/nest/nest.provider.d.ts +0 -8
- package/test/index.esm.js +239 -395
- package/test/package.json +17 -17
- package/test/src/lib/firebase/firebase.admin.auth.d.ts +4 -25
- package/test/src/lib/firebase/firebase.admin.nest.d.ts +0 -4
- package/test/src/lib/firebase/firebase.admin.nest.function.d.ts +7 -7
- package/test/src/lib/firebase/firebase.function.d.ts +20 -81
- package/test/src/lib/firebase/firebase.test.d.ts +0 -9
- package/twilio/index.esm.js +11 -14
- package/twilio/package.json +8 -8
- package/zoho/index.esm.js +72 -132
- package/zoho/package.json +12 -12
- package/zoho/src/lib/zoho.accounts.firebase.system.d.ts +0 -10
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { type FirebaseAuthUserId, type FormSpace, type FormSpaceFileSlot, type FormSpaceId } from '@dereekb/firebase';
|
|
2
|
+
import { type Maybe, type PromiseOrValue } from '@dereekb/util';
|
|
3
|
+
import { type StorageFileInitializeFromUploadServiceInitializer } from '../storagefile/storagefile.upload.service.initializer';
|
|
4
|
+
import { type FormSpaceServerActionsContext } from './formspace.action.server';
|
|
5
|
+
/**
|
|
6
|
+
* @module formspace.upload.initializer
|
|
7
|
+
*
|
|
8
|
+
* The AUTHORITATIVE upload gate for FormSpace files.
|
|
9
|
+
*
|
|
10
|
+
* `storage.rules` can enforce the outer size and content-type bound and can keep the write inside the
|
|
11
|
+
* uploader's own namespace, but it cannot read Firestore — so it cannot know whether the FormSpace exists,
|
|
12
|
+
* whether it is still a draft, whether this slot belongs to its type, or whether the space has already
|
|
13
|
+
* used up its upload budget. All of that is decided HERE, after the bytes have landed but before any
|
|
14
|
+
* StorageFile document exists, and a rejection returns a PERMANENT failure so the stray upload is deleted
|
|
15
|
+
* rather than retried forever.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Input handed to a {@link FormSpaceUploadAuthorizationDelegate}.
|
|
19
|
+
*/
|
|
20
|
+
export interface FormSpaceUploadAuthorizationDelegateInput {
|
|
21
|
+
/**
|
|
22
|
+
* The space the bytes landed against, as loaded before any transaction.
|
|
23
|
+
*/
|
|
24
|
+
readonly formSpace: FormSpace;
|
|
25
|
+
/**
|
|
26
|
+
* The space's id, as parsed from the upload path.
|
|
27
|
+
*/
|
|
28
|
+
readonly formSpaceId: FormSpaceId;
|
|
29
|
+
/**
|
|
30
|
+
* The uid whose uploads folder the file landed in. Never equal to `formSpace.u` here.
|
|
31
|
+
*/
|
|
32
|
+
readonly uploaderId: FirebaseAuthUserId;
|
|
33
|
+
/**
|
|
34
|
+
* The slot being filled.
|
|
35
|
+
*/
|
|
36
|
+
readonly slot: FormSpaceFileSlot;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Decides whether an uploader who is NOT the space's own `u` may nonetheless upload into it.
|
|
40
|
+
*
|
|
41
|
+
* The DEFAULT FormSpace is single-user: `u` is set at creation, never changes, and is the only party that
|
|
42
|
+
* may upload into it. A SHARED space — one whose `o` names a model many users can reach — needs a second
|
|
43
|
+
* answer, and that answer is app policy (typically a read against some other collection), so it cannot live
|
|
44
|
+
* in this package.
|
|
45
|
+
*
|
|
46
|
+
* Consulted ONCE, BEFORE the claim transaction, and ONLY when `formSpace.u !== uploaderId`. Two
|
|
47
|
+
* consequences worth stating:
|
|
48
|
+
*
|
|
49
|
+
* - An owner's own upload never reaches the delegate, so a broken delegate cannot regress the single-user
|
|
50
|
+
* path every existing FormSpaceType uses.
|
|
51
|
+
* - Resolving it outside the transactions is safe because the decision reads only `u`, `o` and `t`, none of
|
|
52
|
+
* which ever change after creation. Inside `runTransaction` it would be re-run on every contention retry
|
|
53
|
+
* and would still read outside the transaction's snapshot, so the transaction would buy nothing.
|
|
54
|
+
*
|
|
55
|
+
* Returning `false` is a DECISION: it becomes {@link formSpaceUploadUserMismatchError}, which
|
|
56
|
+
* {@link FORM_SPACE_UPLOAD_REFUSAL_ERROR_CODES} already classifies as a permanent refusal, so the stray
|
|
57
|
+
* upload is discarded rather than retried forever. THROWING is infrastructure: it falls through to the
|
|
58
|
+
* transient branch and the source is left for the next sweep.
|
|
59
|
+
*/
|
|
60
|
+
export type FormSpaceUploadAuthorizationDelegate = (input: FormSpaceUploadAuthorizationDelegateInput) => PromiseOrValue<boolean>;
|
|
61
|
+
/**
|
|
62
|
+
* Configuration for {@link formSpaceStorageFileUploadInitializers}.
|
|
63
|
+
*
|
|
64
|
+
* Extends the actions context rather than wrapping it, so an existing call site that passes the context
|
|
65
|
+
* object directly keeps compiling unchanged.
|
|
66
|
+
*/
|
|
67
|
+
export interface FormSpaceStorageFileUploadInitializersConfig extends FormSpaceServerActionsContext {
|
|
68
|
+
/**
|
|
69
|
+
* Optional policy for an upload by someone other than the space's `u`.
|
|
70
|
+
*
|
|
71
|
+
* Absent by default, which is the original behaviour exactly: any uploader that is not `u` is refused.
|
|
72
|
+
*/
|
|
73
|
+
readonly uploadAuthorizationDelegate?: Maybe<FormSpaceUploadAuthorizationDelegate>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Creates the {@link StorageFileInitializeFromUploadServiceInitializer} entries for FormSpace uploads.
|
|
77
|
+
*
|
|
78
|
+
* ONE initializer covers every form type: the per-type rules come from the {@link FormSpaceTypeConfig}
|
|
79
|
+
* registry keyed off the loaded space, not from the initializer's own registration.
|
|
80
|
+
*
|
|
81
|
+
* @param config - The FormSpace server actions context, plus the optional shared-space upload policy.
|
|
82
|
+
* @returns The initializers to spread into the app's upload service config.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* initializer: [...appInitializers, ...formSpaceStorageFileUploadInitializers(context)]
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
export declare function formSpaceStorageFileUploadInitializers(config: FormSpaceStorageFileUploadInitializersConfig): StorageFileInitializeFromUploadServiceInitializer[];
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { type AppFormSpaceTypeConfigService, type FormSpace, type FormSpaceDocument, type FormSpaceFile, type FormSpaceFileSlot, type FormSpaceFileSlotConfig, type FormSpaceFileValidationSubtask, type FormSpaceFileValidationSubtaskMetadata, type FormSpaceFirestoreCollections, type FormSpaceType, type StorageFileDocument, type StorageFileFirestoreCollections, type StorageFileMetadata, type StoredFileReader } from '@dereekb/firebase';
|
|
2
|
+
import { type Getter, type Maybe, type Milliseconds } from '@dereekb/util';
|
|
3
|
+
import { type StorageFileProcessingPurposeSubtaskProcessorConfigWithTarget } from '../storagefile/storagefile.task.service.handler';
|
|
4
|
+
/**
|
|
5
|
+
* @module formspace.validation
|
|
6
|
+
*
|
|
7
|
+
* SERVER-ONLY registration of what a FormSpace slot's uploaded file must actually contain.
|
|
8
|
+
*
|
|
9
|
+
* The split mirrors the one the type registry already uses. Pure data — which mime types, how large, how
|
|
10
|
+
* many, whether validation is required at all — lives in `@dereekb/firebase` so the client pre-checks with
|
|
11
|
+
* the same rules the server enforces. The CHECK itself is a function, so it lives here: a validator may read
|
|
12
|
+
* the file's bytes, call out to a model, or consult another collection, none of which belongs in a bundle
|
|
13
|
+
* shipped to a browser.
|
|
14
|
+
*
|
|
15
|
+
* Registration is keyed by `(FormSpaceType, slot)` and consumed by one processor targeting the single
|
|
16
|
+
* `form_space` StorageFilePurpose, because the subtask framework dispatches on one target and that target is
|
|
17
|
+
* already spent on the purpose.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* How long a `pending` verdict waits before the validator is asked again, when it names no delay itself.
|
|
21
|
+
*/
|
|
22
|
+
export declare const DEFAULT_FORM_SPACE_FILE_VALIDATION_RETRY_DELAY: Milliseconds;
|
|
23
|
+
/**
|
|
24
|
+
* How many times a validator may answer `pending` before the file is failed.
|
|
25
|
+
*
|
|
26
|
+
* Bounds a validator whose external dependency never resolves. A validator that legitimately needs longer
|
|
27
|
+
* should return a longer `retryIn` rather than more attempts.
|
|
28
|
+
*/
|
|
29
|
+
export declare const DEFAULT_FORM_SPACE_FILE_VALIDATION_MAX_ATTEMPTS = 10;
|
|
30
|
+
/**
|
|
31
|
+
* What a {@link FormSpaceFileValidator} is handed.
|
|
32
|
+
*/
|
|
33
|
+
export interface FormSpaceFileValidatorInput {
|
|
34
|
+
/**
|
|
35
|
+
* The FormSpace the file was uploaded into.
|
|
36
|
+
*/
|
|
37
|
+
readonly formSpaceDocument: FormSpaceDocument;
|
|
38
|
+
/**
|
|
39
|
+
* Loads the FormSpace, memoized for the duration of one task run.
|
|
40
|
+
*/
|
|
41
|
+
readonly loadFormSpace: Getter<Promise<FormSpace>>;
|
|
42
|
+
/**
|
|
43
|
+
* The StorageFile holding the bytes.
|
|
44
|
+
*/
|
|
45
|
+
readonly storageFileDocument: StorageFileDocument;
|
|
46
|
+
/**
|
|
47
|
+
* Reads the stored file's bytes, stream, and metadata.
|
|
48
|
+
*/
|
|
49
|
+
readonly fileDetailsAccessor: StoredFileReader;
|
|
50
|
+
/**
|
|
51
|
+
* The entry on the FormSpace this validation is for.
|
|
52
|
+
*/
|
|
53
|
+
readonly formSpaceFile: FormSpaceFile;
|
|
54
|
+
/**
|
|
55
|
+
* The slot the file fills.
|
|
56
|
+
*/
|
|
57
|
+
readonly slot: FormSpaceFileSlot;
|
|
58
|
+
/**
|
|
59
|
+
* The slot's configuration, when its type declares one.
|
|
60
|
+
*/
|
|
61
|
+
readonly slotConfig: Maybe<FormSpaceFileSlotConfig>;
|
|
62
|
+
/**
|
|
63
|
+
* How many times the validator has already been asked about this file, starting at 0.
|
|
64
|
+
*/
|
|
65
|
+
readonly attempt: number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A validator's answer about one file.
|
|
69
|
+
*
|
|
70
|
+
* `pending` is the third outcome rather than an error: a validator waiting on something external has not
|
|
71
|
+
* failed, and reporting it as a failure would consume the file's retry budget on a check still in flight.
|
|
72
|
+
*/
|
|
73
|
+
export type FormSpaceFileValidationVerdict = 'valid' | 'invalid' | 'pending';
|
|
74
|
+
/**
|
|
75
|
+
* The result of validating one file.
|
|
76
|
+
*/
|
|
77
|
+
export interface FormSpaceFileValidationResult {
|
|
78
|
+
readonly verdict: FormSpaceFileValidationVerdict;
|
|
79
|
+
/**
|
|
80
|
+
* Why the file was judged invalid, written for the OWNER to read and act on.
|
|
81
|
+
*
|
|
82
|
+
* Free text rather than a code because a content rejection cannot be enumerated in advance — "the document
|
|
83
|
+
* expired in 2019" and "this is a photo of a receipt" are both correct answers from the same validator.
|
|
84
|
+
*/
|
|
85
|
+
readonly reason?: Maybe<string>;
|
|
86
|
+
/**
|
|
87
|
+
* How long to wait before asking again. `pending` only; defaults to
|
|
88
|
+
* {@link DEFAULT_FORM_SPACE_FILE_VALIDATION_RETRY_DELAY}.
|
|
89
|
+
*/
|
|
90
|
+
readonly retryIn?: Maybe<Milliseconds>;
|
|
91
|
+
/**
|
|
92
|
+
* Metadata to write onto the StorageFile's `d`, REPLACING the default verdict metadata.
|
|
93
|
+
*/
|
|
94
|
+
readonly metadata?: Maybe<StorageFileMetadata>;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Decides whether one uploaded file satisfies one FormSpace slot.
|
|
98
|
+
*/
|
|
99
|
+
export type FormSpaceFileValidator = (input: FormSpaceFileValidatorInput) => Promise<FormSpaceFileValidationResult>;
|
|
100
|
+
/**
|
|
101
|
+
* Registers a {@link FormSpaceFileValidator} for one {@link FormSpaceType}.
|
|
102
|
+
*/
|
|
103
|
+
export interface FormSpaceFileValidatorConfig {
|
|
104
|
+
/**
|
|
105
|
+
* The type this validator applies to.
|
|
106
|
+
*/
|
|
107
|
+
readonly formSpaceType: FormSpaceType;
|
|
108
|
+
/**
|
|
109
|
+
* The slot this validator applies to. When absent it applies to every slot of the type that does not
|
|
110
|
+
* declare a validator of its own.
|
|
111
|
+
*/
|
|
112
|
+
readonly slot?: Maybe<FormSpaceFileSlot>;
|
|
113
|
+
/**
|
|
114
|
+
* The check.
|
|
115
|
+
*/
|
|
116
|
+
readonly validate: FormSpaceFileValidator;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Configuration for {@link formSpaceFileValidationStorageFileProcessor}.
|
|
120
|
+
*/
|
|
121
|
+
export interface FormSpaceFileValidationStorageFileProcessorConfig {
|
|
122
|
+
readonly formSpaceFirestoreCollections: FormSpaceFirestoreCollections;
|
|
123
|
+
/**
|
|
124
|
+
* Accessor for the StorageFile collection, used to flag a file the register step supersedes.
|
|
125
|
+
*/
|
|
126
|
+
readonly storageFileFirestoreCollections: StorageFileFirestoreCollections;
|
|
127
|
+
/**
|
|
128
|
+
* The registry the processor resolves each file's slot rules from.
|
|
129
|
+
*/
|
|
130
|
+
readonly appFormSpaceTypeConfigService: AppFormSpaceTypeConfigService;
|
|
131
|
+
/**
|
|
132
|
+
* The registered validators.
|
|
133
|
+
*/
|
|
134
|
+
readonly validators: FormSpaceFileValidatorConfig[];
|
|
135
|
+
/**
|
|
136
|
+
* How many `pending` verdicts a file may collect before it is failed. Defaults to
|
|
137
|
+
* {@link DEFAULT_FORM_SPACE_FILE_VALIDATION_MAX_ATTEMPTS}.
|
|
138
|
+
*/
|
|
139
|
+
readonly maxAttempts?: Maybe<number>;
|
|
140
|
+
/**
|
|
141
|
+
* When true, asserts at wiring time that every slot declaring `validationRequired` in
|
|
142
|
+
* `appFormSpaceTypeConfigService` has a validator registered here.
|
|
143
|
+
*
|
|
144
|
+
* On by default. A slot that asks for validation and gets none would otherwise pass every file silently,
|
|
145
|
+
* which is the one failure mode a validator exists to prevent.
|
|
146
|
+
*/
|
|
147
|
+
readonly validateCoverage?: Maybe<boolean>;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Builds the `form_space` purpose's subtask processor: the thing that actually runs a slot's validator.
|
|
151
|
+
*
|
|
152
|
+
* ONE processor covers every form type and every slot, the same way one upload initializer does — the
|
|
153
|
+
* per-slot rules come from the registry keyed off the loaded space, not from the processor's registration.
|
|
154
|
+
*
|
|
155
|
+
* The verdict is written to BOTH the FormSpace's `f` entry and the StorageFile. The FormSpace copy is the
|
|
156
|
+
* one that matters: the owner can read their own space (and list it), but cannot list StorageFiles, so a
|
|
157
|
+
* verdict that never reaches `f` is a verdict the user never sees.
|
|
158
|
+
*
|
|
159
|
+
* @param config - The FormSpace collection, type registry, and registered validators.
|
|
160
|
+
* @returns The processor config, for the `processors` array of the storage-file processing handler.
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```ts
|
|
164
|
+
* const processors = [
|
|
165
|
+
* formSpaceFileValidationStorageFileProcessor({
|
|
166
|
+
* formSpaceFirestoreCollections: context,
|
|
167
|
+
* storageFileFirestoreCollections: context,
|
|
168
|
+
* appFormSpaceTypeConfigService: appFormSpaceTypeConfigService(formSpaceTypeConfigRecord(APP_FORM_SPACE_TYPE_CONFIGS)),
|
|
169
|
+
* validators: [MY_RESUME_VALIDATOR]
|
|
170
|
+
* })
|
|
171
|
+
* ];
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
export declare function formSpaceFileValidationStorageFileProcessor(config: FormSpaceFileValidationStorageFileProcessorConfig): StorageFileProcessingPurposeSubtaskProcessorConfigWithTarget<FormSpaceFileValidationSubtaskMetadata, FormSpaceFileValidationSubtask>;
|
package/model/src/lib/index.d.ts
CHANGED
|
@@ -210,20 +210,27 @@ export interface ProcessStorageFileInTransactionInput {
|
|
|
210
210
|
* Creates or restarts a notification task for the file based on its current processing state,
|
|
211
211
|
* handling stuck-processing detection, forced restarts, and re-processing of already-successful files.
|
|
212
212
|
*
|
|
213
|
-
*
|
|
213
|
+
* Takes the BASE context rather than the full one so a sibling model's actions (Calendar's ICS re-flag,
|
|
214
|
+
* for instance) can build this without standing up the upload service and signed-upload policy registry
|
|
215
|
+
* it has no use for.
|
|
216
|
+
*
|
|
217
|
+
* @param context - The base storage file server actions context.
|
|
214
218
|
* @returns An async function that processes a storage file within a transaction.
|
|
215
219
|
*/
|
|
216
|
-
export declare function _processStorageFileInTransactionFactory(context:
|
|
220
|
+
export declare function _processStorageFileInTransactionFactory(context: BaseStorageFileServerActionsContext): (input: ProcessStorageFileInTransactionInput, transaction: Transaction) => Promise<void>;
|
|
217
221
|
/**
|
|
218
222
|
* Factory for the `processStorageFile` action.
|
|
219
223
|
*
|
|
220
224
|
* Processes a single {@link StorageFile} by creating a notification task for it
|
|
221
225
|
* and marking it as processing. Validates the file is in a valid state for processing.
|
|
222
226
|
*
|
|
223
|
-
*
|
|
227
|
+
* Takes the BASE context, so a sibling model that needs to re-flag a StorageFile it owns can build this
|
|
228
|
+
* action directly instead of injecting the whole {@link StorageFileServerActions}.
|
|
229
|
+
*
|
|
230
|
+
* @param context - The base storage file server actions context.
|
|
224
231
|
* @returns An async transform-and-validate function that processes a single StorageFile.
|
|
225
232
|
*/
|
|
226
|
-
export declare function processStorageFileFactory(context:
|
|
233
|
+
export declare function processStorageFileFactory(context: BaseStorageFileServerActionsContext): import("@dereekb/model").TransformAndValidateFunctionResultFunction<ProcessStorageFileParams, (storageFileDocument: StorageFileDocument) => Promise<ProcessStorageFileResult>, object, unknown>;
|
|
227
234
|
/**
|
|
228
235
|
* Factory for the `deleteAllQueuedStorageFiles` action.
|
|
229
236
|
*
|
|
@@ -3,7 +3,7 @@ import { type NotificationTaskServiceTaskHandlerConfig } from '../notification/n
|
|
|
3
3
|
import { type PromiseOrValue, type Maybe } from '@dereekb/util';
|
|
4
4
|
import { type StorageFileQueueForDeleteTime } from './storagefile.util';
|
|
5
5
|
import { type NotificationTaskSubtaskCleanupInstructions, type NotificationTaskSubtaskFlowEntry, type NotificationTaskSubtaskInput, type NotificationTaskSubtaskNotificationTaskHandlerConfig, type NotificationTaskSubtaskProcessorConfig } from '../notification/notification.task.subtask.handler';
|
|
6
|
-
import
|
|
6
|
+
import { type Archiver, type ArchiverOptions } from 'archiver';
|
|
7
7
|
/**
|
|
8
8
|
* Input for a purpose-specific storage file processing subtask.
|
|
9
9
|
*
|
|
@@ -132,9 +132,9 @@ export interface StorageFileGroupStorageFileZipConfigureZipArchiverOptionsInput
|
|
|
132
132
|
readonly input: StorageFileProcessingPurposeSubtaskInput<StorageFileGroupZipStorageFileProcessingSubtaskMetadata, StorageFileGroupZipStorageFileProcessingSubtask>;
|
|
133
133
|
readonly storageFileGroup: StorageFileGroup;
|
|
134
134
|
}
|
|
135
|
-
export type StorageFileGroupStorageFileZipConfigureZipArchiverOptionsFunction = (input: StorageFileGroupStorageFileZipConfigureZipArchiverOptionsInput) => PromiseOrValue<
|
|
135
|
+
export type StorageFileGroupStorageFileZipConfigureZipArchiverOptionsFunction = (input: StorageFileGroupStorageFileZipConfigureZipArchiverOptionsInput) => PromiseOrValue<ArchiverOptions>;
|
|
136
136
|
export interface StorageFileGroupStorageFileZipFinalizeArchiveInput extends StorageFileGroupStorageFileZipConfigureZipArchiverOptionsInput {
|
|
137
|
-
readonly archive:
|
|
137
|
+
readonly archive: Archiver;
|
|
138
138
|
}
|
|
139
139
|
export type StorageFileGroupStorageFileZipFinalizeArchiveFunction = (input: StorageFileGroupStorageFileZipFinalizeArchiveInput) => Promise<void>;
|
|
140
140
|
export interface StorageFileGroupStorageFileZipFileDisplayNameFunctionInput {
|
|
@@ -74,6 +74,22 @@ export interface StorageFileInitializeFromUploadServiceInitializerStorageFileDoc
|
|
|
74
74
|
* @returns A permanent failure result with the error and optional created file reference.
|
|
75
75
|
*/
|
|
76
76
|
export declare function storageFileInitializeFromUploadServiceInitializerResultPermanentFailure(error: unknown, createdFile?: Maybe<StoragePathRef>): StorageFileInitializeFromUploadServiceInitializerResult;
|
|
77
|
+
/**
|
|
78
|
+
* Convenience factory for creating a TRANSIENT failure result, indicating the initializer could not
|
|
79
|
+
* finish for a reason that may not recur.
|
|
80
|
+
*
|
|
81
|
+
* The difference from a permanent failure is what happens to the SOURCE upload: a permanent failure
|
|
82
|
+
* discards it, while a transient one leaves it in place for the next sweep to retry. Any intermediate
|
|
83
|
+
* file named by `createdFile` is deleted either way, so a retry never finds a half-written destination.
|
|
84
|
+
*
|
|
85
|
+
* Use this for infrastructure — a contended transaction, a storage blip — and reserve the permanent
|
|
86
|
+
* result for a decision that no retry will reverse.
|
|
87
|
+
*
|
|
88
|
+
* @param error - The error that caused the failure.
|
|
89
|
+
* @param createdFile - Optional path to a file that was created before the error and should be deleted.
|
|
90
|
+
* @returns A transient failure result with the error and optional created file reference.
|
|
91
|
+
*/
|
|
92
|
+
export declare function storageFileInitializeFromUploadServiceInitializerResultTransientFailure(error: unknown, createdFile?: Maybe<StoragePathRef>): StorageFileInitializeFromUploadServiceInitializerResult;
|
|
77
93
|
/**
|
|
78
94
|
* Processes the input details accessor and returns the results.
|
|
79
95
|
*/
|