dn-react-router-toolkit 0.5.0 → 0.5.2

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.
@@ -83,9 +83,7 @@ function createWithStrictAuthHandler({ authService }) {
83
83
  };
84
84
  }
85
85
  function createWithAuthHandler({
86
- authService,
87
- tempUserTokenManager,
88
- tempUserCookieManager
86
+ authService
89
87
  }) {
90
88
  return function(fn) {
91
89
  const withAuthHandler = createWithStrictAuthHandler({
@@ -105,30 +103,19 @@ function createWithAuthHandler({
105
103
  });
106
104
  return res;
107
105
  };
108
- const tempUserToken = await tempUserCookieManager.parse(
109
- args.request
110
- );
111
- if (tempUserToken) {
112
- const tempUserPayload = await tempUserTokenManager.verify(tempUserToken);
113
- if (tempUserPayload) {
114
- return respond(tempUserPayload);
115
- }
116
- }
117
106
  const user = await authService.authRepository.createUser({
118
107
  id: (0, import_uuid.v4)(),
119
- role: "temp",
108
+ role: "guest",
120
109
  name: "\uC775\uBA85"
121
110
  });
122
- const newTempUserToken = await tempUserTokenManager.sign({
123
- userId: user.id,
124
- name: user.name,
125
- role: user.role
126
- });
111
+ const { accessToken, refreshToken } = await authService.issueTokenPair(user);
127
112
  const headers = new Headers();
128
- const setCookie = await tempUserCookieManager.serialize(newTempUserToken);
129
- headers.append("Set-Cookie", setCookie);
130
- const newTempUserPayload = tempUserTokenManager.decode(newTempUserToken);
131
- return respond(newTempUserPayload, headers);
113
+ const accessTokenSetCookie = await authService.getAccessTokenSetCookie(accessToken);
114
+ headers.append("Set-Cookie", accessTokenSetCookie);
115
+ const refreshTokenSetCookie = await authService.getRefreshTokenSetCookie(refreshToken);
116
+ headers.append("Set-Cookie", refreshTokenSetCookie);
117
+ const payload = authService.accessTokenManager.decode(accessToken);
118
+ return respond(payload, headers);
132
119
  });
133
120
  return handler;
134
121
  };
@@ -55,9 +55,7 @@ function createWithStrictAuthHandler({ authService }) {
55
55
  };
56
56
  }
57
57
  function createWithAuthHandler({
58
- authService,
59
- tempUserTokenManager,
60
- tempUserCookieManager
58
+ authService
61
59
  }) {
62
60
  return function(fn) {
63
61
  const withAuthHandler = createWithStrictAuthHandler({
@@ -77,30 +75,19 @@ function createWithAuthHandler({
77
75
  });
78
76
  return res;
79
77
  };
80
- const tempUserToken = await tempUserCookieManager.parse(
81
- args.request
82
- );
83
- if (tempUserToken) {
84
- const tempUserPayload = await tempUserTokenManager.verify(tempUserToken);
85
- if (tempUserPayload) {
86
- return respond(tempUserPayload);
87
- }
88
- }
89
78
  const user = await authService.authRepository.createUser({
90
79
  id: v4(),
91
- role: "temp",
80
+ role: "guest",
92
81
  name: "\uC775\uBA85"
93
82
  });
94
- const newTempUserToken = await tempUserTokenManager.sign({
95
- userId: user.id,
96
- name: user.name,
97
- role: user.role
98
- });
83
+ const { accessToken, refreshToken } = await authService.issueTokenPair(user);
99
84
  const headers = new Headers();
100
- const setCookie = await tempUserCookieManager.serialize(newTempUserToken);
101
- headers.append("Set-Cookie", setCookie);
102
- const newTempUserPayload = tempUserTokenManager.decode(newTempUserToken);
103
- return respond(newTempUserPayload, headers);
85
+ const accessTokenSetCookie = await authService.getAccessTokenSetCookie(accessToken);
86
+ headers.append("Set-Cookie", accessTokenSetCookie);
87
+ const refreshTokenSetCookie = await authService.getRefreshTokenSetCookie(refreshToken);
88
+ headers.append("Set-Cookie", refreshTokenSetCookie);
89
+ const payload = authService.accessTokenManager.decode(accessToken);
90
+ return respond(payload, headers);
104
91
  });
105
92
  return handler;
106
93
  };
@@ -1,5 +1,5 @@
1
1
  import { AccessTokenPayload } from 'dn-react-toolkit/auth';
