@soma-vertical-web/multi-lib 1.0.30 → 1.0.32
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/data/api/aviseme/index.d.ts +18 -0
- package/data/api/preview/exit-preview/index.d.ts +13 -0
- package/data/api/preview/index.d.ts +36 -0
- package/data/api/xml/index.d.ts +3 -0
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/index2.js +2 -2
- package/index2.mjs +620 -537
- package/package.json +1 -1
- package/server.d.ts +8 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FetchFunctionsProps } from 'libs/multi-lib/src/types/data/api';
|
|
2
|
+
import * as yup from 'yup';
|
|
3
|
+
declare const schema: yup.ObjectSchema<{
|
|
4
|
+
userName: string | undefined;
|
|
5
|
+
email: string | undefined;
|
|
6
|
+
sku: string | undefined;
|
|
7
|
+
}, yup.AnyObject, {
|
|
8
|
+
userName: undefined;
|
|
9
|
+
email: undefined;
|
|
10
|
+
sku: undefined;
|
|
11
|
+
}, "">;
|
|
12
|
+
type SchemaType = yup.InferType<typeof schema>;
|
|
13
|
+
export declare function aviseMe({ apiUrl, body, }: FetchFunctionsProps<SchemaType>): Promise<{
|
|
14
|
+
ok: boolean;
|
|
15
|
+
status: number;
|
|
16
|
+
text: () => Promise<string>;
|
|
17
|
+
} | undefined>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NextRequest } from 'next/server';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Disables Next.js Draft Mode and redirects to a specified path or the homepage.
|
|
5
|
+
* This route should be called to exit the preview/draft experience.
|
|
6
|
+
*
|
|
7
|
+
* @example /api/preview/disable?redirect=/category
|
|
8
|
+
*/
|
|
9
|
+
export declare function getCMSPreviewExitData(request: NextRequest): {
|
|
10
|
+
redirectTo: string;
|
|
11
|
+
clearCookies: string[];
|
|
12
|
+
disableDraft: boolean;
|
|
13
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { NextRequest } from 'next/server';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Enables Next.js Draft Mode and redirects the user to the provided URL
|
|
5
|
+
* (or to the homepage if none is provided).
|
|
6
|
+
*
|
|
7
|
+
* This route is used to enter the preview/draft experience for any CMS.
|
|
8
|
+
* It supports multiple CMS platforms such as VTEX and Strapi, each sending
|
|
9
|
+
* different preview parameters.
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
* @example VTEX
|
|
13
|
+
* /api/preview?url=/product/123&previewMode=true&versionId=abc123&documentId=xyz789
|
|
14
|
+
*
|
|
15
|
+
* @example strapi
|
|
16
|
+
* /api/preview?url=/blog/my-post&status=draft&secret=STRAPI_PREVIEW_TOKEN
|
|
17
|
+
*/
|
|
18
|
+
export declare function getCMSPreviewData({ platformCMS, request, }: {
|
|
19
|
+
platformCMS: string;
|
|
20
|
+
request: NextRequest;
|
|
21
|
+
}): {
|
|
22
|
+
error: boolean;
|
|
23
|
+
url?: undefined;
|
|
24
|
+
isDraft?: undefined;
|
|
25
|
+
previewData?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
url: string;
|
|
28
|
+
isDraft: boolean;
|
|
29
|
+
previewData: {
|
|
30
|
+
versionId: string;
|
|
31
|
+
releaseId: string;
|
|
32
|
+
documentId: string;
|
|
33
|
+
contentType: string;
|
|
34
|
+
} | null;
|
|
35
|
+
error?: undefined;
|
|
36
|
+
};
|