dineway 0.1.3
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/LICENSE +9 -0
- package/README.md +89 -0
- package/dist/adapters-BlzWJG82.d.mts +106 -0
- package/dist/apply-CAPvMfoU.mjs +1339 -0
- package/dist/astro/index.d.mts +50 -0
- package/dist/astro/index.mjs +1326 -0
- package/dist/astro/middleware/auth.d.mts +30 -0
- package/dist/astro/middleware/auth.mjs +708 -0
- package/dist/astro/middleware/redirect.d.mts +21 -0
- package/dist/astro/middleware/redirect.mjs +62 -0
- package/dist/astro/middleware/request-context.d.mts +17 -0
- package/dist/astro/middleware/request-context.mjs +1371 -0
- package/dist/astro/middleware/setup.d.mts +19 -0
- package/dist/astro/middleware/setup.mjs +46 -0
- package/dist/astro/middleware.d.mts +12 -0
- package/dist/astro/middleware.mjs +1716 -0
- package/dist/astro/types.d.mts +269 -0
- package/dist/astro/types.mjs +1 -0
- package/dist/base64-F8-DUraK.mjs +58 -0
- package/dist/byline-DeWCMU_i.mjs +234 -0
- package/dist/bylines-DyqBV9EQ.mjs +137 -0
- package/dist/chunk-ClPoSABd.mjs +21 -0
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.mjs +3987 -0
- package/dist/client/external-auth-headers.d.mts +38 -0
- package/dist/client/external-auth-headers.mjs +101 -0
- package/dist/client/index.d.mts +397 -0
- package/dist/client/index.mjs +345 -0
- package/dist/config-Cq8H0SfX.mjs +46 -0
- package/dist/connection-C9pxzuag.mjs +52 -0
- package/dist/content-zSgdNmnt.mjs +836 -0
- package/dist/db/index.d.mts +4 -0
- package/dist/db/index.mjs +62 -0
- package/dist/db/libsql.d.mts +10 -0
- package/dist/db/libsql.mjs +21 -0
- package/dist/db/postgres.d.mts +10 -0
- package/dist/db/postgres.mjs +29 -0
- package/dist/db/sqlite.d.mts +10 -0
- package/dist/db/sqlite.mjs +15 -0
- package/dist/default-WYlzADZL.mjs +80 -0
- package/dist/dialect-helpers-B9uSp2GJ.mjs +89 -0
- package/dist/error-DrxtnGPg.mjs +26 -0
- package/dist/index-C-jx21qs.d.mts +4771 -0
- package/dist/index.d.mts +16 -0
- package/dist/index.mjs +30 -0
- package/dist/load-C6FCD1FU.mjs +27 -0
- package/dist/loader-qKmo0wAY.mjs +446 -0
- package/dist/manifest-schema-CTSEyIJ3.mjs +186 -0
- package/dist/media/index.d.mts +25 -0
- package/dist/media/index.mjs +54 -0
- package/dist/media/local-runtime.d.mts +38 -0
- package/dist/media/local-runtime.mjs +132 -0
- package/dist/media-DMTr80Gv.mjs +199 -0
- package/dist/mode-BlyYtIFO.mjs +22 -0
- package/dist/page/index.d.mts +148 -0
- package/dist/page/index.mjs +419 -0
- package/dist/placeholder-B3knXwNc.mjs +267 -0
- package/dist/placeholder-bOx1xCTY.d.mts +283 -0
- package/dist/plugin-utils.d.mts +57 -0
- package/dist/plugin-utils.mjs +77 -0
- package/dist/plugins/adapt-sandbox-entry.d.mts +21 -0
- package/dist/plugins/adapt-sandbox-entry.mjs +112 -0
- package/dist/query-BiaPl_g2.mjs +459 -0
- package/dist/redirect-JPqLAbxa.mjs +328 -0
- package/dist/registry-DSd1GWB8.mjs +851 -0
- package/dist/request-context.d.mts +49 -0
- package/dist/request-context.mjs +42 -0
- package/dist/runner-B5l1JfOj.d.mts +26 -0
- package/dist/runner-BGUGywgG.mjs +1529 -0
- package/dist/runtime.d.mts +25 -0
- package/dist/runtime.mjs +41 -0
- package/dist/search-BNruJHDL.mjs +11054 -0
- package/dist/seed/index.d.mts +3 -0
- package/dist/seed/index.mjs +15 -0
- package/dist/seo/index.d.mts +69 -0
- package/dist/seo/index.mjs +69 -0
- package/dist/storage/local.d.mts +38 -0
- package/dist/storage/local.mjs +165 -0
- package/dist/storage/s3.d.mts +31 -0
- package/dist/storage/s3.mjs +174 -0
- package/dist/tokens-4vgYuXsZ.mjs +170 -0
- package/dist/transport-C5FYnid7.mjs +417 -0
- package/dist/transport-gIL-e43D.d.mts +41 -0
- package/dist/types-BawVha09.mjs +30 -0
- package/dist/types-BgQeVaPj.d.mts +192 -0
- package/dist/types-CLLdsG3g.d.mts +103 -0
- package/dist/types-D38djUXv.d.mts +1196 -0
- package/dist/types-DShnjzb6.mjs +15 -0
- package/dist/types-DkvMXalq.d.mts +425 -0
- package/dist/types-DuNbGKjF.mjs +74 -0
- package/dist/types-ju-_ORz7.d.mts +182 -0
- package/dist/validate-CXnRKfJK.mjs +327 -0
- package/dist/validate-CqRJb_xU.mjs +96 -0
- package/dist/validate-DVKJJ-M_.d.mts +377 -0
- package/locals.d.ts +47 -0
- package/package.json +313 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
//#region src/schema/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Schema Registry Types
|
|
4
|
+
*
|
|
5
|
+
* These types represent the schema definitions stored in the database.
|
|
6
|
+
* They are the source of truth for all collections and fields.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Supported field types
|
|
10
|
+
*/
|
|
11
|
+
type FieldType = "string" | "text" | "number" | "integer" | "boolean" | "datetime" | "select" | "multiSelect" | "portableText" | "image" | "file" | "reference" | "json" | "slug" | "repeater";
|
|
12
|
+
/**
|
|
13
|
+
* SQLite column types that map from field types
|
|
14
|
+
*/
|
|
15
|
+
type ColumnType = "TEXT" | "REAL" | "INTEGER" | "JSON";
|
|
16
|
+
/**
|
|
17
|
+
* Map field types to their SQLite column types
|
|
18
|
+
*/
|
|
19
|
+
declare const FIELD_TYPE_TO_COLUMN: Record<FieldType, ColumnType>;
|
|
20
|
+
/**
|
|
21
|
+
* Features a collection can support
|
|
22
|
+
*/
|
|
23
|
+
type CollectionSupport = "drafts" | "revisions" | "preview" | "scheduling" | "search" | "seo";
|
|
24
|
+
/**
|
|
25
|
+
* Sources for how a collection was created
|
|
26
|
+
*/
|
|
27
|
+
type CollectionSource = `template:${string}` | `import:${string}` | "manual" | "discovered" | "seed";
|
|
28
|
+
/**
|
|
29
|
+
* Validation rules for a field
|
|
30
|
+
*/
|
|
31
|
+
/** Sub-field definition for repeater fields */
|
|
32
|
+
interface RepeaterSubField {
|
|
33
|
+
slug: string;
|
|
34
|
+
type: "string" | "text" | "number" | "integer" | "boolean" | "datetime" | "select";
|
|
35
|
+
label: string;
|
|
36
|
+
required?: boolean;
|
|
37
|
+
options?: string[];
|
|
38
|
+
}
|
|
39
|
+
interface FieldValidation {
|
|
40
|
+
required?: boolean;
|
|
41
|
+
min?: number;
|
|
42
|
+
max?: number;
|
|
43
|
+
minLength?: number;
|
|
44
|
+
maxLength?: number;
|
|
45
|
+
pattern?: string;
|
|
46
|
+
options?: string[];
|
|
47
|
+
subFields?: RepeaterSubField[];
|
|
48
|
+
minItems?: number;
|
|
49
|
+
maxItems?: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Widget options for field rendering
|
|
53
|
+
*/
|
|
54
|
+
interface FieldWidgetOptions {
|
|
55
|
+
rows?: number;
|
|
56
|
+
showPreview?: boolean;
|
|
57
|
+
collection?: string;
|
|
58
|
+
allowMultiple?: boolean;
|
|
59
|
+
[key: string]: unknown;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A collection definition
|
|
63
|
+
*/
|
|
64
|
+
interface Collection {
|
|
65
|
+
id: string;
|
|
66
|
+
slug: string;
|
|
67
|
+
label: string;
|
|
68
|
+
labelSingular?: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
icon?: string;
|
|
71
|
+
supports: CollectionSupport[];
|
|
72
|
+
source?: CollectionSource;
|
|
73
|
+
/** Whether this collection has SEO metadata fields enabled */
|
|
74
|
+
hasSeo: boolean;
|
|
75
|
+
/** URL pattern with {slug} placeholder (e.g. "/{slug}", "/blog/{slug}") */
|
|
76
|
+
urlPattern?: string;
|
|
77
|
+
/** Whether comments are enabled for this collection */
|
|
78
|
+
commentsEnabled: boolean;
|
|
79
|
+
/** Moderation strategy: "all" | "first_time" | "none" */
|
|
80
|
+
commentsModeration: "all" | "first_time" | "none";
|
|
81
|
+
/** Auto-close comments after N days. 0 = never close. */
|
|
82
|
+
commentsClosedAfterDays: number;
|
|
83
|
+
/** Auto-approve comments from authenticated CMS users */
|
|
84
|
+
commentsAutoApproveUsers: boolean;
|
|
85
|
+
createdAt: string;
|
|
86
|
+
updatedAt: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A field definition
|
|
90
|
+
*/
|
|
91
|
+
interface Field {
|
|
92
|
+
id: string;
|
|
93
|
+
collectionId: string;
|
|
94
|
+
slug: string;
|
|
95
|
+
label: string;
|
|
96
|
+
type: FieldType;
|
|
97
|
+
columnType: ColumnType;
|
|
98
|
+
required: boolean;
|
|
99
|
+
unique: boolean;
|
|
100
|
+
defaultValue?: unknown;
|
|
101
|
+
validation?: FieldValidation;
|
|
102
|
+
widget?: string;
|
|
103
|
+
options?: FieldWidgetOptions;
|
|
104
|
+
sortOrder: number;
|
|
105
|
+
searchable: boolean;
|
|
106
|
+
/** Whether this field is translatable (default true). Non-translatable fields are synced across locales. */
|
|
107
|
+
translatable: boolean;
|
|
108
|
+
createdAt: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Input for creating a collection
|
|
112
|
+
*/
|
|
113
|
+
interface CreateCollectionInput {
|
|
114
|
+
slug: string;
|
|
115
|
+
label: string;
|
|
116
|
+
labelSingular?: string;
|
|
117
|
+
description?: string;
|
|
118
|
+
icon?: string;
|
|
119
|
+
supports?: CollectionSupport[];
|
|
120
|
+
source?: CollectionSource;
|
|
121
|
+
urlPattern?: string;
|
|
122
|
+
hasSeo?: boolean;
|
|
123
|
+
commentsEnabled?: boolean;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Input for updating a collection
|
|
127
|
+
*/
|
|
128
|
+
interface UpdateCollectionInput {
|
|
129
|
+
label?: string;
|
|
130
|
+
labelSingular?: string;
|
|
131
|
+
description?: string;
|
|
132
|
+
icon?: string;
|
|
133
|
+
supports?: CollectionSupport[];
|
|
134
|
+
urlPattern?: string;
|
|
135
|
+
hasSeo?: boolean;
|
|
136
|
+
commentsEnabled?: boolean;
|
|
137
|
+
commentsModeration?: "all" | "first_time" | "none";
|
|
138
|
+
commentsClosedAfterDays?: number;
|
|
139
|
+
commentsAutoApproveUsers?: boolean;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Input for creating a field
|
|
143
|
+
*/
|
|
144
|
+
interface CreateFieldInput {
|
|
145
|
+
slug: string;
|
|
146
|
+
label: string;
|
|
147
|
+
type: FieldType;
|
|
148
|
+
required?: boolean;
|
|
149
|
+
unique?: boolean;
|
|
150
|
+
defaultValue?: unknown;
|
|
151
|
+
validation?: FieldValidation;
|
|
152
|
+
widget?: string;
|
|
153
|
+
options?: FieldWidgetOptions;
|
|
154
|
+
sortOrder?: number;
|
|
155
|
+
/** Whether this field should be indexed for search */
|
|
156
|
+
searchable?: boolean;
|
|
157
|
+
/** Whether this field is translatable (default true). Non-translatable fields are synced across locales. */
|
|
158
|
+
translatable?: boolean;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Input for updating a field
|
|
162
|
+
*/
|
|
163
|
+
interface UpdateFieldInput {
|
|
164
|
+
label?: string;
|
|
165
|
+
required?: boolean;
|
|
166
|
+
unique?: boolean;
|
|
167
|
+
defaultValue?: unknown;
|
|
168
|
+
validation?: FieldValidation;
|
|
169
|
+
widget?: string;
|
|
170
|
+
options?: FieldWidgetOptions;
|
|
171
|
+
sortOrder?: number;
|
|
172
|
+
/** Whether this field should be indexed for search */
|
|
173
|
+
searchable?: boolean;
|
|
174
|
+
/** Whether this field is translatable (default true). Non-translatable fields are synced across locales. */
|
|
175
|
+
translatable?: boolean;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* A collection with its fields
|
|
179
|
+
*/
|
|
180
|
+
interface CollectionWithFields extends Collection {
|
|
181
|
+
fields: Field[];
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Reserved field slugs that cannot be used
|
|
185
|
+
*/
|
|
186
|
+
declare const RESERVED_FIELD_SLUGS: string[];
|
|
187
|
+
/**
|
|
188
|
+
* Reserved collection slugs that cannot be used
|
|
189
|
+
*/
|
|
190
|
+
declare const RESERVED_COLLECTION_SLUGS: string[];
|
|
191
|
+
//#endregion
|
|
192
|
+
export { ColumnType as a, FIELD_TYPE_TO_COLUMN as c, FieldValidation as d, FieldWidgetOptions as f, UpdateFieldInput as g, UpdateCollectionInput as h, CollectionWithFields as i, Field as l, RESERVED_FIELD_SLUGS as m, CollectionSource as n, CreateCollectionInput as o, RESERVED_COLLECTION_SLUGS as p, CollectionSupport as r, CreateFieldInput as s, Collection as t, FieldType as u };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
//#region src/database/repositories/types.d.ts
|
|
2
|
+
interface CreateContentInput {
|
|
3
|
+
type: string;
|
|
4
|
+
slug?: string | null;
|
|
5
|
+
data: Record<string, unknown>;
|
|
6
|
+
status?: string;
|
|
7
|
+
authorId?: string;
|
|
8
|
+
primaryBylineId?: string | null;
|
|
9
|
+
locale?: string;
|
|
10
|
+
translationOf?: string;
|
|
11
|
+
publishedAt?: string | null;
|
|
12
|
+
/** Override created_at (ISO 8601). Used by importers to preserve original dates. */
|
|
13
|
+
createdAt?: string | null;
|
|
14
|
+
}
|
|
15
|
+
interface UpdateContentInput {
|
|
16
|
+
data?: Record<string, unknown>;
|
|
17
|
+
status?: string;
|
|
18
|
+
slug?: string | null;
|
|
19
|
+
publishedAt?: string | null;
|
|
20
|
+
scheduledAt?: string | null;
|
|
21
|
+
authorId?: string | null;
|
|
22
|
+
primaryBylineId?: string | null;
|
|
23
|
+
}
|
|
24
|
+
/** SEO fields for content items */
|
|
25
|
+
interface ContentSeo {
|
|
26
|
+
title: string | null;
|
|
27
|
+
description: string | null;
|
|
28
|
+
image: string | null;
|
|
29
|
+
canonical: string | null;
|
|
30
|
+
noIndex: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Input for updating SEO fields on content */
|
|
33
|
+
interface ContentSeoInput {
|
|
34
|
+
title?: string | null;
|
|
35
|
+
description?: string | null;
|
|
36
|
+
image?: string | null;
|
|
37
|
+
canonical?: string | null;
|
|
38
|
+
noIndex?: boolean;
|
|
39
|
+
}
|
|
40
|
+
interface BylineSummary {
|
|
41
|
+
id: string;
|
|
42
|
+
slug: string;
|
|
43
|
+
displayName: string;
|
|
44
|
+
bio: string | null;
|
|
45
|
+
avatarMediaId: string | null;
|
|
46
|
+
websiteUrl: string | null;
|
|
47
|
+
userId: string | null;
|
|
48
|
+
isGuest: boolean;
|
|
49
|
+
createdAt: string;
|
|
50
|
+
updatedAt: string;
|
|
51
|
+
}
|
|
52
|
+
interface ContentBylineCredit {
|
|
53
|
+
byline: BylineSummary;
|
|
54
|
+
sortOrder: number;
|
|
55
|
+
roleLabel: string | null;
|
|
56
|
+
/** Whether this credit was explicitly assigned or inferred from authorId */
|
|
57
|
+
source?: "explicit" | "inferred";
|
|
58
|
+
}
|
|
59
|
+
interface FindManyOptions {
|
|
60
|
+
where?: {
|
|
61
|
+
status?: string;
|
|
62
|
+
authorId?: string;
|
|
63
|
+
locale?: string;
|
|
64
|
+
};
|
|
65
|
+
orderBy?: {
|
|
66
|
+
field: string;
|
|
67
|
+
direction: "asc" | "desc";
|
|
68
|
+
};
|
|
69
|
+
limit?: number;
|
|
70
|
+
cursor?: string;
|
|
71
|
+
}
|
|
72
|
+
interface FindManyResult<T> {
|
|
73
|
+
items: T[];
|
|
74
|
+
nextCursor?: string;
|
|
75
|
+
}
|
|
76
|
+
interface ContentItem {
|
|
77
|
+
id: string;
|
|
78
|
+
type: string;
|
|
79
|
+
slug: string | null;
|
|
80
|
+
status: string;
|
|
81
|
+
data: Record<string, unknown>;
|
|
82
|
+
authorId: string | null;
|
|
83
|
+
primaryBylineId: string | null;
|
|
84
|
+
byline?: BylineSummary | null;
|
|
85
|
+
bylines?: ContentBylineCredit[];
|
|
86
|
+
createdAt: string;
|
|
87
|
+
updatedAt: string;
|
|
88
|
+
publishedAt: string | null;
|
|
89
|
+
scheduledAt: string | null;
|
|
90
|
+
liveRevisionId: string | null;
|
|
91
|
+
draftRevisionId: string | null;
|
|
92
|
+
version: number;
|
|
93
|
+
locale: string | null;
|
|
94
|
+
translationGroup: string | null;
|
|
95
|
+
/** SEO metadata — only populated for collections with `has_seo` enabled */
|
|
96
|
+
seo?: ContentSeo;
|
|
97
|
+
}
|
|
98
|
+
declare class DinewayValidationError extends Error {
|
|
99
|
+
details?: unknown | undefined;
|
|
100
|
+
constructor(message: string, details?: unknown | undefined);
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
export { ContentSeoInput as a, FindManyOptions as c, ContentSeo as i, FindManyResult as l, ContentBylineCredit as n, CreateContentInput as o, ContentItem as r, DinewayValidationError as s, BylineSummary as t, UpdateContentInput as u };
|