@cmssy/core 19.0.0 → 19.1.0
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/dist/{content-client-65N8ZRq9.d.cts → content-client-DhcHP8ln.d.cts} +2 -1
- package/dist/{content-client-65N8ZRq9.d.ts → content-client-DhcHP8ln.d.ts} +2 -1
- package/dist/{csp-COFMUmsq.d.ts → csp-AuptG-R-.d.ts} +1 -1
- package/dist/{csp-BHjoSZ2p.d.cts → csp-Dtp9S9TS.d.cts} +1 -1
- package/dist/index.cjs +5 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -2
- package/dist/internal/locale.cjs +1 -1
- package/dist/internal/locale.d.cts +2 -2
- package/dist/internal/locale.d.ts +2 -2
- package/dist/internal/locale.js +1 -1
- package/dist/internal.cjs +26 -1
- package/dist/internal.d.cts +12 -7
- package/dist/internal.d.ts +12 -7
- package/dist/internal.js +24 -2
- package/dist/{locale-D9KI4bND.d.ts → locale-BCguiP54.d.ts} +1 -1
- package/dist/{locale-JyBHqpAQ.d.cts → locale-CsDPiYGF.d.cts} +1 -1
- package/dist/preflight.d.cts +1 -1
- package/dist/preflight.d.ts +1 -1
- package/package.json +2 -2
|
@@ -20,6 +20,7 @@ type RetryOption = CmssyRetryMode | RetryPolicy | false;
|
|
|
20
20
|
declare const CMSSY_RATE_LIMIT_WINDOW_MS = 60000;
|
|
21
21
|
type ResolvedRetryPolicy = Readonly<Required<RetryPolicy>>;
|
|
22
22
|
declare const CMSSY_RETRY_MODES: Record<CmssyRetryMode, ResolvedRetryPolicy>;
|
|
23
|
+
declare function isTransientRequestError(error: unknown): error is CmssyRequestError;
|
|
23
24
|
|
|
24
25
|
declare const DEFAULT_CMSSY_API_URL = "https://api.cmssy.io/graphql";
|
|
25
26
|
declare function resolveApiUrl(apiUrl: string | undefined): string;
|
|
@@ -52,4 +53,4 @@ declare function fetchPages(config: CmssyClientConfig, options?: Pick<FetchPageO
|
|
|
52
53
|
declare function fetchPageMeta(config: CmssyClientConfig, path: string | string[] | undefined, options?: Pick<FetchPageOptions, "fetch" | "signal" | "retry">): Promise<CmssyPageMeta | null>;
|
|
53
54
|
declare function fetchLayouts(config: CmssyClientConfig, path: string | string[] | undefined, options?: FetchPageOptions): Promise<CmssyLayoutGroup[]>;
|
|
54
55
|
|
|
55
|
-
export { CMSSY_RATE_LIMIT_WINDOW_MS as C, DEFAULT_CMSSY_API_URL as D, type FetchLike as F, type RetryOption as R, CMSSY_RETRY_MODES as a, CmssyRequestError as b, type CmssyRetryMode as c, type FetchLikeResponse as d, type FetchPageOptions as e, type RetryPolicy as f, fetchLayouts as g, fetchPage as h,
|
|
56
|
+
export { CMSSY_RATE_LIMIT_WINDOW_MS as C, DEFAULT_CMSSY_API_URL as D, type FetchLike as F, type RetryOption as R, CMSSY_RETRY_MODES as a, CmssyRequestError as b, type CmssyRetryMode as c, type FetchLikeResponse as d, type FetchPageOptions as e, type RetryPolicy as f, fetchLayouts as g, fetchPage as h, isTransientRequestError as i, fetchPageById as j, fetchPageMeta as k, fetchPages as l, resolveApiUrl as r };
|
|
@@ -20,6 +20,7 @@ type RetryOption = CmssyRetryMode | RetryPolicy | false;
|
|
|
20
20
|
declare const CMSSY_RATE_LIMIT_WINDOW_MS = 60000;
|
|
21
21
|
type ResolvedRetryPolicy = Readonly<Required<RetryPolicy>>;
|
|
22
22
|
declare const CMSSY_RETRY_MODES: Record<CmssyRetryMode, ResolvedRetryPolicy>;
|
|
23
|
+
declare function isTransientRequestError(error: unknown): error is CmssyRequestError;
|
|
23
24
|
|
|
24
25
|
declare const DEFAULT_CMSSY_API_URL = "https://api.cmssy.io/graphql";
|
|
25
26
|
declare function resolveApiUrl(apiUrl: string | undefined): string;
|
|
@@ -52,4 +53,4 @@ declare function fetchPages(config: CmssyClientConfig, options?: Pick<FetchPageO
|
|
|
52
53
|
declare function fetchPageMeta(config: CmssyClientConfig, path: string | string[] | undefined, options?: Pick<FetchPageOptions, "fetch" | "signal" | "retry">): Promise<CmssyPageMeta | null>;
|
|
53
54
|
declare function fetchLayouts(config: CmssyClientConfig, path: string | string[] | undefined, options?: FetchPageOptions): Promise<CmssyLayoutGroup[]>;
|
|
54
55
|
|
|
55
|
-
export { CMSSY_RATE_LIMIT_WINDOW_MS as C, DEFAULT_CMSSY_API_URL as D, type FetchLike as F, type RetryOption as R, CMSSY_RETRY_MODES as a, CmssyRequestError as b, type CmssyRetryMode as c, type FetchLikeResponse as d, type FetchPageOptions as e, type RetryPolicy as f, fetchLayouts as g, fetchPage as h,
|
|
56
|
+
export { CMSSY_RATE_LIMIT_WINDOW_MS as C, DEFAULT_CMSSY_API_URL as D, type FetchLike as F, type RetryOption as R, CMSSY_RETRY_MODES as a, CmssyRequestError as b, type CmssyRetryMode as c, type FetchLikeResponse as d, type FetchPageOptions as e, type RetryPolicy as f, fetchLayouts as g, fetchPage as h, isTransientRequestError as i, fetchPageById as j, fetchPageMeta as k, fetchPages as l, resolveApiUrl as r };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LayoutRegion, BlockPropsSchema, InferBlockContent, CmssyClientConfig, BlockRect, BlockSchema, BlockMeta } from '@cmssy/types';
|
|
2
|
-
import { G as GraphqlRequestOptions } from './locale-
|
|
2
|
+
import { G as GraphqlRequestOptions } from './locale-BCguiP54.js';
|
|
3
3
|
|
|
4
4
|
interface CmssyLayout<R extends readonly LayoutRegion[] = readonly LayoutRegion[]> {
|
|
5
5
|
readonly regions: R;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LayoutRegion, BlockPropsSchema, InferBlockContent, CmssyClientConfig, BlockRect, BlockSchema, BlockMeta } from '@cmssy/types';
|
|
2
|
-
import { G as GraphqlRequestOptions } from './locale-
|
|
2
|
+
import { G as GraphqlRequestOptions } from './locale-CsDPiYGF.cjs';
|
|
3
3
|
|
|
4
4
|
interface CmssyLayout<R extends readonly LayoutRegion[] = readonly LayoutRegion[]> {
|
|
5
5
|
readonly regions: R;
|
package/dist/index.cjs
CHANGED
|
@@ -74,7 +74,7 @@ Set the listed environment variables (e.g. in .env.local) and restart the dev se
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// src/version.ts
|
|
77
|
-
var CMSSY_CORE_VERSION = "19.
|
|
77
|
+
var CMSSY_CORE_VERSION = "19.1.0" ;
|
|
78
78
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
79
79
|
|
|
80
80
|
// src/data/http.ts
|
|
@@ -115,6 +115,9 @@ var CMSSY_RETRY_MODES = {
|
|
|
115
115
|
Object.freeze(CMSSY_RETRY_MODES.build);
|
|
116
116
|
Object.freeze(CMSSY_RETRY_MODES.interactive);
|
|
117
117
|
Object.freeze(CMSSY_RETRY_MODES);
|
|
118
|
+
function isTransientRequestError(error) {
|
|
119
|
+
return error instanceof CmssyRequestError && CMSSY_RETRY_MODES.build.retryStatuses.includes(error.status);
|
|
120
|
+
}
|
|
118
121
|
function resolveRetryPolicy(retry) {
|
|
119
122
|
if (retry === false || retry === void 0) return null;
|
|
120
123
|
if (typeof retry === "string") {
|
|
@@ -1144,6 +1147,7 @@ exports.defineCmssyLayout = defineCmssyLayout;
|
|
|
1144
1147
|
exports.fields = fields;
|
|
1145
1148
|
exports.graphqlRequest = graphqlRequest;
|
|
1146
1149
|
exports.isProtocolCompatible = isProtocolCompatible;
|
|
1150
|
+
exports.isTransientRequestError = isTransientRequestError;
|
|
1147
1151
|
exports.isVerifiedEditUrl = isVerifiedEditUrl;
|
|
1148
1152
|
exports.layoutRegionsToBridge = layoutRegionsToBridge;
|
|
1149
1153
|
exports.localizeHref = localizeHref;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as AppToEditorMessage, B as BoundsMessage, C as ClickMessage, a as CmssyClient, b as CmssyConfig, c as CmssyCspOptions, d as CmssyEnvConfig, e as CmssyLayout, f as CmssyRegion, g as CmssyRegionOf, h as CmssyRegionSettings, i as CmssyRegionSettingsOf, j as CmssyTypedDocument, D as DEFAULT_CMSSY_EDITOR_ORIGINS, E as EditorToAppMessage, I as InvisibleBlock, k as InvisibleBlocksMessage, P as PROTOCOL_VERSION, l as ParentReadyMessage, m as PatchMessage, n as PostTarget, Q as QueryScopedOptions, R as ReadyMessage, S as SHORTCUT_ACTIONS, o as SelectMessage, p as ShortcutAction, q as ShortcutMessage, V as ViewportMessage, r as applyCmssyCsp, s as createCmssyClient, t as defineCmssyConfig, u as defineCmssyLayout, v as isProtocolCompatible, w as normalizeOrigin, x as parseEditorMessage, y as postToEditor, z as resolveEditorOrigin } from './csp-
|
|
2
|
-
export { C as CMSSY_LOCALE_HEADER, G as GraphqlRequestOptions, g as graphqlRequest, l as localizeHref, r as resolveCmssyLocale } from './locale-
|
|
3
|
-
export { C as CMSSY_RATE_LIMIT_WINDOW_MS, a as CMSSY_RETRY_MODES, b as CmssyRequestError, c as CmssyRetryMode, D as DEFAULT_CMSSY_API_URL, F as FetchLike, d as FetchLikeResponse, e as FetchPageOptions, R as RetryOption, f as RetryPolicy } from './content-client-
|
|
1
|
+
export { A as AppToEditorMessage, B as BoundsMessage, C as ClickMessage, a as CmssyClient, b as CmssyConfig, c as CmssyCspOptions, d as CmssyEnvConfig, e as CmssyLayout, f as CmssyRegion, g as CmssyRegionOf, h as CmssyRegionSettings, i as CmssyRegionSettingsOf, j as CmssyTypedDocument, D as DEFAULT_CMSSY_EDITOR_ORIGINS, E as EditorToAppMessage, I as InvisibleBlock, k as InvisibleBlocksMessage, P as PROTOCOL_VERSION, l as ParentReadyMessage, m as PatchMessage, n as PostTarget, Q as QueryScopedOptions, R as ReadyMessage, S as SHORTCUT_ACTIONS, o as SelectMessage, p as ShortcutAction, q as ShortcutMessage, V as ViewportMessage, r as applyCmssyCsp, s as createCmssyClient, t as defineCmssyConfig, u as defineCmssyLayout, v as isProtocolCompatible, w as normalizeOrigin, x as parseEditorMessage, y as postToEditor, z as resolveEditorOrigin } from './csp-Dtp9S9TS.cjs';
|
|
2
|
+
export { C as CMSSY_LOCALE_HEADER, G as GraphqlRequestOptions, g as graphqlRequest, l as localizeHref, r as resolveCmssyLocale } from './locale-CsDPiYGF.cjs';
|
|
3
|
+
export { C as CMSSY_RATE_LIMIT_WINDOW_MS, a as CMSSY_RETRY_MODES, b as CmssyRequestError, c as CmssyRetryMode, D as DEFAULT_CMSSY_API_URL, F as FetchLike, d as FetchLikeResponse, e as FetchPageOptions, R as RetryOption, f as RetryPolicy, i as isTransientRequestError } from './content-client-DhcHP8ln.cjs';
|
|
4
4
|
import * as _cmssy_types from '@cmssy/types';
|
|
5
5
|
import { FieldOptions, TypedField, FieldTypeValueMap, ResolvedMediaValue, PageRef, BlockPropsSchema, InferBlockContent, RelationMode, CmssyModelRecord, ResolvedMedia, MediaType, BlockSchema, LayoutRegion, FieldDefinition, BlockMeta, VerifyCmssyWebhookOptions, CmssyWebhookEvent } from '@cmssy/types';
|
|
6
6
|
export { BlockMeta, BlockPropsSchema, BlockRect, BlockSchema, BuildBlockContextExtra, CmssyBlockAuthContext, CmssyBlockContext, CmssyBlockMember, CmssyBlockPage, CmssyBlockWorkspace, CmssyBranding, CmssyClientConfig, CmssyFormDefinition, CmssyFormField, CmssyFormSettings, CmssyFormSubmitResponse, CmssyLayoutGroup, CmssyLocaleContext, CmssyLocalizedValue, CmssyModelDefinition, CmssyModelRecord, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRecordList, CmssySiteConfig, CmssyWebhookEvent, CmssyWebhookOrder, FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldControl, FieldDefinition, FieldOptions, FieldType, FileFieldValue, InferBlockContent, LayoutRegion, LayoutRegionId, MediaTransform, MediaType, RawBlock, RawLayoutBlock, ResolvedMedia, SubmitFormInput, TypedField, VerifyCmssyWebhookOptions, evaluateFieldConditionGroup, mediaTypeValues } from '@cmssy/types';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as AppToEditorMessage, B as BoundsMessage, C as ClickMessage, a as CmssyClient, b as CmssyConfig, c as CmssyCspOptions, d as CmssyEnvConfig, e as CmssyLayout, f as CmssyRegion, g as CmssyRegionOf, h as CmssyRegionSettings, i as CmssyRegionSettingsOf, j as CmssyTypedDocument, D as DEFAULT_CMSSY_EDITOR_ORIGINS, E as EditorToAppMessage, I as InvisibleBlock, k as InvisibleBlocksMessage, P as PROTOCOL_VERSION, l as ParentReadyMessage, m as PatchMessage, n as PostTarget, Q as QueryScopedOptions, R as ReadyMessage, S as SHORTCUT_ACTIONS, o as SelectMessage, p as ShortcutAction, q as ShortcutMessage, V as ViewportMessage, r as applyCmssyCsp, s as createCmssyClient, t as defineCmssyConfig, u as defineCmssyLayout, v as isProtocolCompatible, w as normalizeOrigin, x as parseEditorMessage, y as postToEditor, z as resolveEditorOrigin } from './csp-
|
|
2
|
-
export { C as CMSSY_LOCALE_HEADER, G as GraphqlRequestOptions, g as graphqlRequest, l as localizeHref, r as resolveCmssyLocale } from './locale-
|
|
3
|
-
export { C as CMSSY_RATE_LIMIT_WINDOW_MS, a as CMSSY_RETRY_MODES, b as CmssyRequestError, c as CmssyRetryMode, D as DEFAULT_CMSSY_API_URL, F as FetchLike, d as FetchLikeResponse, e as FetchPageOptions, R as RetryOption, f as RetryPolicy } from './content-client-
|
|
1
|
+
export { A as AppToEditorMessage, B as BoundsMessage, C as ClickMessage, a as CmssyClient, b as CmssyConfig, c as CmssyCspOptions, d as CmssyEnvConfig, e as CmssyLayout, f as CmssyRegion, g as CmssyRegionOf, h as CmssyRegionSettings, i as CmssyRegionSettingsOf, j as CmssyTypedDocument, D as DEFAULT_CMSSY_EDITOR_ORIGINS, E as EditorToAppMessage, I as InvisibleBlock, k as InvisibleBlocksMessage, P as PROTOCOL_VERSION, l as ParentReadyMessage, m as PatchMessage, n as PostTarget, Q as QueryScopedOptions, R as ReadyMessage, S as SHORTCUT_ACTIONS, o as SelectMessage, p as ShortcutAction, q as ShortcutMessage, V as ViewportMessage, r as applyCmssyCsp, s as createCmssyClient, t as defineCmssyConfig, u as defineCmssyLayout, v as isProtocolCompatible, w as normalizeOrigin, x as parseEditorMessage, y as postToEditor, z as resolveEditorOrigin } from './csp-AuptG-R-.js';
|
|
2
|
+
export { C as CMSSY_LOCALE_HEADER, G as GraphqlRequestOptions, g as graphqlRequest, l as localizeHref, r as resolveCmssyLocale } from './locale-BCguiP54.js';
|
|
3
|
+
export { C as CMSSY_RATE_LIMIT_WINDOW_MS, a as CMSSY_RETRY_MODES, b as CmssyRequestError, c as CmssyRetryMode, D as DEFAULT_CMSSY_API_URL, F as FetchLike, d as FetchLikeResponse, e as FetchPageOptions, R as RetryOption, f as RetryPolicy, i as isTransientRequestError } from './content-client-DhcHP8ln.js';
|
|
4
4
|
import * as _cmssy_types from '@cmssy/types';
|
|
5
5
|
import { FieldOptions, TypedField, FieldTypeValueMap, ResolvedMediaValue, PageRef, BlockPropsSchema, InferBlockContent, RelationMode, CmssyModelRecord, ResolvedMedia, MediaType, BlockSchema, LayoutRegion, FieldDefinition, BlockMeta, VerifyCmssyWebhookOptions, CmssyWebhookEvent } from '@cmssy/types';
|
|
6
6
|
export { BlockMeta, BlockPropsSchema, BlockRect, BlockSchema, BuildBlockContextExtra, CmssyBlockAuthContext, CmssyBlockContext, CmssyBlockMember, CmssyBlockPage, CmssyBlockWorkspace, CmssyBranding, CmssyClientConfig, CmssyFormDefinition, CmssyFormField, CmssyFormSettings, CmssyFormSubmitResponse, CmssyLayoutGroup, CmssyLocaleContext, CmssyLocalizedValue, CmssyModelDefinition, CmssyModelRecord, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyRecordList, CmssySiteConfig, CmssyWebhookEvent, CmssyWebhookOrder, FieldCondition, FieldConditionGroup, FieldConditionLogic, FieldControl, FieldDefinition, FieldOptions, FieldType, FileFieldValue, InferBlockContent, LayoutRegion, LayoutRegionId, MediaTransform, MediaType, RawBlock, RawLayoutBlock, ResolvedMedia, SubmitFormInput, TypedField, VerifyCmssyWebhookOptions, evaluateFieldConditionGroup, mediaTypeValues } from '@cmssy/types';
|
package/dist/index.js
CHANGED
|
@@ -73,7 +73,7 @@ Set the listed environment variables (e.g. in .env.local) and restart the dev se
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
// src/version.ts
|
|
76
|
-
var CMSSY_CORE_VERSION = "19.
|
|
76
|
+
var CMSSY_CORE_VERSION = "19.1.0" ;
|
|
77
77
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
78
78
|
|
|
79
79
|
// src/data/http.ts
|
|
@@ -114,6 +114,9 @@ var CMSSY_RETRY_MODES = {
|
|
|
114
114
|
Object.freeze(CMSSY_RETRY_MODES.build);
|
|
115
115
|
Object.freeze(CMSSY_RETRY_MODES.interactive);
|
|
116
116
|
Object.freeze(CMSSY_RETRY_MODES);
|
|
117
|
+
function isTransientRequestError(error) {
|
|
118
|
+
return error instanceof CmssyRequestError && CMSSY_RETRY_MODES.build.retryStatuses.includes(error.status);
|
|
119
|
+
}
|
|
117
120
|
function resolveRetryPolicy(retry) {
|
|
118
121
|
if (retry === false || retry === void 0) return null;
|
|
119
122
|
if (typeof retry === "string") {
|
|
@@ -1108,4 +1111,4 @@ async function verifyCmssyWebhook(options) {
|
|
|
1108
1111
|
return parsed;
|
|
1109
1112
|
}
|
|
1110
1113
|
|
|
1111
|
-
export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_EDIT_TOKEN_HEADER, CMSSY_LOCALE_HEADER, CMSSY_RATE_LIMIT_WINDOW_MS, CMSSY_RETRY_MODES, CMSSY_SECRET_QUERY_PARAM, CmssyRequestError, CmssyWebhookError, DEFAULT_CMSSY_API_URL, DEFAULT_CMSSY_EDITOR_ORIGINS, PROTOCOL_VERSION, SHORTCUT_ACTIONS, applyCmssyCsp, blocksToMeta, blocksToSchemas, buildBlockManifest, createCmssyClient, defineCmssyConfig, defineCmssyLayout, fields, graphqlRequest, isProtocolCompatible, isVerifiedEditUrl, layoutRegionsToBridge, localizeHref, mediaAlt, mediaDuration, mediaType, mediaUrl, mediaUrls, mintCmssyEditToken, normalizeOrigin, parseEditorMessage, postToEditor, propsToSchema, registryToManifestBlocks, resolveCmssyLocale, resolveEditorOrigin, verifyCmssyEditToken, verifyCmssyWebhook };
|
|
1114
|
+
export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_EDIT_TOKEN_HEADER, CMSSY_LOCALE_HEADER, CMSSY_RATE_LIMIT_WINDOW_MS, CMSSY_RETRY_MODES, CMSSY_SECRET_QUERY_PARAM, CmssyRequestError, CmssyWebhookError, DEFAULT_CMSSY_API_URL, DEFAULT_CMSSY_EDITOR_ORIGINS, PROTOCOL_VERSION, SHORTCUT_ACTIONS, applyCmssyCsp, blocksToMeta, blocksToSchemas, buildBlockManifest, createCmssyClient, defineCmssyConfig, defineCmssyLayout, fields, graphqlRequest, isProtocolCompatible, isTransientRequestError, isVerifiedEditUrl, layoutRegionsToBridge, localizeHref, mediaAlt, mediaDuration, mediaType, mediaUrl, mediaUrls, mintCmssyEditToken, normalizeOrigin, parseEditorMessage, postToEditor, propsToSchema, registryToManifestBlocks, resolveCmssyLocale, resolveEditorOrigin, verifyCmssyEditToken, verifyCmssyWebhook };
|
package/dist/internal/locale.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { C as CMSSY_LOCALE_HEADER, a as localeForPath, b as localeForPathname, l as localizeHref, c as resolveSiteLocales, s as splitCmssyLocale, d as splitLocaleFromPath } from '../locale-
|
|
1
|
+
export { C as CMSSY_LOCALE_HEADER, a as localeForPath, b as localeForPathname, l as localizeHref, c as resolveSiteLocales, s as splitCmssyLocale, d as splitLocaleFromPath } from '../locale-CsDPiYGF.cjs';
|
|
2
2
|
export { CmssySiteLocales } from '@cmssy/types';
|
|
3
|
-
import '../content-client-
|
|
3
|
+
import '../content-client-DhcHP8ln.cjs';
|
|
4
4
|
|
|
5
5
|
declare function localizedPath(slug: string, locale: string, defaultLocale: string): string;
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { C as CMSSY_LOCALE_HEADER, a as localeForPath, b as localeForPathname, l as localizeHref, c as resolveSiteLocales, s as splitCmssyLocale, d as splitLocaleFromPath } from '../locale-
|
|
1
|
+
export { C as CMSSY_LOCALE_HEADER, a as localeForPath, b as localeForPathname, l as localizeHref, c as resolveSiteLocales, s as splitCmssyLocale, d as splitLocaleFromPath } from '../locale-BCguiP54.js';
|
|
2
2
|
export { CmssySiteLocales } from '@cmssy/types';
|
|
3
|
-
import '../content-client-
|
|
3
|
+
import '../content-client-DhcHP8ln.js';
|
|
4
4
|
|
|
5
5
|
declare function localizedPath(slug: string, locale: string, defaultLocale: string): string;
|
|
6
6
|
|
package/dist/internal/locale.js
CHANGED
package/dist/internal.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var types = require('@cmssy/types');
|
|
4
4
|
|
|
5
5
|
// src/version.ts
|
|
6
|
-
var CMSSY_CORE_VERSION = "19.
|
|
6
|
+
var CMSSY_CORE_VERSION = "19.1.0" ;
|
|
7
7
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
8
8
|
|
|
9
9
|
// src/data/http.ts
|
|
@@ -1122,6 +1122,28 @@ function localizeHref(href, locale) {
|
|
|
1122
1122
|
return `${addLocalePrefix(bare, locale.current, locale)}${suffix}`;
|
|
1123
1123
|
}
|
|
1124
1124
|
|
|
1125
|
+
// src/data/layout-store.ts
|
|
1126
|
+
function createCmssyLayoutStore() {
|
|
1127
|
+
return /* @__PURE__ */ new Map();
|
|
1128
|
+
}
|
|
1129
|
+
function layoutStoreKey(config, pageSlug, previewSecret) {
|
|
1130
|
+
return [
|
|
1131
|
+
resolveApiUrl(config.apiUrl),
|
|
1132
|
+
config.org ?? "",
|
|
1133
|
+
config.workspaceSlug,
|
|
1134
|
+
pageSlug,
|
|
1135
|
+
previewSecret ? "draft" : "published"
|
|
1136
|
+
].join("\0");
|
|
1137
|
+
}
|
|
1138
|
+
function readThroughLayoutStore(store, key, load) {
|
|
1139
|
+
if (!store) return load();
|
|
1140
|
+
const pending = store.get(key);
|
|
1141
|
+
if (pending) return pending;
|
|
1142
|
+
const started = load();
|
|
1143
|
+
store.set(key, started);
|
|
1144
|
+
return started;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1125
1147
|
// src/locale.ts
|
|
1126
1148
|
var CMSSY_LOCALE_HEADER = "x-cmssy-locale";
|
|
1127
1149
|
async function localeForPathname(config, pathname) {
|
|
@@ -1341,6 +1363,7 @@ exports.clearWorkspaceIdCache = clearWorkspaceIdCache;
|
|
|
1341
1363
|
exports.cmssyCspHeaders = cmssyCspHeaders;
|
|
1342
1364
|
exports.cmssySecretsMatch = cmssySecretsMatch;
|
|
1343
1365
|
exports.collectFormIds = collectFormIds;
|
|
1366
|
+
exports.createCmssyLayoutStore = createCmssyLayoutStore;
|
|
1344
1367
|
exports.fetchLayouts = fetchLayouts;
|
|
1345
1368
|
exports.fetchPage = fetchPage;
|
|
1346
1369
|
exports.fetchPageById = fetchPageById;
|
|
@@ -1350,11 +1373,13 @@ exports.fetchSiteConfig = fetchSiteConfig;
|
|
|
1350
1373
|
exports.getBlockContentForLanguage = getBlockContentForLanguage;
|
|
1351
1374
|
exports.isDevelopment = isDevelopment;
|
|
1352
1375
|
exports.layoutRegionIds = layoutRegionIds;
|
|
1376
|
+
exports.layoutStoreKey = layoutStoreKey;
|
|
1353
1377
|
exports.localeForPath = localeForPath;
|
|
1354
1378
|
exports.localeForPathname = localeForPathname;
|
|
1355
1379
|
exports.localizeHref = localizeHref;
|
|
1356
1380
|
exports.localizedPath = localizedPath;
|
|
1357
1381
|
exports.normalizeBlockContent = normalizeBlockContent;
|
|
1382
|
+
exports.readThroughLayoutStore = readThroughLayoutStore;
|
|
1358
1383
|
exports.resolveApiUrl = resolveApiUrl;
|
|
1359
1384
|
exports.resolveForms = resolveForms;
|
|
1360
1385
|
exports.resolveInitialTarget = resolveInitialTarget;
|
package/dist/internal.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { g as fetchLayouts, h as fetchPage,
|
|
2
|
-
import { CmssyFormDefinition, BuildBlockContextExtra, CmssyBlockContext, CmssyClientConfig, CmssySiteConfig, FieldDefinition, RawBlock } from '@cmssy/types';
|
|
1
|
+
export { g as fetchLayouts, h as fetchPage, j as fetchPageById, k as fetchPageMeta, l as fetchPages, r as resolveApiUrl } from './content-client-DhcHP8ln.cjs';
|
|
2
|
+
import { CmssyFormDefinition, BuildBlockContextExtra, CmssyBlockContext, CmssyClientConfig, CmssySiteConfig, FieldDefinition, RawBlock, CmssyLayoutGroup } from '@cmssy/types';
|
|
3
3
|
export { CmssySiteLocales } from '@cmssy/types';
|
|
4
|
-
import { G as GraphqlRequestOptions } from './locale-
|
|
5
|
-
export { C as CMSSY_LOCALE_HEADER, a as localeForPath, b as localeForPathname, l as localizeHref, c as resolveSiteLocales, s as splitCmssyLocale, d as splitLocaleFromPath } from './locale-
|
|
6
|
-
import { Q as QueryScopedOptions } from './csp-
|
|
7
|
-
export { F as cmssyCspHeaders, G as isDevelopment, H as layoutRegionIds, J as resolveInitialTarget, K as toCspOrigin } from './csp-
|
|
4
|
+
import { G as GraphqlRequestOptions } from './locale-CsDPiYGF.cjs';
|
|
5
|
+
export { C as CMSSY_LOCALE_HEADER, a as localeForPath, b as localeForPathname, l as localizeHref, c as resolveSiteLocales, s as splitCmssyLocale, d as splitLocaleFromPath } from './locale-CsDPiYGF.cjs';
|
|
6
|
+
import { Q as QueryScopedOptions } from './csp-Dtp9S9TS.cjs';
|
|
7
|
+
export { F as cmssyCspHeaders, G as isDevelopment, H as layoutRegionIds, J as resolveInitialTarget, K as toCspOrigin } from './csp-Dtp9S9TS.cjs';
|
|
8
8
|
export { localizedPath } from './internal/locale.cjs';
|
|
9
9
|
|
|
10
10
|
declare const SITE_CONFIG_QUERY: string;
|
|
@@ -46,6 +46,11 @@ declare function resolveRelationContent(config: CmssyClientConfig, entries: Rela
|
|
|
46
46
|
declare function collectFormIds(blocks: RawBlock[], schemas: BlockSchemaMap, locale: string, defaultLocale: string): string[];
|
|
47
47
|
declare function resolveForms(config: CmssyClientConfig, blocks: RawBlock[], schemas: BlockSchemaMap, locale: string, defaultLocale: string, options?: QueryScopedOptions): Promise<Record<string, CmssyFormDefinition>>;
|
|
48
48
|
|
|
49
|
+
type CmssyLayoutStore = Map<string, Promise<CmssyLayoutGroup[]>>;
|
|
50
|
+
declare function createCmssyLayoutStore(): CmssyLayoutStore;
|
|
51
|
+
declare function layoutStoreKey(config: CmssyClientConfig, pageSlug: string, previewSecret: string | undefined): string;
|
|
52
|
+
declare function readThroughLayoutStore(store: CmssyLayoutStore | undefined, key: string, load: () => Promise<CmssyLayoutGroup[]>): Promise<CmssyLayoutGroup[]>;
|
|
53
|
+
|
|
49
54
|
declare function cmssySecretsMatch(a: string, b: string): Promise<boolean>;
|
|
50
55
|
|
|
51
56
|
interface CmssyDeliveryOperation {
|
|
@@ -54,4 +59,4 @@ interface CmssyDeliveryOperation {
|
|
|
54
59
|
}
|
|
55
60
|
declare const CMSSY_DELIVERY_OPERATIONS: readonly CmssyDeliveryOperation[];
|
|
56
61
|
|
|
57
|
-
export { type BlockSchemaMap, CMSSY_DELIVERY_OPERATIONS, FORM_QUERY, MODEL_DEFINITIONS_QUERY, MODEL_RECORDS_QUERY, type RelationContentEntry, SITE_CONFIG_QUERY, SUBMIT_FORM_MUTATION, asBucket, buildBlockContext, clearWorkspaceIdCache, cmssySecretsMatch, collectFormIds, fetchSiteConfig, getBlockContentForLanguage, normalizeBlockContent, resolveForms, resolveRelationContent, resolveWorkspaceId };
|
|
62
|
+
export { type BlockSchemaMap, CMSSY_DELIVERY_OPERATIONS, type CmssyLayoutStore, FORM_QUERY, MODEL_DEFINITIONS_QUERY, MODEL_RECORDS_QUERY, type RelationContentEntry, SITE_CONFIG_QUERY, SUBMIT_FORM_MUTATION, asBucket, buildBlockContext, clearWorkspaceIdCache, cmssySecretsMatch, collectFormIds, createCmssyLayoutStore, fetchSiteConfig, getBlockContentForLanguage, layoutStoreKey, normalizeBlockContent, readThroughLayoutStore, resolveForms, resolveRelationContent, resolveWorkspaceId };
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { g as fetchLayouts, h as fetchPage,
|
|
2
|
-
import { CmssyFormDefinition, BuildBlockContextExtra, CmssyBlockContext, CmssyClientConfig, CmssySiteConfig, FieldDefinition, RawBlock } from '@cmssy/types';
|
|
1
|
+
export { g as fetchLayouts, h as fetchPage, j as fetchPageById, k as fetchPageMeta, l as fetchPages, r as resolveApiUrl } from './content-client-DhcHP8ln.js';
|
|
2
|
+
import { CmssyFormDefinition, BuildBlockContextExtra, CmssyBlockContext, CmssyClientConfig, CmssySiteConfig, FieldDefinition, RawBlock, CmssyLayoutGroup } from '@cmssy/types';
|
|
3
3
|
export { CmssySiteLocales } from '@cmssy/types';
|
|
4
|
-
import { G as GraphqlRequestOptions } from './locale-
|
|
5
|
-
export { C as CMSSY_LOCALE_HEADER, a as localeForPath, b as localeForPathname, l as localizeHref, c as resolveSiteLocales, s as splitCmssyLocale, d as splitLocaleFromPath } from './locale-
|
|
6
|
-
import { Q as QueryScopedOptions } from './csp-
|
|
7
|
-
export { F as cmssyCspHeaders, G as isDevelopment, H as layoutRegionIds, J as resolveInitialTarget, K as toCspOrigin } from './csp-
|
|
4
|
+
import { G as GraphqlRequestOptions } from './locale-BCguiP54.js';
|
|
5
|
+
export { C as CMSSY_LOCALE_HEADER, a as localeForPath, b as localeForPathname, l as localizeHref, c as resolveSiteLocales, s as splitCmssyLocale, d as splitLocaleFromPath } from './locale-BCguiP54.js';
|
|
6
|
+
import { Q as QueryScopedOptions } from './csp-AuptG-R-.js';
|
|
7
|
+
export { F as cmssyCspHeaders, G as isDevelopment, H as layoutRegionIds, J as resolveInitialTarget, K as toCspOrigin } from './csp-AuptG-R-.js';
|
|
8
8
|
export { localizedPath } from './internal/locale.js';
|
|
9
9
|
|
|
10
10
|
declare const SITE_CONFIG_QUERY: string;
|
|
@@ -46,6 +46,11 @@ declare function resolveRelationContent(config: CmssyClientConfig, entries: Rela
|
|
|
46
46
|
declare function collectFormIds(blocks: RawBlock[], schemas: BlockSchemaMap, locale: string, defaultLocale: string): string[];
|
|
47
47
|
declare function resolveForms(config: CmssyClientConfig, blocks: RawBlock[], schemas: BlockSchemaMap, locale: string, defaultLocale: string, options?: QueryScopedOptions): Promise<Record<string, CmssyFormDefinition>>;
|
|
48
48
|
|
|
49
|
+
type CmssyLayoutStore = Map<string, Promise<CmssyLayoutGroup[]>>;
|
|
50
|
+
declare function createCmssyLayoutStore(): CmssyLayoutStore;
|
|
51
|
+
declare function layoutStoreKey(config: CmssyClientConfig, pageSlug: string, previewSecret: string | undefined): string;
|
|
52
|
+
declare function readThroughLayoutStore(store: CmssyLayoutStore | undefined, key: string, load: () => Promise<CmssyLayoutGroup[]>): Promise<CmssyLayoutGroup[]>;
|
|
53
|
+
|
|
49
54
|
declare function cmssySecretsMatch(a: string, b: string): Promise<boolean>;
|
|
50
55
|
|
|
51
56
|
interface CmssyDeliveryOperation {
|
|
@@ -54,4 +59,4 @@ interface CmssyDeliveryOperation {
|
|
|
54
59
|
}
|
|
55
60
|
declare const CMSSY_DELIVERY_OPERATIONS: readonly CmssyDeliveryOperation[];
|
|
56
61
|
|
|
57
|
-
export { type BlockSchemaMap, CMSSY_DELIVERY_OPERATIONS, FORM_QUERY, MODEL_DEFINITIONS_QUERY, MODEL_RECORDS_QUERY, type RelationContentEntry, SITE_CONFIG_QUERY, SUBMIT_FORM_MUTATION, asBucket, buildBlockContext, clearWorkspaceIdCache, cmssySecretsMatch, collectFormIds, fetchSiteConfig, getBlockContentForLanguage, normalizeBlockContent, resolveForms, resolveRelationContent, resolveWorkspaceId };
|
|
62
|
+
export { type BlockSchemaMap, CMSSY_DELIVERY_OPERATIONS, type CmssyLayoutStore, FORM_QUERY, MODEL_DEFINITIONS_QUERY, MODEL_RECORDS_QUERY, type RelationContentEntry, SITE_CONFIG_QUERY, SUBMIT_FORM_MUTATION, asBucket, buildBlockContext, clearWorkspaceIdCache, cmssySecretsMatch, collectFormIds, createCmssyLayoutStore, fetchSiteConfig, getBlockContentForLanguage, layoutStoreKey, normalizeBlockContent, readThroughLayoutStore, resolveForms, resolveRelationContent, resolveWorkspaceId };
|
package/dist/internal.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { brandingFieldNames, DEFAULT_LAYOUT_REGIONS } from '@cmssy/types';
|
|
2
2
|
|
|
3
3
|
// src/version.ts
|
|
4
|
-
var CMSSY_CORE_VERSION = "19.
|
|
4
|
+
var CMSSY_CORE_VERSION = "19.1.0" ;
|
|
5
5
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
6
6
|
|
|
7
7
|
// src/data/http.ts
|
|
@@ -1120,6 +1120,28 @@ function localizeHref(href, locale) {
|
|
|
1120
1120
|
return `${addLocalePrefix(bare, locale.current, locale)}${suffix}`;
|
|
1121
1121
|
}
|
|
1122
1122
|
|
|
1123
|
+
// src/data/layout-store.ts
|
|
1124
|
+
function createCmssyLayoutStore() {
|
|
1125
|
+
return /* @__PURE__ */ new Map();
|
|
1126
|
+
}
|
|
1127
|
+
function layoutStoreKey(config, pageSlug, previewSecret) {
|
|
1128
|
+
return [
|
|
1129
|
+
resolveApiUrl(config.apiUrl),
|
|
1130
|
+
config.org ?? "",
|
|
1131
|
+
config.workspaceSlug,
|
|
1132
|
+
pageSlug,
|
|
1133
|
+
previewSecret ? "draft" : "published"
|
|
1134
|
+
].join("\0");
|
|
1135
|
+
}
|
|
1136
|
+
function readThroughLayoutStore(store, key, load) {
|
|
1137
|
+
if (!store) return load();
|
|
1138
|
+
const pending = store.get(key);
|
|
1139
|
+
if (pending) return pending;
|
|
1140
|
+
const started = load();
|
|
1141
|
+
store.set(key, started);
|
|
1142
|
+
return started;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1123
1145
|
// src/locale.ts
|
|
1124
1146
|
var CMSSY_LOCALE_HEADER = "x-cmssy-locale";
|
|
1125
1147
|
async function localeForPathname(config, pathname) {
|
|
@@ -1326,4 +1348,4 @@ function layoutRegionIds(layout) {
|
|
|
1326
1348
|
return (layout?.regions ?? DEFAULT_LAYOUT_REGIONS).map((region) => region.id);
|
|
1327
1349
|
}
|
|
1328
1350
|
|
|
1329
|
-
export { CMSSY_DELIVERY_OPERATIONS, CMSSY_LOCALE_HEADER, FORM_QUERY, MODEL_DEFINITIONS_QUERY, MODEL_RECORDS_QUERY, SITE_CONFIG_QUERY, SUBMIT_FORM_MUTATION, asBucket, buildBlockContext, clearWorkspaceIdCache, cmssyCspHeaders, cmssySecretsMatch, collectFormIds, fetchLayouts, fetchPage, fetchPageById, fetchPageMeta, fetchPages, fetchSiteConfig, getBlockContentForLanguage, isDevelopment, layoutRegionIds, localeForPath, localeForPathname, localizeHref, localizedPath, normalizeBlockContent, resolveApiUrl, resolveForms, resolveInitialTarget, resolveRelationContent, resolveSiteLocales, resolveWorkspaceId, splitCmssyLocale, splitLocaleFromPath, toCspOrigin };
|
|
1351
|
+
export { CMSSY_DELIVERY_OPERATIONS, CMSSY_LOCALE_HEADER, FORM_QUERY, MODEL_DEFINITIONS_QUERY, MODEL_RECORDS_QUERY, SITE_CONFIG_QUERY, SUBMIT_FORM_MUTATION, asBucket, buildBlockContext, clearWorkspaceIdCache, cmssyCspHeaders, cmssySecretsMatch, collectFormIds, createCmssyLayoutStore, fetchLayouts, fetchPage, fetchPageById, fetchPageMeta, fetchPages, fetchSiteConfig, getBlockContentForLanguage, isDevelopment, layoutRegionIds, layoutStoreKey, localeForPath, localeForPathname, localizeHref, localizedPath, normalizeBlockContent, readThroughLayoutStore, resolveApiUrl, resolveForms, resolveInitialTarget, resolveRelationContent, resolveSiteLocales, resolveWorkspaceId, splitCmssyLocale, splitLocaleFromPath, toCspOrigin };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CmssyClientConfig, CmssyLocaleContext, CmssySiteLocales } from '@cmssy/types';
|
|
2
|
-
import { F as FetchLike, R as RetryOption } from './content-client-
|
|
2
|
+
import { F as FetchLike, R as RetryOption } from './content-client-DhcHP8ln.js';
|
|
3
3
|
|
|
4
4
|
interface GraphqlRequestOptions {
|
|
5
5
|
fetch?: FetchLike;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CmssyClientConfig, CmssyLocaleContext, CmssySiteLocales } from '@cmssy/types';
|
|
2
|
-
import { F as FetchLike, R as RetryOption } from './content-client-
|
|
2
|
+
import { F as FetchLike, R as RetryOption } from './content-client-DhcHP8ln.cjs';
|
|
3
3
|
|
|
4
4
|
interface GraphqlRequestOptions {
|
|
5
5
|
fetch?: FetchLike;
|
package/dist/preflight.d.cts
CHANGED
package/dist/preflight.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmssy/core",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.1.0",
|
|
4
4
|
"description": "Framework-agnostic cmssy gateway: GraphQL client, block/field system, editor protocol. No React, no Next.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cmssy",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"vitest": "^2.1.0"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@cmssy/types": "0.
|
|
90
|
+
"@cmssy/types": "0.59.0",
|
|
91
91
|
"jose": "^6.2.3"
|
|
92
92
|
},
|
|
93
93
|
"scripts": {
|