@relyio/sdk 0.11.0 → 0.12.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/CHANGELOG.md +88 -0
- package/dist/chunk-3DRDHXLY.js +680 -0
- package/dist/{chunk-PO7CUR5U.cjs → chunk-3MSFWXQL.cjs} +37 -65
- package/dist/{chunk-4HTIU5YE.cjs → chunk-DXCVO6M5.cjs} +46 -59
- package/dist/chunk-FI5VIF4M.cjs +686 -0
- package/dist/{chunk-7GLDVHIH.js → chunk-FRJEUAAF.js} +46 -59
- package/dist/{chunk-2TIJLV2X.js → chunk-POEEDYFM.js} +38 -65
- package/dist/client/index.cjs +3 -3
- package/dist/client/index.d.cts +5 -4
- package/dist/client/index.d.ts +5 -4
- package/dist/client/index.js +1 -1
- package/dist/{define-schema-CVi8nwc7.d.ts → define-schema-DgctHlI2.d.cts} +35 -220
- package/dist/{define-schema-DqpipEHv.d.cts → define-schema-mrEZbY1h.d.ts} +35 -220
- package/dist/{define-content-type-ENAod5Ve.d.cts → include-paths-CL4gHv6I.d.cts} +1673 -734
- package/dist/{define-content-type-ENAod5Ve.d.ts → include-paths-CrJNTsMl.d.ts} +1673 -734
- package/dist/{index-C73cK2Tt.d.ts → index-B9RfZVF1.d.ts} +3 -2
- package/dist/{index-MLAFUuco.d.cts → index-BrvEg6-A.d.cts} +107 -46
- package/dist/{index-BKEAYvvz.d.ts → index-Pw0onkJe.d.ts} +107 -46
- package/dist/{index-BM42r4yg.d.cts → index-b-AkfTUv.d.cts} +3 -2
- package/dist/index.cjs +102 -85
- package/dist/index.d.cts +14 -10
- package/dist/index.d.ts +14 -10
- package/dist/index.js +4 -3
- package/dist/rich-text/index.cjs +29 -0
- package/dist/rich-text/index.d.cts +148 -0
- package/dist/rich-text/index.d.ts +148 -0
- package/dist/rich-text/index.js +4 -0
- package/dist/rich-text.d-rKmpgdGd.d.cts +200 -0
- package/dist/rich-text.d-rKmpgdGd.d.ts +200 -0
- package/dist/schema/index.cjs +34 -38
- package/dist/schema/index.d.cts +84 -37
- package/dist/schema/index.d.ts +84 -37
- package/dist/schema/index.js +1 -1
- package/dist/types/index.d.cts +3 -2
- package/dist/types/index.d.ts +3 -2
- package/package.json +8 -2
- package/dist/.tsbuildinfo +0 -1
|
@@ -1,183 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Component definition matching @relyio/schema ComponentSchema
|
|
5
|
-
*
|
|
6
|
-
* Components are reusable field groups that can be embedded in content types.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
interface ComponentReusabilityMetadata {
|
|
10
|
-
/** Minimum number of usages to be considered reusable */
|
|
11
|
-
minUsageCount?: number;
|
|
12
|
-
/** Maximum complexity score */
|
|
13
|
-
maxComplexity?: number;
|
|
14
|
-
/** Recommended usage contexts */
|
|
15
|
-
recommendedUsage?: string[];
|
|
16
|
-
}
|
|
17
|
-
interface ComponentValidationMetadata {
|
|
18
|
-
/** Whether nesting of components is allowed */
|
|
19
|
-
allowNesting?: boolean;
|
|
20
|
-
/** Maximum nesting depth */
|
|
21
|
-
maxNestingDepth?: number;
|
|
22
|
-
/** How to resolve field ID conflicts */
|
|
23
|
-
conflictResolution?: 'error' | 'component-wins' | 'field-wins' | 'prefix';
|
|
24
|
-
}
|
|
25
|
-
interface ComponentMetadata {
|
|
26
|
-
reusability?: ComponentReusabilityMetadata;
|
|
27
|
-
validation?: ComponentValidationMetadata;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Component configuration. Generic over its fields, as a content type's is, so a component field
|
|
31
|
-
* reads as an object typed by them (`INV-SS-TYPES-INFERRED`).
|
|
32
|
-
*/
|
|
33
|
-
interface ComponentConfig<TFields extends readonly AnyFieldDefinition[] = FieldDefinition[]> {
|
|
34
|
-
/** Display name shown in the UI */
|
|
35
|
-
displayName?: string;
|
|
36
|
-
/** Description of the component */
|
|
37
|
-
description?: string;
|
|
38
|
-
/** AI configuration for content generation and review */
|
|
39
|
-
ai?: AIConfig;
|
|
40
|
-
/** Whether this component is deprecated */
|
|
41
|
-
deprecated?: boolean;
|
|
42
|
-
/** Component fields */
|
|
43
|
-
fields: TFields;
|
|
44
|
-
/** Component metadata for validation and reusability */
|
|
45
|
-
metadata?: ComponentMetadata;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Component definition - preserves field types for inference
|
|
49
|
-
*/
|
|
50
|
-
interface ComponentDefinition<TFields extends readonly AnyFieldDefinition[] = FieldDefinition[]> {
|
|
51
|
-
readonly _tag: 'component';
|
|
52
|
-
readonly name: string;
|
|
53
|
-
readonly displayName?: string;
|
|
54
|
-
readonly description?: string;
|
|
55
|
-
/** AI configuration for content generation and review */
|
|
56
|
-
readonly ai?: AIConfig;
|
|
57
|
-
readonly deprecated?: boolean;
|
|
58
|
-
readonly fields: TFields;
|
|
59
|
-
readonly metadata?: ComponentMetadata;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Define a reusable component (field group)
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* const seoComponent = defineComponent('seoMetadata', {
|
|
66
|
-
* displayName: 'SEO Metadata',
|
|
67
|
-
* description: 'Common SEO fields for all content types',
|
|
68
|
-
* fields: [
|
|
69
|
-
* fields.shortText('metaTitle', {
|
|
70
|
-
* config: { maxLength: 60 },
|
|
71
|
-
* ui: { displayName: 'Meta Title' }
|
|
72
|
-
* }),
|
|
73
|
-
* fields.longText('metaDescription', {
|
|
74
|
-
* config: { maxLength: 160 },
|
|
75
|
-
* ui: { displayName: 'Meta Description' }
|
|
76
|
-
* }),
|
|
77
|
-
* // An image is an entry of an asset type, which a reference points at
|
|
78
|
-
* fields.reference('ogImage', {
|
|
79
|
-
* config: { to: 'productPhoto' },
|
|
80
|
-
* ui: { displayName: 'Open Graph Image' }
|
|
81
|
-
* }),
|
|
82
|
-
* ]
|
|
83
|
-
* })
|
|
84
|
-
*
|
|
85
|
-
* // Use in a content type:
|
|
86
|
-
* const product = defineContentType('product', {
|
|
87
|
-
* displayName: 'Product',
|
|
88
|
-
* fields: [
|
|
89
|
-
* fields.shortText('title', { config: { required: true } }),
|
|
90
|
-
* fields.component('seo', 'seoMetadata'), // Reference the component
|
|
91
|
-
* ]
|
|
92
|
-
* })
|
|
93
|
-
*/
|
|
94
|
-
declare function defineComponent<TFields extends readonly AnyFieldDefinition[]>(name: string, config: ComponentConfig<TFields>): ComponentDefinition<TFields>;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Settings group definition matching @relyio/schema SettingsGroupSchema
|
|
98
|
-
*
|
|
99
|
-
* Settings groups are for project-level configuration that doesn't fit
|
|
100
|
-
* into content types (e.g., API keys, feature flags, integrations).
|
|
101
|
-
*
|
|
102
|
-
* Uses advanced TypeScript generics to preserve literal field IDs through
|
|
103
|
-
* the type system, enabling full autocomplete in SDK methods.
|
|
104
|
-
*/
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Settings group configuration - generic to preserve field types
|
|
108
|
-
*/
|
|
109
|
-
interface SettingsGroupConfig<TFields extends readonly AnyFieldDefinition[] = readonly AnyFieldDefinition[]> {
|
|
110
|
-
/** Display name shown in the UI */
|
|
111
|
-
displayName: string;
|
|
112
|
-
/** Description of the settings group */
|
|
113
|
-
description?: string;
|
|
114
|
-
/** AI configuration for content generation and review */
|
|
115
|
-
ai?: AIConfig;
|
|
116
|
-
/** Access tags for role-based access control */
|
|
117
|
-
accessTags?: string[];
|
|
118
|
-
/** Settings fields - preserves literal types */
|
|
119
|
-
fields: TFields;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Settings group definition - preserves field types for inference
|
|
123
|
-
*/
|
|
124
|
-
interface SettingsGroupDefinition<TFields extends readonly AnyFieldDefinition[] = readonly AnyFieldDefinition[]> {
|
|
125
|
-
readonly _tag: 'settingsGroup';
|
|
126
|
-
readonly name: string;
|
|
127
|
-
readonly displayName: string;
|
|
128
|
-
readonly description?: string;
|
|
129
|
-
/** AI configuration for content generation and review */
|
|
130
|
-
readonly ai?: AIConfig;
|
|
131
|
-
readonly accessTags?: string[];
|
|
132
|
-
readonly fields: TFields;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Define a settings group
|
|
136
|
-
*
|
|
137
|
-
* The generic type parameter preserves the literal field IDs through the type
|
|
138
|
-
* system, enabling autocomplete in SDK methods.
|
|
139
|
-
*
|
|
140
|
-
* @example
|
|
141
|
-
* const integrations = defineSettingsGroup('integrations', {
|
|
142
|
-
* displayName: 'Integrations',
|
|
143
|
-
* description: 'Third-party service integrations',
|
|
144
|
-
* fields: [
|
|
145
|
-
* fields.shortText('stripeApiKey', {
|
|
146
|
-
* config: { required: true },
|
|
147
|
-
* ui: { displayName: 'Stripe API Key' }
|
|
148
|
-
* }),
|
|
149
|
-
* fields.shortText('sendgridApiKey', {
|
|
150
|
-
* ui: { displayName: 'SendGrid API Key' }
|
|
151
|
-
* }),
|
|
152
|
-
* fields.boolean('enableAnalytics', {
|
|
153
|
-
* config: { defaultValue: true },
|
|
154
|
-
* ui: { displayName: 'Enable Analytics' }
|
|
155
|
-
* }),
|
|
156
|
-
* ]
|
|
157
|
-
* })
|
|
158
|
-
*/
|
|
159
|
-
declare function defineSettingsGroup<TFields extends readonly AnyFieldDefinition[]>(name: string, config: SettingsGroupConfig<TFields>): SettingsGroupDefinition<TFields>;
|
|
160
|
-
/**
|
|
161
|
-
* Type alias for any settings group definition.
|
|
162
|
-
*/
|
|
163
|
-
type AnySettingsGroupDefinition = SettingsGroupDefinition<any>;
|
|
164
|
-
/**
|
|
165
|
-
* What a read reports about a settings group beside its fields: the committed document's
|
|
166
|
-
* `SettingsGroupMetadata`, read through `http/api-schema.ts` rather than declared again here.
|
|
167
|
-
*
|
|
168
|
-
* It names the group by `id` and `groupId`, carries the per-locale facts and the version history
|
|
169
|
-
* of `locale`, and says when the group was last written — there is no `createdAt`. The hand-written
|
|
170
|
-
* type this replaces declared a `key`, a `groupType` and a `createdAt` the wire does not carry, and
|
|
171
|
-
* `Date` timestamps where it sends ISO 8601 strings.
|
|
172
|
-
*/
|
|
173
|
-
type SettingsGroupMetadata = components['schemas']['SettingsGroupMetadata'];
|
|
174
|
-
/**
|
|
175
|
-
* Infer the TypeScript type from a settings group definition: every field typed as a read returns it
|
|
176
|
-
* (`schema/infer-fields.ts`), plus `_metadata`. `S` is the schema, as for `InferContentType`.
|
|
177
|
-
*/
|
|
178
|
-
type InferSettingsGroup<T extends AnySettingsGroupDefinition, S extends FieldSchemaContext | undefined = undefined> = FieldValues<DeclaredFields<T>, S> & {
|
|
179
|
-
_metadata: SettingsGroupMetadata;
|
|
180
|
-
};
|
|
1
|
+
import { a4 as ContentTypeDefinition, ab as SingletonContentTypeDefinition, ah as SettingsGroupDefinition, aU as WorkflowDefinition, am as AssetTypeDefinition, a6 as InferContentType } from './include-paths-CL4gHv6I.cjs';
|
|
181
2
|
|
|
182
3
|
/**
|
|
183
4
|
* Query definition matching @relyio/schema QueryDefinitionSchema
|
|
@@ -255,7 +76,12 @@ type WhereValue = string | number | boolean | (string | number | boolean)[] | Wh
|
|
|
255
76
|
type WhereCondition = Record<string, WhereValue>;
|
|
256
77
|
type SortDirection = 'asc' | 'desc';
|
|
257
78
|
type SortCondition = Record<string, SortDirection> | Record<string, SortDirection>[];
|
|
258
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* A relationship joined by name — a reference the fetched type declares, or a reverse one another
|
|
81
|
+
* type declares to it (`reviews`) — optionally filtered, counted and aliased:
|
|
82
|
+
* `{ relationship: 'products', where: { status: 'active' }, aggregate: 'count', alias: 'productCount' }`.
|
|
83
|
+
* `relationship` is a name, with no parentheses. A `select` reads what it joins.
|
|
84
|
+
*/
|
|
259
85
|
type IncludeRelationship = {
|
|
260
86
|
relationship: string;
|
|
261
87
|
where?: WhereCondition;
|
|
@@ -269,23 +95,14 @@ type IncludeRelationship = {
|
|
|
269
95
|
alias?: string;
|
|
270
96
|
};
|
|
271
97
|
/**
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
fields?: string[];
|
|
281
|
-
include?: (string | {
|
|
282
|
-
path: string;
|
|
283
|
-
fields?: string[];
|
|
284
|
-
where?: WhereCondition;
|
|
285
|
-
})[];
|
|
286
|
-
where?: WhereCondition;
|
|
287
|
-
};
|
|
288
|
-
type IncludeDefinition = string | string[] | (string | IncludeRelationship | IncludeSelection)[];
|
|
98
|
+
* What a fetch includes (REL-2035). A string is an **include path**, the grammar `?include=` and the
|
|
99
|
+
* SDK's `include()` read: field ids joined by `.`, crossing lists, page builders, objects and
|
|
100
|
+
* references, each hop written out, with the fields to return in parentheses —
|
|
101
|
+
* `'sections.customers.logo'`, `'sections.features(name,slug)'`. The query returns what
|
|
102
|
+
* `GET …?include=` returns for the same paths. A path's entries are expanded after the read, so a
|
|
103
|
+
* `select` cannot read them: join a relationship for that ({@link IncludeRelationship}).
|
|
104
|
+
*/
|
|
105
|
+
type IncludeDefinition = string | (string | IncludeRelationship)[];
|
|
289
106
|
type SelectMapping = Record<string, string>;
|
|
290
107
|
/** `filters` are `where` conditions bound at call time: the same operators, written the same way. */
|
|
291
108
|
type FilterOperator = WhereOperator;
|
|
@@ -929,7 +746,7 @@ type ViewFilterValue = string | number | boolean | null | (string | number)[] |
|
|
|
929
746
|
interface ViewFilterCondition {
|
|
930
747
|
/**
|
|
931
748
|
* The Property to filter on, as the Studio's entry list names it: `fields.<id>` for a field your
|
|
932
|
-
* schema declares (`fields.seo.title` for a
|
|
749
|
+
* schema declares (`fields.seo.title` for a field of an object's value), `_metadata.<id>` for a system
|
|
933
750
|
* field — `_metadata.status`, `_metadata.createdAt`, `_metadata.updatedAt`. So a field called
|
|
934
751
|
* `status` (`fields.status`) and the entry's own lifecycle (`_metadata.status`) are both
|
|
935
752
|
* filterable.
|
|
@@ -1071,7 +888,6 @@ declare function defineView(id: string, config: ViewConfig): ViewDefinition;
|
|
|
1071
888
|
* Matches the SchemaDefinitionSchema from @relyio/schema:
|
|
1072
889
|
* - locales: Optional array of locale definitions for multi-language support
|
|
1073
890
|
* - contentTypes: Required record of content type definitions
|
|
1074
|
-
* - components: Required record of component definitions (can be empty {})
|
|
1075
891
|
* - singletonContentTypes: Required record of singleton definitions (can be empty {})
|
|
1076
892
|
* - queries: Required record of query definitions (can be empty {})
|
|
1077
893
|
* - settingsGroups: Optional record of settings groups
|
|
@@ -1085,8 +901,6 @@ interface SchemaConfig {
|
|
|
1085
901
|
locales?: LocaleDefinition[];
|
|
1086
902
|
/** Content type definitions (required) */
|
|
1087
903
|
contentTypes: Record<string, ContentTypeDefinition>;
|
|
1088
|
-
/** Reusable component definitions (required, can be empty) */
|
|
1089
|
-
components?: Record<string, ComponentDefinition>;
|
|
1090
904
|
/** Singleton content type definitions (required, can be empty) */
|
|
1091
905
|
singletonContentTypes?: Record<string, SingletonContentTypeDefinition>;
|
|
1092
906
|
/** Predefined query definitions (required, can be empty) */
|
|
@@ -1105,11 +919,10 @@ interface SchemaConfig {
|
|
|
1105
919
|
/**
|
|
1106
920
|
* Complete schema definition - Generic version for type inference
|
|
1107
921
|
*/
|
|
1108
|
-
interface SchemaDefinition<TContentTypes extends Record<string, ContentTypeDefinition> = Record<string, ContentTypeDefinition>,
|
|
922
|
+
interface SchemaDefinition<TContentTypes extends Record<string, ContentTypeDefinition> = Record<string, ContentTypeDefinition>, TSingletons extends Record<string, SingletonContentTypeDefinition> = Record<string, SingletonContentTypeDefinition>, TQueries extends Record<string, QueryDefinition> = Record<string, QueryDefinition>, TSettings extends Record<string, SettingsGroupDefinition> = Record<string, SettingsGroupDefinition>, TLocales extends readonly LocaleDefinition[] = readonly LocaleDefinition[], TRoles extends readonly RoleDefinition[] = readonly RoleDefinition[], TWorkflow extends WorkflowDefinition | undefined = WorkflowDefinition | undefined, TViews extends readonly ViewDefinition[] = readonly ViewDefinition[], TAssets extends Record<string, AssetTypeDefinition> = Record<string, AssetTypeDefinition>> {
|
|
1109
923
|
readonly _tag: 'schema';
|
|
1110
924
|
readonly locales?: TLocales;
|
|
1111
925
|
readonly contentTypes: TContentTypes;
|
|
1112
|
-
readonly components: TComponents;
|
|
1113
926
|
readonly singletonContentTypes: TSingletons;
|
|
1114
927
|
readonly queries: TQueries;
|
|
1115
928
|
readonly settingsGroups?: TSettings;
|
|
@@ -1121,10 +934,9 @@ interface SchemaDefinition<TContentTypes extends Record<string, ContentTypeDefin
|
|
|
1121
934
|
/**
|
|
1122
935
|
* Typed schema config for type inference
|
|
1123
936
|
*/
|
|
1124
|
-
interface TypedSchemaConfig<TContentTypes extends Record<string, ContentTypeDefinition>,
|
|
937
|
+
interface TypedSchemaConfig<TContentTypes extends Record<string, ContentTypeDefinition>, TSingletons extends Record<string, SingletonContentTypeDefinition>, TQueries extends Record<string, QueryDefinition>, TSettings extends Record<string, SettingsGroupDefinition>, TLocales extends readonly LocaleDefinition[] = readonly LocaleDefinition[], TRoles extends readonly RoleDefinition[] = readonly RoleDefinition[], TWorkflow extends WorkflowDefinition | undefined = WorkflowDefinition | undefined, TViews extends readonly ViewDefinition[] = readonly ViewDefinition[], TAssets extends Record<string, AssetTypeDefinition> = Record<string, AssetTypeDefinition>> {
|
|
1125
938
|
locales?: TLocales;
|
|
1126
939
|
contentTypes: TContentTypes;
|
|
1127
|
-
components?: TComponents;
|
|
1128
940
|
singletonContentTypes?: TSingletons;
|
|
1129
941
|
queries?: TQueries;
|
|
1130
942
|
settingsGroups?: TSettings;
|
|
@@ -1141,35 +953,38 @@ interface TypedSchemaConfig<TContentTypes extends Record<string, ContentTypeDefi
|
|
|
1141
953
|
* 2. Used for type inference in the SDK client
|
|
1142
954
|
*
|
|
1143
955
|
* @example
|
|
1144
|
-
* import { defineSchema, defineContentType,
|
|
956
|
+
* import { defineSchema, defineContentType, defineLocale, fields } from '@relyio/sdk/schema'
|
|
1145
957
|
*
|
|
1146
958
|
* const enUS = defineLocale('en-US', { displayName: 'English (US)', default: true })
|
|
1147
959
|
* const esES = defineLocale('es-ES', { displayName: 'Spanish', fallback: ['en-US'] })
|
|
1148
960
|
*
|
|
1149
|
-
* const seoComponent = defineComponent('seo', {
|
|
1150
|
-
* displayName: 'SEO Metadata',
|
|
1151
|
-
* fields: [
|
|
1152
|
-
* fields.shortText('metaTitle', { config: { maxLength: 60 } }),
|
|
1153
|
-
* fields.longText('metaDescription', { config: { maxLength: 160 } }),
|
|
1154
|
-
* ]
|
|
1155
|
-
* })
|
|
1156
|
-
*
|
|
1157
961
|
* const product = defineContentType('product', {
|
|
1158
962
|
* displayName: 'Product',
|
|
1159
963
|
* fields: [
|
|
1160
964
|
* fields.shortText('title', { config: { required: true }, localization: true }),
|
|
1161
965
|
* fields.decimal('price', { config: { min: 0, decimalPlaces: 2 } }),
|
|
1162
|
-
*
|
|
966
|
+
* // One value of a fieldset: `{ _type: 'seo', _key, metaTitle?, metaDescription? }`
|
|
967
|
+
* fields.object('seo', {
|
|
968
|
+
* config: {
|
|
969
|
+
* of: {
|
|
970
|
+
* id: 'seo',
|
|
971
|
+
* displayName: 'SEO Metadata',
|
|
972
|
+
* fields: [
|
|
973
|
+
* fields.shortText('metaTitle', { config: { maxLength: 60 } }),
|
|
974
|
+
* fields.longText('metaDescription', { config: { maxLength: 160 } }),
|
|
975
|
+
* ],
|
|
976
|
+
* },
|
|
977
|
+
* },
|
|
978
|
+
* }),
|
|
1163
979
|
* ]
|
|
1164
980
|
* })
|
|
1165
981
|
*
|
|
1166
982
|
* export const schema = defineSchema({
|
|
1167
983
|
* locales: [enUS, esES],
|
|
1168
984
|
* contentTypes: { product },
|
|
1169
|
-
* components: { seo: seoComponent },
|
|
1170
985
|
* })
|
|
1171
986
|
*/
|
|
1172
|
-
declare function defineSchema<TContentTypes extends Record<string, ContentTypeDefinition>,
|
|
987
|
+
declare function defineSchema<TContentTypes extends Record<string, ContentTypeDefinition>, TSingletons extends Record<string, SingletonContentTypeDefinition> = Record<string, never>, TQueries extends Record<string, QueryDefinition> = Record<string, never>, TSettings extends Record<string, SettingsGroupDefinition> = Record<string, never>, TLocales extends readonly LocaleDefinition[] = readonly LocaleDefinition[], TRoles extends readonly RoleDefinition[] = readonly RoleDefinition[], TWorkflow extends WorkflowDefinition | undefined = WorkflowDefinition | undefined, TViews extends readonly ViewDefinition[] = readonly ViewDefinition[], TAssets extends Record<string, AssetTypeDefinition> = Record<string, never>>(config: TypedSchemaConfig<TContentTypes, TSingletons, TQueries, TSettings, TLocales, TRoles, TWorkflow, TViews, TAssets>): SchemaDefinition<TContentTypes, TSingletons, TQueries, TSettings, TLocales, TRoles, TWorkflow, TViews, TAssets>;
|
|
1173
988
|
/**
|
|
1174
989
|
* Type alias for any schema definition.
|
|
1175
990
|
* Uses `any` intentionally for type inference utilities that need to accept any schema.
|
|
@@ -1181,7 +996,7 @@ type AnySchemaDefinition = SchemaDefinition<any, any, any, any, any, any, any, a
|
|
|
1181
996
|
type SchemaContentTypeNames<T extends AnySchemaDefinition> = keyof T['contentTypes'] & string;
|
|
1182
997
|
/**
|
|
1183
998
|
* An entry of content type `K`, typed by schema `T` as a read returns it — what `content(K)` reads,
|
|
1184
|
-
* with references
|
|
999
|
+
* with references resolved against `T` (`INV-SS-TYPES-INFERRED`).
|
|
1185
1000
|
*/
|
|
1186
1001
|
type SchemaEntry<T extends AnySchemaDefinition, K extends SchemaContentTypeNames<T>> = InferContentType<T['contentTypes'][K], T>;
|
|
1187
1002
|
/**
|
|
@@ -1216,4 +1031,4 @@ type SchemaAssetTypeNames<T extends AnySchemaDefinition> = NonNullable<T['assetT
|
|
|
1216
1031
|
*/
|
|
1217
1032
|
type SchemaLocaleCodes<T extends AnySchemaDefinition> = NonNullable<T['locales']> extends readonly LocaleDefinition[] ? NonNullable<T['locales']>[number]['code'] : never;
|
|
1218
1033
|
|
|
1219
|
-
export { type
|
|
1034
|
+
export { type SearchBlock as $, type RoleDefinition as A, BUILT_IN_ROLES as B, defineView as C, type ContentTypeScopeConfig as D, type ContentTypesScopeConfig as E, type FieldVisibility as F, type EntryTypeScopeConfig as G, type AllScopeConfig as H, type ViewFilterOperator as I, type ViewFilterValue as J, type ViewFilterRelativeDate as K, type LocaleOptions as L, type ViewFilterCondition as M, type ViewFilter as N, type ViewConfig as O, type ViewDefinition as P, defineQuery as Q, ROLE_ACTIONS as R, type SchemaConfig as S, type TextDirection as T, type QueryConfig as U, type ViewScopeConfig as V, type QueryDefinition as W, type QueryType as X, type FullTextSearch as Y, type FetchBlock as Z, type AggregateBlock as _, type SchemaDefinition as a, type WhereCondition as a0, type WhereValue as a1, type WhereOperator as a2, type HavingOperator as a3, type QueryScalar as a4, type SortCondition as a5, type SortDirection as a6, type IncludeDefinition as a7, type IncludeRelationship as a8, type SelectMapping as a9, type FilterDefinition as aa, type CachePolicy as ab, type CachePolicyObject as ac, type IncludeSubQuery as ad, type IncludeSubQueries as ae, type Parameterizable as af, type QueryParameter as ag, type QueryParameterType as ah, type QueryCardinality as ai, type InferQueryResponse as aj, type InferQueryParams as ak, type FilterOperator as al, type SchemaContentTypeNames as b, type SchemaSingletonNames as c, defineSchema as d, type SchemaQueryNames as e, type SchemaLocaleCodes as f, type SchemaSettingsGroupNames as g, type SchemaAssetTypeNames as h, type SchemaEntry as i, type SchemaEntryOf as j, defineLocale as k, isLocaleDefinition as l, getLocaleCodes as m, findDefaultLocale as n, getActiveLocales as o, buildFallbackChain as p, type LocaleDefinition as q, defineRole as r, isRoleDefinition as s, isBuiltInRole as t, getBuiltInRoleActions as u, BUILT_IN_ROLE_ACTIONS as v, type BuiltInRole as w, type RoleAction as x, type ResourcePermission as y, type RoleConfig as z };
|