@dereekb/firebase-server 13.4.0 → 13.4.2
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 +553 -119
- package/index.esm.js +553 -121
- package/mailgun/package.json +9 -9
- package/model/index.cjs.js +645 -350
- package/model/index.esm.js +646 -351
- package/model/package.json +9 -9
- package/model/src/lib/mailgun/notification.send.service.mailgun.d.ts +1 -0
- package/model/src/lib/notification/index.d.ts +2 -2
- package/model/src/lib/notification/{notification.action.service.d.ts → notification.action.server.d.ts} +53 -1
- package/model/src/lib/notification/{notification.action.init.service.d.ts → notification.action.server.init.d.ts} +20 -0
- package/model/src/lib/notification/notification.config.service.d.ts +2 -0
- package/model/src/lib/notification/notification.create.run.d.ts +1 -0
- package/model/src/lib/notification/notification.error.d.ts +16 -0
- package/model/src/lib/notification/notification.expedite.service.d.ts +11 -3
- package/model/src/lib/notification/notification.module.d.ts +19 -6
- package/model/src/lib/notification/notification.send.service.notificationsummary.d.ts +1 -0
- package/model/src/lib/notification/notification.send.service.text.d.ts +2 -0
- package/model/src/lib/notification/notification.task.service.handler.d.ts +1 -0
- package/model/src/lib/notification/notification.task.service.util.d.ts +1 -0
- package/model/src/lib/notification/notification.task.subtask.handler.d.ts +3 -0
- package/model/src/lib/notification/notification.util.d.ts +4 -2
- package/model/src/lib/storagefile/index.d.ts +1 -1
- package/model/src/lib/storagefile/storagefile.action.server.d.ts +98 -1
- package/model/src/lib/storagefile/{storagefile.action.init.service.d.ts → storagefile.action.server.init.d.ts} +13 -2
- package/model/src/lib/storagefile/storagefile.error.d.ts +27 -0
- package/model/src/lib/storagefile/storagefile.module.d.ts +14 -4
- package/model/src/lib/storagefile/storagefile.task.service.handler.d.ts +29 -7
- package/model/src/lib/storagefile/storagefile.upload.service.initializer.d.ts +2 -0
- package/oidc/index.cjs.js +150 -32
- package/oidc/index.esm.js +150 -32
- package/oidc/package.json +10 -10
- package/oidc/src/lib/controller/oidc.interaction.controller.d.ts +12 -0
- package/oidc/src/lib/controller/oidc.wellknown.controller.d.ts +6 -0
- package/oidc/src/lib/model/jwks/jwks.d.ts +9 -0
- package/oidc/src/lib/model/jwks/jwks.query.d.ts +9 -0
- package/oidc/src/lib/model/oidc/oidcmodel.action.server.d.ts +13 -0
- package/oidc/src/lib/model/oidc/oidcmodel.module.d.ts +5 -1
- package/oidc/src/lib/oidc.config.d.ts +2 -1
- package/oidc/src/lib/oidc.module.d.ts +9 -2
- package/oidc/src/lib/service/oidc.account.service.d.ts +7 -0
- package/oidc/src/lib/service/oidc.adapter.service.d.ts +1 -0
- package/oidc/src/lib/service/oidc.config.service.d.ts +1 -0
- package/oidc/src/lib/service/oidc.encryption.service.d.ts +6 -0
- package/oidc/src/lib/service/oidc.interaction.service.d.ts +15 -0
- package/oidc/src/lib/service/oidc.jwks.service.d.ts +18 -2
- package/oidc/src/lib/service/oidc.service.d.ts +7 -3
- package/package.json +10 -10
- package/src/lib/auth/auth.context.d.ts +1 -0
- package/src/lib/auth/auth.service.d.ts +17 -1
- package/src/lib/auth/auth.service.error.d.ts +46 -0
- package/src/lib/env/env.config.d.ts +2 -0
- package/src/lib/env/env.service.d.ts +21 -7
- package/src/lib/firestore/array.d.ts +1 -0
- package/src/lib/firestore/driver.accessor.batch.d.ts +4 -0
- package/src/lib/firestore/driver.accessor.d.ts +4 -0
- package/src/lib/firestore/driver.accessor.default.d.ts +5 -1
- package/src/lib/firestore/driver.accessor.transaction.d.ts +4 -0
- package/src/lib/firestore/driver.d.ts +2 -0
- package/src/lib/firestore/driver.query.d.ts +4 -0
- package/src/lib/firestore/increment.d.ts +1 -0
- package/src/lib/function/assert.d.ts +7 -0
- package/src/lib/function/context.d.ts +4 -0
- package/src/lib/function/error.auth.d.ts +2 -0
- package/src/lib/function/error.d.ts +86 -11
- package/src/lib/index.d.ts +0 -1
- package/src/lib/nest/analytics/analytics.service.listener.d.ts +2 -0
- package/src/lib/nest/app.d.ts +6 -3
- package/src/lib/nest/auth/auth.module.d.ts +6 -0
- package/src/lib/nest/auth/auth.util.d.ts +19 -1
- package/src/lib/nest/development/development.app.function.d.ts +12 -4
- package/src/lib/nest/development/development.assert.function.d.ts +6 -2
- package/src/lib/nest/development/development.function.d.ts +6 -1
- package/src/lib/nest/development/development.schedule.function.d.ts +3 -1
- package/src/lib/nest/development/development.schedule.function.error.d.ts +8 -0
- package/src/lib/nest/env/env.service.d.ts +2 -0
- package/src/lib/nest/env/env.util.d.ts +6 -0
- package/src/lib/nest/firebase/firebase.module.d.ts +1 -0
- package/src/lib/nest/firestore/firestore.module.d.ts +8 -0
- package/src/lib/nest/function/context.d.ts +2 -0
- package/src/lib/nest/model/analytics.details.d.ts +21 -7
- package/src/lib/nest/model/analytics.emit.d.ts +3 -0
- package/src/lib/nest/model/analytics.handler.d.ts +30 -10
- package/src/lib/nest/model/api.details.d.ts +34 -1
- package/src/lib/nest/model/call.model.function.d.ts +20 -4
- package/src/lib/nest/model/create.model.function.d.ts +6 -1
- package/src/lib/nest/model/crud.assert.function.d.ts +12 -4
- package/src/lib/nest/model/delete.model.function.d.ts +6 -1
- package/src/lib/nest/model/permission.error.d.ts +7 -0
- package/src/lib/nest/model/read.model.function.d.ts +6 -1
- package/src/lib/nest/model/specifier.function.d.ts +3 -0
- package/src/lib/nest/model/update.model.function.d.ts +6 -1
- package/src/lib/nest/nest.provider.d.ts +16 -2
- package/src/lib/nest/storage/storage.module.d.ts +9 -0
- package/src/lib/storage/driver.accessor.d.ts +22 -0
- package/src/lib/storage/driver.d.ts +2 -0
- package/src/lib/storage/storage.d.ts +1 -0
- package/test/package.json +10 -10
- package/zoho/index.cjs.js +8 -6
- package/zoho/index.esm.js +8 -6
- package/zoho/package.json +9 -9
- package/zoho/src/lib/zoho.accounts.firebase.d.ts +2 -1
- package/zoho/src/lib/zoho.accounts.firebase.system.d.ts +2 -1
package/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DBX_FIREBASE_SERVER_NO_AUTH_ERROR_CODE, FIREBASE_AUTH_USER_NOT_FOUND_ERROR, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_LAST_COM_DATE_KEY, FirestoreDocumentContextType, streamFromOnSnapshot, makeFirestoreQueryConstraintFunctionsDriver, FIRESTORE_LIMIT_QUERY_CONSTRAINT_TYPE, FIRESTORE_LIMIT_TO_LAST_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_OFFSET_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AFTER_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_BEFORE_QUERY_CONSTRAINT_TYPE, firestoreContextFactory, firestoreField, optionalFirestoreField, setIdAndKeyFromKeyIdRefOnDocumentData, MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_DEFAULT, SCHEDULED_FUNCTION_DEV_FUNCTION_SPECIFIER, storageListFilesResultFactory, assertStorageUploadOptionsStringFormat, firebaseStorageContextFactory, inContextFirebaseModelsServiceFactory, useFirebaseModelsService } from '@dereekb/firebase';
|
|
1
|
+
import { DBX_FIREBASE_SERVER_NO_AUTH_ERROR_CODE, FIREBASE_AUTH_USER_NOT_FOUND_ERROR, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY, FIREBASE_AUTH_PHONE_NUMBER_ALREADY_EXISTS_ERROR, FIREBASE_AUTH_EMAIL_ALREADY_EXISTS_ERROR, FIREBASE_AUTH_INVALID_PHONE_NUMBER_ERROR, FIREBASE_SERVER_AUTH_CLAIMS_SETUP_LAST_COM_DATE_KEY, FirestoreDocumentContextType, streamFromOnSnapshot, makeFirestoreQueryConstraintFunctionsDriver, FIRESTORE_LIMIT_QUERY_CONSTRAINT_TYPE, FIRESTORE_LIMIT_TO_LAST_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_QUERY_CONSTRAINT_TYPE, FIRESTORE_ORDER_BY_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_QUERY_CONSTRAINT_TYPE, FIRESTORE_WHERE_DOCUMENT_ID_QUERY_CONSTRAINT_TYPE, FIRESTORE_OFFSET_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_START_AFTER_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_AT_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_AT_VALUE_QUERY_CONSTRAINT_TYPE, FIRESTORE_END_BEFORE_QUERY_CONSTRAINT_TYPE, firestoreContextFactory, firestoreField, optionalFirestoreField, setIdAndKeyFromKeyIdRefOnDocumentData, MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_DEFAULT, ScheduledFunctionDevelopmentFunctionTypeEnum, SCHEDULED_FUNCTION_DEV_FUNCTION_SPECIFIER, storageListFilesResultFactory, assertStorageUploadOptionsStringFormat, firebaseStorageContextFactory, inContextFirebaseModelsServiceFactory, useFirebaseModelsService } from '@dereekb/firebase';
|
|
2
2
|
import { partialServerError, isServerError, randomNumberFactory, cachedGetter, filterNullAndUndefinedValues, asSet, AUTH_ADMIN_ROLE, AUTH_TOS_SIGNED_ROLE, forEachKeyValue, KeyValueTypleValueFilter, filterUndefinedValues, isThrottled, mapObjectMap, batch, objectToMap, serverError, asArray, containsAllValues, websiteUrlDetails, mergeObjects, cronExpressionRepeatingEveryNMinutes, mapIdentityFunction, slashPathName, toRelativeSlashPathStartType, fixMultiSlashesInSlashPath, SLASH_PATH_SEPARATOR, objectHasNoKeys, pushItemOrArrayItemsIntoArray, makeGetter, asGetter, build } from '@dereekb/util';
|
|
3
3
|
import { HttpsError } from 'firebase-functions/https';
|
|
4
4
|
import { hoursToMs, toISODateString } from '@dereekb/date';
|
|
@@ -72,6 +72,8 @@ function _type_of$7(obj) {
|
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Creates an unauthenticated {@link HttpsError} indicating the request context has no auth data.
|
|
75
|
+
*
|
|
76
|
+
* @returns A new unauthenticated {@link HttpsError} with the no-auth error code.
|
|
75
77
|
*/ function unauthenticatedContextHasNoAuthData() {
|
|
76
78
|
return unauthenticatedError({
|
|
77
79
|
message: 'expected auth',
|
|
@@ -80,6 +82,8 @@ function _type_of$7(obj) {
|
|
|
80
82
|
}
|
|
81
83
|
/**
|
|
82
84
|
* Creates an unauthenticated {@link HttpsError} indicating the request context has no user UID.
|
|
85
|
+
*
|
|
86
|
+
* @returns A new unauthenticated {@link HttpsError} with the no-auth error code.
|
|
83
87
|
*/ function unauthenticatedContextHasNoUidError() {
|
|
84
88
|
return unauthenticatedError({
|
|
85
89
|
message: 'no user uid',
|
|
@@ -93,9 +97,15 @@ function _type_of$7(obj) {
|
|
|
93
97
|
* Each factory wraps the Firebase `HttpsError` with a consistent shape: an HTTP status code,
|
|
94
98
|
* a string error code, and an optional {@link ServerError} detail object.
|
|
95
99
|
*/ var UNAUTHENTICATED_ERROR_CODE = 'UNAUTHENTICATED';
|
|
96
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Creates an unauthenticated (401) {@link HttpsError}.
|
|
102
|
+
*
|
|
103
|
+
* @param messageOrError - Optional error message string or partial server error object.
|
|
104
|
+
* @returns A new unauthenticated (401) {@link HttpsError}.
|
|
105
|
+
*/ function unauthenticatedError(messageOrError) {
|
|
106
|
+
var _serverError_message;
|
|
97
107
|
var serverError = partialServerError(messageOrError);
|
|
98
|
-
return new HttpsError('unauthenticated', (serverError
|
|
108
|
+
return new HttpsError('unauthenticated', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'unauthenticated', _object_spread_props$c(_object_spread$g({
|
|
99
109
|
status: 401,
|
|
100
110
|
code: UNAUTHENTICATED_ERROR_CODE
|
|
101
111
|
}, serverError), {
|
|
@@ -103,9 +113,15 @@ function _type_of$7(obj) {
|
|
|
103
113
|
}));
|
|
104
114
|
}
|
|
105
115
|
var FORBIDDEN_ERROR_CODE = 'FORBIDDEN';
|
|
106
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* Creates a forbidden (403) {@link HttpsError}.
|
|
118
|
+
*
|
|
119
|
+
* @param messageOrError - Optional error message string or partial server error object.
|
|
120
|
+
* @returns A new forbidden (403) {@link HttpsError}.
|
|
121
|
+
*/ function forbiddenError(messageOrError) {
|
|
122
|
+
var _serverError_message;
|
|
107
123
|
var serverError = partialServerError(messageOrError);
|
|
108
|
-
return new HttpsError('permission-denied', (serverError
|
|
124
|
+
return new HttpsError('permission-denied', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'forbidden', _object_spread_props$c(_object_spread$g({
|
|
109
125
|
status: 403,
|
|
110
126
|
code: FORBIDDEN_ERROR_CODE
|
|
111
127
|
}, serverError), {
|
|
@@ -113,9 +129,15 @@ var FORBIDDEN_ERROR_CODE = 'FORBIDDEN';
|
|
|
113
129
|
}));
|
|
114
130
|
}
|
|
115
131
|
var PERMISSION_DENIED_ERROR_CODE = 'PERMISSION_DENIED';
|
|
116
|
-
/**
|
|
132
|
+
/**
|
|
133
|
+
* Creates a permission-denied (403) {@link HttpsError}.
|
|
134
|
+
*
|
|
135
|
+
* @param messageOrError - Optional error message string or partial server error object.
|
|
136
|
+
* @returns A new permission-denied (403) {@link HttpsError}.
|
|
137
|
+
*/ function permissionDeniedError(messageOrError) {
|
|
138
|
+
var _serverError_message;
|
|
117
139
|
var serverError = partialServerError(messageOrError);
|
|
118
|
-
return new HttpsError('permission-denied', (serverError
|
|
140
|
+
return new HttpsError('permission-denied', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'permission denied', _object_spread_props$c(_object_spread$g({
|
|
119
141
|
status: 403,
|
|
120
142
|
code: PERMISSION_DENIED_ERROR_CODE
|
|
121
143
|
}, serverError), {
|
|
@@ -123,9 +145,15 @@ var PERMISSION_DENIED_ERROR_CODE = 'PERMISSION_DENIED';
|
|
|
123
145
|
}));
|
|
124
146
|
}
|
|
125
147
|
var NOT_FOUND_ERROR_CODE = 'NOT_FOUND';
|
|
126
|
-
/**
|
|
148
|
+
/**
|
|
149
|
+
* Creates a not-found (404) {@link HttpsError}.
|
|
150
|
+
*
|
|
151
|
+
* @param messageOrError - Optional error message string or partial server error object.
|
|
152
|
+
* @returns A new not-found (404) {@link HttpsError}.
|
|
153
|
+
*/ function notFoundError(messageOrError) {
|
|
154
|
+
var _serverError_message;
|
|
127
155
|
var serverError = partialServerError(messageOrError);
|
|
128
|
-
return new HttpsError('not-found', (serverError
|
|
156
|
+
return new HttpsError('not-found', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'not found', _object_spread_props$c(_object_spread$g({
|
|
129
157
|
status: 404,
|
|
130
158
|
code: NOT_FOUND_ERROR_CODE
|
|
131
159
|
}, serverError), {
|
|
@@ -133,9 +161,15 @@ var NOT_FOUND_ERROR_CODE = 'NOT_FOUND';
|
|
|
133
161
|
}));
|
|
134
162
|
}
|
|
135
163
|
var MODEL_NOT_AVAILABLE_ERROR_CODE = 'MODEL_NOT_AVAILABLE';
|
|
136
|
-
/**
|
|
164
|
+
/**
|
|
165
|
+
* Creates a model-not-available (404) {@link HttpsError}, used when a Firestore document does not exist.
|
|
166
|
+
*
|
|
167
|
+
* @param messageOrError - Optional error message string or partial server error object.
|
|
168
|
+
* @returns A new model-not-available (404) {@link HttpsError}.
|
|
169
|
+
*/ function modelNotAvailableError(messageOrError) {
|
|
170
|
+
var _serverError_message;
|
|
137
171
|
var serverError = partialServerError(messageOrError);
|
|
138
|
-
return new HttpsError('not-found', (serverError
|
|
172
|
+
return new HttpsError('not-found', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'model was not available', _object_spread_props$c(_object_spread$g({
|
|
139
173
|
status: 404,
|
|
140
174
|
code: MODEL_NOT_AVAILABLE_ERROR_CODE
|
|
141
175
|
}, serverError), {
|
|
@@ -143,9 +177,15 @@ var MODEL_NOT_AVAILABLE_ERROR_CODE = 'MODEL_NOT_AVAILABLE';
|
|
|
143
177
|
}));
|
|
144
178
|
}
|
|
145
179
|
var BAD_REQUEST_ERROR_CODE = 'BAD_REQUEST';
|
|
146
|
-
/**
|
|
180
|
+
/**
|
|
181
|
+
* Creates a bad-request (400) {@link HttpsError}.
|
|
182
|
+
*
|
|
183
|
+
* @param messageOrError - Optional error message string or partial server error object.
|
|
184
|
+
* @returns A new bad-request (400) {@link HttpsError}.
|
|
185
|
+
*/ function badRequestError(messageOrError) {
|
|
186
|
+
var _serverError_message;
|
|
147
187
|
var serverError = partialServerError(messageOrError);
|
|
148
|
-
return new HttpsError('invalid-argument', (serverError
|
|
188
|
+
return new HttpsError('invalid-argument', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'bad request', _object_spread_props$c(_object_spread$g({
|
|
149
189
|
status: 400,
|
|
150
190
|
code: BAD_REQUEST_ERROR_CODE
|
|
151
191
|
}, serverError), {
|
|
@@ -153,9 +193,15 @@ var BAD_REQUEST_ERROR_CODE = 'BAD_REQUEST';
|
|
|
153
193
|
}));
|
|
154
194
|
}
|
|
155
195
|
var CONFLICT_ERROR_CODE = 'CONFLICT';
|
|
156
|
-
/**
|
|
196
|
+
/**
|
|
197
|
+
* Creates a precondition-conflict (409) {@link HttpsError}.
|
|
198
|
+
*
|
|
199
|
+
* @param messageOrError - Optional error message string or partial server error object.
|
|
200
|
+
* @returns A new precondition-conflict (409) {@link HttpsError}.
|
|
201
|
+
*/ function preconditionConflictError(messageOrError) {
|
|
202
|
+
var _serverError_message;
|
|
157
203
|
var serverError = partialServerError(messageOrError);
|
|
158
|
-
return new HttpsError('failed-precondition', (serverError
|
|
204
|
+
return new HttpsError('failed-precondition', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'conflict', _object_spread_props$c(_object_spread$g({
|
|
159
205
|
status: 409,
|
|
160
206
|
code: CONFLICT_ERROR_CODE
|
|
161
207
|
}, serverError), {
|
|
@@ -163,9 +209,15 @@ var CONFLICT_ERROR_CODE = 'CONFLICT';
|
|
|
163
209
|
}));
|
|
164
210
|
}
|
|
165
211
|
var ALREADY_EXISTS_ERROR_CODE = 'ALREADY_EXISTS';
|
|
166
|
-
/**
|
|
212
|
+
/**
|
|
213
|
+
* Creates an already-exists (409) {@link HttpsError}.
|
|
214
|
+
*
|
|
215
|
+
* @param messageOrError - Optional error message string or partial server error object.
|
|
216
|
+
* @returns A new already-exists (409) {@link HttpsError}.
|
|
217
|
+
*/ function alreadyExistsError(messageOrError) {
|
|
218
|
+
var _serverError_message;
|
|
167
219
|
var serverError = partialServerError(messageOrError);
|
|
168
|
-
return new HttpsError('already-exists', (serverError
|
|
220
|
+
return new HttpsError('already-exists', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'already exists', _object_spread_props$c(_object_spread$g({
|
|
169
221
|
status: 409,
|
|
170
222
|
code: ALREADY_EXISTS_ERROR_CODE
|
|
171
223
|
}, serverError), {
|
|
@@ -173,9 +225,15 @@ var ALREADY_EXISTS_ERROR_CODE = 'ALREADY_EXISTS';
|
|
|
173
225
|
}));
|
|
174
226
|
}
|
|
175
227
|
var UNAVAILABLE_ERROR_CODE = 'UNAVAILABLE';
|
|
176
|
-
/**
|
|
228
|
+
/**
|
|
229
|
+
* Creates an unavailable (503) {@link HttpsError}.
|
|
230
|
+
*
|
|
231
|
+
* @param messageOrError - Optional error message string or partial server error object.
|
|
232
|
+
* @returns A new unavailable (503) {@link HttpsError}.
|
|
233
|
+
*/ function unavailableError(messageOrError) {
|
|
234
|
+
var _serverError_message;
|
|
177
235
|
var serverError = partialServerError(messageOrError);
|
|
178
|
-
return new HttpsError('unavailable', (serverError
|
|
236
|
+
return new HttpsError('unavailable', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'service unavailable', _object_spread_props$c(_object_spread$g({
|
|
179
237
|
status: 503,
|
|
180
238
|
code: UNAVAILABLE_ERROR_CODE
|
|
181
239
|
}, serverError), {
|
|
@@ -183,9 +241,15 @@ var UNAVAILABLE_ERROR_CODE = 'UNAVAILABLE';
|
|
|
183
241
|
}));
|
|
184
242
|
}
|
|
185
243
|
var UNAVAILABLE_OR_DEACTIVATED_FUNCTION_ERROR_CODE = 'UNAVAILABLE_OR_DEACTIVATED_FUNCTION';
|
|
186
|
-
/**
|
|
244
|
+
/**
|
|
245
|
+
* Creates an unimplemented (501) {@link HttpsError} for deactivated or unavailable functions.
|
|
246
|
+
*
|
|
247
|
+
* @param messageOrError - Optional error message string or partial server error object.
|
|
248
|
+
* @returns A new unimplemented (501) {@link HttpsError}.
|
|
249
|
+
*/ function unavailableOrDeactivatedFunctionError(messageOrError) {
|
|
250
|
+
var _serverError_message;
|
|
187
251
|
var serverError = partialServerError(messageOrError);
|
|
188
|
-
return new HttpsError('unimplemented', (serverError
|
|
252
|
+
return new HttpsError('unimplemented', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'the requested function is not available or has been deactivated for use', _object_spread_props$c(_object_spread$g({
|
|
189
253
|
status: 501,
|
|
190
254
|
code: UNAVAILABLE_OR_DEACTIVATED_FUNCTION_ERROR_CODE
|
|
191
255
|
}, serverError), {
|
|
@@ -193,9 +257,15 @@ var UNAVAILABLE_OR_DEACTIVATED_FUNCTION_ERROR_CODE = 'UNAVAILABLE_OR_DEACTIVATED
|
|
|
193
257
|
}));
|
|
194
258
|
}
|
|
195
259
|
var INTERNAL_SERVER_ERROR_CODE = 'INTERNAL_ERROR';
|
|
196
|
-
/**
|
|
260
|
+
/**
|
|
261
|
+
* Creates an internal-error (500) {@link HttpsError}.
|
|
262
|
+
*
|
|
263
|
+
* @param messageOrError - Optional error message string or partial server error object.
|
|
264
|
+
* @returns A new internal-error (500) {@link HttpsError}.
|
|
265
|
+
*/ function internalServerError(messageOrError) {
|
|
266
|
+
var _serverError_message;
|
|
197
267
|
var serverError = partialServerError(messageOrError);
|
|
198
|
-
return new HttpsError('internal', (serverError
|
|
268
|
+
return new HttpsError('internal', (_serverError_message = serverError.message) !== null && _serverError_message !== void 0 ? _serverError_message : 'internal error', _object_spread_props$c(_object_spread$g({
|
|
199
269
|
status: 500,
|
|
200
270
|
code: INTERNAL_SERVER_ERROR_CODE
|
|
201
271
|
}, serverError), {
|
|
@@ -204,13 +274,19 @@ var INTERNAL_SERVER_ERROR_CODE = 'INTERNAL_ERROR';
|
|
|
204
274
|
}
|
|
205
275
|
/**
|
|
206
276
|
* Type guard for Firebase {@link HttpsError} instances.
|
|
277
|
+
*
|
|
278
|
+
* @param input - The value to check.
|
|
279
|
+
* @returns `true` if the input is a Firebase {@link HttpsError}.
|
|
207
280
|
*/ function isFirebaseHttpsError(input) {
|
|
208
|
-
return (typeof input === "undefined" ? "undefined" : _type_of$7(input)) === 'object' && input
|
|
281
|
+
return (typeof input === "undefined" ? "undefined" : _type_of$7(input)) === 'object' && input != null && 'code' in input && 'httpErrorCode' in input && 'toJSON' in input;
|
|
209
282
|
}
|
|
210
283
|
/**
|
|
211
284
|
* Type guard for Firebase Admin {@link admin.FirebaseError} instances.
|
|
285
|
+
*
|
|
286
|
+
* @param input - The value to check.
|
|
287
|
+
* @returns `true` if the input is a Firebase Admin {@link admin.FirebaseError}.
|
|
212
288
|
*/ function isFirebaseError(input) {
|
|
213
|
-
return (typeof input === "undefined" ? "undefined" : _type_of$7(input)) === 'object' && input
|
|
289
|
+
return (typeof input === "undefined" ? "undefined" : _type_of$7(input)) === 'object' && input != null && 'code' in input && 'message' in input && 'toJSON' in input;
|
|
214
290
|
}
|
|
215
291
|
/**
|
|
216
292
|
* Analyzes a caught error and extracts structured Firebase error information.
|
|
@@ -219,6 +295,7 @@ var INTERNAL_SERVER_ERROR_CODE = 'INTERNAL_ERROR';
|
|
|
219
295
|
* and extracts any embedded error codes and {@link ServerError} details.
|
|
220
296
|
*
|
|
221
297
|
* @param e - The caught error to analyze.
|
|
298
|
+
* @returns Structured {@link FirebaseServerErrorInfo} with classified error details.
|
|
222
299
|
*
|
|
223
300
|
* @example
|
|
224
301
|
* ```typescript
|
|
@@ -263,6 +340,9 @@ var INTERNAL_SERVER_ERROR_CODE = 'INTERNAL_ERROR';
|
|
|
263
340
|
}
|
|
264
341
|
/**
|
|
265
342
|
* Returns a tuple of [firebaseErrorCode, errorInfo] for pattern-matching on Firebase error codes.
|
|
343
|
+
*
|
|
344
|
+
* @param e - The caught error to analyze.
|
|
345
|
+
* @returns A tuple of the Firebase error code (if present) and the full error info.
|
|
266
346
|
*/ function firebaseServerErrorInfoCodePair(e) {
|
|
267
347
|
var info = firebaseServerErrorInfo(e);
|
|
268
348
|
return [
|
|
@@ -272,6 +352,9 @@ var INTERNAL_SERVER_ERROR_CODE = 'INTERNAL_ERROR';
|
|
|
272
352
|
}
|
|
273
353
|
/**
|
|
274
354
|
* Returns a tuple of [serverError, errorInfo] for pattern-matching on embedded server error details.
|
|
355
|
+
*
|
|
356
|
+
* @param e - The caught error to analyze.
|
|
357
|
+
* @returns A tuple of the server error (if present) and the full error info.
|
|
275
358
|
*/ function firebaseServerErrorInfoServerErrorPair(e) {
|
|
276
359
|
var info = firebaseServerErrorInfo(e);
|
|
277
360
|
return [
|
|
@@ -281,6 +364,9 @@ var INTERNAL_SERVER_ERROR_CODE = 'INTERNAL_ERROR';
|
|
|
281
364
|
}
|
|
282
365
|
/**
|
|
283
366
|
* Returns a tuple of [serverErrorCode, errorInfo] for pattern-matching on server error string codes.
|
|
367
|
+
*
|
|
368
|
+
* @param e - The caught error to analyze.
|
|
369
|
+
* @returns A tuple of the server error code (if present) and the full error info.
|
|
284
370
|
*/ function firebaseServerErrorInfoServerErrorCodePair(e) {
|
|
285
371
|
var info = firebaseServerErrorInfo(e);
|
|
286
372
|
return [
|
|
@@ -305,6 +391,9 @@ var INTERNAL_SERVER_ERROR_CODE = 'INTERNAL_ERROR';
|
|
|
305
391
|
/**
|
|
306
392
|
* Type guard that checks whether the given callable context contains authenticated user data (non-null auth with a uid).
|
|
307
393
|
*
|
|
394
|
+
* @param context - The callable context to check.
|
|
395
|
+
* @returns `true` if the context has authenticated user data with a valid UID.
|
|
396
|
+
*
|
|
308
397
|
* @example
|
|
309
398
|
* ```typescript
|
|
310
399
|
* if (isContextWithAuthData(context)) {
|
|
@@ -313,11 +402,12 @@ var INTERNAL_SERVER_ERROR_CODE = 'INTERNAL_ERROR';
|
|
|
313
402
|
* ```
|
|
314
403
|
*/ function isContextWithAuthData(context) {
|
|
315
404
|
var _context_auth;
|
|
316
|
-
return Boolean(
|
|
405
|
+
return Boolean((_context_auth = context.auth) === null || _context_auth === void 0 ? void 0 : _context_auth.uid);
|
|
317
406
|
}
|
|
318
407
|
/**
|
|
319
408
|
* Asserts that the callable context contains authenticated user data.
|
|
320
409
|
*
|
|
410
|
+
* @param context - The callable context to assert on.
|
|
321
411
|
* @throws {HttpsError} Throws an unauthenticated error if auth data is missing.
|
|
322
412
|
*
|
|
323
413
|
* @example
|
|
@@ -338,6 +428,7 @@ var INTERNAL_SERVER_ERROR_CODE = 'INTERNAL_ERROR';
|
|
|
338
428
|
* including email, phone, and sign-in timestamps.
|
|
339
429
|
*
|
|
340
430
|
* @param token - The decoded ID token from Firebase Admin Auth.
|
|
431
|
+
* @returns A normalized {@link FirebaseAuthToken} with camelCase fields.
|
|
341
432
|
*
|
|
342
433
|
* @example
|
|
343
434
|
* ```typescript
|
|
@@ -521,7 +612,7 @@ function _ts_generator$c(thisArg, body) {
|
|
|
521
612
|
];
|
|
522
613
|
case 2:
|
|
523
614
|
error = _state.sent();
|
|
524
|
-
if (
|
|
615
|
+
if (error.code === FIREBASE_AUTH_USER_NOT_FOUND_ERROR) {
|
|
525
616
|
return [
|
|
526
617
|
2,
|
|
527
618
|
undefined
|
|
@@ -610,6 +701,63 @@ function _is_native_reflect_construct$5() {
|
|
|
610
701
|
return !!result;
|
|
611
702
|
})();
|
|
612
703
|
}
|
|
704
|
+
/**
|
|
705
|
+
* Thrown by {@link AbstractFirebaseServerNewUserService.createNewUser} when Firebase Auth rejects
|
|
706
|
+
* user creation because the provided phone number or email is already associated with another account.
|
|
707
|
+
*
|
|
708
|
+
* @example
|
|
709
|
+
* ```typescript
|
|
710
|
+
* try {
|
|
711
|
+
* await newUserService.initializeNewUser({ email, phone });
|
|
712
|
+
* } catch (e) {
|
|
713
|
+
* if (e instanceof FirebaseServerAuthUserExistsError && e.identifierType === 'phone') {
|
|
714
|
+
* const existingUser = await auth.getUserByPhoneNumber(e.identifierValue);
|
|
715
|
+
* }
|
|
716
|
+
* }
|
|
717
|
+
* ```
|
|
718
|
+
*/ var FirebaseServerAuthUserExistsError = /*#__PURE__*/ function(BaseError) {
|
|
719
|
+
_inherits$5(FirebaseServerAuthUserExistsError, BaseError);
|
|
720
|
+
function FirebaseServerAuthUserExistsError(code, identifierType, identifierValue) {
|
|
721
|
+
_class_call_check$o(this, FirebaseServerAuthUserExistsError);
|
|
722
|
+
var _this;
|
|
723
|
+
_this = _call_super$5(this, FirebaseServerAuthUserExistsError, [
|
|
724
|
+
"A user with the provided ".concat(identifierType, " already exists.")
|
|
725
|
+
]), _define_property$s(_this, "code", void 0), _define_property$s(_this, "identifierType", void 0), _define_property$s(_this, "identifierValue", void 0);
|
|
726
|
+
_this.code = code;
|
|
727
|
+
_this.identifierType = identifierType;
|
|
728
|
+
_this.identifierValue = identifierValue;
|
|
729
|
+
return _this;
|
|
730
|
+
}
|
|
731
|
+
return FirebaseServerAuthUserExistsError;
|
|
732
|
+
}(BaseError);
|
|
733
|
+
/**
|
|
734
|
+
* Thrown by {@link AbstractFirebaseServerNewUserService.createNewUser} when Firebase Auth rejects
|
|
735
|
+
* user creation due to invalid input (e.g., a malformed phone number).
|
|
736
|
+
*
|
|
737
|
+
* @example
|
|
738
|
+
* ```typescript
|
|
739
|
+
* try {
|
|
740
|
+
* await newUserService.initializeNewUser({ email, phone: 'not-e164' });
|
|
741
|
+
* } catch (e) {
|
|
742
|
+
* if (e instanceof FirebaseServerAuthUserBadInputError) {
|
|
743
|
+
* console.log(`Bad input (${e.code}): ${e.inputValue}`);
|
|
744
|
+
* }
|
|
745
|
+
* }
|
|
746
|
+
* ```
|
|
747
|
+
*/ var FirebaseServerAuthUserBadInputError = /*#__PURE__*/ function(BaseError) {
|
|
748
|
+
_inherits$5(FirebaseServerAuthUserBadInputError, BaseError);
|
|
749
|
+
function FirebaseServerAuthUserBadInputError(code, inputValue, message) {
|
|
750
|
+
_class_call_check$o(this, FirebaseServerAuthUserBadInputError);
|
|
751
|
+
var _this;
|
|
752
|
+
_this = _call_super$5(this, FirebaseServerAuthUserBadInputError, [
|
|
753
|
+
message !== null && message !== void 0 ? message : "Invalid input for user creation: ".concat(inputValue)
|
|
754
|
+
]), _define_property$s(_this, "code", void 0), _define_property$s(_this, "inputValue", void 0);
|
|
755
|
+
_this.code = code;
|
|
756
|
+
_this.inputValue = inputValue;
|
|
757
|
+
return _this;
|
|
758
|
+
}
|
|
759
|
+
return FirebaseServerAuthUserBadInputError;
|
|
760
|
+
}(BaseError);
|
|
613
761
|
/**
|
|
614
762
|
* Thrown by sendSetupDetails() if the user has no setup configuration available, meaning they probably already have accepted their invite or is in an invalid state.
|
|
615
763
|
*/ var FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError = /*#__PURE__*/ function(BaseError) {
|
|
@@ -660,6 +808,9 @@ function _array_like_to_array$a(arr, len) {
|
|
|
660
808
|
function _array_with_holes$3(arr) {
|
|
661
809
|
if (Array.isArray(arr)) return arr;
|
|
662
810
|
}
|
|
811
|
+
function _array_without_holes$7(arr) {
|
|
812
|
+
if (Array.isArray(arr)) return _array_like_to_array$a(arr);
|
|
813
|
+
}
|
|
663
814
|
function _assert_this_initialized$4(self) {
|
|
664
815
|
if (self === void 0) {
|
|
665
816
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
@@ -749,6 +900,9 @@ function _inherits$4(subClass, superClass) {
|
|
|
749
900
|
});
|
|
750
901
|
if (superClass) _set_prototype_of$4(subClass, superClass);
|
|
751
902
|
}
|
|
903
|
+
function _iterable_to_array$7(iter) {
|
|
904
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
905
|
+
}
|
|
752
906
|
function _iterable_to_array_limit$3(arr, i) {
|
|
753
907
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
754
908
|
if (_i == null) return;
|
|
@@ -776,6 +930,9 @@ function _iterable_to_array_limit$3(arr, i) {
|
|
|
776
930
|
function _non_iterable_rest$3() {
|
|
777
931
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
778
932
|
}
|
|
933
|
+
function _non_iterable_spread$7() {
|
|
934
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
935
|
+
}
|
|
779
936
|
function _object_spread$f(target) {
|
|
780
937
|
for(var i = 1; i < arguments.length; i++){
|
|
781
938
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
@@ -807,6 +964,9 @@ function _set_prototype_of$4(o, p) {
|
|
|
807
964
|
function _sliced_to_array$3(arr, i) {
|
|
808
965
|
return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$a(arr, i) || _non_iterable_rest$3();
|
|
809
966
|
}
|
|
967
|
+
function _to_consumable_array$7(arr) {
|
|
968
|
+
return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$7();
|
|
969
|
+
}
|
|
810
970
|
function _type_of$5(obj) {
|
|
811
971
|
"@swc/helpers - typeof";
|
|
812
972
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
@@ -1014,6 +1174,8 @@ function _ts_generator$b(thisArg, body) {
|
|
|
1014
1174
|
{
|
|
1015
1175
|
/**
|
|
1016
1176
|
* Generates a random numeric string for use as a temporary reset password.
|
|
1177
|
+
*
|
|
1178
|
+
* @returns A random numeric string suitable as a temporary password.
|
|
1017
1179
|
*/ key: "_generateResetPasswordKey",
|
|
1018
1180
|
value: function _generateResetPasswordKey() {
|
|
1019
1181
|
return String(DEFAULT_FIREBASE_PASSWORD_NUMBER_GENERATOR());
|
|
@@ -1194,6 +1356,7 @@ function _ts_generator$b(thisArg, body) {
|
|
|
1194
1356
|
*
|
|
1195
1357
|
* @param roles - The complete set of roles to assign.
|
|
1196
1358
|
* @param claimsToRetain - Additional claims to merge in alongside the role-derived claims.
|
|
1359
|
+
* @returns Resolves when the claims have been replaced.
|
|
1197
1360
|
*
|
|
1198
1361
|
* @example
|
|
1199
1362
|
* ```typescript
|
|
@@ -1204,7 +1367,7 @@ function _ts_generator$b(thisArg, body) {
|
|
|
1204
1367
|
return _async_to_generator$b(function() {
|
|
1205
1368
|
var claims;
|
|
1206
1369
|
return _ts_generator$b(this, function(_state) {
|
|
1207
|
-
claims = _object_spread$f({}, claimsToRetain, this._claimsForRolesChange(
|
|
1370
|
+
claims = _object_spread$f({}, claimsToRetain, this._claimsForRolesChange(_to_consumable_array$7(roles)));
|
|
1208
1371
|
return [
|
|
1209
1372
|
2,
|
|
1210
1373
|
this.setClaims(claims)
|
|
@@ -1217,6 +1380,9 @@ function _ts_generator$b(thisArg, body) {
|
|
|
1217
1380
|
/**
|
|
1218
1381
|
* Converts roles to their corresponding claim keys, filtering out null/undefined entries
|
|
1219
1382
|
* that represent unrelated claims in the service's {@link FirebaseServerAuthService.claimsForRoles} output.
|
|
1383
|
+
*
|
|
1384
|
+
* @param roles - The roles to convert to claims.
|
|
1385
|
+
* @returns Filtered claims object with only the relevant role-based entries.
|
|
1220
1386
|
*/ key: "_claimsForRolesChange",
|
|
1221
1387
|
value: function _claimsForRolesChange(roles) {
|
|
1222
1388
|
return filterNullAndUndefinedValues(this.service.claimsForRoles(asSet(roles)));
|
|
@@ -1245,12 +1411,8 @@ function _ts_generator$b(thisArg, body) {
|
|
|
1245
1411
|
];
|
|
1246
1412
|
case 1:
|
|
1247
1413
|
currentClaims = _state.sent();
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
newClaims = filterNullAndUndefinedValues(newClaims);
|
|
1251
|
-
} else {
|
|
1252
|
-
newClaims = claims;
|
|
1253
|
-
}
|
|
1414
|
+
newClaims = _object_spread$f({}, currentClaims, filterUndefinedValues(claims, false));
|
|
1415
|
+
newClaims = filterNullAndUndefinedValues(newClaims);
|
|
1254
1416
|
return [
|
|
1255
1417
|
2,
|
|
1256
1418
|
this.setClaims(newClaims)
|
|
@@ -1379,6 +1541,7 @@ function _ts_generator$b(thisArg, body) {
|
|
|
1379
1541
|
*
|
|
1380
1542
|
* @param authService - The auth service to create a context from if needed.
|
|
1381
1543
|
* @param userContextOrUid - A user context or UID string.
|
|
1544
|
+
* @returns The resolved user context instance.
|
|
1382
1545
|
*
|
|
1383
1546
|
* @example
|
|
1384
1547
|
* ```typescript
|
|
@@ -1562,6 +1725,7 @@ function _ts_generator$b(thisArg, body) {
|
|
|
1562
1725
|
3,
|
|
1563
1726
|
7
|
|
1564
1727
|
];
|
|
1728
|
+
// Cast to string | undefined because claims are cast from raw custom claims which may not have this field at runtime
|
|
1565
1729
|
setupCommunicationAt = setupDetails.claims.setupCommunicationAt;
|
|
1566
1730
|
hasSentCommunication = Boolean(setupCommunicationAt);
|
|
1567
1731
|
if (!((config === null || config === void 0 ? void 0 : config.sendSetupDetailsOnce) && hasSentCommunication)) return [
|
|
@@ -1569,7 +1733,7 @@ function _ts_generator$b(thisArg, body) {
|
|
|
1569
1733
|
2
|
|
1570
1734
|
];
|
|
1571
1735
|
// do not send.
|
|
1572
|
-
if (config
|
|
1736
|
+
if (config.throwErrors) {
|
|
1573
1737
|
throw new FirebaseServerAuthNewUserSendSetupDetailsSendOnceError();
|
|
1574
1738
|
}
|
|
1575
1739
|
return [
|
|
@@ -1699,6 +1863,8 @@ function _ts_generator$b(thisArg, body) {
|
|
|
1699
1863
|
key: "updateSetupContentSentTime",
|
|
1700
1864
|
value: /**
|
|
1701
1865
|
* Records the current timestamp as the last setup content communication date in the user's claims.
|
|
1866
|
+
*
|
|
1867
|
+
* @param details - The user's setup details containing the user context.
|
|
1702
1868
|
*/ function updateSetupContentSentTime(details) {
|
|
1703
1869
|
return _async_to_generator$b(function() {
|
|
1704
1870
|
var setupCommunicationAt;
|
|
@@ -1765,15 +1931,25 @@ function _ts_generator$b(thisArg, body) {
|
|
|
1765
1931
|
*
|
|
1766
1932
|
* Generates a random setup password if none is provided. Override to customize user creation behavior.
|
|
1767
1933
|
*
|
|
1934
|
+
* @param input - The initialization configuration for the new user.
|
|
1935
|
+
* @returns The created user record and the setup password used.
|
|
1768
1936
|
* @throws Throws if the Firebase Admin SDK rejects the user creation.
|
|
1769
1937
|
*/ function createNewUser(input) {
|
|
1770
1938
|
return _async_to_generator$b(function() {
|
|
1771
|
-
var uid, displayName, email, phoneNumber, inputPassword, password, user;
|
|
1939
|
+
var uid, displayName, email, phoneNumber, inputPassword, password, user, e, firebaseError, errorCode;
|
|
1772
1940
|
return _ts_generator$b(this, function(_state) {
|
|
1773
1941
|
switch(_state.label){
|
|
1774
1942
|
case 0:
|
|
1775
1943
|
uid = input.uid, displayName = input.displayName, email = input.email, phoneNumber = input.phone, inputPassword = input.setupPassword;
|
|
1776
1944
|
password = inputPassword !== null && inputPassword !== void 0 ? inputPassword : this.generateRandomSetupPassword();
|
|
1945
|
+
_state.label = 1;
|
|
1946
|
+
case 1:
|
|
1947
|
+
_state.trys.push([
|
|
1948
|
+
1,
|
|
1949
|
+
3,
|
|
1950
|
+
,
|
|
1951
|
+
4
|
|
1952
|
+
]);
|
|
1777
1953
|
return [
|
|
1778
1954
|
4,
|
|
1779
1955
|
this.authService.auth.createUser({
|
|
@@ -1784,8 +1960,25 @@ function _ts_generator$b(thisArg, body) {
|
|
|
1784
1960
|
password: password
|
|
1785
1961
|
})
|
|
1786
1962
|
];
|
|
1787
|
-
case
|
|
1963
|
+
case 2:
|
|
1788
1964
|
user = _state.sent();
|
|
1965
|
+
return [
|
|
1966
|
+
3,
|
|
1967
|
+
4
|
|
1968
|
+
];
|
|
1969
|
+
case 3:
|
|
1970
|
+
e = _state.sent();
|
|
1971
|
+
firebaseError = e;
|
|
1972
|
+
errorCode = firebaseError.code;
|
|
1973
|
+
if (errorCode === FIREBASE_AUTH_PHONE_NUMBER_ALREADY_EXISTS_ERROR && phoneNumber) {
|
|
1974
|
+
throw new FirebaseServerAuthUserExistsError(errorCode, 'phone', phoneNumber);
|
|
1975
|
+
} else if (errorCode === FIREBASE_AUTH_EMAIL_ALREADY_EXISTS_ERROR && email) {
|
|
1976
|
+
throw new FirebaseServerAuthUserExistsError(errorCode, 'email', email);
|
|
1977
|
+
} else if (errorCode === FIREBASE_AUTH_INVALID_PHONE_NUMBER_ERROR && phoneNumber) {
|
|
1978
|
+
throw new FirebaseServerAuthUserBadInputError(errorCode, phoneNumber);
|
|
1979
|
+
}
|
|
1980
|
+
throw e;
|
|
1981
|
+
case 4:
|
|
1789
1982
|
return [
|
|
1790
1983
|
2,
|
|
1791
1984
|
{
|
|
@@ -1808,6 +2001,8 @@ function _ts_generator$b(thisArg, body) {
|
|
|
1808
2001
|
key: "updateClaimsToClearUser",
|
|
1809
2002
|
value: /**
|
|
1810
2003
|
* Clears setup-related claims (setup password and last communication date) from the user.
|
|
2004
|
+
*
|
|
2005
|
+
* @param userContext - The user context to clear setup claims from.
|
|
1811
2006
|
*/ function updateClaimsToClearUser(userContext) {
|
|
1812
2007
|
return _async_to_generator$b(function() {
|
|
1813
2008
|
var _obj;
|
|
@@ -2013,6 +2208,7 @@ function _ts_generator$b(thisArg, body) {
|
|
|
2013
2208
|
* Creates a NestJS provider that binds the given config to the {@link FIREBASE_SERVER_ENV_TOKEN} injection token.
|
|
2014
2209
|
*
|
|
2015
2210
|
* @param env - The Firebase server environment configuration.
|
|
2211
|
+
* @returns A NestJS provider binding the config to the {@link FIREBASE_SERVER_ENV_TOKEN} token.
|
|
2016
2212
|
*
|
|
2017
2213
|
* @example
|
|
2018
2214
|
* ```typescript
|
|
@@ -2031,6 +2227,7 @@ function _ts_generator$b(thisArg, body) {
|
|
|
2031
2227
|
* Use this when the NestJS app needs the config accessible via either token.
|
|
2032
2228
|
*
|
|
2033
2229
|
* @param env - The Firebase server environment configuration.
|
|
2230
|
+
* @returns An array of providers binding the config to both Firebase and base server env tokens.
|
|
2034
2231
|
*
|
|
2035
2232
|
* @example
|
|
2036
2233
|
* ```typescript
|
|
@@ -2072,6 +2269,7 @@ function _class_call_check$m(instance, Constructor) {
|
|
|
2072
2269
|
* Each field in the input maps to an atomic increment operation. Null/undefined values default to 0.
|
|
2073
2270
|
*
|
|
2074
2271
|
* @param input - The increment specification mapping field names to numeric deltas.
|
|
2272
|
+
* @returns Firestore {@link UpdateData} with atomic increment operations.
|
|
2075
2273
|
*
|
|
2076
2274
|
* @example
|
|
2077
2275
|
* ```typescript
|
|
@@ -2144,6 +2342,7 @@ function _unsupported_iterable_to_array$9(o, minLen) {
|
|
|
2144
2342
|
* Google Cloud Firestore's {@link FieldValue.arrayUnion} and {@link FieldValue.arrayRemove}.
|
|
2145
2343
|
*
|
|
2146
2344
|
* @param input - The array update specification with `union` and/or `remove` field maps.
|
|
2345
|
+
* @returns Firestore {@link UpdateData} with array union/remove operations.
|
|
2147
2346
|
*
|
|
2148
2347
|
* @example
|
|
2149
2348
|
* ```typescript
|
|
@@ -2153,8 +2352,8 @@ function _unsupported_iterable_to_array$9(o, minLen) {
|
|
|
2153
2352
|
* });
|
|
2154
2353
|
* ```
|
|
2155
2354
|
*/ function firestoreServerArrayUpdateToUpdateData(input) {
|
|
2156
|
-
var union = input
|
|
2157
|
-
var remove = input
|
|
2355
|
+
var union = input.union;
|
|
2356
|
+
var remove = input.remove;
|
|
2158
2357
|
function createUpdatesWithArrayFunction(fieldUpdate, arrayUpdateFunction) {
|
|
2159
2358
|
var result;
|
|
2160
2359
|
if (fieldUpdate) {
|
|
@@ -2288,7 +2487,7 @@ function _define_property$p(obj, key, value) {
|
|
|
2288
2487
|
key: "update",
|
|
2289
2488
|
value: function update(data, params) {
|
|
2290
2489
|
if ((params === null || params === void 0 ? void 0 : params.precondition) != null) {
|
|
2291
|
-
this.batch.update(this.documentRef, data, params
|
|
2490
|
+
this.batch.update(this.documentRef, data, params.precondition);
|
|
2292
2491
|
} else {
|
|
2293
2492
|
this.batch.update(this.documentRef, data);
|
|
2294
2493
|
}
|
|
@@ -2305,6 +2504,7 @@ function _define_property$p(obj, key, value) {
|
|
|
2305
2504
|
* the batch applies all queued writes atomically.
|
|
2306
2505
|
*
|
|
2307
2506
|
* @param writeBatch - The Google Cloud WriteBatch to queue operations into.
|
|
2507
|
+
* @returns A factory that creates batch-backed accessors sharing the given WriteBatch.
|
|
2308
2508
|
*
|
|
2309
2509
|
* @example
|
|
2310
2510
|
* ```typescript
|
|
@@ -2347,6 +2547,9 @@ function _define_property$p(obj, key, value) {
|
|
|
2347
2547
|
}();
|
|
2348
2548
|
/**
|
|
2349
2549
|
* Creates a {@link WriteBatchFirestoreDocumentContext} wrapping the given batch.
|
|
2550
|
+
*
|
|
2551
|
+
* @param batch - The Google Cloud WriteBatch to use.
|
|
2552
|
+
* @returns A new {@link WriteBatchFirestoreDocumentContext} for the given batch.
|
|
2350
2553
|
*/ function writeBatchDocumentContext(batch) {
|
|
2351
2554
|
return new WriteBatchFirestoreDocumentContext(batch);
|
|
2352
2555
|
}
|
|
@@ -2473,6 +2676,8 @@ function _define_property$o(obj, key, value) {
|
|
|
2473
2676
|
/**
|
|
2474
2677
|
* Creates a {@link FirestoreDocumentDataAccessorFactory} that produces default (non-batched, non-transactional) accessors.
|
|
2475
2678
|
*
|
|
2679
|
+
* @returns A factory that creates default (non-batched, non-transactional) accessors.
|
|
2680
|
+
*
|
|
2476
2681
|
* @example
|
|
2477
2682
|
* ```typescript
|
|
2478
2683
|
* const factory = defaultFirestoreAccessorFactory<User>();
|
|
@@ -2490,6 +2695,8 @@ function _define_property$o(obj, key, value) {
|
|
|
2490
2695
|
* Creates a {@link FirestoreDocumentContext} with no special execution context (no batch, no transaction).
|
|
2491
2696
|
*
|
|
2492
2697
|
* Operations performed through this context execute immediately against Firestore.
|
|
2698
|
+
*
|
|
2699
|
+
* @returns A {@link FirestoreDocumentContext} for direct Firestore operations.
|
|
2493
2700
|
*/ function defaultFirestoreDocumentContext() {
|
|
2494
2701
|
return {
|
|
2495
2702
|
contextType: FirestoreDocumentContextType.NONE,
|
|
@@ -2619,7 +2826,7 @@ function _define_property$n(obj, key, value) {
|
|
|
2619
2826
|
key: "update",
|
|
2620
2827
|
value: function update(data, params) {
|
|
2621
2828
|
if (params === null || params === void 0 ? void 0 : params.precondition) {
|
|
2622
|
-
this.transaction.update(this.documentRef, data, params
|
|
2829
|
+
this.transaction.update(this.documentRef, data, params.precondition);
|
|
2623
2830
|
} else {
|
|
2624
2831
|
this.transaction.update(this.documentRef, data);
|
|
2625
2832
|
}
|
|
@@ -2636,6 +2843,7 @@ function _define_property$n(obj, key, value) {
|
|
|
2636
2843
|
* atomic operation.
|
|
2637
2844
|
*
|
|
2638
2845
|
* @param transaction - The Google Cloud Transaction to execute operations within.
|
|
2846
|
+
* @returns A factory that creates transaction-backed accessors sharing the given transaction.
|
|
2639
2847
|
*
|
|
2640
2848
|
* @example
|
|
2641
2849
|
* ```typescript
|
|
@@ -2679,6 +2887,9 @@ function _define_property$n(obj, key, value) {
|
|
|
2679
2887
|
}();
|
|
2680
2888
|
/**
|
|
2681
2889
|
* Creates a {@link TransactionFirestoreDocumentContext} wrapping the given transaction.
|
|
2890
|
+
*
|
|
2891
|
+
* @param transaction - The Google Cloud Transaction to use.
|
|
2892
|
+
* @returns A new {@link TransactionFirestoreDocumentContext} for the given transaction.
|
|
2682
2893
|
*/ function transactionDocumentContext(transaction) {
|
|
2683
2894
|
return new TransactionFirestoreDocumentContext(transaction);
|
|
2684
2895
|
}
|
|
@@ -2865,6 +3076,7 @@ function _ts_generator$a(thisArg, body) {
|
|
|
2865
3076
|
* @param start - A Firestore object that can resolve collection paths (e.g., Firestore instance, DocumentReference).
|
|
2866
3077
|
* @param path - The initial collection path.
|
|
2867
3078
|
* @param pathSegments - Optional pairs of [docId, collectionName] for subcollection traversal.
|
|
3079
|
+
* @returns The resolved {@link CollectionReference} at the given path.
|
|
2868
3080
|
* @throws Error if pathSegments length is odd (segments must come in pairs).
|
|
2869
3081
|
*
|
|
2870
3082
|
* @example
|
|
@@ -2875,7 +3087,7 @@ function _ts_generator$a(thisArg, body) {
|
|
|
2875
3087
|
*/ function collectionRefForPath(start, path, pathSegments) {
|
|
2876
3088
|
var ref = start.collection(path);
|
|
2877
3089
|
if (pathSegments === null || pathSegments === void 0 ? void 0 : pathSegments.length) {
|
|
2878
|
-
if (
|
|
3090
|
+
if (pathSegments.length % 2 !== 0) {
|
|
2879
3091
|
throw new Error('Invalid number of path segments provided for collection. Path: "'.concat(path, '" + "').concat(pathSegments, '"'));
|
|
2880
3092
|
}
|
|
2881
3093
|
var batches = batch(pathSegments, 2); // batch to tuple [string, string]
|
|
@@ -2895,6 +3107,7 @@ function _ts_generator$a(thisArg, body) {
|
|
|
2895
3107
|
* @param start - A Firestore object that can resolve document paths (e.g., CollectionReference).
|
|
2896
3108
|
* @param path - Optional document ID or path within the collection.
|
|
2897
3109
|
* @param pathSegments - Optional pairs of [collectionName, docId] for subcollection traversal.
|
|
3110
|
+
* @returns The resolved {@link DocumentReference} at the given path.
|
|
2898
3111
|
*
|
|
2899
3112
|
* @example
|
|
2900
3113
|
* ```typescript
|
|
@@ -2919,6 +3132,8 @@ function _ts_generator$a(thisArg, body) {
|
|
|
2919
3132
|
* Implements document/collection resolution, transaction/batch factories, and context factories
|
|
2920
3133
|
* using the `@google-cloud/firestore` library.
|
|
2921
3134
|
*
|
|
3135
|
+
* @returns A {@link FirestoreAccessorDriver} for the Google Cloud Admin SDK.
|
|
3136
|
+
*
|
|
2922
3137
|
* @example
|
|
2923
3138
|
* ```typescript
|
|
2924
3139
|
* const accessorDriver = googleCloudFirestoreAccessorDriver();
|
|
@@ -2953,18 +3168,10 @@ function _ts_generator$a(thisArg, body) {
|
|
|
2953
3168
|
return function(fn) {
|
|
2954
3169
|
return _async_to_generator$a(function() {
|
|
2955
3170
|
return _ts_generator$a(this, function(_state) {
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
firestore.runTransaction(fn)
|
|
2961
|
-
];
|
|
2962
|
-
case 1:
|
|
2963
|
-
return [
|
|
2964
|
-
2,
|
|
2965
|
-
_state.sent()
|
|
2966
|
-
];
|
|
2967
|
-
}
|
|
3171
|
+
return [
|
|
3172
|
+
2,
|
|
3173
|
+
firestore.runTransaction(fn)
|
|
3174
|
+
];
|
|
2968
3175
|
});
|
|
2969
3176
|
})();
|
|
2970
3177
|
};
|
|
@@ -3089,6 +3296,8 @@ var _obj;
|
|
|
3089
3296
|
* Creates a {@link FirestoreQueryConstraintFunctionsDriver} for the Google Cloud Firestore server SDK.
|
|
3090
3297
|
*
|
|
3091
3298
|
* Translates abstract query constraints into Google Cloud Firestore query builder calls.
|
|
3299
|
+
*
|
|
3300
|
+
* @returns A {@link FirestoreQueryConstraintFunctionsDriver} for the server SDK.
|
|
3092
3301
|
*/ function firestoreClientQueryConstraintFunctionsDriver() {
|
|
3093
3302
|
return makeFirestoreQueryConstraintFunctionsDriver({
|
|
3094
3303
|
mapping: FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING,
|
|
@@ -3110,6 +3319,8 @@ var _obj;
|
|
|
3110
3319
|
* streaming (streamDocs) via `onSnapshot`. Transaction-aware reads are supported
|
|
3111
3320
|
* through the optional transaction parameter in `getDocs`.
|
|
3112
3321
|
*
|
|
3322
|
+
* @returns A complete {@link FirestoreQueryDriver} for the Google Cloud Admin SDK.
|
|
3323
|
+
*
|
|
3113
3324
|
* @example
|
|
3114
3325
|
* ```typescript
|
|
3115
3326
|
* const queryDriver = googleCloudFirestoreQueryDriver();
|
|
@@ -3144,6 +3355,8 @@ var _obj;
|
|
|
3144
3355
|
*
|
|
3145
3356
|
* Bundles the server-side accessor driver and query driver, identified as `@google-cloud/firestore`.
|
|
3146
3357
|
*
|
|
3358
|
+
* @returns A complete set of {@link FirestoreDrivers} for the Google Cloud Admin SDK.
|
|
3359
|
+
*
|
|
3147
3360
|
* @example
|
|
3148
3361
|
* ```typescript
|
|
3149
3362
|
* const drivers = googleCloudFirestoreDrivers();
|
|
@@ -3354,6 +3567,7 @@ function _ts_generator$9(thisArg, body) {
|
|
|
3354
3567
|
/**
|
|
3355
3568
|
* Asserts that the callable context contains auth data with a valid UID.
|
|
3356
3569
|
*
|
|
3570
|
+
* @param context - The callable context to check for auth data.
|
|
3357
3571
|
* @throws {HttpsError} Throws unauthenticated error if no auth data is present.
|
|
3358
3572
|
*
|
|
3359
3573
|
* @example
|
|
@@ -3371,13 +3585,15 @@ function _ts_generator$9(thisArg, body) {
|
|
|
3371
3585
|
*
|
|
3372
3586
|
* @param document - The Firestore document to load data from.
|
|
3373
3587
|
* @param message - Optional custom error message.
|
|
3588
|
+
* @returns The document's snapshot data.
|
|
3374
3589
|
* @throws {HttpsError} Throws a {@link modelNotAvailableError} (404) if the document has no data.
|
|
3375
3590
|
*
|
|
3376
3591
|
* @example
|
|
3377
3592
|
* ```typescript
|
|
3378
3593
|
* const userData = await assertSnapshotData(userDocument);
|
|
3379
3594
|
* ```
|
|
3380
|
-
*/
|
|
3595
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- FirestoreDocument generic requires any for proper type inference
|
|
3596
|
+
function assertSnapshotData(document, message) {
|
|
3381
3597
|
return _async_to_generator$9(function() {
|
|
3382
3598
|
var data;
|
|
3383
3599
|
return _ts_generator$9(this, function(_state) {
|
|
@@ -3409,8 +3625,10 @@ function _ts_generator$9(thisArg, body) {
|
|
|
3409
3625
|
*
|
|
3410
3626
|
* @param document - The Firestore document to load data from.
|
|
3411
3627
|
* @param message - Optional custom error message.
|
|
3628
|
+
* @returns The document's snapshot data with `id` and `key` attached.
|
|
3412
3629
|
* @throws {HttpsError} Throws a {@link modelNotAvailableError} (404) if the document has no data.
|
|
3413
|
-
*/
|
|
3630
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- FirestoreDocument generic requires any for proper type inference
|
|
3631
|
+
function assertSnapshotDataWithKey(document, message) {
|
|
3414
3632
|
return _async_to_generator$9(function() {
|
|
3415
3633
|
var data;
|
|
3416
3634
|
return _ts_generator$9(this, function(_state) {
|
|
@@ -3436,7 +3654,8 @@ function _ts_generator$9(thisArg, body) {
|
|
|
3436
3654
|
* @param document - The Firestore document to check.
|
|
3437
3655
|
* @param message - Optional custom error message.
|
|
3438
3656
|
* @throws {HttpsError} Throws a {@link modelNotAvailableError} (404) if the document does not exist.
|
|
3439
|
-
*/
|
|
3657
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- FirestoreDocument generic requires any for proper type inference
|
|
3658
|
+
function assertDocumentExists(document, message) {
|
|
3440
3659
|
return _async_to_generator$9(function() {
|
|
3441
3660
|
var exists;
|
|
3442
3661
|
return _ts_generator$9(this, function(_state) {
|
|
@@ -3462,7 +3681,12 @@ function _ts_generator$9(thisArg, body) {
|
|
|
3462
3681
|
* Creates a {@link modelNotAvailableError} for the given document's model type.
|
|
3463
3682
|
*
|
|
3464
3683
|
* Used by {@link assertDocumentExists} and other assertion functions.
|
|
3465
|
-
|
|
3684
|
+
*
|
|
3685
|
+
* @param document - The document (or object with `modelType`) to generate the error for.
|
|
3686
|
+
* @param message - Optional custom error message.
|
|
3687
|
+
* @returns A {@link modelNotAvailableError} with the document's model type in the message.
|
|
3688
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- FirestoreDocument generic requires any for proper type inference
|
|
3689
|
+
function documentModelNotAvailableError(document, message) {
|
|
3466
3690
|
return modelNotAvailableError({
|
|
3467
3691
|
message: message !== null && message !== void 0 ? message : "The ".concat(document.modelType, " was unavailable.")
|
|
3468
3692
|
});
|
|
@@ -3473,6 +3697,8 @@ function _ts_generator$9(thisArg, body) {
|
|
|
3473
3697
|
*/ var PHONE_NUMBER_ALREADY_EXISTS_ERROR_CODE = 'PHONE_NUMBER_ALREADY_EXISTS';
|
|
3474
3698
|
/**
|
|
3475
3699
|
* Creates a precondition conflict (409) error indicating the phone number already exists.
|
|
3700
|
+
*
|
|
3701
|
+
* @returns A new precondition-conflict (409) {@link HttpsError} with the phone-number-exists code.
|
|
3476
3702
|
*/ function phoneNumberAlreadyExistsError() {
|
|
3477
3703
|
return preconditionConflictError({
|
|
3478
3704
|
code: PHONE_NUMBER_ALREADY_EXISTS_ERROR_CODE,
|
|
@@ -3490,7 +3716,7 @@ function _ts_generator$9(thisArg, body) {
|
|
|
3490
3716
|
*/ function handleFirebaseAuthError(e, handleUnknownCode) {
|
|
3491
3717
|
handleFirebaseError(e, function(firebaseError) {
|
|
3492
3718
|
switch(firebaseError.code){
|
|
3493
|
-
case
|
|
3719
|
+
case FIREBASE_AUTH_PHONE_NUMBER_ALREADY_EXISTS_ERROR:
|
|
3494
3720
|
throw phoneNumberAlreadyExistsError();
|
|
3495
3721
|
default:
|
|
3496
3722
|
handleUnknownCode === null || handleUnknownCode === void 0 ? void 0 : handleUnknownCode(firebaseError);
|
|
@@ -3556,7 +3782,10 @@ function _class_call_check$h(instance, Constructor) {
|
|
|
3556
3782
|
* Creates a default no-op {@link FirebaseServerAnalyticsServiceListener}.
|
|
3557
3783
|
*
|
|
3558
3784
|
* Used when no analytics provider is configured. All methods are no-ops.
|
|
3785
|
+
*
|
|
3786
|
+
* @returns A no-op listener that silently discards all analytics events.
|
|
3559
3787
|
*/ function noopFirebaseServerAnalyticsServiceListener() {
|
|
3788
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3560
3789
|
var noop = function noop() {};
|
|
3561
3790
|
return {
|
|
3562
3791
|
handleOnCallAnalyticsEvent: noop,
|
|
@@ -3864,6 +4093,9 @@ function _ts_generator$8(thisArg, body) {
|
|
|
3864
4093
|
* emitter('triggered').sendEventType('Handler Starting');
|
|
3865
4094
|
* emitter('success').sendEvent('Widget Created', { id: result.id });
|
|
3866
4095
|
* ```
|
|
4096
|
+
*
|
|
4097
|
+
* @param config - The service and context to bind to the emitter factory.
|
|
4098
|
+
* @returns A factory function that creates lifecycle-stage-specific emitters.
|
|
3867
4099
|
*/ function onCallAnalyticsEmitterInstance(config) {
|
|
3868
4100
|
var service = config.service, context = config.context;
|
|
3869
4101
|
return function(lifecycle) {
|
|
@@ -3871,6 +4103,7 @@ function _ts_generator$8(thisArg, body) {
|
|
|
3871
4103
|
service: service,
|
|
3872
4104
|
context: context,
|
|
3873
4105
|
lifecycle: lifecycle,
|
|
4106
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3874
4107
|
sendEvent: function sendEvent(event, properties) {
|
|
3875
4108
|
service.handleOnCallAnalyticsEvent({
|
|
3876
4109
|
event: event,
|
|
@@ -4070,22 +4303,34 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
4070
4303
|
// MARK: Type Guards
|
|
4071
4304
|
/**
|
|
4072
4305
|
* Whether the details are specifier-level (has specifiers map).
|
|
4306
|
+
*
|
|
4307
|
+
* @param details - The API details to check.
|
|
4308
|
+
* @returns True if the details contain a specifiers map.
|
|
4073
4309
|
*/ function isOnCallModelTypeApiDetails(details) {
|
|
4074
4310
|
return details != null && 'specifiers' in details;
|
|
4075
4311
|
}
|
|
4076
4312
|
/**
|
|
4077
4313
|
* Whether the details are CRUD-model-level (has modelTypes map).
|
|
4314
|
+
*
|
|
4315
|
+
* @param details - The API details to check.
|
|
4316
|
+
* @returns True if the details contain a modelTypes map.
|
|
4078
4317
|
*/ function isOnCallCrudModelApiDetails(details) {
|
|
4079
4318
|
return details != null && 'modelTypes' in details;
|
|
4080
4319
|
}
|
|
4081
4320
|
/**
|
|
4082
4321
|
* Whether the details are handler-level (leaf node — no specifiers or modelTypes).
|
|
4322
|
+
*
|
|
4323
|
+
* @param details - The API details to check.
|
|
4324
|
+
* @returns True if the details are handler-level (no specifiers or modelTypes).
|
|
4083
4325
|
*/ function isOnCallHandlerApiDetails(details) {
|
|
4084
4326
|
return details != null && !('specifiers' in details) && !('modelTypes' in details);
|
|
4085
4327
|
}
|
|
4086
4328
|
/**
|
|
4087
4329
|
* Whether the specifier-level details represent a true specifier (multiple sub-operations)
|
|
4088
4330
|
* vs a wrapped direct handler (`isSpecifier: false`, details under `_`).
|
|
4331
|
+
*
|
|
4332
|
+
* @param details - The specifier-level API details to check.
|
|
4333
|
+
* @returns True if the details represent a true specifier with multiple sub-operations.
|
|
4089
4334
|
*/ function isActualSpecifier(details) {
|
|
4090
4335
|
return details.isSpecifier;
|
|
4091
4336
|
}
|
|
@@ -4118,7 +4363,11 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
4118
4363
|
* fn: async (request) => { ... }
|
|
4119
4364
|
* });
|
|
4120
4365
|
* ```
|
|
4121
|
-
|
|
4366
|
+
*
|
|
4367
|
+
* @param config - The API details configuration including the handler function.
|
|
4368
|
+
* @returns The handler function with _apiDetails attached.
|
|
4369
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4370
|
+
function withApiDetails(config) {
|
|
4122
4371
|
var optionalAuth = config.optionalAuth, fn = config.fn, apiDetails = _object_without_properties(config, [
|
|
4123
4372
|
"optionalAuth",
|
|
4124
4373
|
"fn"
|
|
@@ -4132,6 +4381,9 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
4132
4381
|
// MARK: Aggregation Utilities
|
|
4133
4382
|
/**
|
|
4134
4383
|
* Reads _apiDetails from a function if present.
|
|
4384
|
+
*
|
|
4385
|
+
* @param fn - The function or object that may carry _apiDetails.
|
|
4386
|
+
* @returns The API details if present, otherwise undefined.
|
|
4135
4387
|
*/ function readApiDetails(fn) {
|
|
4136
4388
|
return fn === null || fn === void 0 ? void 0 : fn._apiDetails;
|
|
4137
4389
|
}
|
|
@@ -4139,6 +4391,9 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
4139
4391
|
* Aggregates _apiDetails from a specifier handler config object.
|
|
4140
4392
|
*
|
|
4141
4393
|
* Returns OnCallModelTypeApiDetails if any handlers have _apiDetails, otherwise undefined.
|
|
4394
|
+
*
|
|
4395
|
+
* @param config - Map of specifier keys to handler functions.
|
|
4396
|
+
* @returns Aggregated specifier-level API details, or undefined if no handlers have _apiDetails.
|
|
4142
4397
|
*/ function aggregateSpecifierApiDetails(config) {
|
|
4143
4398
|
var specifiers = {};
|
|
4144
4399
|
var hasAny = false;
|
|
@@ -4176,6 +4431,9 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
4176
4431
|
* Aggregates _apiDetails from a model type map (used by onCallCreateModel, etc.).
|
|
4177
4432
|
*
|
|
4178
4433
|
* Returns OnCallCrudModelApiDetails if any handlers have _apiDetails, otherwise undefined.
|
|
4434
|
+
*
|
|
4435
|
+
* @param map - Map of model type strings to handler functions.
|
|
4436
|
+
* @returns Aggregated CRUD-model-level API details, or undefined if no handlers have _apiDetails.
|
|
4179
4437
|
*/ function aggregateCrudModelApiDetails(map) {
|
|
4180
4438
|
var modelTypes = {};
|
|
4181
4439
|
var hasAny = false;
|
|
@@ -4222,6 +4480,9 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
4222
4480
|
* Aggregates _apiDetails from the top-level call model map.
|
|
4223
4481
|
*
|
|
4224
4482
|
* Returns OnCallModelApiDetails if any CRUD handlers have _apiDetails, otherwise undefined.
|
|
4483
|
+
*
|
|
4484
|
+
* @param map - Map of call type strings to CRUD handler functions.
|
|
4485
|
+
* @returns Aggregated model-level API details, or undefined if no handlers have _apiDetails.
|
|
4225
4486
|
*/ function aggregateModelApiDetails(map) {
|
|
4226
4487
|
var result = {};
|
|
4227
4488
|
var hasAny = false;
|
|
@@ -4288,7 +4549,7 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
4288
4549
|
if (modelDetails == null) {
|
|
4289
4550
|
continue;
|
|
4290
4551
|
}
|
|
4291
|
-
if (!models
|
|
4552
|
+
if (!(modelType in models)) {
|
|
4292
4553
|
models[modelType] = {
|
|
4293
4554
|
calls: {}
|
|
4294
4555
|
};
|
|
@@ -4332,9 +4593,16 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
4332
4593
|
/**
|
|
4333
4594
|
* Resolves leaf-level analytics details from the aggregated _apiDetails tree.
|
|
4334
4595
|
*
|
|
4335
|
-
* Walks: call
|
|
4596
|
+
* Walks: call -> modelType -> specifier (if specifier-level), then reads the `analytics`
|
|
4336
4597
|
* field from the handler-level {@link OnCallModelFunctionApiDetails}.
|
|
4337
|
-
|
|
4598
|
+
*
|
|
4599
|
+
* @param apiDetails - The top-level aggregated API details.
|
|
4600
|
+
* @param call - The CRUD operation type to look up.
|
|
4601
|
+
* @param modelType - The Firestore model type to look up.
|
|
4602
|
+
* @param specifier - Optional specifier key for variant handlers.
|
|
4603
|
+
* @returns The analytics details for the resolved handler, or undefined.
|
|
4604
|
+
*/ // eslint-disable-next-line @typescript-eslint/max-params
|
|
4605
|
+
function resolveAnalyticsFromApiDetails(apiDetails, call, modelType, specifier) {
|
|
4338
4606
|
var _apiDetails_call;
|
|
4339
4607
|
var modelDetails = (_apiDetails_call = apiDetails[call]) === null || _apiDetails_call === void 0 ? void 0 : _apiDetails_call.modelTypes[modelType];
|
|
4340
4608
|
if (modelDetails) {
|
|
@@ -4357,6 +4625,9 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
4357
4625
|
* which the client can use to display a meaningful "not found" message. Intended to be
|
|
4358
4626
|
* passed to Firebase permission/existence checking utilities as the
|
|
4359
4627
|
* {@link FirebaseDoesNotExistErrorContextErrorFunction} callback.
|
|
4628
|
+
*
|
|
4629
|
+
* @param firebaseContextGrantedModelRoles - The granted model roles context containing the document reference.
|
|
4630
|
+
* @returns A model-not-available HTTP error.
|
|
4360
4631
|
*/ var nestFirebaseDoesNotExistError = function nestFirebaseDoesNotExistError(firebaseContextGrantedModelRoles) {
|
|
4361
4632
|
var _firebaseContextGrantedModelRoles_data, _firebaseContextGrantedModelRoles_data1;
|
|
4362
4633
|
return modelNotAvailableError({
|
|
@@ -4372,6 +4643,10 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
4372
4643
|
* Returns a "forbidden" HTTP error including the document key, model type, and the roles
|
|
4373
4644
|
* that were required but not granted. Intended to be passed to Firebase permission checking
|
|
4374
4645
|
* utilities as the {@link FirebasePermissionErrorContextErrorFunction} callback.
|
|
4646
|
+
*
|
|
4647
|
+
* @param firebaseContextGrantedModelRoles - The granted model roles context containing the document reference.
|
|
4648
|
+
* @param roles - The roles that were required but not granted.
|
|
4649
|
+
* @returns A forbidden HTTP error.
|
|
4375
4650
|
*/ var nestFirebaseForbiddenPermissionError = function nestFirebaseForbiddenPermissionError(firebaseContextGrantedModelRoles, roles) {
|
|
4376
4651
|
var _firebaseContextGrantedModelRoles_data, _firebaseContextGrantedModelRoles_data1;
|
|
4377
4652
|
return forbiddenError({
|
|
@@ -4424,7 +4699,8 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
4424
4699
|
*
|
|
4425
4700
|
* @param fn
|
|
4426
4701
|
* @param request
|
|
4427
|
-
*/
|
|
4702
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- accepts any nest context and input type for generic auth assertion
|
|
4703
|
+
function assertRequestRequiresAuthForFunction(fn, request) {
|
|
4428
4704
|
if (fn._requireAuth !== false) {
|
|
4429
4705
|
assertIsContextWithAuthData(request);
|
|
4430
4706
|
}
|
|
@@ -4474,13 +4750,15 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
4474
4750
|
* fromUpload: updateProfileFromUpload
|
|
4475
4751
|
* });
|
|
4476
4752
|
* ```
|
|
4477
|
-
*/
|
|
4753
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4754
|
+
function onCallSpecifierHandler(config) {
|
|
4478
4755
|
var map = objectToMap(config);
|
|
4479
4756
|
var fn = function fn(request) {
|
|
4480
4757
|
var _request_specifier = request.specifier, specifier = _request_specifier === void 0 ? MODEL_FUNCTION_FIREBASE_CRUD_FUNCTION_SPECIFIER_DEFAULT : _request_specifier;
|
|
4481
4758
|
var handler = map.get(specifier);
|
|
4482
4759
|
if (handler != null) {
|
|
4483
4760
|
assertRequestRequiresAuthForFunction(handler, request);
|
|
4761
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4484
4762
|
return handler(request);
|
|
4485
4763
|
} else {
|
|
4486
4764
|
throw unknownModelCrudFunctionSpecifierError(specifier);
|
|
@@ -4497,6 +4775,9 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
4497
4775
|
/**
|
|
4498
4776
|
* Creates a bad-request error indicating the provided specifier is not recognized
|
|
4499
4777
|
* by the current model CRUD handler.
|
|
4778
|
+
*
|
|
4779
|
+
* @param specifier - The unrecognized specifier string.
|
|
4780
|
+
* @returns A bad-request error with UNKNOWN_SPECIFIER_ERROR code.
|
|
4500
4781
|
*/ function unknownModelCrudFunctionSpecifierError(specifier) {
|
|
4501
4782
|
return badRequestError(serverError({
|
|
4502
4783
|
status: 400,
|
|
@@ -4599,8 +4880,7 @@ function _object_spread_props$a(target, source) {
|
|
|
4599
4880
|
}
|
|
4600
4881
|
}
|
|
4601
4882
|
var fn = function fn(request) {
|
|
4602
|
-
var
|
|
4603
|
-
var call = (_request_data = request.data) === null || _request_data === void 0 ? void 0 : _request_data.call;
|
|
4883
|
+
var call = request.data.call;
|
|
4604
4884
|
if (!call) {
|
|
4605
4885
|
throw onCallModelMissingCallTypeError();
|
|
4606
4886
|
}
|
|
@@ -4608,18 +4888,21 @@ function _object_spread_props$a(target, source) {
|
|
|
4608
4888
|
if (!callFn) {
|
|
4609
4889
|
throw onCallModelUnknownCallTypeError(call);
|
|
4610
4890
|
}
|
|
4611
|
-
var
|
|
4891
|
+
var _request_data = request.data, specifier = _request_data.specifier, modelType = _request_data.modelType;
|
|
4892
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4612
4893
|
var auth = request.auth;
|
|
4894
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4613
4895
|
var context = {
|
|
4614
4896
|
call: call,
|
|
4615
4897
|
modelType: modelType,
|
|
4616
4898
|
specifier: specifier,
|
|
4617
4899
|
uid: auth === null || auth === void 0 ? void 0 : auth.uid,
|
|
4618
4900
|
auth: auth,
|
|
4619
|
-
data:
|
|
4901
|
+
data: request.data.data,
|
|
4620
4902
|
request: request
|
|
4621
4903
|
};
|
|
4622
4904
|
preAssert(context);
|
|
4905
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4623
4906
|
var result;
|
|
4624
4907
|
// Resolve analytics from _apiDetails tree — callWithAnalytics handles undefined details
|
|
4625
4908
|
var analyticsService = getAnalyticsService(request);
|
|
@@ -4645,6 +4928,8 @@ function _object_spread_props$a(target, source) {
|
|
|
4645
4928
|
}
|
|
4646
4929
|
/**
|
|
4647
4930
|
* Creates a bad-request error indicating the `call` field was missing from the request payload.
|
|
4931
|
+
*
|
|
4932
|
+
* @returns A bad-request error with CALL_TYPE_MISSING_ERROR code.
|
|
4648
4933
|
*/ function onCallModelMissingCallTypeError() {
|
|
4649
4934
|
return badRequestError(serverError({
|
|
4650
4935
|
status: 400,
|
|
@@ -4654,6 +4939,9 @@ function _object_spread_props$a(target, source) {
|
|
|
4654
4939
|
}
|
|
4655
4940
|
/**
|
|
4656
4941
|
* Creates a bad-request error indicating the provided `call` type is not recognized.
|
|
4942
|
+
*
|
|
4943
|
+
* @param call - The unrecognized call type string.
|
|
4944
|
+
* @returns A bad-request error with UNKNOWN_CALL_TYPE_ERROR code.
|
|
4657
4945
|
*/ function onCallModelUnknownCallTypeError(call) {
|
|
4658
4946
|
return badRequestError(serverError({
|
|
4659
4947
|
status: 400,
|
|
@@ -4670,14 +4958,16 @@ function _object_spread_props$a(target, source) {
|
|
|
4670
4958
|
* Dispatches to the correct model-type handler from the map, enforces auth requirements,
|
|
4671
4959
|
* runs pre-assertions, and aggregates API details from all handlers for MCP introspection.
|
|
4672
4960
|
*
|
|
4961
|
+
* @param map - Maps model type strings to their handler functions.
|
|
4962
|
+
* @param config - Configuration including call type, crud type, and error factory.
|
|
4963
|
+
* @returns A callable function that dispatches to the correct model-type handler.
|
|
4673
4964
|
* @internal Not intended for direct use outside the model CRUD module.
|
|
4674
4965
|
*/ function _onCallWithCallTypeFunction(map, config) {
|
|
4675
|
-
var callType = config.callType
|
|
4966
|
+
var callType = config.callType, _config_preAssert = config.preAssert, preAssert = _config_preAssert === void 0 ? function() {
|
|
4676
4967
|
return undefined;
|
|
4677
4968
|
} : _config_preAssert, throwOnUnknownModelType = config.throwOnUnknownModelType;
|
|
4678
4969
|
var fn = function fn(request) {
|
|
4679
|
-
var
|
|
4680
|
-
var modelType = (_request_data = request.data) === null || _request_data === void 0 ? void 0 : _request_data.modelType;
|
|
4970
|
+
var modelType = request.data.modelType;
|
|
4681
4971
|
var crudFn = map[modelType];
|
|
4682
4972
|
if (crudFn) {
|
|
4683
4973
|
var specifier = request.data.specifier;
|
|
@@ -4724,15 +5014,18 @@ function _object_spread_props$a(target, source) {
|
|
|
4724
5014
|
*/ function onCallCreateModel(map) {
|
|
4725
5015
|
var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
4726
5016
|
var preAssert = config.preAssert;
|
|
5017
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4727
5018
|
return _onCallWithCallTypeFunction(map, {
|
|
4728
5019
|
callType: 'create',
|
|
4729
|
-
crudType: 'create',
|
|
4730
5020
|
preAssert: preAssert,
|
|
4731
5021
|
throwOnUnknownModelType: createModelUnknownModelTypeError
|
|
4732
5022
|
});
|
|
4733
5023
|
}
|
|
4734
5024
|
/**
|
|
4735
5025
|
* Creates a bad-request error indicating the requested model type is not valid for creation.
|
|
5026
|
+
*
|
|
5027
|
+
* @param modelType - The unrecognized model type string.
|
|
5028
|
+
* @returns A bad-request error with UNKNOWN_TYPE_ERROR code.
|
|
4736
5029
|
*/ function createModelUnknownModelTypeError(modelType) {
|
|
4737
5030
|
return badRequestError(serverError({
|
|
4738
5031
|
status: 400,
|
|
@@ -4764,15 +5057,18 @@ function _object_spread_props$a(target, source) {
|
|
|
4764
5057
|
*/ function onCallReadModel(map) {
|
|
4765
5058
|
var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
4766
5059
|
var preAssert = config.preAssert;
|
|
5060
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4767
5061
|
return _onCallWithCallTypeFunction(map, {
|
|
4768
5062
|
callType: 'read',
|
|
4769
|
-
crudType: 'read',
|
|
4770
5063
|
preAssert: preAssert,
|
|
4771
5064
|
throwOnUnknownModelType: readModelUnknownModelTypeError
|
|
4772
5065
|
});
|
|
4773
5066
|
}
|
|
4774
5067
|
/**
|
|
4775
5068
|
* Creates a bad-request error indicating the requested model type is not valid for reading.
|
|
5069
|
+
*
|
|
5070
|
+
* @param modelType - The unrecognized model type string.
|
|
5071
|
+
* @returns A bad-request error with UNKNOWN_TYPE_ERROR code.
|
|
4776
5072
|
*/ function readModelUnknownModelTypeError(modelType) {
|
|
4777
5073
|
return badRequestError(serverError({
|
|
4778
5074
|
status: 400,
|
|
@@ -4807,15 +5103,18 @@ function _object_spread_props$a(target, source) {
|
|
|
4807
5103
|
*/ function onCallUpdateModel(map) {
|
|
4808
5104
|
var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
4809
5105
|
var preAssert = config.preAssert;
|
|
5106
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4810
5107
|
return _onCallWithCallTypeFunction(map, {
|
|
4811
5108
|
callType: 'update',
|
|
4812
|
-
crudType: 'update',
|
|
4813
5109
|
preAssert: preAssert,
|
|
4814
5110
|
throwOnUnknownModelType: updateModelUnknownModelTypeError
|
|
4815
5111
|
});
|
|
4816
5112
|
}
|
|
4817
5113
|
/**
|
|
4818
5114
|
* Creates a bad-request error indicating the requested model type is not valid for updating.
|
|
5115
|
+
*
|
|
5116
|
+
* @param modelType - The unrecognized model type string.
|
|
5117
|
+
* @returns A bad-request error with UNKNOWN_TYPE_ERROR code.
|
|
4819
5118
|
*/ function updateModelUnknownModelTypeError(modelType) {
|
|
4820
5119
|
return badRequestError(serverError({
|
|
4821
5120
|
status: 400,
|
|
@@ -4847,15 +5146,18 @@ function _object_spread_props$a(target, source) {
|
|
|
4847
5146
|
*/ function onCallDeleteModel(map) {
|
|
4848
5147
|
var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
4849
5148
|
var preAssert = config.preAssert;
|
|
5149
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4850
5150
|
return _onCallWithCallTypeFunction(map, {
|
|
4851
5151
|
callType: 'delete',
|
|
4852
|
-
crudType: 'delete',
|
|
4853
5152
|
preAssert: preAssert,
|
|
4854
5153
|
throwOnUnknownModelType: deleteModelUnknownModelTypeError
|
|
4855
5154
|
});
|
|
4856
5155
|
}
|
|
4857
5156
|
/**
|
|
4858
5157
|
* Creates a bad-request error indicating the requested model type is not valid for deletion.
|
|
5158
|
+
*
|
|
5159
|
+
* @param modelType - The unrecognized model type string.
|
|
5160
|
+
* @returns A bad-request error with UNKNOWN_TYPE_ERROR code.
|
|
4859
5161
|
*/ function deleteModelUnknownModelTypeError(modelType) {
|
|
4860
5162
|
return badRequestError(serverError({
|
|
4861
5163
|
status: 400,
|
|
@@ -5169,6 +5471,7 @@ FirebaseServerAnalyticsSegmentModule = __decorate([
|
|
|
5169
5471
|
* Creates a NestJS {@link FactoryProvider} that binds a Firebase Admin app getter to {@link FIREBASE_APP_TOKEN}.
|
|
5170
5472
|
*
|
|
5171
5473
|
* @param useFactory - Factory function returning the Firebase Admin app instance.
|
|
5474
|
+
* @returns A NestJS factory provider for the Firebase Admin app.
|
|
5172
5475
|
*
|
|
5173
5476
|
* @example
|
|
5174
5477
|
* ```typescript
|
|
@@ -5266,6 +5569,9 @@ FirebaseServerAuthModule = __decorate([
|
|
|
5266
5569
|
* Returns two providers: the concrete service and an alias that maps
|
|
5267
5570
|
* `FirebaseServerAuthService` to the concrete token, enabling injection by the abstract type.
|
|
5268
5571
|
*
|
|
5572
|
+
* @param provider - The factory provider configuration for the auth service.
|
|
5573
|
+
* @returns A tuple containing the configured provider and an alias provider.
|
|
5574
|
+
*
|
|
5269
5575
|
* @example
|
|
5270
5576
|
* ```typescript
|
|
5271
5577
|
* const providers = provideFirebaseServerAuthService({
|
|
@@ -5291,6 +5597,9 @@ FirebaseServerAuthModule = __decorate([
|
|
|
5291
5597
|
* Generates NestJS {@link ModuleMetadata} for an app's auth module, including the {@link FirebaseServerAuthModule}
|
|
5292
5598
|
* import and the custom {@link FirebaseServerAuthService} provider.
|
|
5293
5599
|
*
|
|
5600
|
+
* @param config - The module metadata configuration including the service provider.
|
|
5601
|
+
* @returns The merged NestJS module metadata.
|
|
5602
|
+
*
|
|
5294
5603
|
* @example
|
|
5295
5604
|
* ```typescript
|
|
5296
5605
|
* @Module(firebaseServerAuthModuleMetadata({
|
|
@@ -5314,15 +5623,21 @@ FirebaseServerAuthModule = __decorate([
|
|
|
5314
5623
|
/**
|
|
5315
5624
|
* Asserts that the caller has admin privileges in the request.
|
|
5316
5625
|
*
|
|
5626
|
+
* @param request - The callable request to check for admin privileges.
|
|
5317
5627
|
* @throws {HttpsError} Throws forbidden (403) if the caller is not an admin.
|
|
5318
|
-
*/
|
|
5628
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5629
|
+
function assertIsAdminInRequest(request) {
|
|
5319
5630
|
if (!isAdminInRequest(request)) {
|
|
5320
5631
|
throw forbiddenError();
|
|
5321
5632
|
}
|
|
5322
5633
|
}
|
|
5323
5634
|
/**
|
|
5324
5635
|
* Checks whether the caller has admin privileges in the request.
|
|
5325
|
-
|
|
5636
|
+
*
|
|
5637
|
+
* @param request - The callable request to check for admin privileges.
|
|
5638
|
+
* @returns True if the caller has admin privileges.
|
|
5639
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5640
|
+
function isAdminInRequest(request) {
|
|
5326
5641
|
return request.nest.authService.context(request).isAdmin;
|
|
5327
5642
|
}
|
|
5328
5643
|
/**
|
|
@@ -5330,9 +5645,12 @@ FirebaseServerAuthModule = __decorate([
|
|
|
5330
5645
|
*
|
|
5331
5646
|
* If the request data contains a `uid` that differs from the caller's auth UID, admin status is required.
|
|
5332
5647
|
*
|
|
5648
|
+
* @param request - The callable request containing the target UID.
|
|
5649
|
+
* @param requireUid - If true, a UID must be present in the request data.
|
|
5333
5650
|
* @returns The resolved target UID (from request data or auth).
|
|
5334
5651
|
* @throws {HttpsError} Throws forbidden (403) if the caller is not authorized.
|
|
5335
|
-
*/
|
|
5652
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5653
|
+
function assertIsAdminOrTargetUserInRequestData(request, requireUid) {
|
|
5336
5654
|
var _request_data_uid;
|
|
5337
5655
|
var _request_auth;
|
|
5338
5656
|
if (!isAdminOrTargetUserInRequestData(request, requireUid)) {
|
|
@@ -5343,8 +5661,11 @@ FirebaseServerAuthModule = __decorate([
|
|
|
5343
5661
|
/**
|
|
5344
5662
|
* Checks whether the caller is an admin or is targeting their own user record in the request data.
|
|
5345
5663
|
*
|
|
5664
|
+
* @param request - The callable request containing the target UID.
|
|
5346
5665
|
* @param requireUid - If true, a UID must be present in the request data.
|
|
5347
|
-
|
|
5666
|
+
* @returns True if the caller is an admin or is targeting their own user record.
|
|
5667
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5668
|
+
function isAdminOrTargetUserInRequestData(request) {
|
|
5348
5669
|
var requireUid = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
5349
5670
|
var _request_auth;
|
|
5350
5671
|
var uid = request.data.uid;
|
|
@@ -5358,8 +5679,10 @@ FirebaseServerAuthModule = __decorate([
|
|
|
5358
5679
|
/**
|
|
5359
5680
|
* Asserts that the caller has signed the Terms of Service.
|
|
5360
5681
|
*
|
|
5682
|
+
* @param request - The callable request to check for ToS status.
|
|
5361
5683
|
* @throws {HttpsError} Throws forbidden (403) if ToS has not been signed.
|
|
5362
|
-
*/
|
|
5684
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5685
|
+
function assertHasSignedTosInRequest(request) {
|
|
5363
5686
|
if (!hasSignedTosInRequest(request)) {
|
|
5364
5687
|
throw forbiddenError({
|
|
5365
5688
|
message: 'ToS has not been signed.'
|
|
@@ -5368,15 +5691,21 @@ FirebaseServerAuthModule = __decorate([
|
|
|
5368
5691
|
}
|
|
5369
5692
|
/**
|
|
5370
5693
|
* Checks whether the caller has signed the Terms of Service.
|
|
5371
|
-
|
|
5694
|
+
*
|
|
5695
|
+
* @param request - The callable request to check for ToS status.
|
|
5696
|
+
* @returns True if the caller has signed the Terms of Service.
|
|
5697
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5698
|
+
function hasSignedTosInRequest(request) {
|
|
5372
5699
|
return request.nest.authService.context(request).hasSignedTos;
|
|
5373
5700
|
}
|
|
5374
5701
|
/**
|
|
5375
5702
|
* Asserts that the caller has all of the specified auth roles.
|
|
5376
5703
|
*
|
|
5704
|
+
* @param request - The callable request to check for auth roles.
|
|
5377
5705
|
* @param authRoles - One or more roles that must all be present.
|
|
5378
5706
|
* @throws {HttpsError} Throws forbidden (403) if any required role is missing.
|
|
5379
|
-
*/
|
|
5707
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5708
|
+
function assertHasRolesInRequest(request, authRoles) {
|
|
5380
5709
|
if (!hasAuthRolesInRequest(request, authRoles)) {
|
|
5381
5710
|
throw forbiddenError({
|
|
5382
5711
|
message: 'Missing required auth roles.',
|
|
@@ -5388,7 +5717,12 @@ FirebaseServerAuthModule = __decorate([
|
|
|
5388
5717
|
}
|
|
5389
5718
|
/**
|
|
5390
5719
|
* Checks whether the caller has all of the specified auth roles.
|
|
5391
|
-
|
|
5720
|
+
*
|
|
5721
|
+
* @param request - The callable request to check for auth roles.
|
|
5722
|
+
* @param authRoles - One or more roles that must all be present.
|
|
5723
|
+
* @returns True if the caller has all of the specified auth roles.
|
|
5724
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5725
|
+
function hasAuthRolesInRequest(request, authRoles) {
|
|
5392
5726
|
return containsAllValues(request.nest.authService.context(request).authRoles, authRoles);
|
|
5393
5727
|
}
|
|
5394
5728
|
/**
|
|
@@ -5396,8 +5730,10 @@ FirebaseServerAuthModule = __decorate([
|
|
|
5396
5730
|
*
|
|
5397
5731
|
* This may be used to filter out new users that were not invited from finishing their onboarding.
|
|
5398
5732
|
*
|
|
5399
|
-
* @param request
|
|
5400
|
-
|
|
5733
|
+
* @param request - The callable request to check for setup password claims.
|
|
5734
|
+
* @returns True if the claims contain a setup password key.
|
|
5735
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5736
|
+
function hasNewUserSetupPasswordInRequest(request) {
|
|
5401
5737
|
var claims = request.nest.authService.context(request).claims;
|
|
5402
5738
|
return claims[FIREBASE_SERVER_AUTH_CLAIMS_SETUP_PASSWORD_KEY] != null;
|
|
5403
5739
|
}
|
|
@@ -5490,6 +5826,9 @@ function _object_spread_props$7(target, source) {
|
|
|
5490
5826
|
}
|
|
5491
5827
|
/**
|
|
5492
5828
|
* Creates a bad-request error indicating the provided development function specifier is not recognized.
|
|
5829
|
+
*
|
|
5830
|
+
* @param specifier - the unrecognized specifier string from the client request.
|
|
5831
|
+
* @returns A bad-request error with the unknown specifier details.
|
|
5493
5832
|
*/ function developmentUnknownSpecifierError(specifier) {
|
|
5494
5833
|
return badRequestError(serverError({
|
|
5495
5834
|
status: 400,
|
|
@@ -5507,6 +5846,8 @@ function _object_spread_props$7(target, source) {
|
|
|
5507
5846
|
/**
|
|
5508
5847
|
* Creates a bad-request error for when the caller sends a 'run' command
|
|
5509
5848
|
* without specifying which scheduled function to execute.
|
|
5849
|
+
*
|
|
5850
|
+
* @returns A bad-request error indicating the missing run name.
|
|
5510
5851
|
*/ function noRunNameSpecifiedForScheduledFunctionDevelopmentFunction() {
|
|
5511
5852
|
return badRequestError({
|
|
5512
5853
|
code: NO_RUN_NAME_SPECIFIED_FOR_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_CODE,
|
|
@@ -5519,6 +5860,9 @@ function _object_spread_props$7(target, source) {
|
|
|
5519
5860
|
/**
|
|
5520
5861
|
* Creates a bad-request error for when the requested scheduled function name
|
|
5521
5862
|
* is not found in the registered function map.
|
|
5863
|
+
*
|
|
5864
|
+
* @param name - the unrecognized function name from the client request.
|
|
5865
|
+
* @returns A bad-request error with the unknown function name details.
|
|
5522
5866
|
*/ function unknownScheduledFunctionDevelopmentFunctionName(name) {
|
|
5523
5867
|
return badRequestError({
|
|
5524
5868
|
code: UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_NAME_CODE,
|
|
@@ -5534,6 +5878,9 @@ function _object_spread_props$7(target, source) {
|
|
|
5534
5878
|
/**
|
|
5535
5879
|
* Creates a bad-request error for when the request `type` field does not match
|
|
5536
5880
|
* any supported operation ('run' or 'list').
|
|
5881
|
+
*
|
|
5882
|
+
* @param type - the unrecognized type value from the client request.
|
|
5883
|
+
* @returns A bad-request error with the unknown type details.
|
|
5537
5884
|
*/ function unknownScheduledFunctionDevelopmentFunctionType(type) {
|
|
5538
5885
|
return badRequestError({
|
|
5539
5886
|
code: UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_TYPE_CODE,
|
|
@@ -5748,7 +6095,7 @@ function _ts_generator$7(thisArg, body) {
|
|
|
5748
6095
|
var result = [];
|
|
5749
6096
|
forEachKeyValue(allScheduledFunctions, {
|
|
5750
6097
|
forEach: function forEach(x) {
|
|
5751
|
-
var _x = _sliced_to_array(x,
|
|
6098
|
+
var _x = _sliced_to_array(x, 1), functionName = _x[0];
|
|
5752
6099
|
result.push({
|
|
5753
6100
|
name: functionName.toString()
|
|
5754
6101
|
});
|
|
@@ -5765,12 +6112,12 @@ function _ts_generator$7(thisArg, body) {
|
|
|
5765
6112
|
data = request.data;
|
|
5766
6113
|
type = data.type;
|
|
5767
6114
|
switch(type){
|
|
5768
|
-
case
|
|
6115
|
+
case ScheduledFunctionDevelopmentFunctionTypeEnum.RUN:
|
|
5769
6116
|
return [
|
|
5770
6117
|
3,
|
|
5771
6118
|
1
|
|
5772
6119
|
];
|
|
5773
|
-
case
|
|
6120
|
+
case ScheduledFunctionDevelopmentFunctionTypeEnum.LIST:
|
|
5774
6121
|
return [
|
|
5775
6122
|
3,
|
|
5776
6123
|
6
|
|
@@ -5828,8 +6175,6 @@ function _ts_generator$7(thisArg, body) {
|
|
|
5828
6175
|
}
|
|
5829
6176
|
];
|
|
5830
6177
|
case 7:
|
|
5831
|
-
throw unknownScheduledFunctionDevelopmentFunctionType(type);
|
|
5832
|
-
case 8:
|
|
5833
6178
|
return [
|
|
5834
6179
|
2
|
|
5835
6180
|
];
|
|
@@ -6017,8 +6362,10 @@ function _ts_generator$6(thisArg, body) {
|
|
|
6017
6362
|
*
|
|
6018
6363
|
* export const { dev } = devFunctions;
|
|
6019
6364
|
* ```
|
|
6020
|
-
*/
|
|
6365
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- generic type parameters require `any` for Firebase SDK compatibility
|
|
6366
|
+
function firebaseServerDevFunctions(config) {
|
|
6021
6367
|
var enabled = config.enabled, secure = config.secure, nest = config.nest, developerFunctionsMap = config.developerFunctionsMap, onCallFactory = config.onCallFactory, allScheduledFunctions = config.allScheduledFunctions, disableDevelopmentScheduleFunction = config.disableDevelopmentScheduleFunction;
|
|
6368
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated -- RunnableHttpFunction supports legacy gen 1 deployments
|
|
6022
6369
|
var dev;
|
|
6023
6370
|
if (enabled) {
|
|
6024
6371
|
var fullFunctionsMap = _object_spread$8({}, developerFunctionsMap);
|
|
@@ -6033,7 +6380,7 @@ function _ts_generator$6(thisArg, body) {
|
|
|
6033
6380
|
}
|
|
6034
6381
|
dev = onCallFactory(onCallFunction)(nest);
|
|
6035
6382
|
} else {
|
|
6036
|
-
dev = onCallFactory(function(
|
|
6383
|
+
dev = onCallFactory(function() {
|
|
6037
6384
|
return _async_to_generator$6(function() {
|
|
6038
6385
|
return _ts_generator$6(this, function(_state) {
|
|
6039
6386
|
throw unavailableError({
|
|
@@ -6153,6 +6500,8 @@ function _is_native_reflect_construct$1() {
|
|
|
6153
6500
|
key: "developmentSchedulerEnabled",
|
|
6154
6501
|
get: /**
|
|
6155
6502
|
* Enabled when not in production and not in a testing environment.
|
|
6503
|
+
*
|
|
6504
|
+
* @returns True if the development scheduler should be enabled.
|
|
6156
6505
|
*/ function get() {
|
|
6157
6506
|
return !this.isProduction && !this.isTestingEnv;
|
|
6158
6507
|
}
|
|
@@ -6175,6 +6524,9 @@ DefaultFirebaseServerEnvService = __decorate([
|
|
|
6175
6524
|
*
|
|
6176
6525
|
* Useful for conditionally enabling production-only Cloud Functions (e.g., scheduled tasks).
|
|
6177
6526
|
*
|
|
6527
|
+
* @param nest - getter for the NestJS application context promise.
|
|
6528
|
+
* @returns An async decision function that resolves to `true` in production.
|
|
6529
|
+
*
|
|
6178
6530
|
* @example
|
|
6179
6531
|
* ```typescript
|
|
6180
6532
|
* const isProduction = nestAppIsProductionEnvironment(nestAppGetter);
|
|
@@ -6191,6 +6543,9 @@ DefaultFirebaseServerEnvService = __decorate([
|
|
|
6191
6543
|
* Creates an async decision function that resolves to `true` if the development scheduler is enabled.
|
|
6192
6544
|
*
|
|
6193
6545
|
* The development scheduler is enabled in non-production, non-testing environments.
|
|
6546
|
+
*
|
|
6547
|
+
* @param nest - getter for the NestJS application context promise.
|
|
6548
|
+
* @returns An async decision function that resolves to `true` when the development scheduler is enabled.
|
|
6194
6549
|
*/ function nestAppHasDevelopmentSchedulerEnabled(nest) {
|
|
6195
6550
|
return function() {
|
|
6196
6551
|
return nest().then(function(x) {
|
|
@@ -6287,6 +6642,11 @@ FirebaseServerFirestoreContextModule = __decorate([
|
|
|
6287
6642
|
/**
|
|
6288
6643
|
* Creates a NestJS provider that initializes a Firestore collections instance from the app's {@link FirestoreContext}.
|
|
6289
6644
|
*
|
|
6645
|
+
* @param config - The provide token and factory function configuration.
|
|
6646
|
+
* @param config.provide - The class token to provide.
|
|
6647
|
+
* @param config.useFactory - Factory that creates the collections from a FirestoreContext.
|
|
6648
|
+
* @returns A tuple containing the configured NestJS provider.
|
|
6649
|
+
*
|
|
6290
6650
|
* @example
|
|
6291
6651
|
* ```typescript
|
|
6292
6652
|
* const [provider] = provideAppFirestoreCollections({
|
|
@@ -6310,6 +6670,9 @@ FirebaseServerFirestoreContextModule = __decorate([
|
|
|
6310
6670
|
* Generates NestJS {@link ModuleMetadata} for an app's Firestore module, including the
|
|
6311
6671
|
* {@link FirebaseServerFirestoreContextModule} import and the app's collections provider.
|
|
6312
6672
|
*
|
|
6673
|
+
* @param config - The Firestore collections config plus optional additional module metadata.
|
|
6674
|
+
* @returns NestJS module metadata ready to be passed to the `@Module()` decorator.
|
|
6675
|
+
*
|
|
6313
6676
|
* @example
|
|
6314
6677
|
* ```typescript
|
|
6315
6678
|
* @Module(appFirestoreModuleMetadata({
|
|
@@ -6619,6 +6982,7 @@ function _object_spread_props$4(target, source) {
|
|
|
6619
6982
|
* @param makeNestContext - Factory that creates the typed context from the NestJS application context.
|
|
6620
6983
|
* @returns A factory for creating nest-context-aware event function handlers.
|
|
6621
6984
|
*/ function cloudEventHandlerWithNestContextFactory(makeNestContext) {
|
|
6985
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- CloudEvent generic requires `any` for SDK compatibility
|
|
6622
6986
|
return function(fn) {
|
|
6623
6987
|
return function(nestAppPromiseGetter) {
|
|
6624
6988
|
var handlerBuilder = function handlerBuilder(handler) {
|
|
@@ -6983,6 +7347,8 @@ function _ts_generator$5(thisArg, body) {
|
|
|
6983
7347
|
/**
|
|
6984
7348
|
* Default error logger that writes validation error details to the console.
|
|
6985
7349
|
* Used when `logError` is `true` or omitted in the factory options.
|
|
7350
|
+
*
|
|
7351
|
+
* @param details - the validation error details to log.
|
|
6986
7352
|
*/ var defaultFirebaseServerActionsTransformFactoryLogErrorFunction = function defaultFirebaseServerActionsTransformFactoryLogErrorFunction(details) {
|
|
6987
7353
|
console.log('firebaseServerActionsTransformFactory() encountered validation error: ', details);
|
|
6988
7354
|
};
|
|
@@ -7608,7 +7974,8 @@ function _unsupported_iterable_to_array$2(o, minLen) {
|
|
|
7608
7974
|
builder = (_builder1 = builder).exclude.apply(_builder1, _to_consumable_array$2(excludePatterns));
|
|
7609
7975
|
}
|
|
7610
7976
|
(_builder = builder).forRoutes.apply(_builder, _to_consumable_array$2(forRoutes));
|
|
7611
|
-
|
|
7977
|
+
var excludeInfo = excludePatterns.length > 0 ? " (excluding: ".concat(excludePatterns.join(', '), ")") : '';
|
|
7978
|
+
this.logger.debug("Configured AppCheck middleware for routes: ".concat(forRoutes.join(', ')).concat(excludeInfo));
|
|
7612
7979
|
}
|
|
7613
7980
|
}
|
|
7614
7981
|
]);
|
|
@@ -8046,16 +8413,28 @@ function _ts_generator$2(thisArg, body) {
|
|
|
8046
8413
|
}
|
|
8047
8414
|
/**
|
|
8048
8415
|
* Resolves a Google Cloud Storage {@link Bucket} from a {@link StoragePath}.
|
|
8416
|
+
*
|
|
8417
|
+
* @param storage - the Google Cloud Storage client instance.
|
|
8418
|
+
* @param path - the storage path containing the bucket ID.
|
|
8419
|
+
* @returns The resolved Google Cloud Storage bucket.
|
|
8049
8420
|
*/ function googleCloudStorageBucketForStorageFilePath(storage, path) {
|
|
8050
8421
|
return storage.bucket(path.bucketId);
|
|
8051
8422
|
}
|
|
8052
8423
|
/**
|
|
8053
8424
|
* Resolves a Google Cloud Storage {@link GoogleCloudFile} from a {@link StoragePath}.
|
|
8425
|
+
*
|
|
8426
|
+
* @param storage - the Google Cloud Storage client instance.
|
|
8427
|
+
* @param path - the storage path containing bucket ID and file path.
|
|
8428
|
+
* @returns The resolved Google Cloud Storage file reference.
|
|
8054
8429
|
*/ function googleCloudStorageFileForStorageFilePath(storage, path) {
|
|
8055
8430
|
return googleCloudStorageBucketForStorageFilePath(storage, path).file(path.pathString);
|
|
8056
8431
|
}
|
|
8057
8432
|
/**
|
|
8058
8433
|
* Converts Google Cloud Storage {@link FileMetadata} into the normalized {@link StorageMetadata} format.
|
|
8434
|
+
*
|
|
8435
|
+
* @param file - the Google Cloud Storage file reference.
|
|
8436
|
+
* @param metadata - the raw file metadata from the Google Cloud SDK.
|
|
8437
|
+
* @returns Normalized storage metadata.
|
|
8059
8438
|
*/ function googleCloudFileMetadataToStorageMetadata(file, metadata) {
|
|
8060
8439
|
var _metadata_generation;
|
|
8061
8440
|
var fullPath = file.name;
|
|
@@ -8086,6 +8465,10 @@ function _ts_generator$2(thisArg, body) {
|
|
|
8086
8465
|
* and ACL operations for a single file in Google Cloud Storage.
|
|
8087
8466
|
*
|
|
8088
8467
|
* Handles emulator-specific edge cases (e.g., signing errors, atomic move fallback).
|
|
8468
|
+
*
|
|
8469
|
+
* @param storage - the Google Cloud Storage client instance.
|
|
8470
|
+
* @param storagePath - the storage path identifying the file's bucket and path.
|
|
8471
|
+
* @returns A file accessor with CRUD, streaming, and ACL operations.
|
|
8089
8472
|
*/ function googleCloudStorageAccessorFile(storage, storagePath) {
|
|
8090
8473
|
var file = googleCloudStorageFileForStorageFilePath(storage, storagePath);
|
|
8091
8474
|
function makeDownloadOptions(maxDownloadSizeBytes) {
|
|
@@ -8096,7 +8479,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
8096
8479
|
}
|
|
8097
8480
|
function _configureMetadata(options) {
|
|
8098
8481
|
var _options_metadata, _options_metadata1, _options_metadata2, _options_metadata3, _options_metadata4, _options_metadata5;
|
|
8099
|
-
var customMetadata = filterUndefinedValues(_object_spread$1({}, (_options_metadata = options.metadata) === null || _options_metadata === void 0 ? void 0 : _options_metadata.customMetadata, options
|
|
8482
|
+
var customMetadata = filterUndefinedValues(_object_spread$1({}, (_options_metadata = options.metadata) === null || _options_metadata === void 0 ? void 0 : _options_metadata.customMetadata, options.customMetadata));
|
|
8100
8483
|
return filterUndefinedValues({
|
|
8101
8484
|
cacheControl: (_options_metadata1 = options.metadata) === null || _options_metadata1 === void 0 ? void 0 : _options_metadata1.cacheControl,
|
|
8102
8485
|
contentDisposition: (_options_metadata2 = options.metadata) === null || _options_metadata2 === void 0 ? void 0 : _options_metadata2.contentDisposition,
|
|
@@ -8213,7 +8596,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
8213
8596
|
return x[0];
|
|
8214
8597
|
}).catch(function(e) {
|
|
8215
8598
|
var publicUrlBackup;
|
|
8216
|
-
if (e && e.name === 'SigningError' && (isTestNodeEnv() || process.env.FIREBASE_STORAGE_EMULATOR_HOST)) {
|
|
8599
|
+
if (_instanceof(e, Error) && e.name === 'SigningError' && (isTestNodeEnv() || process.env.FIREBASE_STORAGE_EMULATOR_HOST)) {
|
|
8217
8600
|
// NOTE: Signing does not behave properly in the emulator as it is not supported.
|
|
8218
8601
|
// https://github.com/firebase/firebase-tools/issues/3400
|
|
8219
8602
|
// we can return the public url instead.
|
|
@@ -8356,7 +8739,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
8356
8739
|
},
|
|
8357
8740
|
copy: copy,
|
|
8358
8741
|
delete: function _delete(options) {
|
|
8359
|
-
return file.delete(options).then(function(
|
|
8742
|
+
return file.delete(options).then(function() {
|
|
8360
8743
|
return undefined;
|
|
8361
8744
|
});
|
|
8362
8745
|
},
|
|
@@ -8390,7 +8773,8 @@ function _ts_generator$2(thisArg, body) {
|
|
|
8390
8773
|
}
|
|
8391
8774
|
var googleCloudStorageListFilesResultFactory = storageListFilesResultFactory({
|
|
8392
8775
|
hasItems: function hasItems(result) {
|
|
8393
|
-
|
|
8776
|
+
var _result_apiResponse_items;
|
|
8777
|
+
return Boolean((_result_apiResponse_items = result.apiResponse.items) !== null && _result_apiResponse_items !== void 0 ? _result_apiResponse_items : result.apiResponse.prefixes);
|
|
8394
8778
|
},
|
|
8395
8779
|
hasNext: function hasNext(result) {
|
|
8396
8780
|
return result.nextQuery != null;
|
|
@@ -8399,7 +8783,8 @@ var googleCloudStorageListFilesResultFactory = storageListFilesResultFactory({
|
|
|
8399
8783
|
var _result_nextQuery;
|
|
8400
8784
|
return (_result_nextQuery = result.nextQuery) === null || _result_nextQuery === void 0 ? void 0 : _result_nextQuery.pageToken;
|
|
8401
8785
|
},
|
|
8402
|
-
next: function next(
|
|
8786
|
+
next: function next(param, result) {
|
|
8787
|
+
var options = param.options, folder = param.folder;
|
|
8403
8788
|
return folder.list(_object_spread$1({}, options, result.nextQuery));
|
|
8404
8789
|
},
|
|
8405
8790
|
file: function file(storage, fileResult) {
|
|
@@ -8409,9 +8794,8 @@ var googleCloudStorageListFilesResultFactory = storageListFilesResultFactory({
|
|
|
8409
8794
|
return googleCloudStorageAccessorFolder(storage, folderResult.storagePath);
|
|
8410
8795
|
},
|
|
8411
8796
|
filesFromResult: function filesFromResult(result) {
|
|
8412
|
-
var
|
|
8413
|
-
var
|
|
8414
|
-
var items = (_ref = (_result_apiResponse = result.apiResponse) === null || _result_apiResponse === void 0 ? void 0 : _result_apiResponse.items) !== null && _ref !== void 0 ? _ref : [];
|
|
8797
|
+
var _result_apiResponse_items;
|
|
8798
|
+
var items = (_result_apiResponse_items = result.apiResponse.items) !== null && _result_apiResponse_items !== void 0 ? _result_apiResponse_items : [];
|
|
8415
8799
|
return items.map(function(x) {
|
|
8416
8800
|
return {
|
|
8417
8801
|
raw: x,
|
|
@@ -8424,9 +8808,8 @@ var googleCloudStorageListFilesResultFactory = storageListFilesResultFactory({
|
|
|
8424
8808
|
});
|
|
8425
8809
|
},
|
|
8426
8810
|
foldersFromResult: function foldersFromResult(result, folder) {
|
|
8427
|
-
var
|
|
8428
|
-
var
|
|
8429
|
-
var items = (_ref = (_result_apiResponse = result.apiResponse) === null || _result_apiResponse === void 0 ? void 0 : _result_apiResponse.prefixes) !== null && _ref !== void 0 ? _ref : [];
|
|
8811
|
+
var _result_apiResponse_prefixes;
|
|
8812
|
+
var items = (_result_apiResponse_prefixes = result.apiResponse.prefixes) !== null && _result_apiResponse_prefixes !== void 0 ? _result_apiResponse_prefixes : [];
|
|
8430
8813
|
return items.map(function(prefix) {
|
|
8431
8814
|
return {
|
|
8432
8815
|
raw: prefix,
|
|
@@ -8442,6 +8825,10 @@ var googleCloudStorageListFilesResultFactory = storageListFilesResultFactory({
|
|
|
8442
8825
|
/**
|
|
8443
8826
|
* Creates a {@link GoogleCloudStorageAccessorFolder} that supports checking folder existence
|
|
8444
8827
|
* and listing files/subfolders with pagination.
|
|
8828
|
+
*
|
|
8829
|
+
* @param storage - the Google Cloud Storage client instance.
|
|
8830
|
+
* @param storagePath - the storage path identifying the folder's bucket and prefix.
|
|
8831
|
+
* @returns A folder accessor with existence checking and listing operations.
|
|
8445
8832
|
*/ function googleCloudStorageAccessorFolder(storage, storagePath) {
|
|
8446
8833
|
var bucket = googleCloudStorageBucketForStorageFilePath(storage, storagePath);
|
|
8447
8834
|
var file = bucket.file(storagePath.pathString);
|
|
@@ -8485,7 +8872,11 @@ var googleCloudStorageListFilesResultFactory = storageListFilesResultFactory({
|
|
|
8485
8872
|
nextQuery: nextQuery,
|
|
8486
8873
|
apiResponse: apiResponse
|
|
8487
8874
|
};
|
|
8488
|
-
return googleCloudStorageListFilesResultFactory(
|
|
8875
|
+
return googleCloudStorageListFilesResultFactory({
|
|
8876
|
+
storage: storage,
|
|
8877
|
+
folder: folder,
|
|
8878
|
+
options: options
|
|
8879
|
+
}, result);
|
|
8489
8880
|
});
|
|
8490
8881
|
}
|
|
8491
8882
|
};
|
|
@@ -8494,6 +8885,8 @@ var googleCloudStorageListFilesResultFactory = storageListFilesResultFactory({
|
|
|
8494
8885
|
/**
|
|
8495
8886
|
* Creates a {@link FirebaseStorageAccessorDriver} for Google Cloud Storage (Admin SDK).
|
|
8496
8887
|
*
|
|
8888
|
+
* @returns A server-side storage accessor driver for Google Cloud Storage.
|
|
8889
|
+
*
|
|
8497
8890
|
* @example
|
|
8498
8891
|
* ```typescript
|
|
8499
8892
|
* const driver = googleCloudStorageFirebaseStorageAccessorDriver();
|
|
@@ -8515,6 +8908,8 @@ var googleCloudStorageListFilesResultFactory = storageListFilesResultFactory({
|
|
|
8515
8908
|
*
|
|
8516
8909
|
* Bundles the server-side storage accessor driver, identified as `@google-cloud/storage`.
|
|
8517
8910
|
*
|
|
8911
|
+
* @returns A complete set of storage drivers for server-side usage.
|
|
8912
|
+
*
|
|
8518
8913
|
* @example
|
|
8519
8914
|
* ```typescript
|
|
8520
8915
|
* const drivers = googleCloudFirebaseStorageDrivers();
|
|
@@ -8616,6 +9011,7 @@ function _define_property$3(obj, key, value) {
|
|
|
8616
9011
|
* Storage wrapper and the raw Google Cloud Storage SDK.
|
|
8617
9012
|
*
|
|
8618
9013
|
* @param storage - The Firebase Admin Storage instance.
|
|
9014
|
+
* @returns The underlying Google Cloud Storage client.
|
|
8619
9015
|
*
|
|
8620
9016
|
* @example
|
|
8621
9017
|
* ```typescript
|
|
@@ -8766,6 +9162,7 @@ FirebaseServerStorageContextModule = __decorate([
|
|
|
8766
9162
|
* Creates a NestJS provider that configures the default storage bucket ID.
|
|
8767
9163
|
*
|
|
8768
9164
|
* @param input - A bucket ID string or full factory config object.
|
|
9165
|
+
* @returns A NestJS provider for the storage context factory config token.
|
|
8769
9166
|
* @throws Error if `defaultBucketId` is empty.
|
|
8770
9167
|
*
|
|
8771
9168
|
* @example
|
|
@@ -8786,6 +9183,8 @@ FirebaseServerStorageContextModule = __decorate([
|
|
|
8786
9183
|
}
|
|
8787
9184
|
/**
|
|
8788
9185
|
* Returns the default provider config that creates a standard {@link FirebaseServerStorageService}.
|
|
9186
|
+
*
|
|
9187
|
+
* @returns The default provider configuration for FirebaseServerStorageService.
|
|
8789
9188
|
*/ function defaultProvideFirebaseServerStorageServiceSimple() {
|
|
8790
9189
|
return {
|
|
8791
9190
|
provide: FirebaseServerStorageService,
|
|
@@ -8799,6 +9198,9 @@ FirebaseServerStorageContextModule = __decorate([
|
|
|
8799
9198
|
*
|
|
8800
9199
|
* If the provider token differs from `FirebaseServerStorageService`, an alias provider is added
|
|
8801
9200
|
* so the service can also be injected by the abstract type.
|
|
9201
|
+
*
|
|
9202
|
+
* @param provider - The storage service provider configuration.
|
|
9203
|
+
* @returns An array of NestJS providers for the storage service.
|
|
8802
9204
|
*/ function provideFirebaseServerStorageService(provider) {
|
|
8803
9205
|
var _provider_inject;
|
|
8804
9206
|
var providers = [
|
|
@@ -8820,13 +9222,17 @@ FirebaseServerStorageContextModule = __decorate([
|
|
|
8820
9222
|
* Generates NestJS {@link ModuleMetadata} for an app's storage module, including the
|
|
8821
9223
|
* {@link FirebaseServerStorageContextModule} import and the storage service provider.
|
|
8822
9224
|
*
|
|
9225
|
+
* @param config - Optional configuration including a custom service provider and additional module metadata.
|
|
9226
|
+
* @returns NestJS module metadata ready to be passed to the `@Module()` decorator.
|
|
9227
|
+
*
|
|
8823
9228
|
* @example
|
|
8824
9229
|
* ```typescript
|
|
8825
9230
|
* @Module(firebaseServerStorageModuleMetadata())
|
|
8826
9231
|
* export class AppStorageModule {}
|
|
8827
9232
|
* ```
|
|
8828
9233
|
*/ function firebaseServerStorageModuleMetadata(config) {
|
|
8829
|
-
var
|
|
9234
|
+
var _ref;
|
|
9235
|
+
var serviceProvider = (_ref = config === null || config === void 0 ? void 0 : config.serviceProvider) !== null && _ref !== void 0 ? _ref : defaultProvideFirebaseServerStorageServiceSimple();
|
|
8830
9236
|
var providers = provideFirebaseServerStorageService(serviceProvider);
|
|
8831
9237
|
var tokensToExport = injectionTokensFromProviders(providers);
|
|
8832
9238
|
return mergeModuleMetadata({
|
|
@@ -9084,6 +9490,9 @@ function _ts_generator$1(thisArg, body) {
|
|
|
9084
9490
|
* times with the same app reuses the existing server. The factory wires up Firebase Admin,
|
|
9085
9491
|
* environment config, storage, AppCheck middleware, and webhook routes based on the config.
|
|
9086
9492
|
*
|
|
9493
|
+
* @param config - Configuration for the NestJS server instance including the root module, providers, and middleware options.
|
|
9494
|
+
* @returns A NestServerInstance that manages server lifecycle for the given module class.
|
|
9495
|
+
*
|
|
9087
9496
|
* @example
|
|
9088
9497
|
* ```typescript
|
|
9089
9498
|
* const instance = nestServerInstance({ moduleClass: AppModule, appCheckEnabled: true });
|
|
@@ -9099,7 +9508,7 @@ function _ts_generator$1(thisArg, body) {
|
|
|
9099
9508
|
var server = express();
|
|
9100
9509
|
var createNestServer = function createNestServer(expressInstance) {
|
|
9101
9510
|
return _async_to_generator$1(function() {
|
|
9102
|
-
var _config_defaultStorageBucket, _buildNestServerRootModule, rootModule, globalApiRoutePrefixConfig, options, nestApp;
|
|
9511
|
+
var _config_defaultStorageBucket, _buildNestServerRootModule, rootModule, globalApiRoutePrefixConfig, options, nestApp, configured;
|
|
9103
9512
|
return _ts_generator$1(this, function(_state) {
|
|
9104
9513
|
switch(_state.label){
|
|
9105
9514
|
case 0:
|
|
@@ -9129,7 +9538,10 @@ function _ts_generator$1(thisArg, body) {
|
|
|
9129
9538
|
nestApp = nestApp.setGlobalPrefix(globalApiRoutePrefixConfig.globalApiRoutePrefix, globalApiRoutePrefixConfig);
|
|
9130
9539
|
}
|
|
9131
9540
|
if (configureNestServerInstance) {
|
|
9132
|
-
|
|
9541
|
+
configured = configureNestServerInstance(nestApp);
|
|
9542
|
+
if (configured) {
|
|
9543
|
+
nestApp = configured;
|
|
9544
|
+
}
|
|
9133
9545
|
}
|
|
9134
9546
|
return [
|
|
9135
9547
|
2,
|
|
@@ -9397,16 +9809,31 @@ function _ts_generator(thisArg, body) {
|
|
|
9397
9809
|
/**
|
|
9398
9810
|
* Abstract class that wraps an INestApplicationContext value.
|
|
9399
9811
|
*/ var AbstractNestContext = /*#__PURE__*/ function() {
|
|
9400
|
-
function AbstractNestContext(
|
|
9812
|
+
function AbstractNestContext(nestApplication) {
|
|
9401
9813
|
_class_call_check$1(this, AbstractNestContext);
|
|
9402
|
-
_define_property$1(this, "
|
|
9403
|
-
this.
|
|
9814
|
+
_define_property$1(this, "_nestApplication", void 0);
|
|
9815
|
+
this._nestApplication = nestApplication;
|
|
9404
9816
|
}
|
|
9405
9817
|
_create_class$1(AbstractNestContext, [
|
|
9406
9818
|
{
|
|
9407
9819
|
key: "nest",
|
|
9408
|
-
get:
|
|
9409
|
-
|
|
9820
|
+
get: /**
|
|
9821
|
+
* Returns the NestJS application context.
|
|
9822
|
+
*
|
|
9823
|
+
* @deprecated use nestApplication instead.
|
|
9824
|
+
* @returns The NestJS application context.
|
|
9825
|
+
*/ function get() {
|
|
9826
|
+
return this._nestApplication;
|
|
9827
|
+
}
|
|
9828
|
+
},
|
|
9829
|
+
{
|
|
9830
|
+
key: "nestApplication",
|
|
9831
|
+
get: /**
|
|
9832
|
+
* Returns the NestJS application context.
|
|
9833
|
+
*
|
|
9834
|
+
* @returns The NestJS application context.
|
|
9835
|
+
*/ function get() {
|
|
9836
|
+
return this._nestApplication;
|
|
9410
9837
|
}
|
|
9411
9838
|
}
|
|
9412
9839
|
]);
|
|
@@ -9416,7 +9843,8 @@ function _ts_generator(thisArg, body) {
|
|
|
9416
9843
|
* Abstract class used for the top-level NestJS context for Firebase services.
|
|
9417
9844
|
*
|
|
9418
9845
|
* Your API implementation of this class is usually <AppPrefix>ApiNestContext (e.g. `DemoApiNestContext`).
|
|
9419
|
-
*/
|
|
9846
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- FirebaseModelsService generic requires `any` for SDK compatibility
|
|
9847
|
+
var AbstractFirebaseNestContext = /*#__PURE__*/ function(AbstractNestContext) {
|
|
9420
9848
|
_inherits(AbstractFirebaseNestContext, AbstractNestContext);
|
|
9421
9849
|
function AbstractFirebaseNestContext() {
|
|
9422
9850
|
_class_call_check$1(this, AbstractFirebaseNestContext);
|
|
@@ -9439,13 +9867,13 @@ function _ts_generator(thisArg, body) {
|
|
|
9439
9867
|
{
|
|
9440
9868
|
key: "envService",
|
|
9441
9869
|
get: function get() {
|
|
9442
|
-
return this.
|
|
9870
|
+
return this.nestApplication.get(FirebaseServerEnvService);
|
|
9443
9871
|
}
|
|
9444
9872
|
},
|
|
9445
9873
|
{
|
|
9446
9874
|
key: "storageService",
|
|
9447
9875
|
get: function get() {
|
|
9448
|
-
return this.
|
|
9876
|
+
return this.nestApplication.get(FirebaseServerStorageService);
|
|
9449
9877
|
}
|
|
9450
9878
|
},
|
|
9451
9879
|
{
|
|
@@ -9456,6 +9884,7 @@ function _ts_generator(thisArg, body) {
|
|
|
9456
9884
|
*
|
|
9457
9885
|
* @param auth - The request's auth data reference.
|
|
9458
9886
|
* @param buildFn - Optional builder to customize the context.
|
|
9887
|
+
* @returns A model context with auth, app, and error factories.
|
|
9459
9888
|
*/ key: "makeModelContext",
|
|
9460
9889
|
value: function makeModelContext(auth, buildFn) {
|
|
9461
9890
|
var base = {
|
|
@@ -9477,6 +9906,7 @@ function _ts_generator(thisArg, body) {
|
|
|
9477
9906
|
*
|
|
9478
9907
|
* @param context - The request's auth data reference.
|
|
9479
9908
|
* @param buildFn - Optional builder to customize the model context.
|
|
9909
|
+
* @returns An in-context models service scoped to the given auth context.
|
|
9480
9910
|
*/ key: "model",
|
|
9481
9911
|
value: function model(context, buildFn) {
|
|
9482
9912
|
var firebaseModelContext = this.makeModelContext(context, buildFn);
|
|
@@ -9485,7 +9915,8 @@ function _ts_generator(thisArg, body) {
|
|
|
9485
9915
|
},
|
|
9486
9916
|
{
|
|
9487
9917
|
key: "useModel",
|
|
9488
|
-
value:
|
|
9918
|
+
value: // eslint-disable-next-line @typescript-eslint/no-explicit-any -- implementation signature uses `any` to unify overload return types
|
|
9919
|
+
function useModel(type, select) {
|
|
9489
9920
|
return _async_to_generator(function() {
|
|
9490
9921
|
var _select_use, context, usePromise, use;
|
|
9491
9922
|
return _ts_generator(this, function(_state) {
|
|
@@ -9547,7 +9978,8 @@ function _define_property(obj, key, value) {
|
|
|
9547
9978
|
* Abstract class used for the top-level server NestJS context for server-only services.
|
|
9548
9979
|
*
|
|
9549
9980
|
* Your API implementation of this class is usually <AppPrefix>ApiServerNestContext (e.g. `DemoApiServerNestContext`).
|
|
9550
|
-
*/
|
|
9981
|
+
*/ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- generic type parameters require `any` for Firebase SDK compatibility
|
|
9982
|
+
var AbstractServerFirebaseNestContext = /*#__PURE__*/ function() {
|
|
9551
9983
|
function AbstractServerFirebaseNestContext(c) {
|
|
9552
9984
|
_class_call_check(this, AbstractServerFirebaseNestContext);
|
|
9553
9985
|
_define_property(this, "_context", void 0);
|
|
@@ -9563,7 +9995,7 @@ function _define_property(obj, key, value) {
|
|
|
9563
9995
|
{
|
|
9564
9996
|
key: "nest",
|
|
9565
9997
|
get: function get() {
|
|
9566
|
-
return this.context.
|
|
9998
|
+
return this.context.nestApplication;
|
|
9567
9999
|
}
|
|
9568
10000
|
}
|
|
9569
10001
|
]);
|
|
@@ -9571,4 +10003,4 @@ function _define_property(obj, key, value) {
|
|
|
9571
10003
|
}
|
|
9572
10004
|
();
|
|
9573
10005
|
|
|
9574
|
-
export { ALREADY_EXISTS_ERROR_CODE, AbstractFirebaseNestContext, AbstractFirebaseServerActionsContext, AbstractFirebaseServerAuthContext, AbstractFirebaseServerAuthService, AbstractFirebaseServerAuthUserContext, AbstractFirebaseServerNewUserService, AbstractNestContext, AbstractServerFirebaseNestContext, BAD_REQUEST_ERROR_CODE, CONFLICT_ERROR_CODE, ConfigureFirebaseAppCheckMiddlewareModule, ConfigureFirebaseWebhookMiddlewareModule, DEFAULT_FIREBASE_PASSWORD_NUMBER_GENERATOR, DEFAULT_SETUP_COM_THROTTLE_TIME, DefaultFirebaseServerEnvService, FIREBASE_APP_TOKEN, FIREBASE_AUTH_TOKEN, FIREBASE_FIRESTORE_CONTEXT_TOKEN, FIREBASE_FIRESTORE_TOKEN, FIREBASE_SERVER_ENV_TOKEN, FIREBASE_SERVER_VALIDATION_ERROR_CODE, FIREBASE_STORAGE_CONTEXT_FACTORY_CONFIG_TOKEN, FIREBASE_STORAGE_CONTEXT_TOKEN, FIREBASE_STORAGE_TOKEN, FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING, FORBIDDEN_ERROR_CODE, FirebaseAppCheckMiddleware, FirebaseAppCheckMiddlewareConfig, FirebaseNestServerRootModule, FirebaseRawBodyMiddleware, FirebaseServerAnalyticsSegmentListenerService, FirebaseServerAnalyticsSegmentModule, FirebaseServerAnalyticsService, FirebaseServerAnalyticsServiceListener, FirebaseServerAuthModule, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError, FirebaseServerAuthNewUserSendSetupDetailsThrottleError, FirebaseServerAuthService, FirebaseServerEnvService, FirebaseServerFirestoreContextModule, FirebaseServerFirestoreModule, FirebaseServerStorageContextModule, FirebaseServerStorageModule, FirebaseServerStorageService, GlobalRoutePrefixConfig, INTERNAL_SERVER_ERROR_CODE, MODEL_NOT_AVAILABLE_ERROR_CODE, NOT_FOUND_ERROR_CODE, NO_RUN_NAME_SPECIFIED_FOR_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_CODE, NoSetupContentFirebaseServerNewUserService, ON_CALL_MODEL_ANALYTICS_HANDLER, ON_CALL_MODEL_ANALYTICS_SERVICE, OnCallModelAnalyticsService, PERMISSION_DENIED_ERROR_CODE, PHONE_NUMBER_ALREADY_EXISTS_ERROR_CODE, SkipAppCheck, UNAUTHENTICATED_ERROR_CODE, UNAVAILABLE_ERROR_CODE, UNAVAILABLE_OR_DEACTIVATED_FUNCTION_ERROR_CODE, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_NAME_CODE, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_TYPE_CODE, _onCallWithCallTypeFunction, aggregateCrudModelApiDetails, aggregateModelApiDetails, aggregateSpecifierApiDetails, alreadyExistsError, appAnalyticsModuleMetadata, appFirestoreModuleMetadata, assertContextHasAuth, assertDocumentExists, assertHasRolesInRequest, assertHasSignedTosInRequest, assertIsAdminInRequest, assertIsAdminOrTargetUserInRequestData, assertIsContextWithAuthData, assertRequestRequiresAuthForFunction, assertSnapshotData, assertSnapshotDataWithKey, badRequestError, blockingFunctionHandlerWithNestContextFactory, buildNestServerRootModule, callWithAnalytics, cloudEventHandlerWithNestContextFactory, collectionRefForPath, createModelUnknownModelTypeError, defaultFirebaseServerActionsTransformFactoryLogErrorFunction, defaultProvideFirebaseServerStorageServiceSimple, deleteModelUnknownModelTypeError, developmentUnknownSpecifierError, docRefForPath, documentModelNotAvailableError, firebaseAuthTokenFromDecodedIdToken, firebaseServerActionsContext, firebaseServerActionsTransformContext, firebaseServerActionsTransformFactory, firebaseServerAppTokenProvider, firebaseServerAuthModuleMetadata, firebaseServerDevFunctions, firebaseServerEnvTokenProvider, firebaseServerEnvTokenProviders, firebaseServerErrorInfo, firebaseServerErrorInfoCodePair, firebaseServerErrorInfoServerErrorCodePair, firebaseServerErrorInfoServerErrorPair, firebaseServerStorageDefaultBucketIdTokenProvider, firebaseServerStorageModuleMetadata, firebaseServerValidationError, firebaseServerValidationServerError, firestoreClientQueryConstraintFunctionsDriver, firestoreEncryptedField, firestoreServerIncrementUpdateToUpdateData, forbiddenError, getAuthUserOrUndefined, getModelApiDetails, googleCloudFileMetadataToStorageMetadata, googleCloudFirebaseStorageContextFactory, googleCloudFirebaseStorageDrivers, googleCloudFirestoreAccessorDriver, googleCloudFirestoreContextFactory, googleCloudFirestoreDrivers, googleCloudFirestoreQueryDriver, googleCloudStorageAccessorFile, googleCloudStorageAccessorFolder, googleCloudStorageBucketForStorageFilePath, googleCloudStorageFileForStorageFilePath, googleCloudStorageFirebaseStorageAccessorDriver, googleCloudStorageFromFirebaseAdminStorage, googleCloudStorageListFilesResultFactory, handleFirebaseAuthError, handleFirebaseError, hasAuthRolesInRequest, hasNewUserSetupPasswordInRequest, hasSignedTosInRequest, inAuthContext, injectNestApplicationContextIntoRequest, injectNestIntoRequest, internalServerError, isActualSpecifier, isAdminInRequest, isAdminOrTargetUserInRequestData, isContextWithAuthData, isFirebaseError, isFirebaseHttpsError, isOnCallCrudModelApiDetails, isOnCallHandlerApiDetails, isOnCallModelTypeApiDetails, isOnCallSpecifierApiDetails, makeBlockingFunctionWithHandler, makeOnScheduleHandlerWithNestApplicationRequest, makeScheduledFunctionDevelopmentFunction, modelNotAvailableError, nestAppHasDevelopmentSchedulerEnabled, nestAppIsProductionEnvironment, nestFirebaseDoesNotExistError, nestFirebaseForbiddenPermissionError, nestServerInstance, noRunNameSpecifiedForScheduledFunctionDevelopmentFunction, noopFirebaseServerAnalyticsServiceListener, notFoundError, onCallAnalyticsEmitterInstance, onCallCreateModel, onCallDeleteModel, onCallDevelopmentFunction, onCallHandlerWithNestApplicationFactory, onCallHandlerWithNestContextFactory, onCallModel, onCallModelMissingCallTypeError, onCallModelUnknownCallTypeError, onCallReadModel, onCallSpecifierHandler, onCallUpdateModel, onScheduleHandlerWithNestApplicationFactory, onScheduleHandlerWithNestContextFactory, optionalAuthContext, optionalFirestoreEncryptedField, permissionDeniedError, phoneNumberAlreadyExistsError, preconditionConflictError, provideAppFirestoreCollections, provideFirebaseServerAuthService, provideFirebaseServerStorageService, readApiDetails, readModelUnknownModelTypeError, resolveAnalyticsFromApiDetails, setNestContextOnRequest, setNestContextOnScheduleRequest, taskQueueFunctionHandlerWithNestContextFactory, unauthenticatedContextHasNoAuthData, unauthenticatedContextHasNoUidError, unauthenticatedError, unavailableError, unavailableOrDeactivatedFunctionError, unknownModelCrudFunctionSpecifierError, unknownScheduledFunctionDevelopmentFunctionName, unknownScheduledFunctionDevelopmentFunctionType, updateModelUnknownModelTypeError, userContextFromUid, verifyAppCheckInRequest, withApiDetails };
|
|
10006
|
+
export { ALREADY_EXISTS_ERROR_CODE, AbstractFirebaseNestContext, AbstractFirebaseServerActionsContext, AbstractFirebaseServerAuthContext, AbstractFirebaseServerAuthService, AbstractFirebaseServerAuthUserContext, AbstractFirebaseServerNewUserService, AbstractNestContext, AbstractServerFirebaseNestContext, BAD_REQUEST_ERROR_CODE, CONFLICT_ERROR_CODE, ConfigureFirebaseAppCheckMiddlewareModule, ConfigureFirebaseWebhookMiddlewareModule, DEFAULT_FIREBASE_PASSWORD_NUMBER_GENERATOR, DEFAULT_SETUP_COM_THROTTLE_TIME, DefaultFirebaseServerEnvService, FIREBASE_APP_TOKEN, FIREBASE_AUTH_TOKEN, FIREBASE_FIRESTORE_CONTEXT_TOKEN, FIREBASE_FIRESTORE_TOKEN, FIREBASE_SERVER_ENV_TOKEN, FIREBASE_SERVER_VALIDATION_ERROR_CODE, FIREBASE_STORAGE_CONTEXT_FACTORY_CONFIG_TOKEN, FIREBASE_STORAGE_CONTEXT_TOKEN, FIREBASE_STORAGE_TOKEN, FIRESTORE_CLIENT_QUERY_CONSTRAINT_HANDLER_MAPPING, FORBIDDEN_ERROR_CODE, FirebaseAppCheckMiddleware, FirebaseAppCheckMiddlewareConfig, FirebaseNestServerRootModule, FirebaseRawBodyMiddleware, FirebaseServerAnalyticsSegmentListenerService, FirebaseServerAnalyticsSegmentModule, FirebaseServerAnalyticsService, FirebaseServerAnalyticsServiceListener, FirebaseServerAuthModule, FirebaseServerAuthNewUserSendSetupDetailsNoSetupConfigError, FirebaseServerAuthNewUserSendSetupDetailsSendOnceError, FirebaseServerAuthNewUserSendSetupDetailsThrottleError, FirebaseServerAuthService, FirebaseServerAuthUserBadInputError, FirebaseServerAuthUserExistsError, FirebaseServerEnvService, FirebaseServerFirestoreContextModule, FirebaseServerFirestoreModule, FirebaseServerStorageContextModule, FirebaseServerStorageModule, FirebaseServerStorageService, GlobalRoutePrefixConfig, INTERNAL_SERVER_ERROR_CODE, MODEL_NOT_AVAILABLE_ERROR_CODE, NOT_FOUND_ERROR_CODE, NO_RUN_NAME_SPECIFIED_FOR_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_CODE, NoSetupContentFirebaseServerNewUserService, ON_CALL_MODEL_ANALYTICS_HANDLER, ON_CALL_MODEL_ANALYTICS_SERVICE, OnCallModelAnalyticsService, PERMISSION_DENIED_ERROR_CODE, PHONE_NUMBER_ALREADY_EXISTS_ERROR_CODE, SkipAppCheck, UNAUTHENTICATED_ERROR_CODE, UNAVAILABLE_ERROR_CODE, UNAVAILABLE_OR_DEACTIVATED_FUNCTION_ERROR_CODE, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_NAME_CODE, UNKNOWN_SCHEDULED_FUNCTION_DEVELOPMENT_FUNCTION_TYPE_CODE, _onCallWithCallTypeFunction, aggregateCrudModelApiDetails, aggregateModelApiDetails, aggregateSpecifierApiDetails, alreadyExistsError, appAnalyticsModuleMetadata, appFirestoreModuleMetadata, assertContextHasAuth, assertDocumentExists, assertHasRolesInRequest, assertHasSignedTosInRequest, assertIsAdminInRequest, assertIsAdminOrTargetUserInRequestData, assertIsContextWithAuthData, assertRequestRequiresAuthForFunction, assertSnapshotData, assertSnapshotDataWithKey, badRequestError, blockingFunctionHandlerWithNestContextFactory, buildNestServerRootModule, callWithAnalytics, cloudEventHandlerWithNestContextFactory, collectionRefForPath, createModelUnknownModelTypeError, defaultFirebaseServerActionsTransformFactoryLogErrorFunction, defaultProvideFirebaseServerStorageServiceSimple, deleteModelUnknownModelTypeError, developmentUnknownSpecifierError, docRefForPath, documentModelNotAvailableError, firebaseAuthTokenFromDecodedIdToken, firebaseServerActionsContext, firebaseServerActionsTransformContext, firebaseServerActionsTransformFactory, firebaseServerAppTokenProvider, firebaseServerAuthModuleMetadata, firebaseServerDevFunctions, firebaseServerEnvTokenProvider, firebaseServerEnvTokenProviders, firebaseServerErrorInfo, firebaseServerErrorInfoCodePair, firebaseServerErrorInfoServerErrorCodePair, firebaseServerErrorInfoServerErrorPair, firebaseServerStorageDefaultBucketIdTokenProvider, firebaseServerStorageModuleMetadata, firebaseServerValidationError, firebaseServerValidationServerError, firestoreClientQueryConstraintFunctionsDriver, firestoreEncryptedField, firestoreServerIncrementUpdateToUpdateData, forbiddenError, getAuthUserOrUndefined, getModelApiDetails, googleCloudFileMetadataToStorageMetadata, googleCloudFirebaseStorageContextFactory, googleCloudFirebaseStorageDrivers, googleCloudFirestoreAccessorDriver, googleCloudFirestoreContextFactory, googleCloudFirestoreDrivers, googleCloudFirestoreQueryDriver, googleCloudStorageAccessorFile, googleCloudStorageAccessorFolder, googleCloudStorageBucketForStorageFilePath, googleCloudStorageFileForStorageFilePath, googleCloudStorageFirebaseStorageAccessorDriver, googleCloudStorageFromFirebaseAdminStorage, googleCloudStorageListFilesResultFactory, handleFirebaseAuthError, handleFirebaseError, hasAuthRolesInRequest, hasNewUserSetupPasswordInRequest, hasSignedTosInRequest, inAuthContext, injectNestApplicationContextIntoRequest, injectNestIntoRequest, internalServerError, isActualSpecifier, isAdminInRequest, isAdminOrTargetUserInRequestData, isContextWithAuthData, isFirebaseError, isFirebaseHttpsError, isOnCallCrudModelApiDetails, isOnCallHandlerApiDetails, isOnCallModelTypeApiDetails, isOnCallSpecifierApiDetails, makeBlockingFunctionWithHandler, makeOnScheduleHandlerWithNestApplicationRequest, makeScheduledFunctionDevelopmentFunction, modelNotAvailableError, nestAppHasDevelopmentSchedulerEnabled, nestAppIsProductionEnvironment, nestFirebaseDoesNotExistError, nestFirebaseForbiddenPermissionError, nestServerInstance, noRunNameSpecifiedForScheduledFunctionDevelopmentFunction, noopFirebaseServerAnalyticsServiceListener, notFoundError, onCallAnalyticsEmitterInstance, onCallCreateModel, onCallDeleteModel, onCallDevelopmentFunction, onCallHandlerWithNestApplicationFactory, onCallHandlerWithNestContextFactory, onCallModel, onCallModelMissingCallTypeError, onCallModelUnknownCallTypeError, onCallReadModel, onCallSpecifierHandler, onCallUpdateModel, onScheduleHandlerWithNestApplicationFactory, onScheduleHandlerWithNestContextFactory, optionalAuthContext, optionalFirestoreEncryptedField, permissionDeniedError, phoneNumberAlreadyExistsError, preconditionConflictError, provideAppFirestoreCollections, provideFirebaseServerAuthService, provideFirebaseServerStorageService, readApiDetails, readModelUnknownModelTypeError, resolveAnalyticsFromApiDetails, setNestContextOnRequest, setNestContextOnScheduleRequest, taskQueueFunctionHandlerWithNestContextFactory, unauthenticatedContextHasNoAuthData, unauthenticatedContextHasNoUidError, unauthenticatedError, unavailableError, unavailableOrDeactivatedFunctionError, unknownModelCrudFunctionSpecifierError, unknownScheduledFunctionDevelopmentFunctionName, unknownScheduledFunctionDevelopmentFunctionType, updateModelUnknownModelTypeError, userContextFromUid, verifyAppCheckInRequest, withApiDetails };
|