uityu.shared 1.0.1 → 1.0.3
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/README.md +23 -0
- package/dist/http/cors.d.ts +27 -0
- package/dist/http/cors.d.ts.map +1 -0
- package/dist/http/cors.js +103 -0
- package/dist/http/cors.js.map +1 -0
- package/dist/http/index.d.ts +1 -0
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +1 -0
- package/dist/http/index.js.map +1 -1
- package/package.json +10 -1
package/README.md
CHANGED
|
@@ -140,6 +140,29 @@ export async function handler(req): Promise<Response> {
|
|
|
140
140
|
}
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
+
### Middleware CORS configurable
|
|
144
|
+
|
|
145
|
+
```ts
|
|
146
|
+
import { createCorsToolkit } from 'uityu.shared/http';
|
|
147
|
+
|
|
148
|
+
const cors = createCorsToolkit({
|
|
149
|
+
allowedOrigins: ['https://app.uityu.com', 'https://admin.uityu.com'],
|
|
150
|
+
allowedMethods: ['GET', 'POST'],
|
|
151
|
+
allowedHeaders: ['Content-Type', 'Authorization'],
|
|
152
|
+
exposeHeaders: ['X-Trace-Id'],
|
|
153
|
+
allowCredentials: true,
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
export const handler = (req, res, next) => {
|
|
157
|
+
cors.corsHandler(req, res, (err) => {
|
|
158
|
+
if (err) return next(err);
|
|
159
|
+
if (!cors.ensureMethod(req, res, 'POST')) return;
|
|
160
|
+
// ...logic
|
|
161
|
+
next();
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
```
|
|
165
|
+
|
|
143
166
|
## Búsqueda (`uityu.shared/search`)
|
|
144
167
|
|
|
145
168
|
```ts
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type CorsRequestLike = {
|
|
2
|
+
headers?: Record<string, unknown>;
|
|
3
|
+
method?: string;
|
|
4
|
+
get?(header: string): string | undefined;
|
|
5
|
+
};
|
|
6
|
+
export type CorsResponseLike = {
|
|
7
|
+
setHeader(name: string, value: string): void;
|
|
8
|
+
status?(code: number): CorsResponseLike | void;
|
|
9
|
+
send?(body?: unknown): unknown;
|
|
10
|
+
};
|
|
11
|
+
export type CorsNextLike = (error?: unknown) => unknown;
|
|
12
|
+
export interface CorsConfig {
|
|
13
|
+
allowedOrigins: string[];
|
|
14
|
+
allowedMethods?: string[];
|
|
15
|
+
allowedHeaders?: string[];
|
|
16
|
+
exposeHeaders?: string[];
|
|
17
|
+
allowCredentials?: boolean;
|
|
18
|
+
preflightStatusCode?: number;
|
|
19
|
+
enableDebugHeader?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface CorsToolkit {
|
|
22
|
+
applyCorsHeaders(req: CorsRequestLike, res: CorsResponseLike): void;
|
|
23
|
+
corsHandler(req: CorsRequestLike, res: CorsResponseLike, next: CorsNextLike): unknown;
|
|
24
|
+
ensureMethod(req: CorsRequestLike, res: CorsResponseLike, expectedMethod: string): boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function createCorsToolkit(config: CorsConfig): CorsToolkit;
|
|
27
|
+
//# sourceMappingURL=cors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cors.d.ts","sourceRoot":"","sources":["../../src/http/cors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,MAAM,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAAC;IAC/C,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;AAExD,MAAM,WAAW,UAAU;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,WAAW;IAC1B,gBAAgB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACpE,WAAW,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC;IACtF,YAAY,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5F;AAOD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,WAAW,CA2DjE"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
const DEFAULT_ALLOWED_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"];
|
|
2
|
+
const DEFAULT_ALLOWED_HEADERS = ["Content-Type", "Authorization", "X-Requested-With"];
|
|
3
|
+
const DEFAULT_EXPOSE_HEADERS = ["X-Trace-Id", "WWW-Authenticate"];
|
|
4
|
+
const DEFAULT_PREFLIGHT_STATUS = 204;
|
|
5
|
+
export function createCorsToolkit(config) {
|
|
6
|
+
const normalizedConfig = normalizeConfig(config);
|
|
7
|
+
const allowedOriginSet = new Set(normalizedConfig.allowedOrigins);
|
|
8
|
+
const applyCorsHeaders = (req, res) => {
|
|
9
|
+
const origin = readHeader(req, "origin");
|
|
10
|
+
const allowedOrigin = resolveAllowedOrigin(origin, allowedOriginSet);
|
|
11
|
+
if (allowedOrigin) {
|
|
12
|
+
res.setHeader("Access-Control-Allow-Origin", allowedOrigin);
|
|
13
|
+
}
|
|
14
|
+
else if (normalizedConfig.enableDebugHeader) {
|
|
15
|
+
res.setHeader("X-CORS-Not-Allowed-Origin", origin ?? "<none>");
|
|
16
|
+
}
|
|
17
|
+
res.setHeader("Vary", "Origin");
|
|
18
|
+
res.setHeader("Access-Control-Allow-Headers", normalizedConfig.allowedHeaders.join(", "));
|
|
19
|
+
res.setHeader("Access-Control-Allow-Methods", normalizedConfig.allowedMethods.join(", "));
|
|
20
|
+
res.setHeader("Access-Control-Expose-Headers", normalizedConfig.exposeHeaders.join(", "));
|
|
21
|
+
res.setHeader("Access-Control-Allow-Credentials", normalizedConfig.allowCredentials ? "true" : "false");
|
|
22
|
+
};
|
|
23
|
+
const corsHandler = (req, res, next) => {
|
|
24
|
+
applyCorsHeaders(req, res);
|
|
25
|
+
if (isPreflight(req)) {
|
|
26
|
+
respond(res, normalizedConfig.preflightStatusCode, "");
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
return next();
|
|
30
|
+
};
|
|
31
|
+
const ensureMethod = (req, res, expectedMethod) => {
|
|
32
|
+
if (isPreflight(req)) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
const method = (req.method ?? "").toUpperCase();
|
|
36
|
+
if (method !== expectedMethod.toUpperCase()) {
|
|
37
|
+
respond(res, 405, "Method Not Allowed");
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
applyCorsHeaders,
|
|
44
|
+
corsHandler,
|
|
45
|
+
ensureMethod,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const normalizeConfig = (config) => {
|
|
49
|
+
const allowedOrigins = config.allowedOrigins.map((value) => value?.trim()).filter(Boolean);
|
|
50
|
+
if (!allowedOrigins.length) {
|
|
51
|
+
throw new Error("CORS configuration requires at least one allowed origin");
|
|
52
|
+
}
|
|
53
|
+
if (config.allowCredentials && allowedOrigins.includes("*")) {
|
|
54
|
+
throw new Error("Cannot use wildcard origin when allowCredentials is true");
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
allowedOrigins,
|
|
58
|
+
allowedMethods: normalizeList(config.allowedMethods, DEFAULT_ALLOWED_METHODS),
|
|
59
|
+
allowedHeaders: normalizeList(config.allowedHeaders, DEFAULT_ALLOWED_HEADERS),
|
|
60
|
+
exposeHeaders: normalizeList(config.exposeHeaders, DEFAULT_EXPOSE_HEADERS),
|
|
61
|
+
allowCredentials: Boolean(config.allowCredentials),
|
|
62
|
+
preflightStatusCode: config.preflightStatusCode ?? DEFAULT_PREFLIGHT_STATUS,
|
|
63
|
+
enableDebugHeader: Boolean(config.enableDebugHeader),
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
const normalizeList = (value, fallback) => {
|
|
67
|
+
const source = value && value.length ? value : fallback;
|
|
68
|
+
return Array.from(new Set(source.map((entry) => entry.trim()).filter(Boolean)));
|
|
69
|
+
};
|
|
70
|
+
const resolveAllowedOrigin = (origin, whitelist) => {
|
|
71
|
+
if (!origin) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
if (whitelist.has("*")) {
|
|
75
|
+
return origin;
|
|
76
|
+
}
|
|
77
|
+
return whitelist.has(origin) ? origin : null;
|
|
78
|
+
};
|
|
79
|
+
const readHeader = (req, name) => {
|
|
80
|
+
if (typeof req.get === "function") {
|
|
81
|
+
const value = req.get(name);
|
|
82
|
+
if (typeof value === "string") {
|
|
83
|
+
return value;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const headers = req.headers ?? {};
|
|
87
|
+
const value = headers[name] ?? headers[name.toLowerCase()];
|
|
88
|
+
return typeof value === "string" ? value : undefined;
|
|
89
|
+
};
|
|
90
|
+
const isPreflight = (req) => (req.method ?? "").toUpperCase() === "OPTIONS";
|
|
91
|
+
const respond = (res, status, body) => {
|
|
92
|
+
if (typeof res.status === "function") {
|
|
93
|
+
const next = res.status(status);
|
|
94
|
+
if (next && typeof next.send === "function") {
|
|
95
|
+
next.send(body);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (typeof res.send === "function") {
|
|
100
|
+
res.send(body);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=cors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cors.js","sourceRoot":"","sources":["../../src/http/cors.ts"],"names":[],"mappings":"AA8BA,MAAM,uBAAuB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAC;AAC9F,MAAM,uBAAuB,GAAG,CAAC,cAAc,EAAE,eAAe,EAAE,kBAAkB,CAAU,CAAC;AAC/F,MAAM,sBAAsB,GAAG,CAAC,YAAY,EAAE,kBAAkB,CAAU,CAAC;AAC3E,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAErC,MAAM,UAAU,iBAAiB,CAAC,MAAkB;IAClD,MAAM,gBAAgB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACjD,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAElE,MAAM,gBAAgB,GAAG,CAAC,GAAoB,EAAE,GAAqB,EAAQ,EAAE;QAC7E,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACzC,MAAM,aAAa,GAAG,oBAAoB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;QAErE,IAAI,aAAa,EAAE,CAAC;YAClB,GAAG,CAAC,SAAS,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CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,GAAoB,EAAW,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC;AAEtG,MAAM,OAAO,GAAG,CAAC,GAAqB,EAAE,MAAc,EAAE,IAAY,EAAQ,EAAE;IAC5E,IAAI,OAAO,GAAG,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAC5C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAChB,OAAO;QACT,CAAC;IACH,CAAC;IAED,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACnC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;AACH,CAAC,CAAC"}
|
package/dist/http/index.d.ts
CHANGED
package/dist/http/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
|
package/dist/http/index.js
CHANGED
package/dist/http/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uityu.shared",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Shared infrastructure toolkit for UITYU microservices (Cloud Functions, SSR, APIs).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,38 +8,47 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"import": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.js",
|
|
11
12
|
"types": "./dist/index.d.ts"
|
|
12
13
|
},
|
|
13
14
|
"./common": {
|
|
14
15
|
"import": "./dist/common/index.js",
|
|
16
|
+
"default": "./dist/common/index.js",
|
|
15
17
|
"types": "./dist/common/index.d.ts"
|
|
16
18
|
},
|
|
17
19
|
"./common/math": {
|
|
18
20
|
"import": "./dist/common/math/index.js",
|
|
21
|
+
"default": "./dist/common/math/index.js",
|
|
19
22
|
"types": "./dist/common/math/index.d.ts"
|
|
20
23
|
},
|
|
21
24
|
"./common/logging": {
|
|
22
25
|
"import": "./dist/common/logging/index.js",
|
|
26
|
+
"default": "./dist/common/logging/index.js",
|
|
23
27
|
"types": "./dist/common/logging/index.d.ts"
|
|
24
28
|
},
|
|
25
29
|
"./common/string": {
|
|
26
30
|
"import": "./dist/common/string/index.js",
|
|
31
|
+
"default": "./dist/common/string/index.js",
|
|
27
32
|
"types": "./dist/common/string/index.d.ts"
|
|
28
33
|
},
|
|
29
34
|
"./errors": {
|
|
30
35
|
"import": "./dist/errors/index.js",
|
|
36
|
+
"default": "./dist/errors/index.js",
|
|
31
37
|
"types": "./dist/errors/index.d.ts"
|
|
32
38
|
},
|
|
33
39
|
"./firebase/admin": {
|
|
34
40
|
"import": "./dist/firebase/admin/index.js",
|
|
41
|
+
"default": "./dist/firebase/admin/index.js",
|
|
35
42
|
"types": "./dist/firebase/admin/index.d.ts"
|
|
36
43
|
},
|
|
37
44
|
"./http": {
|
|
38
45
|
"import": "./dist/http/index.js",
|
|
46
|
+
"default": "./dist/http/index.js",
|
|
39
47
|
"types": "./dist/http/index.d.ts"
|
|
40
48
|
},
|
|
41
49
|
"./search": {
|
|
42
50
|
"import": "./dist/search/index.js",
|
|
51
|
+
"default": "./dist/search/index.js",
|
|
43
52
|
"types": "./dist/search/index.d.ts"
|
|
44
53
|
}
|
|
45
54
|
},
|