2
- import { AuthService, JWTManager, CookieManager } from 'dn-react-toolkit/auth/server';
2
+ import { AuthService } from 'dn-react-toolkit/auth/server';
3
3
  import { LoaderFunctionArgs, ActionFunctionArgs } from 'react-router';
4
4
 
5
5
  type Handler<T extends LoaderFunctionArgs | ActionFunctionArgs> = (arg: T) => Promise<unknown> | unknown;
@@ -8,10 +8,8 @@ type WithAuthHandler<T extends LoaderFunctionArgs | ActionFunctionArgs> = (fn: I
8
8
  declare function createWithStrictAuthHandler<T extends LoaderFunctionArgs | ActionFunctionArgs>({ authService }: {
9
9
  authService: AuthService;
10
10
  }): <THandler extends Handler<T>>(fn: (auth?: AccessTokenPayload) => THandler) => THandler;
11
- declare function createWithAuthHandler<T extends LoaderFunctionArgs | ActionFunctionArgs>({ authService, tempUserTokenManager, tempUserCookieManager, }: {
11
+ declare function createWithAuthHandler<T extends LoaderFunctionArgs | ActionFunctionArgs>({ authService, }: {
12
12
  authService: AuthService;
13
- tempUserTokenManager: JWTManager<AccessTokenPayload>;
14
- tempUserCookieManager: CookieManager;
15
13
  }): <THandler extends Handler<T>>(fn: (auth: AccessTokenPayload) => THandler) => THandler;
16
14
 
17
15
  export { type WithAuthHandler, createWithAuthHandler, createWithStrictAuthHandler };
@@ -1,5 +1,5 @@
1
1
  import { AccessTokenPayload } from 'dn-react-toolkit/auth';
2
- import { AuthService, JWTManager, CookieManager } from 'dn-react-toolkit/auth/server';
2
+ import { AuthService } from 'dn-react-toolkit/auth/server';
3
3
  import { LoaderFunctionArgs, ActionFunctionArgs } from 'react-router';
4
4
 
5
5
  type Handler<T extends LoaderFunctionArgs | ActionFunctionArgs> = (arg: T) => Promise<unknown> | unknown;
@@ -8,10 +8,8 @@ type WithAuthHandler<T extends LoaderFunctionArgs | ActionFunctionArgs> = (fn: I
8
8
  declare function createWithStrictAuthHandler<T extends LoaderFunctionArgs | ActionFunctionArgs>({ authService }: {
9
9
  authService: AuthService;
10
10
  }): <THandler extends Handler<T>>(fn: (auth?: AccessTokenPayload) => THandler) => THandler;
11
- declare function createWithAuthHandler<T extends LoaderFunctionArgs | ActionFunctionArgs>({ authService, tempUserTokenManager, tempUserCookieManager, }: {
11
+ declare function createWithAuthHandler<T extends LoaderFunctionArgs | ActionFunctionArgs>({ authService, }: {
12
12
  authService: AuthService;
13
- tempUserTokenManager: JWTManager<AccessTokenPayload>;
14
- tempUserCookieManager: CookieManager;
15
13
  }): <THandler extends Handler<T>>(fn: (auth: AccessTokenPayload) => THandler) => THandler;
16
14
 
17
15
  export { type WithAuthHandler, createWithAuthHandler, createWithStrictAuthHandler };
@@ -80,9 +80,7 @@ function createWithStrictAuthHandler({ authService }) {
80
80
  };
81
81
  }
82
82
  function createWithAuthHandler({
83
- authService,
84
- tempUserTokenManager,
85
- tempUserCookieManager
83
+ authService
86
84
  }) {
87
85
  return function(fn) {
88
86
  const withAuthHandler = createWithStrictAuthHandler({
@@ -102,30 +100,19 @@ function createWithAuthHandler({
102
100
  });
103
101
  return res;
104
102
  };
105
- const tempUserToken = await tempUserCookieManager.parse(
106
- args.request
107
- );
108
- if (tempUserToken) {
109
- const tempUserPayload = await tempUserTokenManager.verify(tempUserToken);
110
- if (tempUserPayload) {
111
- return respond(tempUserPayload);
112
- }
113
- }
114
103
  const user = await authService.authRepository.createUser({
115
104
  id: (0, import_uuid.v4)(),
116
- role: "temp",
105
+ role: "guest",
117
106
  name: "\uC775\uBA85"
118
107
  });
119
- const newTempUserToken = await tempUserTokenManager.sign({
120
- userId: user.id,
121
- name: user.name,
122
- role: user.role
123
- });
108
+ const { accessToken, refreshToken } = await authService.issueTokenPair(user);
124
109
  const headers = new Headers();
125
- const setCookie = await tempUserCookieManager.serialize(newTempUserToken);
126
- headers.append("Set-Cookie", setCookie);
127
- const newTempUserPayload = tempUserTokenManager.decode(newTempUserToken);
128
- return respond(newTempUserPayload, headers);
110
+ const accessTokenSetCookie = await authService.getAccessTokenSetCookie(accessToken);
111
+ headers.append("Set-Cookie", accessTokenSetCookie);
112
+ const refreshTokenSetCookie = await authService.getRefreshTokenSetCookie(refreshToken);
113
+ headers.append("Set-Cookie", refreshTokenSetCookie);
114
+ const payload = authService.accessTokenManager.decode(accessToken);
115
+ return respond(payload, headers);
129
116
  });
130
117
  return handler;
131
118
  };
@@ -55,9 +55,7 @@ function createWithStrictAuthHandler({ authService }) {
55
55
  };
56
56
  }
57
57
  function createWithAuthHandler({
58
- authService,
59
- tempUserTokenManager,
60
- tempUserCookieManager
58
+ authService
61
59
  }) {
62
60
  return function(fn) {
63
61
  const withAuthHandler = createWithStrictAuthHandler({
@@ -77,30 +75,19 @@ function createWithAuthHandler({
77
75
  });
78
76
  return res;
79
77
  };
80
- const tempUserToken = await tempUserCookieManager.parse(
81
- args.request
82
- );
83
- if (tempUserToken) {
84
- const tempUserPayload = await tempUserTokenManager.verify(tempUserToken);
85
- if (tempUserPayload) {
86
- return respond(tempUserPayload);
87
- }
88
- }
89
78
  const user = await authService.authRepository.createUser({
90
79
  id: v4(),
91
- role: "temp",
80
+ role: "guest",
92
81
  name: "\uC775\uBA85"
93
82
  });
94
- const newTempUserToken = await tempUserTokenManager.sign({
95
- userId: user.id,
96
- name: user.name,
97
- role: user.role
98
- });
83
+ const { accessToken, refreshToken } = await authService.issueTokenPair(user);
99
84
  const headers = new Headers();
100
- const setCookie = await tempUserCookieManager.serialize(newTempUserToken);
101
- headers.append("Set-Cookie", setCookie);
102
- const newTempUserPayload = tempUserTokenManager.decode(newTempUserToken);
103
- return respond(newTempUserPayload, headers);
85
+ const accessTokenSetCookie = await authService.getAccessTokenSetCookie(accessToken);
86
+ headers.append("Set-Cookie", accessTokenSetCookie);
87
+ const refreshTokenSetCookie = await authService.getRefreshTokenSetCookie(refreshToken);
88
+ headers.append("Set-Cookie", refreshTokenSetCookie);
89
+ const payload = authService.accessTokenManager.decode(accessToken);
90
+ return respond(payload, headers);
104
91
  });
105
92
  return handler;
106
93
  };
package/dist/seo/index.js CHANGED
@@ -98,7 +98,10 @@ function configSEO(config) {
98
98
  content: socialImage.length > 0 ? "summary_large_image" : "summary"
99
99
  },
100
100
  pageTitle && { property: "twitter:title", content: pageTitle },
101
- description && { property: "twitter:description", content: description },
101
+ description && {
102
+ property: "twitter:description",
103
+ content: description
104
+ },
102
105
  ...socialImage?.map((file) => ({
103
106
  property: "twitter:image",
104
107
  content: file.url
@@ -106,16 +109,10 @@ function configSEO(config) {
106
109
  ];
107
110
  };
108
111
  function StructedData() {
109
- const matches = (0, import_react_router.useMatches)();
110
- const data = matches.reduce((acc, match) => {
111
- return {
112
- ...acc,
113
- ...match.loaderData?.seo || {}
114
- };
115
- }, {});
116
- const { pageTitle, description, keywords, url, thumbnail } = data;
112
+ const { seo } = (0, import_react_router.useLoaderData)();
113
+ const props = seo || {};
114
+ const { pageTitle, description, keywords, url, thumbnail } = props;
117
115
  const thumbnailUrl = thumbnail?.url;
118
- const props = data?.seo || {};
119
116
  const websiteSchemaId = `${config.origin}/#website`;
120
117
  const websiteSchema = {
121
118
  "@type": "WebSite",
@@ -136,7 +133,9 @@ function configSEO(config) {
136
133
  }
137
134
  ] : [],
138
135
  ...props.images || [],
139
- ...props.collection?.map((portfolio) => portfolio.thumbnail) || []
136
+ ...props.collection?.map(
137
+ (portfolio) => portfolio.thumbnail
138
+ ) || []
140
139
  ].filter(Boolean);
141
140
  const image = images.filter((file) => file.id).map((file) => ({
142
141
  "@type": "ImageObject",
@@ -152,21 +151,23 @@ function configSEO(config) {
152
151
  const collectionMainEntity = props.collection ? {
153
152
  "@type": "ItemList",
154
153
  numberOfItems: props.collection.length,
155
- itemListElement: props.collection.map((item, index) => ({
156
- "@type": "ListItem",
157
- position: index + 1,
158
- url: item.url,
159
- item: {
160
- "@type": "WebPage",
161
- "@id": `${item.url}#webpage`,
154
+ itemListElement: props.collection.map(
155
+ (item, index) => ({
156
+ "@type": "ListItem",
157
+ position: index + 1,
162
158
  url: item.url,
163
- name: item.title,
164
- thumbnailUrl: item.thumbnail?.url,
165
- dateModified: item.updatedAt?.toISOString(),
166
- dateCreated: item.createdAt?.toISOString(),
167
- datePublished: item.createdAt?.toISOString()
168
- }
169
- }))
159
+ item: {
160
+ "@type": "WebPage",
161
+ "@id": `${item.url}#webpage`,
162
+ url: item.url,
163
+ name: item.title,
164
+ thumbnailUrl: item.thumbnail?.url,
165
+ dateModified: item.updatedAt?.toISOString(),
166
+ dateCreated: item.createdAt?.toISOString(),
167
+ datePublished: item.createdAt?.toISOString()
168
+ }
169
+ })
170
+ )
170
171
  } : void 0;
171
172
  const structuredData = {
172
173
  "@context": "https://schema.org",
@@ -35,7 +35,7 @@ var require_schema = __commonJS({
35
35
  // src/seo/seo.tsx
36
36
  var Schema = __toESM(require_schema());
37
37
  import React from "react";
38
- import { useMatches } from "react-router";
38
+ import { useLoaderData } from "react-router";
39
39
  function configSEO(config) {
40
40
  function init(props) {
41
41
  const canonicalPath = props.canonicalPath;
@@ -85,7 +85,10 @@ function configSEO(config) {
85
85
  content: socialImage.length > 0 ? "summary_large_image" : "summary"
86
86
  },
87
87
  pageTitle && { property: "twitter:title", content: pageTitle },
88
- description && { property: "twitter:description", content: description },
88
+ description && {
89
+ property: "twitter:description",
90
+ content: description
91
+ },
89
92
  ...socialImage?.map((file) => ({
90
93
  property: "twitter:image",
91
94
  content: file.url
@@ -93,16 +96,10 @@ function configSEO(config) {
93
96
  ];
94
97
  };
95
98
  function StructedData() {
96
- const matches = useMatches();
97
- const data = matches.reduce((acc, match) => {
98
- return {
99
- ...acc,
100
- ...match.loaderData?.seo || {}
101
- };
102
- }, {});
103
- const { pageTitle, description, keywords, url, thumbnail } = data;
99
+ const { seo } = useLoaderData();
100
+ const props = seo || {};
101
+ const { pageTitle, description, keywords, url, thumbnail } = props;
104
102
  const thumbnailUrl = thumbnail?.url;
105
- const props = data?.seo || {};
106
103
  const websiteSchemaId = `${config.origin}/#website`;
107
104
  const websiteSchema = {
108
105
  "@type": "WebSite",
@@ -123,7 +120,9 @@ function configSEO(config) {
123
120
  }
124
121
  ] : [],
125
122
  ...props.images || [],
126
- ...props.collection?.map((portfolio) => portfolio.thumbnail) || []
123
+ ...props.collection?.map(
124
+ (portfolio) => portfolio.thumbnail
125
+ ) || []
127
126
  ].filter(Boolean);
128
127
  const image = images.filter((file) => file.id).map((file) => ({
129
128
  "@type": "ImageObject",
@@ -139,21 +138,23 @@ function configSEO(config) {
139
138
  const collectionMainEntity = props.collection ? {
140
139
  "@type": "ItemList",
141
140
  numberOfItems: props.collection.length,
142
- itemListElement: props.collection.map((item, index) => ({
143
- "@type": "ListItem",
144
- position: index + 1,
145
- url: item.url,
146
- item: {
147
- "@type": "WebPage",
148
- "@id": `${item.url}#webpage`,
141
+ itemListElement: props.collection.map(
142
+ (item, index) => ({
143
+ "@type": "ListItem",
144
+ position: index + 1,
149
145
  url: item.url,
150
- name: item.title,
151
- thumbnailUrl: item.thumbnail?.url,
152
- dateModified: item.updatedAt?.toISOString(),
153
- dateCreated: item.createdAt?.toISOString(),
154
- datePublished: item.createdAt?.toISOString()
155
- }
156
- }))
146
+ item: {
147
+ "@type": "WebPage",
148
+ "@id": `${item.url}#webpage`,
149
+ url: item.url,
150
+ name: item.title,
151
+ thumbnailUrl: item.thumbnail?.url,
152
+ dateModified: item.updatedAt?.toISOString(),
153
+ dateCreated: item.createdAt?.toISOString(),
154
+ datePublished: item.createdAt?.toISOString()
155
+ }
156
+ })
157
+ )
157
158
  } : void 0;
158
159
  const structuredData = {
159
160
  "@context": "https://schema.org",
package/dist/seo/seo.js CHANGED
@@ -96,7 +96,10 @@ function configSEO(config) {
96
96
  content: socialImage.length > 0 ? "summary_large_image" : "summary"
97
97
  },
98
98
  pageTitle && { property: "twitter:title", content: pageTitle },
99
- description && { property: "twitter:description", content: description },
99
+ description && {
100
+ property: "twitter:description",
101
+ content: description
102
+ },
100
103
  ...socialImage?.map((file) => ({
101
104
  property: "twitter:image",
102
105
  content: file.url
@@ -104,16 +107,10 @@ function configSEO(config) {
104
107
  ];
105
108
  };
106
109
  function StructedData() {
107
- const matches = (0, import_react_router.useMatches)();
108
- const data = matches.reduce((acc, match) => {
109
- return {
110
- ...acc,
111
- ...match.loaderData?.seo || {}
112
- };
113
- }, {});
114
- const { pageTitle, description, keywords, url, thumbnail } = data;
110
+ const { seo } = (0, import_react_router.useLoaderData)();
111
+ const props = seo || {};
112
+ const { pageTitle, description, keywords, url, thumbnail } = props;
115
113
  const thumbnailUrl = thumbnail?.url;
116
- const props = data?.seo || {};
117
114
  const websiteSchemaId = `${config.origin}/#website`;
118
115
  const websiteSchema = {
119
116
  "@type": "WebSite",
@@ -134,7 +131,9 @@ function configSEO(config) {
134
131
  }
135
132
  ] : [],
136
133
  ...props.images || [],
137
- ...props.collection?.map((portfolio) => portfolio.thumbnail) || []
134
+ ...props.collection?.map(
135
+ (portfolio) => portfolio.thumbnail
136
+ ) || []
138
137
  ].filter(Boolean);
139
138
  const image = images.filter((file) => file.id).map((file) => ({
140
139
  "@type": "ImageObject",
@@ -150,21 +149,23 @@ function configSEO(config) {
150
149
  const collectionMainEntity = props.collection ? {
151
150
  "@type": "ItemList",
152
151
  numberOfItems: props.collection.length,
153
- itemListElement: props.collection.map((item, index) => ({
154
- "@type": "ListItem",
155
- position: index + 1,
156
- url: item.url,
157
- item: {
158
- "@type": "WebPage",
159
- "@id": `${item.url}#webpage`,
152
+ itemListElement: props.collection.map(
153
+ (item, index) => ({
154
+ "@type": "ListItem",
155
+ position: index + 1,
160
156
  url: item.url,
161
- name: item.title,
162
- thumbnailUrl: item.thumbnail?.url,
163
- dateModified: item.updatedAt?.toISOString(),
164
- dateCreated: item.createdAt?.toISOString(),
165
- datePublished: item.createdAt?.toISOString()
166
- }
167
- }))
157
+ item: {
158
+ "@type": "WebPage",
159
+ "@id": `${item.url}#webpage`,
160
+ url: item.url,
161
+ name: item.title,
162
+ thumbnailUrl: item.thumbnail?.url,
163
+ dateModified: item.updatedAt?.toISOString(),
164
+ dateCreated: item.createdAt?.toISOString(),
165
+ datePublished: item.createdAt?.toISOString()
166
+ }
167
+ })
168
+ )
168
169
  } : void 0;
169
170
  const structuredData = {
170
171
  "@context": "https://schema.org",
package/dist/seo/seo.mjs CHANGED
@@ -35,7 +35,7 @@ var require_schema = __commonJS({
35
35
  // src/seo/seo.tsx
36
36
  var Schema = __toESM(require_schema());
37
37
  import React from "react";
38
- import { useMatches } from "react-router";
38
+ import { useLoaderData } from "react-router";
39
39
  function configSEO(config) {
40
40
  function init(props) {
41
41
  const canonicalPath = props.canonicalPath;
@@ -85,7 +85,10 @@ function configSEO(config) {
85
85
  content: socialImage.length > 0 ? "summary_large_image" : "summary"
86
86
  },
87
87
  pageTitle && { property: "twitter:title", content: pageTitle },
88
- description && { property: "twitter:description", content: description },
88
+ description && {
89
+ property: "twitter:description",
90
+ content: description
91
+ },
89
92
  ...socialImage?.map((file) => ({
90
93
  property: "twitter:image",
91
94
  content: file.url
@@ -93,16 +96,10 @@ function configSEO(config) {
93
96
  ];
94
97
  };
95
98
  function StructedData() {
96
- const matches = useMatches();
97
- const data = matches.reduce((acc, match) => {
98
- return {
99
- ...acc,
100
- ...match.loaderData?.seo || {}
101
- };
102
- }, {});
103
- const { pageTitle, description, keywords, url, thumbnail } = data;
99
+ const { seo } = useLoaderData();
100
+ const props = seo || {};
101
+ const { pageTitle, description, keywords, url, thumbnail } = props;
104
102
  const thumbnailUrl = thumbnail?.url;
105
- const props = data?.seo || {};
106
103
  const websiteSchemaId = `${config.origin}/#website`;
107
104
  const websiteSchema = {
108
105
  "@type": "WebSite",
@@ -123,7 +120,9 @@ function configSEO(config) {
123
120
  }
124
121
  ] : [],
125
122
  ...props.images || [],
126
- ...props.collection?.map((portfolio) => portfolio.thumbnail) || []
123
+ ...props.collection?.map(
124
+ (portfolio) => portfolio.thumbnail
125
+ ) || []
127
126
  ].filter(Boolean);
128
127
  const image = images.filter((file) => file.id).map((file) => ({
129
128
  "@type": "ImageObject",
@@ -139,21 +138,23 @@ function configSEO(config) {
139
138
  const collectionMainEntity = props.collection ? {
140
139
  "@type": "ItemList",
141
140
  numberOfItems: props.collection.length,
142
- itemListElement: props.collection.map((item, index) => ({
143
- "@type": "ListItem",
144
- position: index + 1,
145
- url: item.url,
146
- item: {
147
- "@type": "WebPage",
148
- "@id": `${item.url}#webpage`,
141
+ itemListElement: props.collection.map(
142
+ (item, index) => ({
143
+ "@type": "ListItem",
144
+ position: index + 1,
149
145
  url: item.url,
150
- name: item.title,
151
- thumbnailUrl: item.thumbnail?.url,
152
- dateModified: item.updatedAt?.toISOString(),
153
- dateCreated: item.createdAt?.toISOString(),
154
- datePublished: item.createdAt?.toISOString()
155
- }
156
- }))
146
+ item: {
147
+ "@type": "WebPage",
148
+ "@id": `${item.url}#webpage`,
149
+ url: item.url,
150
+ name: item.title,
151
+ thumbnailUrl: item.thumbnail?.url,
152
+ dateModified: item.updatedAt?.toISOString(),
153
+ dateCreated: item.createdAt?.toISOString(),
154
+ datePublished: item.createdAt?.toISOString()
155
+ }
156
+ })
157
+ )
157
158
  } : void 0;
158
159
  const structuredData = {
159
160
  "@context": "https://schema.org",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dn-react-router-toolkit",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.js",
@@ -71,7 +71,7 @@
71
71
  },
72
72
  "dependencies": {
73
73
  "@react-router/dev": "^7.11.0",
74
- "dn-react-toolkit": "0.2.29",
74
+ "dn-react-toolkit": "0.2.36",
75
75
  "pg": "^8.16.3",
76
76
  "uuid": "^13.0.0"
77
77
  },
@@ -81,4 +81,4 @@
81
81
  "react-dom": "^19",
82
82
  "react-router": "^7"
83
83
  }
84
- }
84
+ }