@dereekb/firebase-server 13.15.0 → 13.17.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 +58 -31
- package/index.esm.js +59 -32
- package/mailgun/package.json +9 -9
- package/mcp/index.cjs.js +1928 -225
- package/mcp/index.esm.js +1913 -226
- package/mcp/package.json +11 -11
- package/mcp/src/lib/mcp.config.d.ts +11 -0
- package/mcp/src/lib/service/index.d.ts +3 -0
- package/mcp/src/lib/service/mcp.manifest.d.ts +29 -0
- package/mcp/src/lib/service/mcp.route-manifest.d.ts +120 -0
- package/mcp/src/lib/service/mcp.server.factory.d.ts +14 -0
- package/mcp/src/lib/service/mcp.tool-generator.d.ts +28 -1
- package/mcp/src/lib/service/mcp.visibility.d.ts +17 -0
- package/mcp/src/lib/service/tools/mcp.tool.enum-info.d.ts +70 -0
- package/mcp/src/lib/service/tools/mcp.tool.model-info.d.ts +51 -2
- package/mcp/src/lib/service/tools/mcp.tool.url-models.d.ts +101 -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/nest/controller/model/model.api.get.service.d.ts +5 -0
- 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');
|
|
@@ -1335,7 +1335,7 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1335
1335
|
];
|
|
1336
1336
|
case 1:
|
|
1337
1337
|
claims = _state.sent();
|
|
1338
|
-
result = claims.resetPassword
|
|
1338
|
+
result = claims.resetPassword == null ? undefined : claims;
|
|
1339
1339
|
return [
|
|
1340
1340
|
2,
|
|
1341
1341
|
result
|
|
@@ -1746,15 +1746,21 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1746
1746
|
case 1:
|
|
1747
1747
|
userRecord = _state.sent();
|
|
1748
1748
|
createdUser = false;
|
|
1749
|
-
if (
|
|
1749
|
+
if (!userRecord) return [
|
|
1750
1750
|
3,
|
|
1751
|
-
|
|
1751
|
+
2
|
|
1752
|
+
];
|
|
1753
|
+
userRecordId = userRecord.uid;
|
|
1754
|
+
return [
|
|
1755
|
+
3,
|
|
1756
|
+
6
|
|
1752
1757
|
];
|
|
1758
|
+
case 2:
|
|
1753
1759
|
return [
|
|
1754
1760
|
4,
|
|
1755
1761
|
this.createNewUser(input)
|
|
1756
1762
|
];
|
|
1757
|
-
case
|
|
1763
|
+
case 3:
|
|
1758
1764
|
createResult = _state.sent();
|
|
1759
1765
|
// add the setup password to the user's credentials
|
|
1760
1766
|
userContext = this.authService.userContext(createResult.user.uid);
|
|
@@ -1762,7 +1768,7 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1762
1768
|
4,
|
|
1763
1769
|
this.addNewUserSetupClaims(userContext, createResult.password)
|
|
1764
1770
|
];
|
|
1765
|
-
case
|
|
1771
|
+
case 4:
|
|
1766
1772
|
_state.sent();
|
|
1767
1773
|
createdUser = true;
|
|
1768
1774
|
userRecordId = userContext.uid;
|
|
@@ -1770,14 +1776,8 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1770
1776
|
4,
|
|
1771
1777
|
userContext.loadRecord()
|
|
1772
1778
|
];
|
|
1773
|
-
case 4:
|
|
1774
|
-
userRecord = _state.sent();
|
|
1775
|
-
return [
|
|
1776
|
-
3,
|
|
1777
|
-
6
|
|
1778
|
-
];
|
|
1779
1779
|
case 5:
|
|
1780
|
-
|
|
1780
|
+
userRecord = _state.sent();
|
|
1781
1781
|
_state.label = 6;
|
|
1782
1782
|
case 6:
|
|
1783
1783
|
if (!(createdUser && sendSetupContent === true || sendSetupContentIfUserExists)) return [
|
|
@@ -3611,10 +3611,10 @@ function _define_property$v(obj, key, value) {
|
|
|
3611
3611
|
{
|
|
3612
3612
|
key: "update",
|
|
3613
3613
|
value: function update(data, params) {
|
|
3614
|
-
if ((params === null || params === void 0 ? void 0 : params.precondition)
|
|
3615
|
-
this.batch.update(this.documentRef, data, params.precondition);
|
|
3616
|
-
} else {
|
|
3614
|
+
if ((params === null || params === void 0 ? void 0 : params.precondition) == null) {
|
|
3617
3615
|
this.batch.update(this.documentRef, data);
|
|
3616
|
+
} else {
|
|
3617
|
+
this.batch.update(this.documentRef, data, params.precondition);
|
|
3618
3618
|
}
|
|
3619
3619
|
return Promise.resolve();
|
|
3620
3620
|
}
|
|
@@ -7577,6 +7577,11 @@ function _ts_generator$9(thisArg, body) {
|
|
|
7577
7577
|
* permission-denied / not-found errors surface a real message + code instead of the generic
|
|
7578
7578
|
* `"Unknown error"` fallback the inline mapping used previously.
|
|
7579
7579
|
*
|
|
7580
|
+
* When no real message survives, the fallback is derived from the resolved error `code` so the two
|
|
7581
|
+
* distinct outcomes stay distinguishable — a not-found read no longer reads as "permission denied"
|
|
7582
|
+
* (and vice-versa). Only when neither a message nor a recognizable code is present does it fall back
|
|
7583
|
+
* to a generic message.
|
|
7584
|
+
*
|
|
7580
7585
|
* @param entry - A failed-key entry from the underlying multi-read.
|
|
7581
7586
|
* @returns A `{ key, message, code? }` triple safe to return to API/MCP callers.
|
|
7582
7587
|
*/ function modelAccessReadErrorFromUseMultipleModelsFailure(entry) {
|
|
@@ -7589,10 +7594,28 @@ function _ts_generator$9(thisArg, body) {
|
|
|
7589
7594
|
var code = (_info_serverErrorCode = info.serverErrorCode) !== null && _info_serverErrorCode !== void 0 ? _info_serverErrorCode : info.firebaseErrorCode;
|
|
7590
7595
|
return {
|
|
7591
7596
|
key: entry.key,
|
|
7592
|
-
message: (_ref = (_ref1 = serverMessage !== null && serverMessage !== void 0 ? serverMessage : httpsMessage) !== null && _ref1 !== void 0 ? _ref1 : plainMessage) !== null && _ref !== void 0 ? _ref :
|
|
7597
|
+
message: (_ref = (_ref1 = serverMessage !== null && serverMessage !== void 0 ? serverMessage : httpsMessage) !== null && _ref1 !== void 0 ? _ref1 : plainMessage) !== null && _ref !== void 0 ? _ref : modelAccessReadErrorMessageFromCode(code),
|
|
7593
7598
|
code: code
|
|
7594
7599
|
};
|
|
7595
7600
|
}
|
|
7601
|
+
/**
|
|
7602
|
+
* Derives a fallback read-error message from a resolved error code, distinguishing not-found from
|
|
7603
|
+
* permission-denied. Accepts both the server-error form (`NOT_FOUND` / `PERMISSION_DENIED` /
|
|
7604
|
+
* `FORBIDDEN`) and the Firebase HttpsError form (`not-found` / `permission-denied`).
|
|
7605
|
+
*
|
|
7606
|
+
* @param code - The resolved error code (`serverErrorCode ?? firebaseErrorCode`), if any.
|
|
7607
|
+
* @returns `'not found'`, `'permission denied'`, or a generic `'unknown error'` fallback.
|
|
7608
|
+
*/ function modelAccessReadErrorMessageFromCode(code) {
|
|
7609
|
+
var message;
|
|
7610
|
+
if (code === firebase.NOT_FOUND_ERROR_CODE || code === 'not-found') {
|
|
7611
|
+
message = 'not found';
|
|
7612
|
+
} else if (code === firebase.PERMISSION_DENIED_ERROR_CODE || code === firebase.FORBIDDEN_ERROR_CODE || code === 'permission-denied') {
|
|
7613
|
+
message = 'permission denied';
|
|
7614
|
+
} else {
|
|
7615
|
+
message = 'unknown error';
|
|
7616
|
+
}
|
|
7617
|
+
return message;
|
|
7618
|
+
}
|
|
7596
7619
|
// MARK: Service
|
|
7597
7620
|
/**
|
|
7598
7621
|
* Service for direct document reads using the `useModel()` permission-checking pattern.
|
|
@@ -9577,7 +9600,7 @@ function _object_spread_props$7(target, source) {
|
|
|
9577
9600
|
*
|
|
9578
9601
|
* @__NO_SIDE_EFFECTS__
|
|
9579
9602
|
*/ function makeBlockingFunctionWithHandler(blockingFunctionBuilder, handler, opts) {
|
|
9580
|
-
var blockingFn = opts
|
|
9603
|
+
var blockingFn = opts == null ? blockingFunctionBuilder(handler) : blockingFunctionBuilder(opts, handler);
|
|
9581
9604
|
blockingFn.__handler = handler;
|
|
9582
9605
|
return blockingFn;
|
|
9583
9606
|
}
|
|
@@ -10244,7 +10267,7 @@ function _ts_generator$5(thisArg, body) {
|
|
|
10244
10267
|
* @__NO_SIDE_EFFECTS__
|
|
10245
10268
|
*/ function firebaseServerActionsTransformFactory(options) {
|
|
10246
10269
|
var logError = (options !== null && options !== void 0 ? options : {}).logError;
|
|
10247
|
-
var logErrorFunction = logError
|
|
10270
|
+
var logErrorFunction = logError === false ? util.mapIdentityFunction : typeof logError === 'function' ? logError : defaultFirebaseServerActionsTransformFactoryLogErrorFunction;
|
|
10248
10271
|
return model.transformAndValidateObjectFactory({
|
|
10249
10272
|
handleValidationError: function handleValidationError(validationErrors) {
|
|
10250
10273
|
return _async_to_generator$5(function() {
|
|
@@ -10556,15 +10579,11 @@ exports.FirebaseAppCheckMiddleware = __decorate([
|
|
|
10556
10579
|
switch(_state.label){
|
|
10557
10580
|
case 0:
|
|
10558
10581
|
appCheckToken = req.header('X-Firebase-AppCheck');
|
|
10559
|
-
if (
|
|
10560
|
-
3,
|
|
10561
|
-
1
|
|
10562
|
-
];
|
|
10563
|
-
error = new common.ForbiddenException();
|
|
10564
|
-
return [
|
|
10582
|
+
if (!appCheckToken) return [
|
|
10565
10583
|
3,
|
|
10566
|
-
|
|
10584
|
+
5
|
|
10567
10585
|
];
|
|
10586
|
+
_state.label = 1;
|
|
10568
10587
|
case 1:
|
|
10569
10588
|
_state.trys.push([
|
|
10570
10589
|
1,
|
|
@@ -10590,6 +10609,14 @@ exports.FirebaseAppCheckMiddleware = __decorate([
|
|
|
10590
10609
|
4
|
|
10591
10610
|
];
|
|
10592
10611
|
case 4:
|
|
10612
|
+
return [
|
|
10613
|
+
3,
|
|
10614
|
+
6
|
|
10615
|
+
];
|
|
10616
|
+
case 5:
|
|
10617
|
+
error = new common.ForbiddenException();
|
|
10618
|
+
_state.label = 6;
|
|
10619
|
+
case 6:
|
|
10593
10620
|
return [
|
|
10594
10621
|
2,
|
|
10595
10622
|
error
|
|
@@ -11239,7 +11266,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
11239
11266
|
contentEncoding: (_options_metadata3 = options.metadata) === null || _options_metadata3 === void 0 ? void 0 : _options_metadata3.contentEncoding,
|
|
11240
11267
|
contentLanguage: (_options_metadata4 = options.metadata) === null || _options_metadata4 === void 0 ? void 0 : _options_metadata4.contentLanguage,
|
|
11241
11268
|
contentType: (_options_metadata5 = options.metadata) === null || _options_metadata5 === void 0 ? void 0 : _options_metadata5.contentType,
|
|
11242
|
-
metadata:
|
|
11269
|
+
metadata: util.objectHasNoKeys(customMetadata) ? undefined : customMetadata
|
|
11243
11270
|
});
|
|
11244
11271
|
}
|
|
11245
11272
|
function makeUploadOptions(options) {
|
|
@@ -11335,8 +11362,8 @@ function _ts_generator$2(thisArg, body) {
|
|
|
11335
11362
|
return _async_to_generator$2(function() {
|
|
11336
11363
|
var _ref, _ref1, expires, config;
|
|
11337
11364
|
return _ts_generator$2(this, function(_state) {
|
|
11338
|
-
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)
|
|
11339
|
-
: dateFns.
|
|
11365
|
+
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
|
|
11366
|
+
: dateFns.addMilliseconds(new Date(), input.expiresIn); // default expiration in 1 hour
|
|
11340
11367
|
config = _object_spread_props$3(_object_spread$3({}, input), {
|
|
11341
11368
|
action: (_ref1 = input === null || input === void 0 ? void 0 : input.action) !== null && _ref1 !== void 0 ? _ref1 : 'read',
|
|
11342
11369
|
expires: expires,
|
|
@@ -11502,9 +11529,9 @@ function _ts_generator$2(thisArg, body) {
|
|
|
11502
11529
|
});
|
|
11503
11530
|
},
|
|
11504
11531
|
makePublic: function makePublic(setPublic) {
|
|
11505
|
-
return (setPublic
|
|
11532
|
+
return (setPublic === false ? file.acl.delete({
|
|
11506
11533
|
entity: PUBLIC_ACL.entity
|
|
11507
|
-
})).then(function() {
|
|
11534
|
+
}) : file.acl.add(PUBLIC_ACL)).then(function() {
|
|
11508
11535
|
return undefined;
|
|
11509
11536
|
});
|
|
11510
11537
|
},
|
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';
|
|
@@ -1333,7 +1333,7 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1333
1333
|
];
|
|
1334
1334
|
case 1:
|
|
1335
1335
|
claims = _state.sent();
|
|
1336
|
-
result = claims.resetPassword
|
|
1336
|
+
result = claims.resetPassword == null ? undefined : claims;
|
|
1337
1337
|
return [
|
|
1338
1338
|
2,
|
|
1339
1339
|
result
|
|
@@ -1744,15 +1744,21 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1744
1744
|
case 1:
|
|
1745
1745
|
userRecord = _state.sent();
|
|
1746
1746
|
createdUser = false;
|
|
1747
|
-
if (
|
|
1747
|
+
if (!userRecord) return [
|
|
1748
1748
|
3,
|
|
1749
|
-
|
|
1749
|
+
2
|
|
1750
|
+
];
|
|
1751
|
+
userRecordId = userRecord.uid;
|
|
1752
|
+
return [
|
|
1753
|
+
3,
|
|
1754
|
+
6
|
|
1750
1755
|
];
|
|
1756
|
+
case 2:
|
|
1751
1757
|
return [
|
|
1752
1758
|
4,
|
|
1753
1759
|
this.createNewUser(input)
|
|
1754
1760
|
];
|
|
1755
|
-
case
|
|
1761
|
+
case 3:
|
|
1756
1762
|
createResult = _state.sent();
|
|
1757
1763
|
// add the setup password to the user's credentials
|
|
1758
1764
|
userContext = this.authService.userContext(createResult.user.uid);
|
|
@@ -1760,7 +1766,7 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1760
1766
|
4,
|
|
1761
1767
|
this.addNewUserSetupClaims(userContext, createResult.password)
|
|
1762
1768
|
];
|
|
1763
|
-
case
|
|
1769
|
+
case 4:
|
|
1764
1770
|
_state.sent();
|
|
1765
1771
|
createdUser = true;
|
|
1766
1772
|
userRecordId = userContext.uid;
|
|
@@ -1768,14 +1774,8 @@ function _ts_generator$g(thisArg, body) {
|
|
|
1768
1774
|
4,
|
|
1769
1775
|
userContext.loadRecord()
|
|
1770
1776
|
];
|
|
1771
|
-
case 4:
|
|
1772
|
-
userRecord = _state.sent();
|
|
1773
|
-
return [
|
|
1774
|
-
3,
|
|
1775
|
-
6
|
|
1776
|
-
];
|
|
1777
1777
|
case 5:
|
|
1778
|
-
|
|
1778
|
+
userRecord = _state.sent();
|
|
1779
1779
|
_state.label = 6;
|
|
1780
1780
|
case 6:
|
|
1781
1781
|
if (!(createdUser && sendSetupContent === true || sendSetupContentIfUserExists)) return [
|
|
@@ -3609,10 +3609,10 @@ function _define_property$v(obj, key, value) {
|
|
|
3609
3609
|
{
|
|
3610
3610
|
key: "update",
|
|
3611
3611
|
value: function update(data, params) {
|
|
3612
|
-
if ((params === null || params === void 0 ? void 0 : params.precondition)
|
|
3613
|
-
this.batch.update(this.documentRef, data, params.precondition);
|
|
3614
|
-
} else {
|
|
3612
|
+
if ((params === null || params === void 0 ? void 0 : params.precondition) == null) {
|
|
3615
3613
|
this.batch.update(this.documentRef, data);
|
|
3614
|
+
} else {
|
|
3615
|
+
this.batch.update(this.documentRef, data, params.precondition);
|
|
3616
3616
|
}
|
|
3617
3617
|
return Promise.resolve();
|
|
3618
3618
|
}
|
|
@@ -7575,6 +7575,11 @@ function _ts_generator$9(thisArg, body) {
|
|
|
7575
7575
|
* permission-denied / not-found errors surface a real message + code instead of the generic
|
|
7576
7576
|
* `"Unknown error"` fallback the inline mapping used previously.
|
|
7577
7577
|
*
|
|
7578
|
+
* When no real message survives, the fallback is derived from the resolved error `code` so the two
|
|
7579
|
+
* distinct outcomes stay distinguishable — a not-found read no longer reads as "permission denied"
|
|
7580
|
+
* (and vice-versa). Only when neither a message nor a recognizable code is present does it fall back
|
|
7581
|
+
* to a generic message.
|
|
7582
|
+
*
|
|
7578
7583
|
* @param entry - A failed-key entry from the underlying multi-read.
|
|
7579
7584
|
* @returns A `{ key, message, code? }` triple safe to return to API/MCP callers.
|
|
7580
7585
|
*/ function modelAccessReadErrorFromUseMultipleModelsFailure(entry) {
|
|
@@ -7587,10 +7592,28 @@ function _ts_generator$9(thisArg, body) {
|
|
|
7587
7592
|
var code = (_info_serverErrorCode = info.serverErrorCode) !== null && _info_serverErrorCode !== void 0 ? _info_serverErrorCode : info.firebaseErrorCode;
|
|
7588
7593
|
return {
|
|
7589
7594
|
key: entry.key,
|
|
7590
|
-
message: (_ref = (_ref1 = serverMessage !== null && serverMessage !== void 0 ? serverMessage : httpsMessage) !== null && _ref1 !== void 0 ? _ref1 : plainMessage) !== null && _ref !== void 0 ? _ref :
|
|
7595
|
+
message: (_ref = (_ref1 = serverMessage !== null && serverMessage !== void 0 ? serverMessage : httpsMessage) !== null && _ref1 !== void 0 ? _ref1 : plainMessage) !== null && _ref !== void 0 ? _ref : modelAccessReadErrorMessageFromCode(code),
|
|
7591
7596
|
code: code
|
|
7592
7597
|
};
|
|
7593
7598
|
}
|
|
7599
|
+
/**
|
|
7600
|
+
* Derives a fallback read-error message from a resolved error code, distinguishing not-found from
|
|
7601
|
+
* permission-denied. Accepts both the server-error form (`NOT_FOUND` / `PERMISSION_DENIED` /
|
|
7602
|
+
* `FORBIDDEN`) and the Firebase HttpsError form (`not-found` / `permission-denied`).
|
|
7603
|
+
*
|
|
7604
|
+
* @param code - The resolved error code (`serverErrorCode ?? firebaseErrorCode`), if any.
|
|
7605
|
+
* @returns `'not found'`, `'permission denied'`, or a generic `'unknown error'` fallback.
|
|
7606
|
+
*/ function modelAccessReadErrorMessageFromCode(code) {
|
|
7607
|
+
var message;
|
|
7608
|
+
if (code === NOT_FOUND_ERROR_CODE || code === 'not-found') {
|
|
7609
|
+
message = 'not found';
|
|
7610
|
+
} else if (code === PERMISSION_DENIED_ERROR_CODE || code === FORBIDDEN_ERROR_CODE || code === 'permission-denied') {
|
|
7611
|
+
message = 'permission denied';
|
|
7612
|
+
} else {
|
|
7613
|
+
message = 'unknown error';
|
|
7614
|
+
}
|
|
7615
|
+
return message;
|
|
7616
|
+
}
|
|
7594
7617
|
// MARK: Service
|
|
7595
7618
|
/**
|
|
7596
7619
|
* Service for direct document reads using the `useModel()` permission-checking pattern.
|
|
@@ -9575,7 +9598,7 @@ function _object_spread_props$7(target, source) {
|
|
|
9575
9598
|
*
|
|
9576
9599
|
* @__NO_SIDE_EFFECTS__
|
|
9577
9600
|
*/ function makeBlockingFunctionWithHandler(blockingFunctionBuilder, handler, opts) {
|
|
9578
|
-
var blockingFn = opts
|
|
9601
|
+
var blockingFn = opts == null ? blockingFunctionBuilder(handler) : blockingFunctionBuilder(opts, handler);
|
|
9579
9602
|
blockingFn.__handler = handler;
|
|
9580
9603
|
return blockingFn;
|
|
9581
9604
|
}
|
|
@@ -10242,7 +10265,7 @@ function _ts_generator$5(thisArg, body) {
|
|
|
10242
10265
|
* @__NO_SIDE_EFFECTS__
|
|
10243
10266
|
*/ function firebaseServerActionsTransformFactory(options) {
|
|
10244
10267
|
var logError = (options !== null && options !== void 0 ? options : {}).logError;
|
|
10245
|
-
var logErrorFunction = logError
|
|
10268
|
+
var logErrorFunction = logError === false ? mapIdentityFunction : typeof logError === 'function' ? logError : defaultFirebaseServerActionsTransformFactoryLogErrorFunction;
|
|
10246
10269
|
return transformAndValidateObjectFactory({
|
|
10247
10270
|
handleValidationError: function handleValidationError(validationErrors) {
|
|
10248
10271
|
return _async_to_generator$5(function() {
|
|
@@ -10554,15 +10577,11 @@ FirebaseAppCheckMiddleware = __decorate([
|
|
|
10554
10577
|
switch(_state.label){
|
|
10555
10578
|
case 0:
|
|
10556
10579
|
appCheckToken = req.header('X-Firebase-AppCheck');
|
|
10557
|
-
if (
|
|
10558
|
-
3,
|
|
10559
|
-
1
|
|
10560
|
-
];
|
|
10561
|
-
error = new ForbiddenException();
|
|
10562
|
-
return [
|
|
10580
|
+
if (!appCheckToken) return [
|
|
10563
10581
|
3,
|
|
10564
|
-
|
|
10582
|
+
5
|
|
10565
10583
|
];
|
|
10584
|
+
_state.label = 1;
|
|
10566
10585
|
case 1:
|
|
10567
10586
|
_state.trys.push([
|
|
10568
10587
|
1,
|
|
@@ -10588,6 +10607,14 @@ FirebaseAppCheckMiddleware = __decorate([
|
|
|
10588
10607
|
4
|
|
10589
10608
|
];
|
|
10590
10609
|
case 4:
|
|
10610
|
+
return [
|
|
10611
|
+
3,
|
|
10612
|
+
6
|
|
10613
|
+
];
|
|
10614
|
+
case 5:
|
|
10615
|
+
error = new ForbiddenException();
|
|
10616
|
+
_state.label = 6;
|
|
10617
|
+
case 6:
|
|
10591
10618
|
return [
|
|
10592
10619
|
2,
|
|
10593
10620
|
error
|
|
@@ -11237,7 +11264,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
11237
11264
|
contentEncoding: (_options_metadata3 = options.metadata) === null || _options_metadata3 === void 0 ? void 0 : _options_metadata3.contentEncoding,
|
|
11238
11265
|
contentLanguage: (_options_metadata4 = options.metadata) === null || _options_metadata4 === void 0 ? void 0 : _options_metadata4.contentLanguage,
|
|
11239
11266
|
contentType: (_options_metadata5 = options.metadata) === null || _options_metadata5 === void 0 ? void 0 : _options_metadata5.contentType,
|
|
11240
|
-
metadata:
|
|
11267
|
+
metadata: objectHasNoKeys(customMetadata) ? undefined : customMetadata
|
|
11241
11268
|
});
|
|
11242
11269
|
}
|
|
11243
11270
|
function makeUploadOptions(options) {
|
|
@@ -11333,8 +11360,8 @@ function _ts_generator$2(thisArg, body) {
|
|
|
11333
11360
|
return _async_to_generator$2(function() {
|
|
11334
11361
|
var _ref, _ref1, expires, config;
|
|
11335
11362
|
return _ts_generator$2(this, function(_state) {
|
|
11336
|
-
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)
|
|
11337
|
-
:
|
|
11363
|
+
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
|
|
11364
|
+
: addMilliseconds(new Date(), input.expiresIn); // default expiration in 1 hour
|
|
11338
11365
|
config = _object_spread_props$3(_object_spread$3({}, input), {
|
|
11339
11366
|
action: (_ref1 = input === null || input === void 0 ? void 0 : input.action) !== null && _ref1 !== void 0 ? _ref1 : 'read',
|
|
11340
11367
|
expires: expires,
|
|
@@ -11500,9 +11527,9 @@ function _ts_generator$2(thisArg, body) {
|
|
|
11500
11527
|
});
|
|
11501
11528
|
},
|
|
11502
11529
|
makePublic: function makePublic(setPublic) {
|
|
11503
|
-
return (setPublic
|
|
11530
|
+
return (setPublic === false ? file.acl.delete({
|
|
11504
11531
|
entity: PUBLIC_ACL.entity
|
|
11505
|
-
})).then(function() {
|
|
11532
|
+
}) : file.acl.add(PUBLIC_ACL)).then(function() {
|
|
11506
11533
|
return undefined;
|
|
11507
11534
|
});
|
|
11508
11535
|
},
|
package/mailgun/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/firebase-server/mailgun",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.17.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.17.0",
|
|
6
|
+
"@dereekb/firebase": "13.17.0",
|
|
7
|
+
"@dereekb/firebase-server": "13.17.0",
|
|
8
|
+
"@dereekb/date": "13.17.0",
|
|
9
|
+
"@dereekb/nestjs": "13.17.0",
|
|
10
|
+
"@dereekb/model": "13.17.0",
|
|
11
|
+
"@dereekb/rxjs": "13.17.0",
|
|
12
|
+
"@dereekb/util": "13.17.0"
|
|
13
13
|
},
|
|
14
14
|
"exports": {
|
|
15
15
|
"./package.json": "./package.json",
|