5htp-core 0.4.9-8 → 0.4.9-9
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/package.json +1 -1
- package/src/client/services/router/response/index.tsx +2 -4
- package/src/common/router/index.ts +3 -1
- package/src/server/app/container/config.ts +3 -1
- package/src/server/services/router/request/index.ts +1 -1
- package/src/server/services/router/response/page/index.tsx +11 -8
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "5htp-core",
|
|
3
3
|
"description": "Convenient TypeScript framework designed for Performance and Productivity.",
|
|
4
|
-
"version": "0.4.9-
|
|
4
|
+
"version": "0.4.9-9",
|
|
5
5
|
"author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
|
|
6
6
|
"repository": "git://github.com/gaetanlegac/5htp-core.git",
|
|
7
7
|
"license": "MIT",
|
|
@@ -39,12 +39,10 @@ export type TRouterContext<
|
|
|
39
39
|
page: ClientPage<TRouter>,
|
|
40
40
|
data: TObjetDonnees
|
|
41
41
|
}
|
|
42
|
-
&
|
|
43
42
|
// Expose client application services (api, socket, ...)
|
|
44
43
|
//TRouter["app"]
|
|
45
|
-
TApplication
|
|
46
|
-
&
|
|
47
|
-
ReturnType<TRouter["config"]["context"]>
|
|
44
|
+
& TApplication
|
|
45
|
+
& ReturnType<TRouter["config"]["context"]>
|
|
48
46
|
)
|
|
49
47
|
|
|
50
48
|
/*----------------------------------
|
|
@@ -72,7 +72,9 @@ export type TClientOrServerContext = (
|
|
|
72
72
|
// So here, we put the
|
|
73
73
|
//{[clientContextKey in keyof ClientRouterContext/*Omit<ClientRouterContext, TClientOnlyContextKeys>*/]: undefined}
|
|
74
74
|
//&
|
|
75
|
-
|
|
75
|
+
|
|
76
|
+
// Page is always available in client context
|
|
77
|
+
With<ServerRouterContext, 'page'>
|
|
76
78
|
)
|
|
77
79
|
)
|
|
78
80
|
|
|
@@ -87,7 +87,7 @@ export default class ServerRequest<
|
|
|
87
87
|
this.router = router;
|
|
88
88
|
this.api = new ApiClient(this);
|
|
89
89
|
|
|
90
|
-
this.url = this.req.
|
|
90
|
+
this.url = this.req.protocol + '://' + this.req.get('host') + this.req.originalUrl;
|
|
91
91
|
this.host = this.req.get('host') as string;
|
|
92
92
|
this.method = method;
|
|
93
93
|
this.headers = headers || {};
|
|
@@ -125,17 +125,18 @@ export default class Page<TRouter extends Router = Router> extends PageResponse<
|
|
|
125
125
|
'og:type': 'website',
|
|
126
126
|
'og:locale': this.app.identity.locale,
|
|
127
127
|
'og:site_name': this.app.identity.web.title,
|
|
128
|
-
'og:url': this.
|
|
128
|
+
'og:url': this.url,
|
|
129
129
|
|
|
130
130
|
'og:title': this.title,
|
|
131
131
|
'og:description': this.description,
|
|
132
132
|
|
|
133
|
-
'twitter:url': this.
|
|
133
|
+
'twitter:url': this.url,
|
|
134
134
|
'twitter:card': 'summary_large_image',
|
|
135
135
|
'twitter:title': this.title,
|
|
136
|
-
'twitter:text:title': this.title,
|
|
137
136
|
'twitter:description': this.description,
|
|
138
137
|
|
|
138
|
+
...(this.app.identity.web.metas || {}),
|
|
139
|
+
|
|
139
140
|
...this.metas
|
|
140
141
|
};
|
|
141
142
|
|
|
@@ -155,10 +156,10 @@ export default class Page<TRouter extends Router = Router> extends PageResponse<
|
|
|
155
156
|
logo: {
|
|
156
157
|
'@type': 'ImageObject',
|
|
157
158
|
'@id': this.router.url('/#logo'),
|
|
158
|
-
url: this.router.url('/public/
|
|
159
|
-
width: "
|
|
160
|
-
height: "
|
|
161
|
-
caption: this.app.identity.
|
|
159
|
+
url: this.router.url('/public/brand/1024.png'),
|
|
160
|
+
width: "1024px",
|
|
161
|
+
height: "1024px",
|
|
162
|
+
caption: this.app.identity.name
|
|
162
163
|
},
|
|
163
164
|
sameAs: []
|
|
164
165
|
}, {
|
|
@@ -171,7 +172,9 @@ export default class Page<TRouter extends Router = Router> extends PageResponse<
|
|
|
171
172
|
"@id": this.router.url('/#organization'),
|
|
172
173
|
},
|
|
173
174
|
inLanguage: this.app.identity.locale,
|
|
174
|
-
potentialAction: [],
|
|
175
|
+
potentialAction: [],
|
|
176
|
+
|
|
177
|
+
...(this.app.identity.web.jsonld || {}),
|
|
175
178
|
}, {
|
|
176
179
|
'@type': "WebPage",
|
|
177
180
|
'@id': this.url,
|