@fedify/express 2.2.0-dev.610 → 2.2.0-dev.622
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/dist/index.cjs +6 -31
- package/dist/index.js +3 -6
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1,40 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
const node_buffer = __toESM(require("node:buffer"));
|
|
25
|
-
const node_stream = __toESM(require("node:stream"));
|
|
26
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let node_buffer = require("node:buffer");
|
|
3
|
+
let node_stream = require("node:stream");
|
|
27
4
|
//#region src/index.ts
|
|
28
5
|
function integrateFederation(federation, contextDataFactory) {
|
|
29
6
|
return (req, res, next) => {
|
|
30
7
|
const request = fromERequest(req);
|
|
31
8
|
const contextData = contextDataFactory(req);
|
|
32
|
-
|
|
33
|
-
contextDataPromise.then(async (contextData$1) => {
|
|
9
|
+
(contextData instanceof Promise ? contextData : Promise.resolve(contextData)).then(async (contextData) => {
|
|
34
10
|
let notFound = false;
|
|
35
11
|
let notAcceptable = false;
|
|
36
12
|
const response = await federation.fetch(request, {
|
|
37
|
-
contextData
|
|
13
|
+
contextData,
|
|
38
14
|
onNotFound: () => {
|
|
39
15
|
notFound = true;
|
|
40
16
|
next();
|
|
@@ -94,6 +70,5 @@ function setEResponse(res, response) {
|
|
|
94
70
|
});
|
|
95
71
|
});
|
|
96
72
|
}
|
|
97
|
-
|
|
98
73
|
//#endregion
|
|
99
|
-
exports.integrateFederation = integrateFederation;
|
|
74
|
+
exports.integrateFederation = integrateFederation;
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { Buffer } from "node:buffer";
|
|
2
2
|
import { Readable } from "node:stream";
|
|
3
|
-
|
|
4
3
|
//#region src/index.ts
|
|
5
4
|
function integrateFederation(federation, contextDataFactory) {
|
|
6
5
|
return (req, res, next) => {
|
|
7
6
|
const request = fromERequest(req);
|
|
8
7
|
const contextData = contextDataFactory(req);
|
|
9
|
-
|
|
10
|
-
contextDataPromise.then(async (contextData$1) => {
|
|
8
|
+
(contextData instanceof Promise ? contextData : Promise.resolve(contextData)).then(async (contextData) => {
|
|
11
9
|
let notFound = false;
|
|
12
10
|
let notAcceptable = false;
|
|
13
11
|
const response = await federation.fetch(request, {
|
|
14
|
-
contextData
|
|
12
|
+
contextData,
|
|
15
13
|
onNotFound: () => {
|
|
16
14
|
notFound = true;
|
|
17
15
|
next();
|
|
@@ -71,6 +69,5 @@ function setEResponse(res, response) {
|
|
|
71
69
|
});
|
|
72
70
|
});
|
|
73
71
|
}
|
|
74
|
-
|
|
75
72
|
//#endregion
|
|
76
|
-
export { integrateFederation };
|
|
73
|
+
export { integrateFederation };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/express",
|
|
3
|
-
"version": "2.2.0-dev.
|
|
3
|
+
"version": "2.2.0-dev.622+e54cb037",
|
|
4
4
|
"description": "Integrate Fedify with Express",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Fedify",
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
],
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"express": "^4.0.0",
|
|
52
|
-
"@fedify/fedify": "^2.2.0-dev.
|
|
52
|
+
"@fedify/fedify": "^2.2.0-dev.622+e54cb037"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/express": "^4.0.0",
|
|
56
56
|
"@types/node": "^22.17.0",
|
|
57
|
-
"tsdown": "^0.
|
|
58
|
-
"typescript": "^5.9.
|
|
57
|
+
"tsdown": "^0.21.6",
|
|
58
|
+
"typescript": "^5.9.2"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build:self": "tsdown",
|