@enonic/nextjs-adapter 3.2.2 → 3.3.0-B1
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 +41 -22
- package/src/baseMappings.ts +9 -9
- package/src/common/ComponentRegistry.ts +2 -5
- package/src/common/constants.ts +4 -4
- package/src/common/env.ts +1 -1
- package/src/guillotine/applyProcessors.ts +3 -7
- package/src/guillotine/buildComponentTree.ts +1 -1
- package/src/guillotine/buildErrorResponse.ts +3 -3
- package/src/guillotine/buildPage.ts +2 -2
- package/src/guillotine/collectComponentDescriptors.ts +6 -13
- package/src/guillotine/combineMultipleQueries.ts +3 -6
- package/src/guillotine/createMetaData.ts +2 -2
- package/src/guillotine/fetchContent.ts +8 -14
- package/src/guillotine/fetchContentData.ts +4 -10
- package/src/guillotine/fetchContentPathsForAllLocales.ts +3 -3
- package/src/guillotine/fetchContentPathsForLocale.ts +7 -7
- package/src/guillotine/fetchFromApi.ts +8 -8
- package/src/guillotine/fetchGuillotine.ts +8 -8
- package/src/guillotine/fetchMetaData.ts +5 -5
- package/src/guillotine/getCleanContentPathArrayOrThrow400.ts +2 -2
- package/src/guillotine/getParentRegion.ts +2 -2
- package/src/guillotine/getQueryAndVariables.ts +5 -9
- package/src/guillotine/metadata/configQuery.ts +2 -2
- package/src/guillotine/parseComponentPath.ts +4 -7
- package/src/guillotine/processComponentConfig.ts +1 -1
- package/src/guillotine/restrictComponentsToPath.ts +1 -1
- package/src/i18n/LocaleContext.tsx +3 -3
- package/src/index.ts +3 -3
- package/src/types/component.ts +1 -1
- package/src/types/componentProps.ts +4 -3
- package/src/types/guillotine.ts +1 -1
- package/src/types/index.ts +3 -3
- package/src/utils/buildGuillotineRequestHeaders.ts +4 -7
- package/src/utils/fixDoubleSlashes.ts +1 -1
- package/src/utils/getLocaleMappings.ts +1 -1
- package/src/utils/getRenderMode.ts +2 -5
- package/src/views/BaseComponent.tsx +5 -5
- package/src/views/BaseContent.tsx +1 -1
- package/src/views/BaseMacro.tsx +1 -1
- package/src/views/PropsView.tsx +1 -1
- package/src/views/RichTextView.tsx +68 -25
- package/src/views/StaticContent.tsx +1 -1
- package/baseMappings.d.ts +0 -1
- package/baseMappings.js +0 -43
- package/baseMappings.js.map +0 -1
- package/client/getClientHydratedHtml.d.ts +0 -1
- package/client/getClientHydratedHtml.jsx +0 -9
- package/client/getClientHydratedHtml.jsx.map +0 -1
- package/client.d.ts +0 -1
- package/client.js +0 -3
- package/client.js.map +0 -1
- package/common/ComponentRegistry.d.ts +0 -34
- package/common/ComponentRegistry.js +0 -121
- package/common/ComponentRegistry.js.map +0 -1
- package/common/UrlProcessor.d.ts +0 -25
- package/common/UrlProcessor.js +0 -151
- package/common/UrlProcessor.js.map +0 -1
- package/common/constants.d.ts +0 -51
- package/common/constants.js +0 -86
- package/common/constants.js.map +0 -1
- package/common/env.d.ts +0 -12
- package/common/env.js +0 -30
- package/common/env.js.map +0 -1
- package/guillotine/applyProcessors.d.ts +0 -2
- package/guillotine/applyProcessors.js +0 -33
- package/guillotine/applyProcessors.js.map +0 -1
- package/guillotine/buildComponentTree.d.ts +0 -2
- package/guillotine/buildComponentTree.js +0 -45
- package/guillotine/buildComponentTree.js.map +0 -1
- package/guillotine/buildErrorResponse.d.ts +0 -3
- package/guillotine/buildErrorResponse.js +0 -27
- package/guillotine/buildErrorResponse.js.map +0 -1
- package/guillotine/buildPage.d.ts +0 -2
- package/guillotine/buildPage.js +0 -10
- package/guillotine/buildPage.js.map +0 -1
- package/guillotine/collectComponentDescriptors.d.ts +0 -6
- package/guillotine/collectComponentDescriptors.js +0 -43
- package/guillotine/collectComponentDescriptors.js.map +0 -1
- package/guillotine/combineMultipleQueries.d.ts +0 -2
- package/guillotine/combineMultipleQueries.js +0 -58
- package/guillotine/combineMultipleQueries.js.map +0 -1
- package/guillotine/createMetaData.d.ts +0 -18
- package/guillotine/createMetaData.js +0 -45
- package/guillotine/createMetaData.js.map +0 -1
- package/guillotine/fetchContent.d.ts +0 -9
- package/guillotine/fetchContent.js +0 -222
- package/guillotine/fetchContent.js.map +0 -1
- package/guillotine/fetchContentData.d.ts +0 -2
- package/guillotine/fetchContentData.js +0 -30
- package/guillotine/fetchContentData.js.map +0 -1
- package/guillotine/fetchContentPathsForAllLocales.d.ts +0 -2
- package/guillotine/fetchContentPathsForAllLocales.js +0 -21
- package/guillotine/fetchContentPathsForAllLocales.js.map +0 -1
- package/guillotine/fetchContentPathsForLocale.d.ts +0 -2
- package/guillotine/fetchContentPathsForLocale.js +0 -41
- package/guillotine/fetchContentPathsForLocale.js.map +0 -1
- package/guillotine/fetchFromApi.d.ts +0 -3
- package/guillotine/fetchFromApi.js +0 -76
- package/guillotine/fetchFromApi.js.map +0 -1
- package/guillotine/fetchGuillotine.d.ts +0 -3
- package/guillotine/fetchGuillotine.js +0 -75
- package/guillotine/fetchGuillotine.js.map +0 -1
- package/guillotine/fetchMetaData.d.ts +0 -2
- package/guillotine/fetchMetaData.js +0 -33
- package/guillotine/fetchMetaData.js.map +0 -1
- package/guillotine/getCleanContentPathArrayOrThrow400.d.ts +0 -2
- package/guillotine/getCleanContentPathArrayOrThrow400.js +0 -20
- package/guillotine/getCleanContentPathArrayOrThrow400.js.map +0 -1
- package/guillotine/getComponentConfig.d.ts +0 -2
- package/guillotine/getComponentConfig.js +0 -5
- package/guillotine/getComponentConfig.js.map +0 -1
- package/guillotine/getContentAndComponentPaths.d.ts +0 -1
- package/guillotine/getContentAndComponentPaths.js +0 -12
- package/guillotine/getContentAndComponentPaths.js.map +0 -1
- package/guillotine/getMetaData.d.ts +0 -2
- package/guillotine/getMetaData.js +0 -67
- package/guillotine/getMetaData.js.map +0 -1
- package/guillotine/getParentRegion.d.ts +0 -2
- package/guillotine/getParentRegion.js +0 -40
- package/guillotine/getParentRegion.js.map +0 -1
- package/guillotine/getQueryAndVariables.d.ts +0 -2
- package/guillotine/getQueryAndVariables.js +0 -32
- package/guillotine/getQueryAndVariables.js.map +0 -1
- package/guillotine/metadata/configQuery.d.ts +0 -2
- package/guillotine/metadata/configQuery.js +0 -36
- package/guillotine/metadata/configQuery.js.map +0 -1
- package/guillotine/metadata/richTextQuery.d.ts +0 -1
- package/guillotine/metadata/richTextQuery.js +0 -47
- package/guillotine/metadata/richTextQuery.js.map +0 -1
- package/guillotine/parseComponentPath.d.ts +0 -2
- package/guillotine/parseComponentPath.js +0 -22
- package/guillotine/parseComponentPath.js.map +0 -1
- package/guillotine/prefixFragmentCmpPath.d.ts +0 -1
- package/guillotine/prefixFragmentCmpPath.js +0 -13
- package/guillotine/prefixFragmentCmpPath.js.map +0 -1
- package/guillotine/processComponentConfig.d.ts +0 -2
- package/guillotine/processComponentConfig.js +0 -30
- package/guillotine/processComponentConfig.js.map +0 -1
- package/guillotine/restrictComponentsToPath.d.ts +0 -2
- package/guillotine/restrictComponentsToPath.js +0 -38
- package/guillotine/restrictComponentsToPath.js.map +0 -1
- package/guillotine/validateData.d.ts +0 -2
- package/guillotine/validateData.js +0 -7
- package/guillotine/validateData.js.map +0 -1
- package/guillotine/validateNotFound.d.ts +0 -2
- package/guillotine/validateNotFound.js +0 -16
- package/guillotine/validateNotFound.js.map +0 -1
- package/guillotine/validateShortcut.d.ts +0 -2
- package/guillotine/validateShortcut.js +0 -35
- package/guillotine/validateShortcut.js.map +0 -1
- package/i18n/LocaleContext.d.ts +0 -7
- package/i18n/LocaleContext.jsx +0 -50
- package/i18n/LocaleContext.jsx.map +0 -1
- package/i18n/i18n.d.ts +0 -12
- package/i18n/i18n.js +0 -59
- package/i18n/i18n.js.map +0 -1
- package/index.d.ts +0 -14
- package/index.js +0 -14
- package/index.js.map +0 -1
- package/query/Shortcut.d.ts +0 -1
- package/query/Shortcut.js +0 -19
- package/query/Shortcut.js.map +0 -1
- package/server/getServerRenderedHtml.d.ts +0 -1
- package/server/getServerRenderedHtml.js +0 -4
- package/server/getServerRenderedHtml.js.map +0 -1
- package/server.d.ts +0 -5
- package/server.js +0 -6
- package/server.js.map +0 -1
- package/types/component.d.ts +0 -92
- package/types/component.js +0 -2
- package/types/component.js.map +0 -1
- package/types/componentProps.d.ts +0 -106
- package/types/componentProps.js +0 -2
- package/types/componentProps.js.map +0 -1
- package/types/guillotine.d.ts +0 -344
- package/types/guillotine.js +0 -2
- package/types/guillotine.js.map +0 -1
- package/types/i18n.d.ts +0 -7
- package/types/i18n.js +0 -2
- package/types/i18n.js.map +0 -1
- package/types/index.d.ts +0 -47
- package/types/index.js +0 -3
- package/types/index.js.map +0 -1
- package/types/next.d.ts +0 -6
- package/types/next.js +0 -2
- package/types/next.js.map +0 -1
- package/types/util.d.ts +0 -3
- package/types/util.js +0 -3
- package/types/util.js.map +0 -1
- package/utils/addLineNumbers.d.ts +0 -1
- package/utils/addLineNumbers.js +0 -4
- package/utils/addLineNumbers.js.map +0 -1
- package/utils/buildGuillotineRequestHeaders.d.ts +0 -7
- package/utils/buildGuillotineRequestHeaders.js +0 -16
- package/utils/buildGuillotineRequestHeaders.js.map +0 -1
- package/utils/commonChars.d.ts +0 -1
- package/utils/commonChars.js +0 -17
- package/utils/commonChars.js.map +0 -1
- package/utils/enonicLog.d.ts +0 -5
- package/utils/enonicLog.js +0 -23
- package/utils/enonicLog.js.map +0 -1
- package/utils/fixDoubleSlashes.d.ts +0 -1
- package/utils/fixDoubleSlashes.js +0 -4
- package/utils/fixDoubleSlashes.js.map +0 -1
- package/utils/getAllLocales.d.ts +0 -1
- package/utils/getAllLocales.js +0 -5
- package/utils/getAllLocales.js.map +0 -1
- package/utils/getContentApiUrl.d.ts +0 -2
- package/utils/getContentApiUrl.js +0 -15
- package/utils/getContentApiUrl.js.map +0 -1
- package/utils/getLocaleMapping.d.ts +0 -2
- package/utils/getLocaleMapping.js +0 -19
- package/utils/getLocaleMapping.js.map +0 -1
- package/utils/getLocaleMappingByLocale.d.ts +0 -2
- package/utils/getLocaleMappingByLocale.js +0 -13
- package/utils/getLocaleMappingByLocale.js.map +0 -1
- package/utils/getLocaleMappingByProjectId.d.ts +0 -2
- package/utils/getLocaleMappingByProjectId.js +0 -16
- package/utils/getLocaleMappingByProjectId.js.map +0 -1
- package/utils/getLocaleMappings.d.ts +0 -2
- package/utils/getLocaleMappings.js +0 -30
- package/utils/getLocaleMappings.js.map +0 -1
- package/utils/getRenderMode.d.ts +0 -3
- package/utils/getRenderMode.js +0 -8
- package/utils/getRenderMode.js.map +0 -1
- package/utils/getRequestLocaleInfo.d.ts +0 -6
- package/utils/getRequestLocaleInfo.js +0 -29
- package/utils/getRequestLocaleInfo.js.map +0 -1
- package/utils/getXpBaseUrl.d.ts +0 -2
- package/utils/getXpBaseUrl.js +0 -8
- package/utils/getXpBaseUrl.js.map +0 -1
- package/utils/indent.d.ts +0 -1
- package/utils/indent.js +0 -5
- package/utils/indent.js.map +0 -1
- package/utils/sanitizeGraphqlName.d.ts +0 -1
- package/utils/sanitizeGraphqlName.js +0 -12
- package/utils/sanitizeGraphqlName.js.map +0 -1
- package/views/BaseComponent.d.ts +0 -20
- package/views/BaseComponent.jsx +0 -129
- package/views/BaseComponent.jsx.map +0 -1
- package/views/BaseContent.d.ts +0 -3
- package/views/BaseContent.jsx +0 -38
- package/views/BaseContent.jsx.map +0 -1
- package/views/BaseLayout.d.ts +0 -3
- package/views/BaseLayout.jsx +0 -24
- package/views/BaseLayout.jsx.map +0 -1
- package/views/BaseMacro.d.ts +0 -6
- package/views/BaseMacro.jsx +0 -100
- package/views/BaseMacro.jsx.map +0 -1
- package/views/BasePage.d.ts +0 -3
- package/views/BasePage.jsx +0 -34
- package/views/BasePage.jsx.map +0 -1
- package/views/BasePart.d.ts +0 -3
- package/views/BasePart.jsx +0 -24
- package/views/BasePart.jsx.map +0 -1
- package/views/Empty.d.ts +0 -2
- package/views/Empty.jsx +0 -4
- package/views/Empty.jsx.map +0 -1
- package/views/Fragment.d.ts +0 -3
- package/views/Fragment.jsx +0 -30
- package/views/Fragment.jsx.map +0 -1
- package/views/MainView.d.ts +0 -3
- package/views/MainView.jsx +0 -14
- package/views/MainView.jsx.map +0 -1
- package/views/PropsView.d.ts +0 -2
- package/views/PropsView.jsx +0 -21
- package/views/PropsView.jsx.map +0 -1
- package/views/Region.d.ts +0 -6
- package/views/Region.jsx +0 -52
- package/views/Region.jsx.map +0 -1
- package/views/RichTextView.d.ts +0 -3
- package/views/RichTextView.jsx +0 -39
- package/views/RichTextView.jsx.map +0 -1
- package/views/SingleComponent.d.ts +0 -4
- package/views/SingleComponent.jsx +0 -10
- package/views/SingleComponent.jsx.map +0 -1
- package/views/StaticContent.d.ts +0 -10
- package/views/StaticContent.jsx +0 -37
- package/views/StaticContent.jsx.map +0 -1
- package/views/Text.d.ts +0 -8
- package/views/Text.jsx +0 -4
- package/views/Text.jsx.map +0 -1
- package/views/macros/DefaultMacro.d.ts +0 -3
- package/views/macros/DefaultMacro.jsx +0 -4
- package/views/macros/DefaultMacro.jsx.map +0 -1
- package/views/macros/DisableMacro.d.ts +0 -3
- package/views/macros/DisableMacro.jsx +0 -3
- package/views/macros/DisableMacro.jsx.map +0 -1
package/types/guillotine.d.ts
DELETED
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
import type { PublishInfo } from '@enonic-types/core';
|
|
2
|
-
import type { PageComponent, PageData } from './component';
|
|
3
|
-
import type { MetaData } from './componentProps';
|
|
4
|
-
import type { Context } from './next';
|
|
5
|
-
import type { RecursivePartial } from './util';
|
|
6
|
-
export interface GuillotineError {
|
|
7
|
-
errorType: string;
|
|
8
|
-
locations: {
|
|
9
|
-
line: number;
|
|
10
|
-
column: number;
|
|
11
|
-
}[];
|
|
12
|
-
message: string;
|
|
13
|
-
validationErrorType?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface GuillotineResponseJson<Guillotine = RecursivePartial<HeadlessCms>> {
|
|
16
|
-
data?: Record<string, Guillotine>;
|
|
17
|
-
errors?: GuillotineError[];
|
|
18
|
-
}
|
|
19
|
-
export interface GuillotineResponse<Data = Record<string, unknown>> {
|
|
20
|
-
json: () => Promise<GuillotineResponseJson<Data>>;
|
|
21
|
-
text: () => Promise<string>;
|
|
22
|
-
ok: boolean;
|
|
23
|
-
status: number;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Sends one query to the guillotine API and asks for content type, then uses the type to select a second query and variables, which is sent to the API and fetches content data.
|
|
27
|
-
* @param contentPath string or string array: pre-split or slash-delimited _path to a content available on the API
|
|
28
|
-
* @returns FetchContentResult object: {data?: T, error?: {code, message}}
|
|
29
|
-
*/
|
|
30
|
-
export type ContentFetcher = (context: Context) => Promise<FetchContentResult>;
|
|
31
|
-
export interface ContentResult<Content = Record<string, unknown>> extends Result {
|
|
32
|
-
contents?: Content[];
|
|
33
|
-
}
|
|
34
|
-
export interface FetchContentResult extends Result {
|
|
35
|
-
data: Record<string, any> | null;
|
|
36
|
-
common: Record<string, any> | null;
|
|
37
|
-
meta: MetaData;
|
|
38
|
-
page: PageComponent | null;
|
|
39
|
-
}
|
|
40
|
-
export interface GuillotineRequestHeaders {
|
|
41
|
-
[key: string]: string;
|
|
42
|
-
Cookie?: string;
|
|
43
|
-
locale: string;
|
|
44
|
-
locales: string;
|
|
45
|
-
'default-locale': string;
|
|
46
|
-
}
|
|
47
|
-
export type GuillotineResult = Result & Record<string, any>;
|
|
48
|
-
export interface MetaResult extends Result {
|
|
49
|
-
meta?: {
|
|
50
|
-
_id: string;
|
|
51
|
-
_path: string;
|
|
52
|
-
type: string;
|
|
53
|
-
pageAsJson?: PageData;
|
|
54
|
-
components?: PageComponent[];
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
export interface Result {
|
|
58
|
-
error?: {
|
|
59
|
-
code: string;
|
|
60
|
-
message: string;
|
|
61
|
-
} | null;
|
|
62
|
-
}
|
|
63
|
-
interface AccessControlEntry {
|
|
64
|
-
principal: PrincipalKey;
|
|
65
|
-
allow: [Permission];
|
|
66
|
-
deny: [Permission];
|
|
67
|
-
}
|
|
68
|
-
interface Attachment {
|
|
69
|
-
name: string;
|
|
70
|
-
label: string;
|
|
71
|
-
size: number;
|
|
72
|
-
mimeType: string;
|
|
73
|
-
attachmentUrl: string;
|
|
74
|
-
}
|
|
75
|
-
type DateTime = string;
|
|
76
|
-
export interface Component {
|
|
77
|
-
type: ComponentType;
|
|
78
|
-
path: string;
|
|
79
|
-
page?: PageComponentData | null;
|
|
80
|
-
layout?: LayoutComponentData | null;
|
|
81
|
-
image?: ImageComponentData | null;
|
|
82
|
-
part?: PartComponentData | null;
|
|
83
|
-
text?: TextComponentData | null;
|
|
84
|
-
fragment?: FragmentComponentData | null;
|
|
85
|
-
}
|
|
86
|
-
type ComponentType = 'page' | 'layout' | 'image' | 'part' | 'text' | 'fragment';
|
|
87
|
-
interface Content {
|
|
88
|
-
_id: string;
|
|
89
|
-
_name: string;
|
|
90
|
-
_path: string;
|
|
91
|
-
_references?: Content[];
|
|
92
|
-
_score?: number;
|
|
93
|
-
creator?: PrincipalKey;
|
|
94
|
-
modifier?: PrincipalKey;
|
|
95
|
-
createdTime?: DateTime;
|
|
96
|
-
modifiedTime?: DateTime;
|
|
97
|
-
owner?: PrincipalKey;
|
|
98
|
-
type?: string;
|
|
99
|
-
contentType?: ContentType;
|
|
100
|
-
displayName?: string;
|
|
101
|
-
hasChildren?: boolean;
|
|
102
|
-
language?: string;
|
|
103
|
-
valid?: boolean;
|
|
104
|
-
dataAsJson?: JSON;
|
|
105
|
-
x?: ExtraData;
|
|
106
|
-
xAsJson?: JSON;
|
|
107
|
-
pageAsJson?: JSON;
|
|
108
|
-
pageTemplate?: Content;
|
|
109
|
-
components?: Component[];
|
|
110
|
-
attachments?: Attachment[];
|
|
111
|
-
publish?: PublishInfo;
|
|
112
|
-
pageUrl?: string;
|
|
113
|
-
site?: portal_Site;
|
|
114
|
-
parent?: Content;
|
|
115
|
-
children?: Content[];
|
|
116
|
-
childrenConnection?: ContentConnection;
|
|
117
|
-
permissions?: Permissions;
|
|
118
|
-
}
|
|
119
|
-
interface ContentConnection {
|
|
120
|
-
totalCount: Int;
|
|
121
|
-
edges: ContentEdge[];
|
|
122
|
-
pageInfo: PageInfo;
|
|
123
|
-
}
|
|
124
|
-
interface ContentEdge {
|
|
125
|
-
node: Content;
|
|
126
|
-
cursor: string;
|
|
127
|
-
}
|
|
128
|
-
interface ContentType {
|
|
129
|
-
name: string;
|
|
130
|
-
displayName: string;
|
|
131
|
-
description: string;
|
|
132
|
-
superType: string;
|
|
133
|
-
abstract: boolean;
|
|
134
|
-
final: boolean;
|
|
135
|
-
allowChildContent: boolean;
|
|
136
|
-
contentDisplayNameScript: string;
|
|
137
|
-
icon: Icon;
|
|
138
|
-
form: FormItem[];
|
|
139
|
-
formAsJson: JSON;
|
|
140
|
-
getInstances: Content[];
|
|
141
|
-
getInstanceConnection: ContentConnection;
|
|
142
|
-
}
|
|
143
|
-
type ExtraData<App = Record<string, unknown>> = App & {
|
|
144
|
-
media: XData_media_ApplicationConfig;
|
|
145
|
-
base: XData_base_ApplicationConfig;
|
|
146
|
-
};
|
|
147
|
-
type Float = number;
|
|
148
|
-
interface FormItem {
|
|
149
|
-
formItemType: FormItemType;
|
|
150
|
-
name: string;
|
|
151
|
-
label: string;
|
|
152
|
-
}
|
|
153
|
-
type FormItemType = 'ItemSet' | 'Layout' | 'Input' | 'OptionSet';
|
|
154
|
-
interface FragmentComponentData {
|
|
155
|
-
id: string;
|
|
156
|
-
fragment: Content;
|
|
157
|
-
}
|
|
158
|
-
interface GeoPoint {
|
|
159
|
-
value: string;
|
|
160
|
-
latitude: Float;
|
|
161
|
-
longitude: Float;
|
|
162
|
-
}
|
|
163
|
-
export interface HeadlessCms {
|
|
164
|
-
get?: Content;
|
|
165
|
-
getChildren?: Content[];
|
|
166
|
-
getChildrenConnection?: ContentConnection;
|
|
167
|
-
getPermissions?: Permissions;
|
|
168
|
-
getSite?: portal_Site;
|
|
169
|
-
getType?: ContentType;
|
|
170
|
-
getTypes?: ContentType[];
|
|
171
|
-
query?: Content[];
|
|
172
|
-
queryConnection?: QueryContentConnection;
|
|
173
|
-
queryDsl?: Content[];
|
|
174
|
-
queryDslConnection?: QueryDSLContentConnection;
|
|
175
|
-
}
|
|
176
|
-
interface Icon {
|
|
177
|
-
mimeType: string;
|
|
178
|
-
modifiedTime: string;
|
|
179
|
-
}
|
|
180
|
-
interface Image {
|
|
181
|
-
image: Content;
|
|
182
|
-
ref: string;
|
|
183
|
-
style: ImageStyle;
|
|
184
|
-
}
|
|
185
|
-
interface ImageComponentData {
|
|
186
|
-
id: string;
|
|
187
|
-
caption?: string;
|
|
188
|
-
image: media_Image;
|
|
189
|
-
}
|
|
190
|
-
interface ImageStyle {
|
|
191
|
-
name: string;
|
|
192
|
-
aspectRatio: string;
|
|
193
|
-
filter: string;
|
|
194
|
-
}
|
|
195
|
-
type Int = number;
|
|
196
|
-
type JSON = Record<string, unknown>;
|
|
197
|
-
interface LayoutComponentData {
|
|
198
|
-
descriptor: string;
|
|
199
|
-
configAsJson: JSON | null;
|
|
200
|
-
}
|
|
201
|
-
interface Link {
|
|
202
|
-
ref: string;
|
|
203
|
-
uri: string;
|
|
204
|
-
media: Media;
|
|
205
|
-
content: Content;
|
|
206
|
-
}
|
|
207
|
-
type LocalDateTime = string;
|
|
208
|
-
interface Macro_system_disable_DataConfig {
|
|
209
|
-
body: string;
|
|
210
|
-
}
|
|
211
|
-
interface Macro_system_embed_DataConfig {
|
|
212
|
-
body: string;
|
|
213
|
-
}
|
|
214
|
-
interface Macro {
|
|
215
|
-
ref: string;
|
|
216
|
-
name: string;
|
|
217
|
-
descriptor: string;
|
|
218
|
-
config: MacroConfig;
|
|
219
|
-
}
|
|
220
|
-
interface MacroConfig {
|
|
221
|
-
disable: Macro_system_disable_DataConfig;
|
|
222
|
-
embed: Macro_system_embed_DataConfig;
|
|
223
|
-
}
|
|
224
|
-
interface Media {
|
|
225
|
-
content: Content;
|
|
226
|
-
intent: MediaIntentType;
|
|
227
|
-
}
|
|
228
|
-
type MediaIntentType = 'download' | 'inline';
|
|
229
|
-
interface media_Image extends Content {
|
|
230
|
-
mediaUrl: string;
|
|
231
|
-
imageUrl: string;
|
|
232
|
-
data: media_Image_Data;
|
|
233
|
-
}
|
|
234
|
-
interface media_Image_Data {
|
|
235
|
-
media: MediaUploader;
|
|
236
|
-
caption: string;
|
|
237
|
-
altText: string;
|
|
238
|
-
artist: string[];
|
|
239
|
-
copyright: string;
|
|
240
|
-
tags: string[];
|
|
241
|
-
}
|
|
242
|
-
interface MediaFocalPoint {
|
|
243
|
-
x: number;
|
|
244
|
-
y: number;
|
|
245
|
-
}
|
|
246
|
-
interface MediaUploader {
|
|
247
|
-
attachment: string;
|
|
248
|
-
focalPoint: MediaFocalPoint;
|
|
249
|
-
}
|
|
250
|
-
interface PageComponentData {
|
|
251
|
-
descriptor?: string;
|
|
252
|
-
customized?: boolean;
|
|
253
|
-
configAsJson?: JSON;
|
|
254
|
-
template?: Content | null;
|
|
255
|
-
}
|
|
256
|
-
interface PageInfo {
|
|
257
|
-
startCursor: string;
|
|
258
|
-
endCursor: string;
|
|
259
|
-
hasNext: boolean;
|
|
260
|
-
}
|
|
261
|
-
interface PartComponentData<Config = Record<string, unknown>> {
|
|
262
|
-
descriptor: string;
|
|
263
|
-
config: Config;
|
|
264
|
-
configAsJson: JSON;
|
|
265
|
-
}
|
|
266
|
-
type Permission = 'READ' | 'CREATE' | 'MODIFY' | 'DELETE' | 'PUBLISH' | 'READ_PERMISSIONS' | 'WRITE_PERMISSIONS';
|
|
267
|
-
interface Permissions {
|
|
268
|
-
inheritsPermissions: boolean;
|
|
269
|
-
permissions: AccessControlEntry[];
|
|
270
|
-
}
|
|
271
|
-
interface portal_Site extends Content {
|
|
272
|
-
data: portal_Site_Data;
|
|
273
|
-
}
|
|
274
|
-
interface portal_Site_Data {
|
|
275
|
-
description: string;
|
|
276
|
-
}
|
|
277
|
-
type PrincipalType = 'user' | 'group' | 'role';
|
|
278
|
-
interface PrincipalKey {
|
|
279
|
-
value: string;
|
|
280
|
-
type: PrincipalType;
|
|
281
|
-
idProvider: string;
|
|
282
|
-
principalId: string;
|
|
283
|
-
}
|
|
284
|
-
interface QueryContentConnection extends ContentConnection {
|
|
285
|
-
aggregationsAsJson: JSON;
|
|
286
|
-
}
|
|
287
|
-
interface QueryDSLContentConnection extends QueryContentConnection {
|
|
288
|
-
highlightAsJson: JSON;
|
|
289
|
-
}
|
|
290
|
-
interface RichText {
|
|
291
|
-
raw: string;
|
|
292
|
-
processedHtml: string;
|
|
293
|
-
macrosAsJson: JSON;
|
|
294
|
-
macros: Macro[];
|
|
295
|
-
images: Image[];
|
|
296
|
-
links: Link[];
|
|
297
|
-
}
|
|
298
|
-
interface TextComponentData {
|
|
299
|
-
value: RichText;
|
|
300
|
-
}
|
|
301
|
-
interface XData_base_ApplicationConfig {
|
|
302
|
-
gpsInfo: XData_base_gpsInfo_DataConfig;
|
|
303
|
-
}
|
|
304
|
-
interface XData_base_gpsInfo_DataConfig {
|
|
305
|
-
geoPoint: GeoPoint;
|
|
306
|
-
altitude: string;
|
|
307
|
-
direction: string;
|
|
308
|
-
}
|
|
309
|
-
interface XData_media_ApplicationConfig {
|
|
310
|
-
imageInfo: XData_media_imageInfo_DataConfig;
|
|
311
|
-
cameraInfo: XData_media_cameraInfo_DataConfig;
|
|
312
|
-
}
|
|
313
|
-
interface XData_media_imageInfo_DataConfig {
|
|
314
|
-
pixelSize: number;
|
|
315
|
-
imageHeight: number;
|
|
316
|
-
imageWidth: number;
|
|
317
|
-
contentType: string;
|
|
318
|
-
description: string;
|
|
319
|
-
byteSize: number;
|
|
320
|
-
colorSpace: string[];
|
|
321
|
-
fileSource: string;
|
|
322
|
-
}
|
|
323
|
-
interface XData_media_cameraInfo_DataConfig {
|
|
324
|
-
date: LocalDateTime;
|
|
325
|
-
make: string;
|
|
326
|
-
model: string;
|
|
327
|
-
lens: string;
|
|
328
|
-
iso: string;
|
|
329
|
-
focalLength: string;
|
|
330
|
-
focalLength35: string;
|
|
331
|
-
exposureBias: string;
|
|
332
|
-
aperture: string[];
|
|
333
|
-
shutterTime: string;
|
|
334
|
-
flash: string;
|
|
335
|
-
autoFlashCompensation: string;
|
|
336
|
-
whiteBalance: string;
|
|
337
|
-
exposureProgram: string;
|
|
338
|
-
shootingMode: string;
|
|
339
|
-
meteringMode: string;
|
|
340
|
-
exposureMode: string;
|
|
341
|
-
focusDistance: string;
|
|
342
|
-
orientation: string;
|
|
343
|
-
}
|
|
344
|
-
export {};
|
package/types/guillotine.js
DELETED
package/types/guillotine.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"guillotine.js","sourceRoot":"","sources":["../src/types/guillotine.ts"],"names":[],"mappings":""}
|
package/types/i18n.d.ts
DELETED
package/types/i18n.js
DELETED
package/types/i18n.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../src/types/i18n.ts"],"names":[],"mappings":""}
|
package/types/index.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export type * from './component';
|
|
2
|
-
export type * from './componentProps';
|
|
3
|
-
export type * from './guillotine';
|
|
4
|
-
export type * from './i18n';
|
|
5
|
-
export type * from './next';
|
|
6
|
-
export type * from './util';
|
|
7
|
-
export interface ContentApiBaseBody {
|
|
8
|
-
query?: string;
|
|
9
|
-
variables?: ContentApiBaseBodyVariables;
|
|
10
|
-
}
|
|
11
|
-
export interface ContentApiBaseBodyVariables {
|
|
12
|
-
path?: string;
|
|
13
|
-
[key: string]: string | number | undefined;
|
|
14
|
-
}
|
|
15
|
-
export interface ContentPathItem {
|
|
16
|
-
contentPath: string[];
|
|
17
|
-
locale: string;
|
|
18
|
-
}
|
|
19
|
-
export interface PathFragment {
|
|
20
|
-
index: number;
|
|
21
|
-
region: string;
|
|
22
|
-
}
|
|
23
|
-
export interface PreviewParams {
|
|
24
|
-
contentPath: string[];
|
|
25
|
-
headers: Record<string, string>;
|
|
26
|
-
params: Record<string, string>;
|
|
27
|
-
}
|
|
28
|
-
export interface LocaleMapping {
|
|
29
|
-
default: boolean;
|
|
30
|
-
project: string;
|
|
31
|
-
site: string;
|
|
32
|
-
locale: string;
|
|
33
|
-
}
|
|
34
|
-
export type LocaleMappings = Record<string, LocaleMapping>;
|
|
35
|
-
export type SelectorName = 'contentType' | 'page' | 'component' | 'part' | 'layout' | 'macro';
|
|
36
|
-
export type FetchOptions = Omit<RequestInit, 'body'> & {
|
|
37
|
-
body?: ContentApiBaseBody;
|
|
38
|
-
next?: {
|
|
39
|
-
revalidate?: boolean | number;
|
|
40
|
-
tags?: string[];
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
export interface StaticContentProps extends Record<string, any> {
|
|
44
|
-
children?: React.ReactNode;
|
|
45
|
-
element?: string;
|
|
46
|
-
condition: boolean;
|
|
47
|
-
}
|
package/types/index.js
DELETED
package/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/types/index.ts"],"names":[],"mappings":"AAAA,+BAA+B"}
|
package/types/next.d.ts
DELETED
package/types/next.js
DELETED
package/types/next.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"next.js","sourceRoot":"","sources":["../src/types/next.ts"],"names":[],"mappings":""}
|
package/types/util.d.ts
DELETED
package/types/util.js
DELETED
package/types/util.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/types/util.ts"],"names":[],"mappings":";AAIA,sFAAsF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function addLineNumbers(s: string): string;
|
package/utils/addLineNumbers.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addLineNumbers.js","sourceRoot":"","sources":["../src/utils/addLineNumbers.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,CAAS;IACpC,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Context, GuillotineRequestHeaders } from '../types';
|
|
2
|
-
export declare function buildGuillotineRequestHeaders({ context, defaultLocale, locale, locales, }: {
|
|
3
|
-
context: Context;
|
|
4
|
-
defaultLocale: string;
|
|
5
|
-
locale: string;
|
|
6
|
-
locales: string[];
|
|
7
|
-
}): GuillotineRequestHeaders;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { GUILLOTINE_REQUEST_HEADERS, JSESSIONID_HEADER, } from '../common/constants';
|
|
2
|
-
export function buildGuillotineRequestHeaders({ context, defaultLocale, locale, locales, }) {
|
|
3
|
-
var _a;
|
|
4
|
-
const guillotineRequestHeaders = {
|
|
5
|
-
[GUILLOTINE_REQUEST_HEADERS.DEFAULT_LOCALE]: defaultLocale,
|
|
6
|
-
[GUILLOTINE_REQUEST_HEADERS.LOCALE]: locale,
|
|
7
|
-
[GUILLOTINE_REQUEST_HEADERS.LOCALES]: JSON.stringify(locales),
|
|
8
|
-
};
|
|
9
|
-
const jsessionid = (_a = context.headers) === null || _a === void 0 ? void 0 : _a.get(JSESSIONID_HEADER);
|
|
10
|
-
if (jsessionid) {
|
|
11
|
-
guillotineRequestHeaders[GUILLOTINE_REQUEST_HEADERS.COOKIE] =
|
|
12
|
-
`${JSESSIONID_HEADER}=${jsessionid}`;
|
|
13
|
-
}
|
|
14
|
-
return guillotineRequestHeaders;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=buildGuillotineRequestHeaders.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildGuillotineRequestHeaders.js","sourceRoot":"","sources":["../src/utils/buildGuillotineRequestHeaders.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,0BAA0B,EAC1B,iBAAiB,GACpB,MAAM,qBAAqB,CAAC;AAG7B,MAAM,UAAU,6BAA6B,CAAC,EAC1C,OAAO,EACP,aAAa,EACb,MAAM,EACN,OAAO,GAMV;;IACG,MAAM,wBAAwB,GAA6B;QACvD,CAAC,0BAA0B,CAAC,cAAc,CAAC,EAAE,aAAa;QAC1D,CAAC,0BAA0B,CAAC,MAAM,CAAC,EAAE,MAAM;QAC3C,CAAC,0BAA0B,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;KAChE,CAAC;IACF,MAAM,UAAU,GAAG,MAAA,OAAO,CAAC,OAAO,0CAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC3D,IAAI,UAAU,EAAE,CAAC;QACb,wBAAwB,CAAC,0BAA0B,CAAC,MAAM,CAAC;YACvD,GAAG,iBAAiB,IAAI,UAAU,EAAE,CAAC;IAC7C,CAAC;IACD,OAAO,wBAAwB,CAAC;AACpC,CAAC"}
|
package/utils/commonChars.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const commonChars: (s1?: string, s2?: string) => string;
|
package/utils/commonChars.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const commonChars = (s1, s2) => {
|
|
2
|
-
let result = '';
|
|
3
|
-
if (!s1 || s1.length === 0 || !s2 || s2.length === 0) {
|
|
4
|
-
return result;
|
|
5
|
-
}
|
|
6
|
-
for (let i = 0; i < s1.length; i++) {
|
|
7
|
-
const s1Element = s1[i];
|
|
8
|
-
if (s2[i] === s1Element) {
|
|
9
|
-
result += s1Element;
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
break;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return result;
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=commonChars.js.map
|
package/utils/commonChars.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commonChars.js","sourceRoot":"","sources":["../src/utils/commonChars.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAW,EAAE,EAAW,EAAE,EAAE;IACpD,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnD,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACjC,MAAM,SAAS,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,IAAI,SAAS,CAAC;QACxB,CAAC;aAAM,CAAC;YACJ,MAAM;QACV,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC"}
|
package/utils/enonicLog.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const enonicDebug: (s?: string, ...params: any[]) => void;
|
|
2
|
-
export declare const enonicLog: (s?: string, ...params: any[]) => void;
|
|
3
|
-
export declare const enonicInfo: (s?: string, ...params: any[]) => void;
|
|
4
|
-
export declare const enonicWarn: (s?: string, ...params: any[]) => void;
|
|
5
|
-
export declare const enonicError: (s?: string, ...params: any[]) => void;
|
package/utils/enonicLog.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { LOGGING } from '../common/env';
|
|
2
|
-
export const enonicDebug = (s, ...params) => {
|
|
3
|
-
enonicPrint('debug', s, ...params);
|
|
4
|
-
};
|
|
5
|
-
export const enonicLog = (s, ...params) => {
|
|
6
|
-
enonicPrint('log', s, ...params);
|
|
7
|
-
};
|
|
8
|
-
export const enonicInfo = (s, ...params) => {
|
|
9
|
-
enonicPrint('info', s, ...params);
|
|
10
|
-
};
|
|
11
|
-
export const enonicWarn = (s, ...params) => {
|
|
12
|
-
enonicPrint('warn', s, ...params);
|
|
13
|
-
};
|
|
14
|
-
export const enonicError = (s, ...params) => {
|
|
15
|
-
enonicPrint('error', s, ...params);
|
|
16
|
-
};
|
|
17
|
-
const enonicPrint = (type, s, ...params) => {
|
|
18
|
-
if (LOGGING) {
|
|
19
|
-
const m = `\n[${new Date().toLocaleTimeString()}] ${s}:\n`;
|
|
20
|
-
console[type](m, ...params, '\n');
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=enonicLog.js.map
|
package/utils/enonicLog.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"enonicLog.js","sourceRoot":"","sources":["../src/utils/enonicLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAEtC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAU,EAAE,GAAG,MAAa,EAAE,EAAE;IACxD,WAAW,CAAC,OAAO,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAU,EAAE,GAAG,MAAa,EAAE,EAAE;IACtD,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAU,EAAE,GAAG,MAAa,EAAE,EAAE;IACvD,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAU,EAAE,GAAG,MAAa,EAAE,EAAE;IACvD,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAU,EAAE,GAAG,MAAa,EAAE,EAAE;IACxD,WAAW,CAAC,OAAO,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,IAAiD,EAAE,CAAU,EAAE,GAAG,MAAa,EAAE,EAAE;IACpG,IAAI,OAAO,EAAE,CAAC;QACV,MAAM,CAAC,GAAG,MAAM,IAAI,IAAI,EAAE,CAAC,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC;QAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function fixDoubleSlashes(str: string): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fixDoubleSlashes.js","sourceRoot":"","sources":["../src/utils/fixDoubleSlashes.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,GAAW;IACxC,OAAO,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC"}
|
package/utils/getAllLocales.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getAllLocales(): string[];
|
package/utils/getAllLocales.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getAllLocales.js","sourceRoot":"","sources":["../src/utils/getAllLocales.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAGtD,MAAM,UAAU,aAAa;IACzB,OAAO,MAAM,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { RENDER_MODE } from '../common/constants';
|
|
2
|
-
import { API_URL } from '../common/env';
|
|
3
|
-
import { getLocaleMapping } from './getLocaleMapping';
|
|
4
|
-
import { fixDoubleSlashes } from './fixDoubleSlashes';
|
|
5
|
-
import { getRenderMode } from './getRenderMode';
|
|
6
|
-
export function getContentApiUrl(context) {
|
|
7
|
-
const project = getLocaleMapping(context).project;
|
|
8
|
-
const branch = getRenderMode(context) === RENDER_MODE.NEXT
|
|
9
|
-
? 'master'
|
|
10
|
-
: getRenderMode(context) === RENDER_MODE.LIVE
|
|
11
|
-
? 'master'
|
|
12
|
-
: 'draft';
|
|
13
|
-
return fixDoubleSlashes(`${API_URL}/${project}/${branch}`);
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=getContentApiUrl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getContentApiUrl.js","sourceRoot":"","sources":["../src/utils/getContentApiUrl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAG9C,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC7C,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;IAClD,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,KAAK,WAAW,CAAC,IAAI;QACtD,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,WAAW,CAAC,IAAI;YACzC,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,OAAO,CAAC;IAElB,OAAO,gBAAgB,CAAC,GAAG,OAAO,IAAI,OAAO,IAAI,MAAM,EAAE,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { PROJECT_ID_HEADER } from '../common/constants';
|
|
2
|
-
import { getLocaleMappingByProjectId } from './getLocaleMappingByProjectId';
|
|
3
|
-
import { getLocaleMappingByLocale } from './getLocaleMappingByLocale';
|
|
4
|
-
export function getLocaleMapping(context) {
|
|
5
|
-
var _a;
|
|
6
|
-
const projectId = (_a = context.headers) === null || _a === void 0 ? void 0 : _a.get(PROJECT_ID_HEADER);
|
|
7
|
-
let config;
|
|
8
|
-
if (projectId) {
|
|
9
|
-
// first use project id header
|
|
10
|
-
config = getLocaleMappingByProjectId(projectId, false);
|
|
11
|
-
}
|
|
12
|
-
if (!config) {
|
|
13
|
-
// next try to use locale from url
|
|
14
|
-
// it will fall back to default locale if not found
|
|
15
|
-
config = getLocaleMappingByLocale(context.locale);
|
|
16
|
-
}
|
|
17
|
-
return config;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=getLocaleMapping.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getLocaleMapping.js","sourceRoot":"","sources":["../src/utils/getLocaleMapping.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAC,2BAA2B,EAAC,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAC,wBAAwB,EAAC,MAAM,4BAA4B,CAAC;AAGpE,MAAM,UAAU,gBAAgB,CAAC,OAAgB;;IAC7C,MAAM,SAAS,GAAG,MAAA,OAAO,CAAC,OAAO,0CAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAE1D,IAAI,MAAqB,CAAC;IAC1B,IAAI,SAAS,EAAE,CAAC;QACZ,8BAA8B;QAC9B,MAAM,GAAG,2BAA2B,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,kCAAkC;QAClC,mDAAmD;QACnD,MAAM,GAAG,wBAAwB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { getLocaleMappings } from './getLocaleMappings';
|
|
2
|
-
export function getLocaleMappingByLocale(locale, useDefault = true) {
|
|
3
|
-
const mappings = getLocaleMappings();
|
|
4
|
-
let config;
|
|
5
|
-
if (locale) {
|
|
6
|
-
config = mappings[locale];
|
|
7
|
-
}
|
|
8
|
-
if (!config && useDefault) {
|
|
9
|
-
config = Object.values(mappings).find(c => c.default);
|
|
10
|
-
}
|
|
11
|
-
return config;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=getLocaleMappingByLocale.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getLocaleMappingByLocale.js","sourceRoot":"","sources":["../src/utils/getLocaleMappingByLocale.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAGtD,MAAM,UAAU,wBAAwB,CAAC,MAAe,EAAE,UAAU,GAAG,IAAI;IACvE,MAAM,QAAQ,GAAG,iBAAiB,EAAE,CAAC;IAErC,IAAI,MAAqB,CAAC;IAC1B,IAAI,MAAM,EAAE,CAAC;QACT,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,CAAC,MAAM,IAAI,UAAU,EAAE,CAAC;QACxB,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
|