@easy-web/core 1.4.1 → 1.6.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/README.md +42 -1
- package/dist/contracts/capabilities.d.ts +38 -0
- package/dist/contracts/capabilities.d.ts.map +1 -1
- package/dist/contracts/content-composition.d.ts +144 -0
- package/dist/contracts/content-composition.d.ts.map +1 -0
- package/dist/contracts/content-composition.js +143 -0
- package/dist/contracts/content-composition.js.map +1 -0
- package/dist/contracts/index.d.ts +2 -0
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +2 -0
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/traits.d.ts +98 -0
- package/dist/contracts/traits.d.ts.map +1 -0
- package/dist/contracts/traits.js +84 -0
- package/dist/contracts/traits.js.map +1 -0
- package/dist/demo/demo-content.d.ts +37 -0
- package/dist/demo/demo-content.d.ts.map +1 -0
- package/dist/demo/demo-content.js +171 -0
- package/dist/demo/demo-content.js.map +1 -0
- package/dist/demo/index.d.ts +3 -0
- package/dist/demo/index.d.ts.map +1 -0
- package/dist/demo/index.js +3 -0
- package/dist/demo/index.js.map +1 -0
- package/dist/demo/legal-shells.d.ts +18 -0
- package/dist/demo/legal-shells.d.ts.map +1 -0
- package/dist/demo/legal-shells.js +40 -0
- package/dist/demo/legal-shells.js.map +1 -0
- package/dist/i18n/cli-catalogs.d.ts +42 -0
- package/dist/i18n/cli-catalogs.d.ts.map +1 -0
- package/dist/i18n/cli-catalogs.js +29 -0
- package/dist/i18n/cli-catalogs.js.map +1 -0
- package/dist/i18n/create-localization.d.ts +37 -0
- package/dist/i18n/create-localization.d.ts.map +1 -0
- package/dist/i18n/create-localization.js +68 -0
- package/dist/i18n/create-localization.js.map +1 -0
- package/dist/i18n/explicit-formatters.d.ts +20 -0
- package/dist/i18n/explicit-formatters.d.ts.map +1 -0
- package/dist/i18n/explicit-formatters.js +18 -0
- package/dist/i18n/explicit-formatters.js.map +1 -0
- package/dist/i18n/index.d.ts +4 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +4 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/locale-inputs.d.ts +18 -0
- package/dist/i18n/locale-inputs.d.ts.map +1 -0
- package/dist/i18n/locale-inputs.js +73 -0
- package/dist/i18n/locale-inputs.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/recipes/admission.d.ts +161 -0
- package/dist/recipes/admission.d.ts.map +1 -0
- package/dist/recipes/admission.js +85 -0
- package/dist/recipes/admission.js.map +1 -0
- package/dist/recipes/graph.d.ts +101 -0
- package/dist/recipes/graph.d.ts.map +1 -0
- package/dist/recipes/graph.js +166 -0
- package/dist/recipes/graph.js.map +1 -0
- package/dist/recipes/index.d.ts +9 -0
- package/dist/recipes/index.d.ts.map +1 -0
- package/dist/recipes/index.js +9 -0
- package/dist/recipes/index.js.map +1 -0
- package/dist/recipes/mermaid.d.ts +3 -0
- package/dist/recipes/mermaid.d.ts.map +1 -0
- package/dist/recipes/mermaid.js +79 -0
- package/dist/recipes/mermaid.js.map +1 -0
- package/dist/recipes/registry.d.ts +82 -0
- package/dist/recipes/registry.d.ts.map +1 -0
- package/dist/recipes/registry.js +40 -0
- package/dist/recipes/registry.js.map +1 -0
- package/dist/recipes/schema.d.ts +129 -0
- package/dist/recipes/schema.d.ts.map +1 -0
- package/dist/recipes/schema.js +41 -0
- package/dist/recipes/schema.js.map +1 -0
- package/dist/recipes/serialize.d.ts +20 -0
- package/dist/recipes/serialize.d.ts.map +1 -0
- package/dist/recipes/serialize.js +56 -0
- package/dist/recipes/serialize.js.map +1 -0
- package/dist/recipes/shell-recipe.d.ts +59 -0
- package/dist/recipes/shell-recipe.d.ts.map +1 -0
- package/dist/recipes/shell-recipe.js +145 -0
- package/dist/recipes/shell-recipe.js.map +1 -0
- package/dist/recipes/types.d.ts +72 -0
- package/dist/recipes/types.d.ts.map +1 -0
- package/dist/recipes/types.js +13 -0
- package/dist/recipes/types.js.map +1 -0
- package/dist/schemas/galleries.d.ts +2 -2
- package/package.json +17 -1
- package/src/components/DemoLegalShell.astro +36 -0
- package/src/contracts/__tests__/content-composition.test.ts +170 -0
- package/src/contracts/capabilities.ts +49 -0
- package/src/contracts/content-composition.ts +176 -0
- package/src/contracts/index.ts +2 -0
- package/src/contracts/traits.ts +107 -0
- package/src/demo/__tests__/demo-content.test.ts +107 -0
- package/src/demo/demo-content.ts +210 -0
- package/src/demo/index.ts +2 -0
- package/src/demo/legal-shells.ts +52 -0
- package/src/i18n/__tests__/create-localization.test.ts +138 -0
- package/src/i18n/__tests__/explicit-formatters.test.ts +82 -0
- package/src/i18n/cli-catalogs.ts +44 -0
- package/src/i18n/create-localization.ts +67 -0
- package/src/i18n/explicit-formatters.ts +36 -0
- package/src/i18n/index.ts +4 -0
- package/src/i18n/locale-inputs.ts +73 -0
- package/src/index.ts +1 -0
- package/src/recipes/__tests__/graph.test.ts +139 -0
- package/src/recipes/__tests__/protocol.test.ts +180 -0
- package/src/recipes/__tests__/serialize.test.ts +128 -0
- package/src/recipes/__tests__/shell-recipe.test.ts +75 -0
- package/src/recipes/admission.ts +77 -0
- package/src/recipes/graph.ts +244 -0
- package/src/recipes/index.ts +8 -0
- package/src/recipes/mermaid.ts +75 -0
- package/src/recipes/registry.ts +48 -0
- package/src/recipes/schema.ts +53 -0
- package/src/recipes/serialize.ts +77 -0
- package/src/recipes/shell-recipe.ts +162 -0
- package/src/recipes/types.ts +63 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { z } from 'astro/zod';
|
|
2
|
+
import { contentLocaleSchema, optionalCurrencyCodeSchema } from '../i18n/locale-inputs.js';
|
|
3
|
+
import { normalizeLocalizedPath, validateLocalizedPaths } from '../i18n/localized-paths.js';
|
|
4
|
+
import { contentTraitSchema, type ContentTrait } from './traits.js';
|
|
5
|
+
|
|
6
|
+
export const presentationBindings = ['homepage', 'list', 'detail', 'navigation', 'cms-admin'] as const;
|
|
7
|
+
export const presentationBindingSchema = z.enum(presentationBindings);
|
|
8
|
+
export type PresentationBinding = z.infer<typeof presentationBindingSchema>;
|
|
9
|
+
|
|
10
|
+
export const presentationBindingRequirements = {
|
|
11
|
+
homepage: ['title', 'slug', 'image', 'featured'],
|
|
12
|
+
list: ['title', 'slug'],
|
|
13
|
+
detail: ['title', 'slug', 'body'],
|
|
14
|
+
navigation: ['title', 'slug'],
|
|
15
|
+
'cms-admin': ['title', 'slug'],
|
|
16
|
+
} as const satisfies Readonly<Record<PresentationBinding, readonly ContentTrait[]>>;
|
|
17
|
+
|
|
18
|
+
export const contentTypeIdSchema = z.string()
|
|
19
|
+
.regex(/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/, 'Content type ID must use lowercase kebab-case')
|
|
20
|
+
.brand<'ContentTypeId'>();
|
|
21
|
+
export type ContentTypeId = z.infer<typeof contentTypeIdSchema>;
|
|
22
|
+
|
|
23
|
+
const localizedTextSchema = z.record(z.string(), z.string().min(1)).readonly();
|
|
24
|
+
const localizedRoutesSchema = z.record(
|
|
25
|
+
z.string(),
|
|
26
|
+
z.string().regex(/^\/(?!\/)(?!.*[?#]).*$/, 'Route must be an absolute path without query or hash'),
|
|
27
|
+
).readonly();
|
|
28
|
+
const selectedTraitsSchema = z.array(contentTraitSchema).min(1).superRefine((traits, context) => {
|
|
29
|
+
if (new Set(traits).size !== traits.length) {
|
|
30
|
+
context.addIssue({ code: z.ZodIssueCode.custom, message: 'Selected traits must be unique' });
|
|
31
|
+
}
|
|
32
|
+
}).readonly();
|
|
33
|
+
const selectedBindingsSchema = z.array(presentationBindingSchema).min(1).superRefine((bindings, context) => {
|
|
34
|
+
if (new Set(bindings).size !== bindings.length) {
|
|
35
|
+
context.addIssue({ code: z.ZodIssueCode.custom, message: 'Selected bindings must be unique' });
|
|
36
|
+
}
|
|
37
|
+
}).readonly();
|
|
38
|
+
|
|
39
|
+
const contentTypeBaseShape = {
|
|
40
|
+
id: contentTypeIdSchema,
|
|
41
|
+
primary: z.boolean().default(false),
|
|
42
|
+
labels: localizedTextSchema,
|
|
43
|
+
routes: localizedRoutesSchema,
|
|
44
|
+
bindings: selectedBindingsSchema,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const moneyContentTypeSchema = z.object({
|
|
48
|
+
...contentTypeBaseShape,
|
|
49
|
+
traits: selectedTraitsSchema.refine((traits) => traits.includes('money'), 'Money selection must include the money trait'),
|
|
50
|
+
currency: optionalCurrencyCodeSchema,
|
|
51
|
+
}).strict().readonly();
|
|
52
|
+
|
|
53
|
+
const nonMoneyContentTypeSchema = z.object({
|
|
54
|
+
...contentTypeBaseShape,
|
|
55
|
+
traits: selectedTraitsSchema.refine((traits) => !traits.includes('money'), 'Non-money selection cannot include the money trait'),
|
|
56
|
+
}).strict().readonly();
|
|
57
|
+
|
|
58
|
+
export const contentTypeDefinitionSchema = z.union([moneyContentTypeSchema, nonMoneyContentTypeSchema]);
|
|
59
|
+
export type ContentTypeDefinition = z.infer<typeof contentTypeDefinitionSchema>;
|
|
60
|
+
|
|
61
|
+
export const defaultReservedContentRoutes = ['/', '/404/', '/admin/'] as const;
|
|
62
|
+
|
|
63
|
+
export const contentCompositionSchema = z.object({
|
|
64
|
+
contentLocales: z.array(contentLocaleSchema).min(1).readonly(),
|
|
65
|
+
contentTypes: z.array(contentTypeDefinitionSchema).readonly(),
|
|
66
|
+
reservedRoutes: z.array(z.string()).default(() => [...defaultReservedContentRoutes]).readonly(),
|
|
67
|
+
}).strict().superRefine((composition, context) => {
|
|
68
|
+
const locales = composition.contentLocales;
|
|
69
|
+
const normalizedReserved = new Set(composition.reservedRoutes.map(normalizeLocalizedPath));
|
|
70
|
+
const ids = new Map<string, number>();
|
|
71
|
+
const routes = new Map<string, string>();
|
|
72
|
+
let primaryId: string | undefined;
|
|
73
|
+
|
|
74
|
+
composition.contentTypes.forEach((contentType, index) => {
|
|
75
|
+
const path = ['contentTypes', index] as const;
|
|
76
|
+
const existingId = ids.get(contentType.id);
|
|
77
|
+
if (existingId !== undefined) {
|
|
78
|
+
context.addIssue({
|
|
79
|
+
code: z.ZodIssueCode.custom,
|
|
80
|
+
path: [...path, 'id'],
|
|
81
|
+
message: `Duplicate content type ID "${contentType.id}"; first declared at contentTypes[${existingId}]`,
|
|
82
|
+
});
|
|
83
|
+
} else {
|
|
84
|
+
ids.set(contentType.id, index);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (contentType.primary) {
|
|
88
|
+
if (primaryId !== undefined) {
|
|
89
|
+
context.addIssue({
|
|
90
|
+
code: z.ZodIssueCode.custom,
|
|
91
|
+
path: [...path, 'primary'],
|
|
92
|
+
message: `Only one primary content type is allowed; "${primaryId}" is already primary`,
|
|
93
|
+
});
|
|
94
|
+
} else {
|
|
95
|
+
primaryId = contentType.id;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
validateLocales(contentType, locales, path, context);
|
|
100
|
+
validateBindings(contentType, path, context);
|
|
101
|
+
validateRoutes(contentType, path, normalizedReserved, routes, context);
|
|
102
|
+
});
|
|
103
|
+
}).readonly();
|
|
104
|
+
|
|
105
|
+
export type ContentComposition = z.infer<typeof contentCompositionSchema>;
|
|
106
|
+
|
|
107
|
+
function validateLocales(
|
|
108
|
+
contentType: ContentTypeDefinition,
|
|
109
|
+
locales: readonly string[],
|
|
110
|
+
path: readonly (string | number)[],
|
|
111
|
+
context: z.RefinementCtx,
|
|
112
|
+
): void {
|
|
113
|
+
for (const [name, localized] of [['labels', contentType.labels], ['routes', contentType.routes]] as const) {
|
|
114
|
+
const declared = Object.keys(localized);
|
|
115
|
+
const missing = locales.filter((locale) => !declared.includes(locale));
|
|
116
|
+
const unknown = declared.filter((locale) => !locales.includes(locale));
|
|
117
|
+
if (missing.length > 0) context.addIssue({
|
|
118
|
+
code: z.ZodIssueCode.custom,
|
|
119
|
+
path: [...path, name],
|
|
120
|
+
message: `Missing configured locale(s): ${missing.join(', ')}`,
|
|
121
|
+
});
|
|
122
|
+
if (unknown.length > 0) context.addIssue({
|
|
123
|
+
code: z.ZodIssueCode.custom,
|
|
124
|
+
path: [...path, name],
|
|
125
|
+
message: `Unknown content locale(s): ${unknown.join(', ')}`,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
for (const problem of validateLocalizedPaths([contentType.routes], locales)) {
|
|
130
|
+
context.addIssue({ code: z.ZodIssueCode.custom, path: [...path, 'routes'], message: problem });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function validateBindings(
|
|
135
|
+
contentType: ContentTypeDefinition,
|
|
136
|
+
path: readonly (string | number)[],
|
|
137
|
+
context: z.RefinementCtx,
|
|
138
|
+
): void {
|
|
139
|
+
const selected = new Set(contentType.traits);
|
|
140
|
+
for (const binding of contentType.bindings) {
|
|
141
|
+
const missing = presentationBindingRequirements[binding].filter((trait) => !selected.has(trait));
|
|
142
|
+
if (missing.length > 0) context.addIssue({
|
|
143
|
+
code: z.ZodIssueCode.custom,
|
|
144
|
+
path: [...path, 'bindings'],
|
|
145
|
+
message: `Binding "${binding}" requires trait(s): ${missing.join(', ')}`,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function validateRoutes(
|
|
151
|
+
contentType: ContentTypeDefinition,
|
|
152
|
+
path: readonly (string | number)[],
|
|
153
|
+
reserved: ReadonlySet<string>,
|
|
154
|
+
routes: Map<string, string>,
|
|
155
|
+
context: z.RefinementCtx,
|
|
156
|
+
): void {
|
|
157
|
+
for (const route of Object.values(contentType.routes)) {
|
|
158
|
+
const normalized = normalizeLocalizedPath(route);
|
|
159
|
+
if (reserved.has(normalized)) context.addIssue({
|
|
160
|
+
code: z.ZodIssueCode.custom,
|
|
161
|
+
path: [...path, 'routes'],
|
|
162
|
+
message: `Route "${route}" is reserved`,
|
|
163
|
+
});
|
|
164
|
+
const owner = routes.get(normalized);
|
|
165
|
+
if (owner !== undefined && owner !== contentType.id) context.addIssue({
|
|
166
|
+
code: z.ZodIssueCode.custom,
|
|
167
|
+
path: [...path, 'routes'],
|
|
168
|
+
message: `Route "${route}" collides with content type "${owner}"`,
|
|
169
|
+
});
|
|
170
|
+
routes.set(normalized, contentType.id);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function parseContentComposition(input: unknown): ContentComposition {
|
|
175
|
+
return contentCompositionSchema.parse(input);
|
|
176
|
+
}
|
package/src/contracts/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './capabilities.js';
|
|
2
|
+
export * from './content-composition.js';
|
|
2
3
|
export * from './implements.js';
|
|
3
4
|
export * from './props.js';
|
|
4
5
|
export * from './publish.js';
|
|
5
6
|
export * from './types.js';
|
|
7
|
+
export * from './traits.js';
|
|
6
8
|
export * from './jsonld.js';
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { z } from 'astro/zod';
|
|
2
|
+
import { currencyCodeSchema } from '../i18n/locale-inputs.js';
|
|
3
|
+
|
|
4
|
+
const imageSourceSchema = z.union([
|
|
5
|
+
z.string().min(1),
|
|
6
|
+
z.object({ src: z.string().min(1) }).passthrough(),
|
|
7
|
+
]);
|
|
8
|
+
|
|
9
|
+
const imageSchema = z.object({
|
|
10
|
+
src: imageSourceSchema,
|
|
11
|
+
alt: z.string().min(1),
|
|
12
|
+
caption: z.string().optional(),
|
|
13
|
+
}).strict().readonly();
|
|
14
|
+
|
|
15
|
+
const linkSchema = z.object({
|
|
16
|
+
label: z.string().min(1),
|
|
17
|
+
href: z.string().min(1),
|
|
18
|
+
external: z.boolean().optional(),
|
|
19
|
+
}).strict().readonly();
|
|
20
|
+
|
|
21
|
+
const titleShape = { title: z.string().min(1) };
|
|
22
|
+
const slugShape = { slug: z.string().min(1).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, 'Slug must use lowercase kebab-case') };
|
|
23
|
+
const summaryShape = { summary: z.string().min(1) };
|
|
24
|
+
const bodyShape = { body: z.string().min(1) };
|
|
25
|
+
const imageShape = { image: imageSchema };
|
|
26
|
+
const photosShape = { photos: z.array(imageSchema).readonly() };
|
|
27
|
+
const orderShape = { order: z.number().int() };
|
|
28
|
+
const taxonomyShape = { taxonomy: z.array(z.string().min(1)).readonly() };
|
|
29
|
+
const publicationShape = { publishDate: z.date(), modifiedDate: z.date().optional() };
|
|
30
|
+
const scheduleShape = { startDate: z.date(), endDate: z.date().optional() };
|
|
31
|
+
const locationShape = { location: z.string().min(1) };
|
|
32
|
+
const ctaShape = { cta: linkSchema };
|
|
33
|
+
const moneyShape = { amount: z.number().finite(), currency: currencyCodeSchema };
|
|
34
|
+
const featuredShape = { featured: z.boolean() };
|
|
35
|
+
|
|
36
|
+
export const contentTraits = [
|
|
37
|
+
'title',
|
|
38
|
+
'slug',
|
|
39
|
+
'summary',
|
|
40
|
+
'body',
|
|
41
|
+
'image',
|
|
42
|
+
'photos',
|
|
43
|
+
'order',
|
|
44
|
+
'taxonomy',
|
|
45
|
+
'publication',
|
|
46
|
+
'schedule',
|
|
47
|
+
'location',
|
|
48
|
+
'cta',
|
|
49
|
+
'money',
|
|
50
|
+
'featured',
|
|
51
|
+
] as const;
|
|
52
|
+
|
|
53
|
+
export const contentTraitSchema = z.enum(contentTraits);
|
|
54
|
+
export type ContentTrait = z.infer<typeof contentTraitSchema>;
|
|
55
|
+
|
|
56
|
+
export const titleTraitSchema = z.object(titleShape).strict().readonly();
|
|
57
|
+
export const slugTraitSchema = z.object(slugShape).strict().readonly();
|
|
58
|
+
export const summaryTraitSchema = z.object(summaryShape).strict().readonly();
|
|
59
|
+
export const bodyTraitSchema = z.object(bodyShape).strict().readonly();
|
|
60
|
+
export const imageTraitSchema = z.object(imageShape).strict().readonly();
|
|
61
|
+
export const photosTraitSchema = z.object(photosShape).strict().readonly();
|
|
62
|
+
export const orderTraitSchema = z.object(orderShape).strict().readonly();
|
|
63
|
+
export const taxonomyTraitSchema = z.object(taxonomyShape).strict().readonly();
|
|
64
|
+
export const publicationTraitSchema = z.object(publicationShape).strict().readonly();
|
|
65
|
+
export const scheduleTraitSchema = z.object(scheduleShape).strict().readonly();
|
|
66
|
+
export const locationTraitSchema = z.object(locationShape).strict().readonly();
|
|
67
|
+
export const ctaTraitSchema = z.object(ctaShape).strict().readonly();
|
|
68
|
+
export const moneyTraitSchema = z.object(moneyShape).strict().readonly();
|
|
69
|
+
export const featuredTraitSchema = z.object(featuredShape).strict().readonly();
|
|
70
|
+
|
|
71
|
+
export type TitleTrait = z.infer<typeof titleTraitSchema>;
|
|
72
|
+
export type SlugTrait = z.infer<typeof slugTraitSchema>;
|
|
73
|
+
export type SummaryTrait = z.infer<typeof summaryTraitSchema>;
|
|
74
|
+
export type BodyTrait = z.infer<typeof bodyTraitSchema>;
|
|
75
|
+
export type ImageTrait = z.infer<typeof imageTraitSchema>;
|
|
76
|
+
export type PhotosTrait = z.infer<typeof photosTraitSchema>;
|
|
77
|
+
export type OrderTrait = z.infer<typeof orderTraitSchema>;
|
|
78
|
+
export type TaxonomyTrait = z.infer<typeof taxonomyTraitSchema>;
|
|
79
|
+
export type PublicationTrait = z.infer<typeof publicationTraitSchema>;
|
|
80
|
+
export type ScheduleTrait = z.infer<typeof scheduleTraitSchema>;
|
|
81
|
+
export type LocationTrait = z.infer<typeof locationTraitSchema>;
|
|
82
|
+
export type CtaTrait = z.infer<typeof ctaTraitSchema>;
|
|
83
|
+
export type MoneyTrait = z.infer<typeof moneyTraitSchema>;
|
|
84
|
+
export type FeaturedTrait = z.infer<typeof featuredTraitSchema>;
|
|
85
|
+
|
|
86
|
+
const contentTraitShapes = {
|
|
87
|
+
title: titleShape,
|
|
88
|
+
slug: slugShape,
|
|
89
|
+
summary: summaryShape,
|
|
90
|
+
body: bodyShape,
|
|
91
|
+
image: imageShape,
|
|
92
|
+
photos: photosShape,
|
|
93
|
+
order: orderShape,
|
|
94
|
+
taxonomy: taxonomyShape,
|
|
95
|
+
publication: publicationShape,
|
|
96
|
+
schedule: scheduleShape,
|
|
97
|
+
location: locationShape,
|
|
98
|
+
cta: ctaShape,
|
|
99
|
+
money: moneyShape,
|
|
100
|
+
featured: featuredShape,
|
|
101
|
+
} satisfies Record<ContentTrait, Record<string, z.ZodTypeAny>>;
|
|
102
|
+
|
|
103
|
+
export function composeContentTraitSchema(traits: readonly ContentTrait[]) {
|
|
104
|
+
const shape: Record<string, z.ZodTypeAny> = {};
|
|
105
|
+
for (const trait of traits) Object.assign(shape, contentTraitShapes[trait]);
|
|
106
|
+
return z.object(shape).strict().readonly();
|
|
107
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { readFileSync, readdirSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { experimental_AstroContainer as AstroContainer } from 'astro/container';
|
|
5
|
+
import DemoLegalShell from '../../components/DemoLegalShell.astro';
|
|
6
|
+
import { parseContentComposition } from '../../contracts/index.js';
|
|
7
|
+
import {
|
|
8
|
+
canonicalHash,
|
|
9
|
+
createFixedClock,
|
|
10
|
+
generateDemoContent,
|
|
11
|
+
validateDemoContent,
|
|
12
|
+
type DemoContent,
|
|
13
|
+
} from '../demo-content.js';
|
|
14
|
+
import { DEMO_DISCLAIMER, generateDemoLegalShells, validateDemoLegalShell } from '../legal-shells.js';
|
|
15
|
+
|
|
16
|
+
const composition = parseContentComposition({
|
|
17
|
+
contentLocales: ['de', 'en'],
|
|
18
|
+
contentTypes: [
|
|
19
|
+
{
|
|
20
|
+
id: 'catalog-item', primary: true,
|
|
21
|
+
labels: { de: 'Produkte', en: 'Products' },
|
|
22
|
+
routes: { de: '/produkte/', en: '/en/products/' },
|
|
23
|
+
traits: ['title', 'slug', 'summary', 'body', 'image', 'photos', 'cta', 'money', 'featured', 'publication', 'schedule', 'location', 'taxonomy', 'order'],
|
|
24
|
+
bindings: ['homepage', 'list', 'detail'],
|
|
25
|
+
currency: 'EUR',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const gen = () => generateDemoContent(composition, { clock: createFixedClock() });
|
|
31
|
+
|
|
32
|
+
describe('demo content', () => {
|
|
33
|
+
it('is deterministic with a fixed clock', () => {
|
|
34
|
+
expect(canonicalHash(gen())).toBe(canonicalHash(gen()));
|
|
35
|
+
expect(JSON.stringify(gen())).toBe(JSON.stringify(gen()));
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('changes when the clock changes', () => {
|
|
39
|
+
const other = generateDemoContent(composition, { clock: createFixedClock('2027-05-05T00:00:00.000Z') });
|
|
40
|
+
expect(canonicalHash(other)).not.toBe(canonicalHash(gen()));
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('gives every asset alt, provenance and license', () => {
|
|
44
|
+
const content = gen();
|
|
45
|
+
expect(content.assets.length).toBeGreaterThan(0);
|
|
46
|
+
validateDemoContent(content);
|
|
47
|
+
for (const a of content.assets) {
|
|
48
|
+
expect(a.alt).not.toBe('');
|
|
49
|
+
expect(a.provenance).toMatch(/license/i);
|
|
50
|
+
expect(a.license).toBeTruthy();
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('contains no private-looking data', () => {
|
|
55
|
+
const c = gen();
|
|
56
|
+
// The SVG xmlns namespace URI is the one legitimate URL; it is excluded.
|
|
57
|
+
expect(JSON.stringify({ items: c.items, assets: c.assets.map(({ svg: _s, ...r }) => r) })).not.toMatch(/@|https?:|www\.|\.(de|com)\b/i);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('rejects an unlicensed image', () => {
|
|
61
|
+
const c = gen();
|
|
62
|
+
const bad: DemoContent = { ...c, assets: [{ ...c.assets[0]!, license: undefined as never }, ...c.assets.slice(1)] };
|
|
63
|
+
expect(() => validateDemoContent(bad)).toThrow(/license/);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('rejects missing alt text', () => {
|
|
67
|
+
const c = gen();
|
|
68
|
+
const bad: DemoContent = { ...c, assets: [{ ...c.assets[0]!, alt: '' }, ...c.assets.slice(1)] };
|
|
69
|
+
expect(() => validateDemoContent(bad)).toThrow(/alt/);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('rejects a private-looking id, email and domain', () => {
|
|
73
|
+
for (const leak of ['9f1c2d3e-1111-4222-8333-444455556666', 'jane@example.com', 'acme.com']) {
|
|
74
|
+
const c = gen();
|
|
75
|
+
const item = { ...c.items[0]!, data: { ...c.items[0]!.data, title: leak } };
|
|
76
|
+
expect(() => validateDemoContent({ ...c, items: [item, ...c.items.slice(1)] })).toThrow(/Private/);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('never calls the real clock in demo sources', () => {
|
|
81
|
+
const dir = join(__dirname, '..');
|
|
82
|
+
for (const f of readdirSync(dir).filter((n) => n.endsWith('.ts'))) {
|
|
83
|
+
const src = readFileSync(join(dir, f), 'utf8');
|
|
84
|
+
expect(src, f).not.toMatch(/Date\.now\(|new Date\(\s*\)/);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
describe('demo legal shells', () => {
|
|
90
|
+
it('renders the disclaimer prominently in en and de', async () => {
|
|
91
|
+
const container = await AstroContainer.create();
|
|
92
|
+
for (const shell of generateDemoLegalShells(['de', 'en'])) {
|
|
93
|
+
validateDemoLegalShell(shell);
|
|
94
|
+
const html = await container.renderToString(DemoLegalShell, { props: { shell } });
|
|
95
|
+
expect(html).toContain(shell.disclaimer);
|
|
96
|
+
expect(html).toContain('data-demo-disclaimer');
|
|
97
|
+
}
|
|
98
|
+
expect(DEMO_DISCLAIMER.en).toMatch(/SAMPLE CONTENT - INCOMPLETE/);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it('rejects a shell without disclaimer and has no private data', () => {
|
|
102
|
+
const [shell] = generateDemoLegalShells(['en']);
|
|
103
|
+
expect(() => validateDemoLegalShell({ ...shell!, disclaimer: '' })).toThrow(/disclaimer/);
|
|
104
|
+
expect(JSON.stringify(generateDemoLegalShells(['de', 'en']))).not.toMatch(/@|https?:|www\./i);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import {
|
|
2
|
+
composeContentTraitSchema,
|
|
3
|
+
type ContentComposition,
|
|
4
|
+
type ContentTrait,
|
|
5
|
+
type ContentTypeDefinition,
|
|
6
|
+
} from '../contracts/index.js';
|
|
7
|
+
|
|
8
|
+
/** Injected time source. The generator never reads the real clock. */
|
|
9
|
+
export interface DemoClock {
|
|
10
|
+
now(): Date;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const DEMO_FIXED_INSTANT = '2026-01-01T00:00:00.000Z';
|
|
14
|
+
|
|
15
|
+
export function createFixedClock(iso: string = DEMO_FIXED_INSTANT): DemoClock {
|
|
16
|
+
const fixed = new Date(iso);
|
|
17
|
+
if (Number.isNaN(fixed.getTime())) throw new Error(`Invalid fixed clock instant: ${iso}`);
|
|
18
|
+
return { now: () => new Date(fixed.getTime()) };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const DEMO_LICENSES = ['CC0-1.0', 'internal-placeholder-not-for-production'] as const;
|
|
22
|
+
export type DemoLicense = (typeof DEMO_LICENSES)[number];
|
|
23
|
+
|
|
24
|
+
export interface DemoAsset {
|
|
25
|
+
readonly src: string;
|
|
26
|
+
readonly alt: string;
|
|
27
|
+
readonly provenance: string;
|
|
28
|
+
readonly license: DemoLicense;
|
|
29
|
+
readonly svg: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface DemoContentItem {
|
|
33
|
+
readonly contentTypeId: string;
|
|
34
|
+
readonly locale: string;
|
|
35
|
+
readonly data: Readonly<Record<string, unknown>>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface DemoContent {
|
|
39
|
+
readonly generatedAt: string;
|
|
40
|
+
readonly items: readonly DemoContentItem[];
|
|
41
|
+
readonly assets: readonly DemoAsset[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface GenerateDemoContentOptions {
|
|
45
|
+
readonly clock: DemoClock;
|
|
46
|
+
readonly itemsPerType?: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const COPY = {
|
|
50
|
+
de: { name: 'Beispiel', body: 'Platzhaltertext fuer Beispielinhalte. Nicht fuer den Produktivbetrieb.', location: 'Beispielort', cta: 'Mehr erfahren', tag: 'Beispiel', alt: 'Neutraler Platzhalter, graue Flaeche', provenance: 'Platzhalter, automatisch erzeugt' },
|
|
51
|
+
en: { name: 'Sample', body: 'Placeholder text for sample content. Not for production use.', location: 'Sample Location', cta: 'Learn more', tag: 'Sample', alt: 'Neutral placeholder, grey rectangle', provenance: 'Placeholder, generated automatically' },
|
|
52
|
+
} as const;
|
|
53
|
+
|
|
54
|
+
function copyFor(locale: string) {
|
|
55
|
+
return locale.toLowerCase().startsWith('de') ? COPY.de : COPY.en;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function placeholderSvg(index: number): string {
|
|
59
|
+
const shade = 200 + ((index * 7) % 40);
|
|
60
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="800" viewBox="0 0 1200 800"><rect width="1200" height="800" fill="rgb(${shade},${shade},${shade})"/></svg>`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function makeAsset(locale: string, typeId: string, index: number): DemoAsset {
|
|
64
|
+
const copy = copyFor(locale);
|
|
65
|
+
return {
|
|
66
|
+
src: `/demo/${typeId}-${locale}-${index + 1}.svg`,
|
|
67
|
+
alt: `${copy.alt} ${index + 1}`,
|
|
68
|
+
provenance: `${copy.provenance}; license: CC0-1.0`,
|
|
69
|
+
license: 'CC0-1.0',
|
|
70
|
+
svg: placeholderSvg(index),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function addDays(base: Date, days: number): Date {
|
|
75
|
+
return new Date(base.getTime() + days * 86_400_000);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function buildItem(
|
|
79
|
+
type: ContentTypeDefinition,
|
|
80
|
+
locale: string,
|
|
81
|
+
index: number,
|
|
82
|
+
base: Date,
|
|
83
|
+
assets: DemoAsset[],
|
|
84
|
+
): Record<string, unknown> {
|
|
85
|
+
const copy = copyFor(locale);
|
|
86
|
+
const n = index + 1;
|
|
87
|
+
const traits = new Set<ContentTrait>(type.traits);
|
|
88
|
+
const data: Record<string, unknown> = {};
|
|
89
|
+
const nextAsset = (): DemoAsset => {
|
|
90
|
+
const asset = makeAsset(locale, type.id, assets.length);
|
|
91
|
+
assets.push(asset);
|
|
92
|
+
return asset;
|
|
93
|
+
};
|
|
94
|
+
if (traits.has('title')) data.title = `${copy.name} ${n}`;
|
|
95
|
+
if (traits.has('slug')) data.slug = `sample-${n}`;
|
|
96
|
+
if (traits.has('summary')) data.summary = `${copy.name} ${n}`;
|
|
97
|
+
if (traits.has('body')) data.body = copy.body;
|
|
98
|
+
if (traits.has('image')) {
|
|
99
|
+
const a = nextAsset();
|
|
100
|
+
data.image = { src: a.src, alt: a.alt };
|
|
101
|
+
}
|
|
102
|
+
if (traits.has('photos')) {
|
|
103
|
+
data.photos = [0, 1].map(() => {
|
|
104
|
+
const a = nextAsset();
|
|
105
|
+
return { src: a.src, alt: a.alt };
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (traits.has('order')) data.order = n;
|
|
109
|
+
if (traits.has('taxonomy')) data.taxonomy = [copy.tag];
|
|
110
|
+
if (traits.has('publication')) data.publishDate = addDays(base, -n);
|
|
111
|
+
if (traits.has('schedule')) data.startDate = addDays(base, n * 7);
|
|
112
|
+
if (traits.has('location')) data.location = copy.location;
|
|
113
|
+
if (traits.has('cta')) data.cta = { label: copy.cta, href: '/' };
|
|
114
|
+
if (traits.has('money') && 'currency' in type) {
|
|
115
|
+
data.amount = n * 10;
|
|
116
|
+
data.currency = type.currency ?? 'EUR';
|
|
117
|
+
}
|
|
118
|
+
if (traits.has('featured')) data.featured = index === 0;
|
|
119
|
+
return data;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function generateDemoContent(
|
|
123
|
+
composition: ContentComposition,
|
|
124
|
+
options: GenerateDemoContentOptions,
|
|
125
|
+
): DemoContent {
|
|
126
|
+
const base = options.clock.now();
|
|
127
|
+
const count = options.itemsPerType ?? 3;
|
|
128
|
+
const items: DemoContentItem[] = [];
|
|
129
|
+
const assets: DemoAsset[] = [];
|
|
130
|
+
for (const type of composition.contentTypes) {
|
|
131
|
+
const schema = composeContentTraitSchema(type.traits);
|
|
132
|
+
for (const locale of composition.contentLocales) {
|
|
133
|
+
for (let i = 0; i < count; i++) {
|
|
134
|
+
const data = schema.parse(buildItem(type, locale, i, base, assets));
|
|
135
|
+
items.push({ contentTypeId: type.id, locale, data });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return { generatedAt: base.toISOString(), items, assets };
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// -- Canonical serialisation and hash --
|
|
143
|
+
|
|
144
|
+
export function canonicalize(value: unknown): string {
|
|
145
|
+
if (value instanceof Date) return JSON.stringify(value.toISOString());
|
|
146
|
+
if (Array.isArray(value)) return `[${value.map(canonicalize).join(',')}]`;
|
|
147
|
+
if (value !== null && typeof value === 'object') {
|
|
148
|
+
const entries = Object.entries(value as Record<string, unknown>)
|
|
149
|
+
.filter(([, v]) => v !== undefined)
|
|
150
|
+
.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
|
|
151
|
+
return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${canonicalize(v)}`).join(',')}}`;
|
|
152
|
+
}
|
|
153
|
+
return JSON.stringify(value);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** FNV-1a 64-bit over the canonical form. Not cryptographic; a determinism fingerprint. */
|
|
157
|
+
export function canonicalHash(value: unknown): string {
|
|
158
|
+
let hash = 0xcbf29ce484222325n;
|
|
159
|
+
for (const char of canonicalize(value)) {
|
|
160
|
+
hash ^= BigInt(char.codePointAt(0) ?? 0);
|
|
161
|
+
hash = (hash * 0x100000001b3n) & 0xffffffffffffffffn;
|
|
162
|
+
}
|
|
163
|
+
return hash.toString(16).padStart(16, '0');
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// -- Validation --
|
|
167
|
+
|
|
168
|
+
/** Emails, URLs, bare domains, GUID-like tenant ids. */
|
|
169
|
+
const PRIVATE_PATTERNS: readonly RegExp[] = [
|
|
170
|
+
/[^\s@]+@[^\s@]+/,
|
|
171
|
+
/https?:\/\//i,
|
|
172
|
+
/\bwww\./i,
|
|
173
|
+
/\b[a-z0-9-]+\.(?:de|com|org|net|io|eu|dev|onmicrosoft)\b/i,
|
|
174
|
+
/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,
|
|
175
|
+
];
|
|
176
|
+
|
|
177
|
+
export function findPrivateData(value: unknown): string[] {
|
|
178
|
+
const text = canonicalize(value);
|
|
179
|
+
return PRIVATE_PATTERNS.filter((p) => p.test(text)).map((p) => p.source);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export function validateDemoContent(content: DemoContent): void {
|
|
183
|
+
const problems: string[] = [];
|
|
184
|
+
const known = new Set<string>();
|
|
185
|
+
for (const asset of content.assets) {
|
|
186
|
+
known.add(asset.src);
|
|
187
|
+
if (!asset.alt.trim()) problems.push(`Asset ${asset.src}: missing alt text`);
|
|
188
|
+
if (!asset.provenance.trim()) problems.push(`Asset ${asset.src}: missing provenance`);
|
|
189
|
+
if (!(DEMO_LICENSES as readonly string[]).includes(asset.license ?? '')) {
|
|
190
|
+
problems.push(`Asset ${asset.src}: missing or unknown license`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
const refs: string[] = [];
|
|
194
|
+
const collect = (v: unknown): void => {
|
|
195
|
+
if (Array.isArray(v)) v.forEach(collect);
|
|
196
|
+
else if (v && typeof v === 'object' && !(v instanceof Date)) {
|
|
197
|
+
const rec = v as Record<string, unknown>;
|
|
198
|
+
if (typeof rec.src === 'string') {
|
|
199
|
+
refs.push(rec.src);
|
|
200
|
+
if (typeof rec.alt !== 'string' || !rec.alt.trim()) problems.push(`Image ${rec.src}: missing alt text`);
|
|
201
|
+
}
|
|
202
|
+
Object.values(rec).forEach(collect);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
content.items.forEach((item) => collect(item.data));
|
|
206
|
+
for (const ref of refs) if (!known.has(ref)) problems.push(`Image ${ref}: no provenance/license entry`);
|
|
207
|
+
const leaks = findPrivateData({ items: content.items, assets: content.assets.map(({ svg: _svg, ...rest }) => rest) });
|
|
208
|
+
if (leaks.length > 0) problems.push(`Private-looking data matched: ${leaks.join(', ')}`);
|
|
209
|
+
if (problems.length > 0) throw new Error(`Demo content invalid:\n- ${problems.join('\n- ')}`);
|
|
210
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type DemoLegalKind = 'imprint' | 'privacy';
|
|
2
|
+
|
|
3
|
+
export const DEMO_DISCLAIMER = {
|
|
4
|
+
en: 'SAMPLE CONTENT - INCOMPLETE - REPLACE BEFORE PRODUCTION',
|
|
5
|
+
de: 'BEISPIELINHALT - UNVOLLSTAENDIG - VOR PRODUKTIVBETRIEB ERSETZEN',
|
|
6
|
+
} as const;
|
|
7
|
+
|
|
8
|
+
export interface DemoLegalShell {
|
|
9
|
+
readonly kind: DemoLegalKind;
|
|
10
|
+
readonly locale: string;
|
|
11
|
+
readonly title: string;
|
|
12
|
+
readonly disclaimer: string;
|
|
13
|
+
readonly sections: readonly { readonly heading: string; readonly body: string }[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const SHELLS = {
|
|
17
|
+
en: {
|
|
18
|
+
imprint: { title: 'Imprint (sample)', headings: ['Provider', 'Contact', 'Responsible for content'] },
|
|
19
|
+
privacy: { title: 'Privacy policy (sample)', headings: ['Controller', 'Data processed', 'Your rights', 'Retention'] },
|
|
20
|
+
body: 'Placeholder paragraph. This section is a structural shell only and contains no legal text. Have it written and reviewed by a qualified professional.',
|
|
21
|
+
},
|
|
22
|
+
de: {
|
|
23
|
+
imprint: { title: 'Impressum (Beispiel)', headings: ['Anbieter', 'Kontakt', 'Inhaltlich verantwortlich'] },
|
|
24
|
+
privacy: { title: 'Datenschutzerklaerung (Beispiel)', headings: ['Verantwortliche Stelle', 'Verarbeitete Daten', 'Ihre Rechte', 'Speicherdauer'] },
|
|
25
|
+
body: 'Platzhalterabsatz. Dieser Abschnitt ist nur ein Strukturgeruest und enthaelt keinen Rechtstext. Bitte von einer fachkundigen Person verfassen und pruefen lassen.',
|
|
26
|
+
},
|
|
27
|
+
} as const;
|
|
28
|
+
|
|
29
|
+
export function generateDemoLegalShells(locales: readonly string[]): DemoLegalShell[] {
|
|
30
|
+
const out: DemoLegalShell[] = [];
|
|
31
|
+
for (const locale of locales) {
|
|
32
|
+
const lang = locale.toLowerCase().startsWith('de') ? 'de' : 'en';
|
|
33
|
+
const catalog = SHELLS[lang];
|
|
34
|
+
for (const kind of ['imprint', 'privacy'] as const) {
|
|
35
|
+
out.push({
|
|
36
|
+
kind,
|
|
37
|
+
locale,
|
|
38
|
+
title: catalog[kind].title,
|
|
39
|
+
disclaimer: DEMO_DISCLAIMER[lang],
|
|
40
|
+
sections: catalog[kind].headings.map((heading) => ({ heading, body: catalog.body })),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return out;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function validateDemoLegalShell(shell: DemoLegalShell): void {
|
|
48
|
+
const required = Object.values(DEMO_DISCLAIMER) as string[];
|
|
49
|
+
if (!required.includes(shell.disclaimer)) {
|
|
50
|
+
throw new Error(`Legal shell ${shell.kind}/${shell.locale}: missing sample/incomplete disclaimer`);
|
|
51
|
+
}
|
|
52
|
+
}
|