ag-common 0.0.500 → 0.0.502
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.
|
@@ -10,7 +10,6 @@ export * from './extractAttributes';
|
|
|
10
10
|
export * from './jwt';
|
|
11
11
|
export * from './plural';
|
|
12
12
|
export * from './routes';
|
|
13
|
-
export * from './routesnext';
|
|
14
13
|
export * from './serviceWorker';
|
|
15
14
|
export * from './useContextMenu';
|
|
16
15
|
export * from './useElementAttribute';
|
package/dist/ui/helpers/index.js
CHANGED
|
@@ -26,7 +26,6 @@ __exportStar(require("./extractAttributes"), exports);
|
|
|
26
26
|
__exportStar(require("./jwt"), exports);
|
|
27
27
|
__exportStar(require("./plural"), exports);
|
|
28
28
|
__exportStar(require("./routes"), exports);
|
|
29
|
-
__exportStar(require("./routesnext"), exports);
|
|
30
29
|
__exportStar(require("./serviceWorker"), exports);
|
|
31
30
|
__exportStar(require("./useContextMenu"), exports);
|
|
32
31
|
__exportStar(require("./useElementAttribute"), exports);
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.502",
|
|
3
3
|
"name": "ag-common",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"typescript": "^5"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@babel/core": "7.22.
|
|
40
|
+
"@babel/core": "7.22.19",
|
|
41
41
|
"@babel/preset-typescript": "7.22.15",
|
|
42
|
-
"@babel/types": "7.22.
|
|
42
|
+
"@babel/types": "7.22.19",
|
|
43
43
|
"@emotion/react": "11.11.1",
|
|
44
44
|
"@emotion/styled": "11.11.0",
|
|
45
|
-
"@smithy/types": "2.3.
|
|
45
|
+
"@smithy/types": "2.3.1",
|
|
46
46
|
"@storybook/addon-actions": "7.4.1",
|
|
47
47
|
"@storybook/addon-docs": "7.4.1",
|
|
48
48
|
"@storybook/addon-essentials": "7.4.1",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"@types/react": "18.2.21",
|
|
59
59
|
"@types/react-dom": "18.2.7",
|
|
60
60
|
"cross-env": "7.0.3",
|
|
61
|
-
"eslint-config-e7npm": "0.0.
|
|
62
|
-
"jest": "29.
|
|
61
|
+
"eslint-config-e7npm": "0.0.36",
|
|
62
|
+
"jest": "29.7.0",
|
|
63
63
|
"rimraf": "5.0.1",
|
|
64
64
|
"storybook": "7.4.1",
|
|
65
65
|
"ts-jest": "29.1.1"
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/** next13 server only */
|
|
2
|
-
export declare const getNextAppRequest: ({ headers, }: {
|
|
3
|
-
/** use next/headers() */
|
|
4
|
-
headers: {
|
|
5
|
-
get: (s: string) => string | null;
|
|
6
|
-
};
|
|
7
|
-
}) => {
|
|
8
|
-
url: {
|
|
9
|
-
hash: string;
|
|
10
|
-
host: string;
|
|
11
|
-
hostname: string;
|
|
12
|
-
href: string;
|
|
13
|
-
origin: string;
|
|
14
|
-
password: string;
|
|
15
|
-
pathname: string;
|
|
16
|
-
port: string;
|
|
17
|
-
protocol: string;
|
|
18
|
-
search: string;
|
|
19
|
-
username: string;
|
|
20
|
-
};
|
|
21
|
-
query: Record<string, string>;
|
|
22
|
-
userAgent: string;
|
|
23
|
-
lang: import("../..").TLang;
|
|
24
|
-
cookieDocument: string | null;
|
|
25
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNextAppRequest = void 0;
|
|
4
|
-
const object_1 = require("../../common/helpers/object");
|
|
5
|
-
const url_1 = require("../../common/helpers/string/url");
|
|
6
|
-
const routes_1 = require("./routes");
|
|
7
|
-
/** next13 server only */
|
|
8
|
-
const getNextAppRequest = ({ headers, }) => {
|
|
9
|
-
var _a, _b, _c, _d, _e;
|
|
10
|
-
let query = {};
|
|
11
|
-
if (headers.get('x-invoke-query')) {
|
|
12
|
-
query = JSON.parse(decodeURIComponent((_a = headers.get('x-invoke-query')) !== null && _a !== void 0 ? _a : '{}'));
|
|
13
|
-
}
|
|
14
|
-
const userAgent = (_c = (_b = headers.get('user-agent')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) !== null && _c !== void 0 ? _c : '';
|
|
15
|
-
const host = (_d = headers.get('host')) !== null && _d !== void 0 ? _d : '';
|
|
16
|
-
const pathname = (_e = headers.get('x-invoke-path')) !== null && _e !== void 0 ? _e : '/';
|
|
17
|
-
const protocol = host.includes(':443') || !host.includes(':') ? 'https:' : 'http:';
|
|
18
|
-
let url = `${protocol}${host}${pathname}`;
|
|
19
|
-
if (Object.keys(query).length > 0) {
|
|
20
|
-
const qs = '?' + (0, object_1.objectToString)(query, '=', '&');
|
|
21
|
-
url += qs;
|
|
22
|
-
}
|
|
23
|
-
const cookieDocument = headers.get('cookie');
|
|
24
|
-
return {
|
|
25
|
-
url: (0, url_1.stripUrl)(new URL(url)),
|
|
26
|
-
query,
|
|
27
|
-
userAgent,
|
|
28
|
-
lang: (0, routes_1.getRenderLanguage)(host),
|
|
29
|
-
cookieDocument,
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
exports.getNextAppRequest = getNextAppRequest;
|