@okam/directus-next 1.2.9 → 1.2.10
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/draft/route.d.ts +1 -1
- package/index.js +2 -2
- package/index.mjs +2 -2
- package/logger.d.ts +3 -2
- package/package.json +3 -3
- package/pageSettings/context.d.ts +3 -2
- package/pageSettings/interface.d.ts +5 -4
- package/pageSettings/usePageSettings.d.ts +3 -2
- package/redirect/route.d.ts +2 -1
- package/redirect/utils/getRedirectsRoute.d.ts +3 -2
- package/redirect/utils/handleRedirect.d.ts +3 -3
- package/router/router.d.ts +3 -2
- package/router/utils/fetchPageSettingsTranslation.d.ts +2 -1
- package/router/utils/locale.d.ts +2 -1
package/draft/route.d.ts
CHANGED
|
@@ -44,4 +44,4 @@ export type HandleDraftOptions = {
|
|
|
44
44
|
* })
|
|
45
45
|
* }
|
|
46
46
|
*/
|
|
47
|
-
export default function handleDraftRoute({ url, getDirectusLanguage, getDraftSecret, getJsonError, }: HandleDraftOptions): Response | undefined
|
|
47
|
+
export default function handleDraftRoute({ url, getDirectusLanguage, getDraftSecret, getJsonError, }: HandleDraftOptions): Promise<Response | undefined>;
|
package/index.js
CHANGED
|
@@ -98,7 +98,7 @@ function getPathFromRoute(routeUrl, url, index = 0) {
|
|
|
98
98
|
});
|
|
99
99
|
return radashi.template(routeUrl, map);
|
|
100
100
|
}
|
|
101
|
-
function handleDraftRoute({
|
|
101
|
+
async function handleDraftRoute({
|
|
102
102
|
url,
|
|
103
103
|
getDirectusLanguage,
|
|
104
104
|
getDraftSecret,
|
|
@@ -147,7 +147,7 @@ function handleDraftRoute({
|
|
|
147
147
|
const withParams = redirectUrl.indexOf("?") !== -1;
|
|
148
148
|
redirectUrl = `${redirectUrl}${withParams ? "&" : "?"}version=${encodeURIComponent(version)}`;
|
|
149
149
|
}
|
|
150
|
-
headers.draftMode().enable();
|
|
150
|
+
(await headers.draftMode()).enable();
|
|
151
151
|
navigation.redirect(redirectUrl);
|
|
152
152
|
return void 0;
|
|
153
153
|
}
|
package/index.mjs
CHANGED
|
@@ -97,7 +97,7 @@ function getPathFromRoute(routeUrl, url, index = 0) {
|
|
|
97
97
|
});
|
|
98
98
|
return template(routeUrl, map);
|
|
99
99
|
}
|
|
100
|
-
function handleDraftRoute({
|
|
100
|
+
async function handleDraftRoute({
|
|
101
101
|
url,
|
|
102
102
|
getDirectusLanguage,
|
|
103
103
|
getDraftSecret,
|
|
@@ -146,7 +146,7 @@ function handleDraftRoute({
|
|
|
146
146
|
const withParams = redirectUrl.indexOf("?") !== -1;
|
|
147
147
|
redirectUrl = `${redirectUrl}${withParams ? "&" : "?"}version=${encodeURIComponent(version)}`;
|
|
148
148
|
}
|
|
149
|
-
draftMode().enable();
|
|
149
|
+
(await draftMode()).enable();
|
|
150
150
|
redirect(redirectUrl);
|
|
151
151
|
return void 0;
|
|
152
152
|
}
|
package/logger.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { LogSeverity } from '../../../stack/logger/src/index.ts';
|
|
2
|
+
|
|
3
|
+
export declare const logger: import('../../../stack/logger/src/index.ts').Logger;
|
|
3
4
|
export declare function log(msg: string, context?: unknown, severity?: LogSeverity): void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okam/directus-next",
|
|
3
3
|
"main": "./index.js",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.10",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@okam/core-lib": "1.17.0",
|
|
36
36
|
"@okam/directus-node": "0.6.2",
|
|
37
37
|
"@okam/logger": "1.1.0",
|
|
38
|
-
"@okam/next-component": "1.2.
|
|
39
|
-
"next": "^
|
|
38
|
+
"@okam/next-component": "1.2.3",
|
|
39
|
+
"next": "^15.0.0",
|
|
40
40
|
"radashi": "^12.3.0",
|
|
41
41
|
"@okam/directus-query": "1.4.2",
|
|
42
42
|
"server-only": "0.0.1",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Variables } from 'graphql-request';
|
|
2
|
+
import { TPageSettingsQueryItem, TUsePageSettingsReturn } from './interface';
|
|
3
|
+
|
|
3
4
|
export declare function pageSettingsContext<Item extends TPageSettingsQueryItem>(defaultValue?: TUsePageSettingsReturn<Item>): readonly [() => TUsePageSettingsReturn<Item> | undefined, (value: TUsePageSettingsReturn<Item> | undefined) => void];
|
|
4
5
|
export declare function pageSettingsVariablesContext(variables?: Variables): readonly [() => object | undefined, (value: object | undefined) => void];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
2
|
+
import { Variables } from 'graphql-request';
|
|
3
|
+
import { TFiles } from '../files/interface';
|
|
4
|
+
import { DirectusRouteConfig } from '../types/directusRouteConfig';
|
|
5
|
+
|
|
5
6
|
export type Fragmentize<FragmentData, FragmentName extends string = string> = {
|
|
6
7
|
' $fragmentRefs'?: {
|
|
7
8
|
[FragmentKey in FragmentName]?: FragmentData | null | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Variables } from 'graphql-request';
|
|
2
|
+
import { TUsePageSettingsProps, TPageSettingsQueryItem, TUsePageSettingsReturn } from './interface';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* @param props Optional props. Passing new props will trigger a new query if the variables have changed compared to the value of the variables in the cache. Omitting props will return the cached value.
|
|
5
6
|
* @param itemKey Required if the query has more than a single root field
|
package/redirect/route.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { TFetchRedirectsResponse } from '../../../../directus-node/src/edge.ts';
|
|
2
|
+
import { DirectusRouteRedirectsModule } from '../../types/directusRouteConfig';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Gets a response from `options.apiRoute`
|
|
5
6
|
* @param {DirectusRouteRedirectsModule} options
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
import { DirectusRouteRedirectsModule } from '../../types/directusRouteConfig';
|
|
3
|
+
|
|
4
4
|
/**
|
|
5
5
|
* Handles next redirection using directus redirects
|
|
6
6
|
*/
|
package/router/router.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { NextRequest, NextResponse as NextResponseType } from 'next/server';
|
|
2
|
+
import { DirectusRouteConfig } from '../types/directusRouteConfig';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Handles incoming middleware requests and rewrites the path to the new format according to fetched page settings.
|
|
5
6
|
* @param request - The NextRequest object
|
package/router/utils/locale.d.ts
CHANGED