@dereekb/firebase-server 13.14.0 → 13.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +46 -38
- package/index.esm.js +47 -39
- package/mailgun/package.json +9 -9
- package/mcp/index.cjs.js +1180 -215
- package/mcp/index.esm.js +1175 -218
- package/mcp/package.json +11 -11
- package/mcp/src/lib/service/index.d.ts +1 -0
- package/mcp/src/lib/service/mcp.server.factory.d.ts +30 -2
- package/mcp/src/lib/service/tools/mcp.tool.batch-execute.d.ts +151 -0
- package/model/index.cjs.js +216 -222
- package/model/index.esm.js +217 -223
- package/model/package.json +9 -9
- package/oidc/index.cjs.js +8 -8
- package/oidc/index.esm.js +8 -8
- package/oidc/package.json +10 -10
- package/package.json +10 -10
- package/src/lib/auth/auth.service.d.ts +23 -3
- package/test/index.cjs.js +3 -3
- package/test/index.esm.js +3 -3
- package/test/package.json +11 -11
- package/twilio/package.json +8 -8
- package/zoho/index.cjs.js +3 -3
- package/zoho/index.esm.js +3 -3
- package/zoho/package.json +9 -9
package/index.cjs.js
CHANGED
|
@@ -18,7 +18,7 @@ var model = require('@dereekb/model');
|
|
|
18
18
|
var admin = require('firebase-admin');
|
|
19
19
|
var storage = require('@google-cloud/storage');
|
|
20
20
|
var dateFns = require('date-fns');
|
|
21
|
-
var types = require('util/types');
|
|
21
|
+
var types = require('node:util/types');
|
|
22
22
|
var rxjs$1 = require('@dereekb/rxjs');
|
|
23
23
|
var platformExpress = require('@nestjs/platform-express');
|
|
24
24
|
var express = require('express');
|
|
@@ -1282,15 +1282,17 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1282
1282
|
},
|
|
1283
1283
|
{
|
|
1284
1284
|
key: "beginResetPassword",
|
|
1285
|
-
value: function beginResetPassword() {
|
|
1285
|
+
value: function beginResetPassword(options) {
|
|
1286
1286
|
return _async_to_generator$g(function() {
|
|
1287
|
-
var password, now, expiresAt, _obj, passwordClaimsData;
|
|
1287
|
+
var _ref, password, now, expiresInMs, expiresAt, _obj, passwordClaimsData;
|
|
1288
1288
|
return _ts_generator$g(this, function(_state) {
|
|
1289
1289
|
switch(_state.label){
|
|
1290
1290
|
case 0:
|
|
1291
1291
|
password = this._generateResetPasswordKey();
|
|
1292
1292
|
now = new Date();
|
|
1293
|
-
|
|
1293
|
+
// An explicit per-call lifetime wins over the context default; otherwise fall back to _resetCodeExpiresInMs().
|
|
1294
|
+
expiresInMs = (_ref = options === null || options === void 0 ? void 0 : options.resetCodeExpiresIn) !== null && _ref !== void 0 ? _ref : this._resetCodeExpiresInMs();
|
|
1295
|
+
expiresAt = new Date(now.getTime() + expiresInMs);
|
|
1294
1296
|
passwordClaimsData = (_obj = {}, _define_property$x(_obj, firebase.FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, password), _define_property$x(_obj, firebase.FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, date.toISODateString(now)), _define_property$x(_obj, firebase.FIREBASE_SERVER_AUTH_CLAIMS_RESET_EXPIRES_AT_KEY, date.toISODateString(expiresAt)), _obj);
|
|
1295
1297
|
// set the claims
|
|
1296
1298
|
return [
|
|
@@ -1333,7 +1335,7 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1333
1335
|
];
|
|
1334
1336
|
case 1:
|
|
1335
1337
|
claims = _state.sent();
|
|
1336
|
-
result = claims.resetPassword
|
|
1338
|
+
result = claims.resetPassword == null ? undefined : claims;
|
|
1337
1339
|
return [
|
|
1338
1340
|
2,
|
|
1339
1341
|
result
|
|
@@ -1744,15 +1746,21 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1744
1746
|
case 1:
|
|
1745
1747
|
userRecord = _state.sent();
|
|
1746
1748
|
createdUser = false;
|
|
1747
|
-
if (
|
|
1749
|
+
if (!userRecord) return [
|
|
1748
1750
|
3,
|
|
1749
|
-
|
|
1751
|
+
2
|
|
1752
|
+
];
|
|
1753
|
+
userRecordId = userRecord.uid;
|
|
1754
|
+
return [
|
|
1755
|
+
3,
|
|
1756
|
+
6
|
|
1750
1757
|
];
|
|
1758
|
+
case 2:
|
|
1751
1759
|
return [
|
|
1752
1760
|
4,
|
|
1753
1761
|
this.createNewUser(input)
|
|
1754
1762
|
];
|
|
1755
|
-
case
|
|
1763
|
+
case 3:
|
|
1756
1764
|
createResult = _state.sent();
|
|
1757
1765
|
// add the setup password to the user's credentials
|
|
1758
1766
|
userContext = this.authService.userContext(createResult.user.uid);
|
|
@@ -1760,7 +1768,7 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1760
1768
|
4,
|
|
1761
1769
|
this.addNewUserSetupClaims(userContext, createResult.password)
|
|
1762
1770
|
];
|
|
1763
|
-
case
|
|
1771
|
+
case 4:
|
|
1764
1772
|
_state.sent();
|
|
1765
1773
|
createdUser = true;
|
|
1766
1774
|
userRecordId = userContext.uid;
|
|
@@ -1768,14 +1776,8 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1768
1776
|
4,
|
|
1769
1777
|
userContext.loadRecord()
|
|
1770
1778
|
];
|
|
1771
|
-
case 4:
|
|
1772
|
-
userRecord = _state.sent();
|
|
1773
|
-
return [
|
|
1774
|
-
3,
|
|
1775
|
-
6
|
|
1776
|
-
];
|
|
1777
1779
|
case 5:
|
|
1778
|
-
|
|
1780
|
+
userRecord = _state.sent();
|
|
1779
1781
|
_state.label = 6;
|
|
1780
1782
|
case 6:
|
|
1781
1783
|
if (!(createdUser && sendSetupContent === true || sendSetupContentIfUserExists)) return [
|
|
@@ -2239,11 +2241,11 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2239
2241
|
* Used by {@link AbstractFirebaseServerUserPasswordResetService.sendResetContent} to rate-limit delivery.
|
|
2240
2242
|
*/ var DEFAULT_RESET_COM_THROTTLE_TIME = date.minutesToMs(1);
|
|
2241
2243
|
/**
|
|
2242
|
-
* Default lifetime (
|
|
2244
|
+
* Default lifetime (30 minutes) of a reset code before it expires.
|
|
2243
2245
|
*
|
|
2244
2246
|
* Used by {@link AbstractFirebaseServerAuthUserContext.beginResetPassword} to set
|
|
2245
2247
|
* `resetExpiresAt` in the user's claims.
|
|
2246
|
-
*/ var DEFAULT_RESET_CODE_EXPIRES_IN = date.minutesToMs(
|
|
2248
|
+
*/ var DEFAULT_RESET_CODE_EXPIRES_IN = date.minutesToMs(30);
|
|
2247
2249
|
/**
|
|
2248
2250
|
* Base implementation of {@link FirebaseServerUserPasswordResetService} that handles reset initiation,
|
|
2249
2251
|
* claims management, throttled reset content delivery, and reset completion.
|
|
@@ -2280,11 +2282,11 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2280
2282
|
key: "beginPasswordReset",
|
|
2281
2283
|
value: function beginPasswordReset(input) {
|
|
2282
2284
|
return _async_to_generator$g(function() {
|
|
2283
|
-
var uid, email, sendResetContent, sendResetDetailsOnce, sendResetIgnoreThrottle, sendResetThrowErrors, data, sendDetailsInTestEnvironment, resolvedUid, userRecord, userContext, claims, oobCode;
|
|
2285
|
+
var uid, email, sendResetContent, sendResetDetailsOnce, sendResetIgnoreThrottle, sendResetThrowErrors, data, sendDetailsInTestEnvironment, resetCodeExpiresIn, resolvedUid, userRecord, userContext, claims, oobCode;
|
|
2284
2286
|
return _ts_generator$g(this, function(_state) {
|
|
2285
2287
|
switch(_state.label){
|
|
2286
2288
|
case 0:
|
|
2287
|
-
uid = input.uid, email = input.email, sendResetContent = input.sendResetContent, sendResetDetailsOnce = input.sendResetDetailsOnce, sendResetIgnoreThrottle = input.sendResetIgnoreThrottle, sendResetThrowErrors = input.sendResetThrowErrors, data = input.data, sendDetailsInTestEnvironment = input.sendDetailsInTestEnvironment;
|
|
2289
|
+
uid = input.uid, email = input.email, sendResetContent = input.sendResetContent, sendResetDetailsOnce = input.sendResetDetailsOnce, sendResetIgnoreThrottle = input.sendResetIgnoreThrottle, sendResetThrowErrors = input.sendResetThrowErrors, data = input.data, sendDetailsInTestEnvironment = input.sendDetailsInTestEnvironment, resetCodeExpiresIn = input.resetCodeExpiresIn;
|
|
2288
2290
|
if (!uid) return [
|
|
2289
2291
|
3,
|
|
2290
2292
|
1
|
|
@@ -2316,7 +2318,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2316
2318
|
userContext = this.authService.userContext(resolvedUid);
|
|
2317
2319
|
return [
|
|
2318
2320
|
4,
|
|
2319
|
-
userContext.beginResetPassword(
|
|
2321
|
+
userContext.beginResetPassword({
|
|
2322
|
+
resetCodeExpiresIn: resetCodeExpiresIn
|
|
2323
|
+
})
|
|
2320
2324
|
];
|
|
2321
2325
|
case 5:
|
|
2322
2326
|
claims = _state.sent();
|
|
@@ -3607,10 +3611,10 @@ function _define_property$v(obj, key, value) {
|
|
|
3607
3611
|
{
|
|
3608
3612
|
key: "update",
|
|
3609
3613
|
value: function update(data, params) {
|
|
3610
|
-
if ((params === null || params === void 0 ? void 0 : params.precondition)
|
|
3611
|
-
this.batch.update(this.documentRef, data, params.precondition);
|
|
3612
|
-
} else {
|
|
3614
|
+
if ((params === null || params === void 0 ? void 0 : params.precondition) == null) {
|
|
3613
3615
|
this.batch.update(this.documentRef, data);
|
|
3616
|
+
} else {
|
|
3617
|
+
this.batch.update(this.documentRef, data, params.precondition);
|
|
3614
3618
|
}
|
|
3615
3619
|
return Promise.resolve();
|
|
3616
3620
|
}
|
|
@@ -9573,7 +9577,7 @@ function _object_spread_props$7(target, source) {
|
|
|
9573
9577
|
*
|
|
9574
9578
|
* @__NO_SIDE_EFFECTS__
|
|
9575
9579
|
*/ function makeBlockingFunctionWithHandler(blockingFunctionBuilder, handler, opts) {
|
|
9576
|
-
var blockingFn = opts
|
|
9580
|
+
var blockingFn = opts == null ? blockingFunctionBuilder(handler) : blockingFunctionBuilder(opts, handler);
|
|
9577
9581
|
blockingFn.__handler = handler;
|
|
9578
9582
|
return blockingFn;
|
|
9579
9583
|
}
|
|
@@ -10240,7 +10244,7 @@ function _ts_generator$5(thisArg, body) {
|
|
|
10240
10244
|
* @__NO_SIDE_EFFECTS__
|
|
10241
10245
|
*/ function firebaseServerActionsTransformFactory(options) {
|
|
10242
10246
|
var logError = (options !== null && options !== void 0 ? options : {}).logError;
|
|
10243
|
-
var logErrorFunction = logError
|
|
10247
|
+
var logErrorFunction = logError === false ? util.mapIdentityFunction : typeof logError === 'function' ? logError : defaultFirebaseServerActionsTransformFactoryLogErrorFunction;
|
|
10244
10248
|
return model.transformAndValidateObjectFactory({
|
|
10245
10249
|
handleValidationError: function handleValidationError(validationErrors) {
|
|
10246
10250
|
return _async_to_generator$5(function() {
|
|
@@ -10552,15 +10556,11 @@ exports.FirebaseAppCheckMiddleware = __decorate([
|
|
|
10552
10556
|
switch(_state.label){
|
|
10553
10557
|
case 0:
|
|
10554
10558
|
appCheckToken = req.header('X-Firebase-AppCheck');
|
|
10555
|
-
if (
|
|
10559
|
+
if (!appCheckToken) return [
|
|
10556
10560
|
3,
|
|
10557
|
-
|
|
10558
|
-
];
|
|
10559
|
-
error = new common.ForbiddenException();
|
|
10560
|
-
return [
|
|
10561
|
-
3,
|
|
10562
|
-
4
|
|
10561
|
+
5
|
|
10563
10562
|
];
|
|
10563
|
+
_state.label = 1;
|
|
10564
10564
|
case 1:
|
|
10565
10565
|
_state.trys.push([
|
|
10566
10566
|
1,
|
|
@@ -10586,6 +10586,14 @@ exports.FirebaseAppCheckMiddleware = __decorate([
|
|
|
10586
10586
|
4
|
|
10587
10587
|
];
|
|
10588
10588
|
case 4:
|
|
10589
|
+
return [
|
|
10590
|
+
3,
|
|
10591
|
+
6
|
|
10592
|
+
];
|
|
10593
|
+
case 5:
|
|
10594
|
+
error = new common.ForbiddenException();
|
|
10595
|
+
_state.label = 6;
|
|
10596
|
+
case 6:
|
|
10589
10597
|
return [
|
|
10590
10598
|
2,
|
|
10591
10599
|
error
|
|
@@ -11235,7 +11243,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
11235
11243
|
contentEncoding: (_options_metadata3 = options.metadata) === null || _options_metadata3 === void 0 ? void 0 : _options_metadata3.contentEncoding,
|
|
11236
11244
|
contentLanguage: (_options_metadata4 = options.metadata) === null || _options_metadata4 === void 0 ? void 0 : _options_metadata4.contentLanguage,
|
|
11237
11245
|
contentType: (_options_metadata5 = options.metadata) === null || _options_metadata5 === void 0 ? void 0 : _options_metadata5.contentType,
|
|
11238
|
-
metadata:
|
|
11246
|
+
metadata: util.objectHasNoKeys(customMetadata) ? undefined : customMetadata
|
|
11239
11247
|
});
|
|
11240
11248
|
}
|
|
11241
11249
|
function makeUploadOptions(options) {
|
|
@@ -11331,8 +11339,8 @@ function _ts_generator$2(thisArg, body) {
|
|
|
11331
11339
|
return _async_to_generator$2(function() {
|
|
11332
11340
|
var _ref, _ref1, expires, config;
|
|
11333
11341
|
return _ts_generator$2(this, function(_state) {
|
|
11334
|
-
expires = (_ref = input === null || input === void 0 ? void 0 : input.expiresAt) !== null && _ref !== void 0 ? _ref : (input === null || input === void 0 ? void 0 : input.expiresIn)
|
|
11335
|
-
: dateFns.
|
|
11342
|
+
expires = (_ref = input === null || input === void 0 ? void 0 : input.expiresAt) !== null && _ref !== void 0 ? _ref : (input === null || input === void 0 ? void 0 : input.expiresIn) == null ? dateFns.addHours(new Date(), 1) // use expiresIn if provided
|
|
11343
|
+
: dateFns.addMilliseconds(new Date(), input.expiresIn); // default expiration in 1 hour
|
|
11336
11344
|
config = _object_spread_props$3(_object_spread$3({}, input), {
|
|
11337
11345
|
action: (_ref1 = input === null || input === void 0 ? void 0 : input.action) !== null && _ref1 !== void 0 ? _ref1 : 'read',
|
|
11338
11346
|
expires: expires,
|
|
@@ -11498,9 +11506,9 @@ function _ts_generator$2(thisArg, body) {
|
|
|
11498
11506
|
});
|
|
11499
11507
|
},
|
|
11500
11508
|
makePublic: function makePublic(setPublic) {
|
|
11501
|
-
return (setPublic
|
|
11509
|
+
return (setPublic === false ? file.acl.delete({
|
|
11502
11510
|
entity: PUBLIC_ACL.entity
|
|
11503
|
-
})).then(function() {
|
|
11511
|
+
}) : file.acl.add(PUBLIC_ACL)).then(function() {
|
|
11504
11512
|
return undefined;
|
|
11505
11513
|
});
|
|
11506
11514
|
},
|
package/index.esm.js
CHANGED
|
@@ -15,8 +15,8 @@ import { https, scheduler } from 'firebase-functions/v2';
|
|
|
15
15
|
import { toTransformAndValidateFunctionResultFactory, transformAndValidateObjectFactory } from '@dereekb/model';
|
|
16
16
|
import admin from 'firebase-admin';
|
|
17
17
|
import { ApiError } from '@google-cloud/storage';
|
|
18
|
-
import {
|
|
19
|
-
import { isUint8Array, isArrayBuffer } from 'util/types';
|
|
18
|
+
import { addHours, addMilliseconds } from 'date-fns';
|
|
19
|
+
import { isUint8Array, isArrayBuffer } from 'node:util/types';
|
|
20
20
|
import { fetchAssetLoader, delegatedAssetLoader, AssetLoader } from '@dereekb/rxjs';
|
|
21
21
|
import { ExpressAdapter } from '@nestjs/platform-express';
|
|
22
22
|
import express from 'express';
|
|
@@ -1280,15 +1280,17 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1280
1280
|
},
|
|
1281
1281
|
{
|
|
1282
1282
|
key: "beginResetPassword",
|
|
1283
|
-
value: function beginResetPassword() {
|
|
1283
|
+
value: function beginResetPassword(options) {
|
|
1284
1284
|
return _async_to_generator$g(function() {
|
|
1285
|
-
var password, now, expiresAt, _obj, passwordClaimsData;
|
|
1285
|
+
var _ref, password, now, expiresInMs, expiresAt, _obj, passwordClaimsData;
|
|
1286
1286
|
return _ts_generator$g(this, function(_state) {
|
|
1287
1287
|
switch(_state.label){
|
|
1288
1288
|
case 0:
|
|
1289
1289
|
password = this._generateResetPasswordKey();
|
|
1290
1290
|
now = new Date();
|
|
1291
|
-
|
|
1291
|
+
// An explicit per-call lifetime wins over the context default; otherwise fall back to _resetCodeExpiresInMs().
|
|
1292
|
+
expiresInMs = (_ref = options === null || options === void 0 ? void 0 : options.resetCodeExpiresIn) !== null && _ref !== void 0 ? _ref : this._resetCodeExpiresInMs();
|
|
1293
|
+
expiresAt = new Date(now.getTime() + expiresInMs);
|
|
1292
1294
|
passwordClaimsData = (_obj = {}, _define_property$x(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_PASSWORD_KEY, password), _define_property$x(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_LAST_COM_DATE_KEY, toISODateString(now)), _define_property$x(_obj, FIREBASE_SERVER_AUTH_CLAIMS_RESET_EXPIRES_AT_KEY, toISODateString(expiresAt)), _obj);
|
|
1293
1295
|
// set the claims
|
|
1294
1296
|
return [
|
|
@@ -1331,7 +1333,7 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1331
1333
|
];
|
|
1332
1334
|
case 1:
|
|
1333
1335
|
claims = _state.sent();
|
|
1334
|
-
result = claims.resetPassword
|
|
1336
|
+
result = claims.resetPassword == null ? undefined : claims;
|
|
1335
1337
|
return [
|
|
1336
1338
|
2,
|
|
1337
1339
|
result
|
|
@@ -1742,15 +1744,21 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1742
1744
|
case 1:
|
|
1743
1745
|
userRecord = _state.sent();
|
|
1744
1746
|
createdUser = false;
|
|
1745
|
-
if (
|
|
1747
|
+
if (!userRecord) return [
|
|
1746
1748
|
3,
|
|
1747
|
-
|
|
1749
|
+
2
|
|
1750
|
+
];
|
|
1751
|
+
userRecordId = userRecord.uid;
|
|
1752
|
+
return [
|
|
1753
|
+
3,
|
|
1754
|
+
6
|
|
1748
1755
|
];
|
|
1756
|
+
case 2:
|
|
1749
1757
|
return [
|
|
1750
1758
|
4,
|
|
1751
1759
|
this.createNewUser(input)
|
|
1752
1760
|
];
|
|
1753
|
-
case
|
|
1761
|
+
case 3:
|
|
1754
1762
|
createResult = _state.sent();
|
|
1755
1763
|
// add the setup password to the user's credentials
|
|
1756
1764
|
userContext = this.authService.userContext(createResult.user.uid);
|
|
@@ -1758,7 +1766,7 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1758
1766
|
4,
|
|
1759
1767
|
this.addNewUserSetupClaims(userContext, createResult.password)
|
|
1760
1768
|
];
|
|
1761
|
-
case
|
|
1769
|
+
case 4:
|
|
1762
1770
|
_state.sent();
|
|
1763
1771
|
createdUser = true;
|
|
1764
1772
|
userRecordId = userContext.uid;
|
|
@@ -1766,14 +1774,8 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1766
1774
|
4,
|
|
1767
1775
|
userContext.loadRecord()
|
|
1768
1776
|
];
|
|
1769
|
-
case 4:
|
|
1770
|
-
userRecord = _state.sent();
|
|
1771
|
-
return [
|
|
1772
|
-
3,
|
|
1773
|
-
6
|
|
1774
|
-
];
|
|
1775
1777
|
case 5:
|
|
1776
|
-
|
|
1778
|
+
userRecord = _state.sent();
|
|
1777
1779
|
_state.label = 6;
|
|
1778
1780
|
case 6:
|
|
1779
1781
|
if (!(createdUser && sendSetupContent === true || sendSetupContentIfUserExists)) return [
|
|
@@ -2237,11 +2239,11 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2237
2239
|
* Used by {@link AbstractFirebaseServerUserPasswordResetService.sendResetContent} to rate-limit delivery.
|
|
2238
2240
|
*/ var DEFAULT_RESET_COM_THROTTLE_TIME = minutesToMs(1);
|
|
2239
2241
|
/**
|
|
2240
|
-
* Default lifetime (
|
|
2242
|
+
* Default lifetime (30 minutes) of a reset code before it expires.
|
|
2241
2243
|
*
|
|
2242
2244
|
* Used by {@link AbstractFirebaseServerAuthUserContext.beginResetPassword} to set
|
|
2243
2245
|
* `resetExpiresAt` in the user's claims.
|
|
2244
|
-
*/ var DEFAULT_RESET_CODE_EXPIRES_IN = minutesToMs(
|
|
2246
|
+
*/ var DEFAULT_RESET_CODE_EXPIRES_IN = minutesToMs(30);
|
|
2245
2247
|
/**
|
|
2246
2248
|
* Base implementation of {@link FirebaseServerUserPasswordResetService} that handles reset initiation,
|
|
2247
2249
|
* claims management, throttled reset content delivery, and reset completion.
|
|
@@ -2278,11 +2280,11 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2278
2280
|
key: "beginPasswordReset",
|
|
2279
2281
|
value: function beginPasswordReset(input) {
|
|
2280
2282
|
return _async_to_generator$g(function() {
|
|
2281
|
-
var uid, email, sendResetContent, sendResetDetailsOnce, sendResetIgnoreThrottle, sendResetThrowErrors, data, sendDetailsInTestEnvironment, resolvedUid, userRecord, userContext, claims, oobCode;
|
|
2283
|
+
var uid, email, sendResetContent, sendResetDetailsOnce, sendResetIgnoreThrottle, sendResetThrowErrors, data, sendDetailsInTestEnvironment, resetCodeExpiresIn, resolvedUid, userRecord, userContext, claims, oobCode;
|
|
2282
2284
|
return _ts_generator$g(this, function(_state) {
|
|
2283
2285
|
switch(_state.label){
|
|
2284
2286
|
case 0:
|
|
2285
|
-
uid = input.uid, email = input.email, sendResetContent = input.sendResetContent, sendResetDetailsOnce = input.sendResetDetailsOnce, sendResetIgnoreThrottle = input.sendResetIgnoreThrottle, sendResetThrowErrors = input.sendResetThrowErrors, data = input.data, sendDetailsInTestEnvironment = input.sendDetailsInTestEnvironment;
|
|
2287
|
+
uid = input.uid, email = input.email, sendResetContent = input.sendResetContent, sendResetDetailsOnce = input.sendResetDetailsOnce, sendResetIgnoreThrottle = input.sendResetIgnoreThrottle, sendResetThrowErrors = input.sendResetThrowErrors, data = input.data, sendDetailsInTestEnvironment = input.sendDetailsInTestEnvironment, resetCodeExpiresIn = input.resetCodeExpiresIn;
|
|
2286
2288
|
if (!uid) return [
|
|
2287
2289
|
3,
|
|
2288
2290
|
1
|
|
@@ -2314,7 +2316,9 @@ function _ts_generator$g(thisArg, body) {
|
|
|
2314
2316
|
userContext = this.authService.userContext(resolvedUid);
|
|
2315
2317
|
return [
|
|
2316
2318
|
4,
|
|
2317
|
-
userContext.beginResetPassword(
|
|
2319
|
+
userContext.beginResetPassword({
|
|
2320
|
+
resetCodeExpiresIn: resetCodeExpiresIn
|
|
2321
|
+
})
|
|
2318
2322
|
];
|
|
2319
2323
|
case 5:
|
|
2320
2324
|
claims = _state.sent();
|
|
@@ -3605,10 +3609,10 @@ function _define_property$v(obj, key, value) {
|
|
|
3605
3609
|
{
|
|
3606
3610
|
key: "update",
|
|
3607
3611
|
value: function update(data, params) {
|
|
3608
|
-
if ((params === null || params === void 0 ? void 0 : params.precondition)
|
|
3609
|
-
this.batch.update(this.documentRef, data, params.precondition);
|
|
3610
|
-
} else {
|
|
3612
|
+
if ((params === null || params === void 0 ? void 0 : params.precondition) == null) {
|
|
3611
3613
|
this.batch.update(this.documentRef, data);
|
|
3614
|
+
} else {
|
|
3615
|
+
this.batch.update(this.documentRef, data, params.precondition);
|
|
3612
3616
|
}
|
|
3613
3617
|
return Promise.resolve();
|
|
3614
3618
|
}
|
|
@@ -9571,7 +9575,7 @@ function _object_spread_props$7(target, source) {
|
|
|
9571
9575
|
*
|
|
9572
9576
|
* @__NO_SIDE_EFFECTS__
|
|
9573
9577
|
*/ function makeBlockingFunctionWithHandler(blockingFunctionBuilder, handler, opts) {
|
|
9574
|
-
var blockingFn = opts
|
|
9578
|
+
var blockingFn = opts == null ? blockingFunctionBuilder(handler) : blockingFunctionBuilder(opts, handler);
|
|
9575
9579
|
blockingFn.__handler = handler;
|
|
9576
9580
|
return blockingFn;
|
|
9577
9581
|
}
|
|
@@ -10238,7 +10242,7 @@ function _ts_generator$5(thisArg, body) {
|
|
|
10238
10242
|
* @__NO_SIDE_EFFECTS__
|
|
10239
10243
|
*/ function firebaseServerActionsTransformFactory(options) {
|
|
10240
10244
|
var logError = (options !== null && options !== void 0 ? options : {}).logError;
|
|
10241
|
-
var logErrorFunction = logError
|
|
10245
|
+
var logErrorFunction = logError === false ? mapIdentityFunction : typeof logError === 'function' ? logError : defaultFirebaseServerActionsTransformFactoryLogErrorFunction;
|
|
10242
10246
|
return transformAndValidateObjectFactory({
|
|
10243
10247
|
handleValidationError: function handleValidationError(validationErrors) {
|
|
10244
10248
|
return _async_to_generator$5(function() {
|
|
@@ -10550,15 +10554,11 @@ FirebaseAppCheckMiddleware = __decorate([
|
|
|
10550
10554
|
switch(_state.label){
|
|
10551
10555
|
case 0:
|
|
10552
10556
|
appCheckToken = req.header('X-Firebase-AppCheck');
|
|
10553
|
-
if (
|
|
10557
|
+
if (!appCheckToken) return [
|
|
10554
10558
|
3,
|
|
10555
|
-
|
|
10556
|
-
];
|
|
10557
|
-
error = new ForbiddenException();
|
|
10558
|
-
return [
|
|
10559
|
-
3,
|
|
10560
|
-
4
|
|
10559
|
+
5
|
|
10561
10560
|
];
|
|
10561
|
+
_state.label = 1;
|
|
10562
10562
|
case 1:
|
|
10563
10563
|
_state.trys.push([
|
|
10564
10564
|
1,
|
|
@@ -10584,6 +10584,14 @@ FirebaseAppCheckMiddleware = __decorate([
|
|
|
10584
10584
|
4
|
|
10585
10585
|
];
|
|
10586
10586
|
case 4:
|
|
10587
|
+
return [
|
|
10588
|
+
3,
|
|
10589
|
+
6
|
|
10590
|
+
];
|
|
10591
|
+
case 5:
|
|
10592
|
+
error = new ForbiddenException();
|
|
10593
|
+
_state.label = 6;
|
|
10594
|
+
case 6:
|
|
10587
10595
|
return [
|
|
10588
10596
|
2,
|
|
10589
10597
|
error
|
|
@@ -11233,7 +11241,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
11233
11241
|
contentEncoding: (_options_metadata3 = options.metadata) === null || _options_metadata3 === void 0 ? void 0 : _options_metadata3.contentEncoding,
|
|
11234
11242
|
contentLanguage: (_options_metadata4 = options.metadata) === null || _options_metadata4 === void 0 ? void 0 : _options_metadata4.contentLanguage,
|
|
11235
11243
|
contentType: (_options_metadata5 = options.metadata) === null || _options_metadata5 === void 0 ? void 0 : _options_metadata5.contentType,
|
|
11236
|
-
metadata:
|
|
11244
|
+
metadata: objectHasNoKeys(customMetadata) ? undefined : customMetadata
|
|
11237
11245
|
});
|
|
11238
11246
|
}
|
|
11239
11247
|
function makeUploadOptions(options) {
|
|
@@ -11329,8 +11337,8 @@ function _ts_generator$2(thisArg, body) {
|
|
|
11329
11337
|
return _async_to_generator$2(function() {
|
|
11330
11338
|
var _ref, _ref1, expires, config;
|
|
11331
11339
|
return _ts_generator$2(this, function(_state) {
|
|
11332
|
-
expires = (_ref = input === null || input === void 0 ? void 0 : input.expiresAt) !== null && _ref !== void 0 ? _ref : (input === null || input === void 0 ? void 0 : input.expiresIn)
|
|
11333
|
-
:
|
|
11340
|
+
expires = (_ref = input === null || input === void 0 ? void 0 : input.expiresAt) !== null && _ref !== void 0 ? _ref : (input === null || input === void 0 ? void 0 : input.expiresIn) == null ? addHours(new Date(), 1) // use expiresIn if provided
|
|
11341
|
+
: addMilliseconds(new Date(), input.expiresIn); // default expiration in 1 hour
|
|
11334
11342
|
config = _object_spread_props$3(_object_spread$3({}, input), {
|
|
11335
11343
|
action: (_ref1 = input === null || input === void 0 ? void 0 : input.action) !== null && _ref1 !== void 0 ? _ref1 : 'read',
|
|
11336
11344
|
expires: expires,
|
|
@@ -11496,9 +11504,9 @@ function _ts_generator$2(thisArg, body) {
|
|
|
11496
11504
|
});
|
|
11497
11505
|
},
|
|
11498
11506
|
makePublic: function makePublic(setPublic) {
|
|
11499
|
-
return (setPublic
|
|
11507
|
+
return (setPublic === false ? file.acl.delete({
|
|
11500
11508
|
entity: PUBLIC_ACL.entity
|
|
11501
|
-
})).then(function() {
|
|
11509
|
+
}) : file.acl.add(PUBLIC_ACL)).then(function() {
|
|
11502
11510
|
return undefined;
|
|
11503
11511
|
});
|
|
11504
11512
|
},
|
package/mailgun/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase-server/mailgun",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.16.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/analytics": "13.
|
|
6
|
-
"@dereekb/firebase": "13.
|
|
7
|
-
"@dereekb/firebase-server": "13.
|
|
8
|
-
"@dereekb/date": "13.
|
|
9
|
-
"@dereekb/nestjs": "13.
|
|
10
|
-
"@dereekb/model": "13.
|
|
11
|
-
"@dereekb/rxjs": "13.
|
|
12
|
-
"@dereekb/util": "13.
|
|
5
|
+
"@dereekb/analytics": "13.16.0",
|
|
6
|
+
"@dereekb/firebase": "13.16.0",
|
|
7
|
+
"@dereekb/firebase-server": "13.16.0",
|
|
8
|
+
"@dereekb/date": "13.16.0",
|
|
9
|
+
"@dereekb/nestjs": "13.16.0",
|
|
10
|
+
"@dereekb/model": "13.16.0",
|
|
11
|
+
"@dereekb/rxjs": "13.16.0",
|
|
12
|
+
"@dereekb/util": "13.16.0"
|
|
13
13
|
},
|
|
14
14
|
"exports": {
|
|
15
15
|
"./package.json": "./package.json",
|