@rimelight/cms 0.0.9 → 0.0.10
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/index.d.mts +1832 -16
- package/dist/index.mjs +1534 -218
- package/dist/schema/index.d.mts +257 -0
- package/dist/schema/index.mjs +18 -2
- package/dist/schema/sqlite.d.mts +232 -0
- package/dist/schema/sqlite.mjs +15 -1
- package/package.json +29 -16
- package/src/admin/api/media-file.ts +0 -1
- package/src/admin/api/media.ts +0 -2
- package/src/admin/layouts/CMSDashboardLayout.astro +7 -1
- package/src/admin/layouts/DefaultParentLayout.astro +0 -1
- package/src/admin/pages/pages-edit.astro +4 -1
- package/src/admin/pages/pages-index.astro +262 -101
- package/src/admin/pages/pages-preview.astro +5 -2
- package/src/admin/pages/templates-index.astro +224 -54
- package/src/admin/pages/users.astro +96 -50
- package/src/admin/pages/versions.astro +49 -37
- package/src/astro/blocks/DialogueBlock.astro +25 -0
- package/src/astro/blocks/LivePreviewBlock.astro +33 -0
- package/src/astro/blocks/SceneBlock.astro +39 -0
- package/src/astro/blocks/ScriptBlock.astro +77 -0
- package/src/astro/blocks/TableBlock.astro +30 -37
- package/src/astro/blocks/index.ts +9 -1
- package/src/env.d.ts +7 -1
- package/src/loader/live.ts +1 -2
- package/src/mcp/index.ts +1290 -32
- package/src/schema/content_types.ts +59 -0
- package/src/schema/index.ts +1 -0
- package/src/schema/sqlite.ts +35 -0
- package/src/services/search-indexer.ts +20 -9
- package/src/services/site-settings.ts +18 -14
- package/src/services/template-seeder.ts +249 -0
- package/src/storage/index.ts +0 -1
- package/LICENSE +0 -21
package/dist/schema/index.d.mts
CHANGED
|
@@ -2059,4 +2059,261 @@ export declare const bylines: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
2059
2059
|
}>;
|
|
2060
2060
|
export type Byline = typeof bylines.$inferSelect;
|
|
2061
2061
|
export type NewByline = typeof bylines.$inferInsert;
|
|
2062
|
+
//#endregion
|
|
2063
|
+
//#region src/schema/content_types.d.ts
|
|
2064
|
+
export type CollectionMode = "document" | "data" | "singleton";
|
|
2065
|
+
export interface DynamicFieldDefinition {
|
|
2066
|
+
type: "text" | "number" | "boolean" | "enum" | "media" | "relation" | "currency" | "array" | "json";
|
|
2067
|
+
label: Localized;
|
|
2068
|
+
description?: Localized;
|
|
2069
|
+
required?: boolean;
|
|
2070
|
+
defaultValue?: any;
|
|
2071
|
+
options?: {
|
|
2072
|
+
label: Localized;
|
|
2073
|
+
value: string;
|
|
2074
|
+
}[];
|
|
2075
|
+
allowedCollections?: string[];
|
|
2076
|
+
validation?: {
|
|
2077
|
+
min?: number;
|
|
2078
|
+
max?: number;
|
|
2079
|
+
pattern?: string;
|
|
2080
|
+
};
|
|
2081
|
+
}
|
|
2082
|
+
export interface EcomSettings {
|
|
2083
|
+
enabled: boolean;
|
|
2084
|
+
currencyDefault: string;
|
|
2085
|
+
trackInventory: boolean;
|
|
2086
|
+
hasVariants: boolean;
|
|
2087
|
+
allowDigitalDownloads: boolean;
|
|
2088
|
+
stripeSync?: boolean;
|
|
2089
|
+
}
|
|
2090
|
+
export declare const contentTypes: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
2091
|
+
name: "content_types";
|
|
2092
|
+
schema: undefined;
|
|
2093
|
+
columns: {
|
|
2094
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
2095
|
+
name: "id";
|
|
2096
|
+
tableName: "content_types";
|
|
2097
|
+
dataType: "string";
|
|
2098
|
+
columnType: "PgUUID";
|
|
2099
|
+
data: string;
|
|
2100
|
+
driverParam: string;
|
|
2101
|
+
notNull: true;
|
|
2102
|
+
hasDefault: true;
|
|
2103
|
+
isPrimaryKey: true;
|
|
2104
|
+
isAutoincrement: false;
|
|
2105
|
+
hasRuntimeDefault: false;
|
|
2106
|
+
enumValues: undefined;
|
|
2107
|
+
baseColumn: never;
|
|
2108
|
+
identity: undefined;
|
|
2109
|
+
generated: undefined;
|
|
2110
|
+
}, {}, {}>;
|
|
2111
|
+
slug: import("drizzle-orm/pg-core").PgColumn<{
|
|
2112
|
+
name: "slug";
|
|
2113
|
+
tableName: "content_types";
|
|
2114
|
+
dataType: "string";
|
|
2115
|
+
columnType: "PgText";
|
|
2116
|
+
data: string;
|
|
2117
|
+
driverParam: string;
|
|
2118
|
+
notNull: true;
|
|
2119
|
+
hasDefault: false;
|
|
2120
|
+
isPrimaryKey: false;
|
|
2121
|
+
isAutoincrement: false;
|
|
2122
|
+
hasRuntimeDefault: false;
|
|
2123
|
+
enumValues: [string, ...string[]];
|
|
2124
|
+
baseColumn: never;
|
|
2125
|
+
identity: undefined;
|
|
2126
|
+
generated: undefined;
|
|
2127
|
+
}, {}, {}>;
|
|
2128
|
+
name: import("drizzle-orm/pg-core").PgColumn<{
|
|
2129
|
+
name: "name";
|
|
2130
|
+
tableName: "content_types";
|
|
2131
|
+
dataType: "json";
|
|
2132
|
+
columnType: "PgJsonb";
|
|
2133
|
+
data: Localized;
|
|
2134
|
+
driverParam: unknown;
|
|
2135
|
+
notNull: true;
|
|
2136
|
+
hasDefault: false;
|
|
2137
|
+
isPrimaryKey: false;
|
|
2138
|
+
isAutoincrement: false;
|
|
2139
|
+
hasRuntimeDefault: false;
|
|
2140
|
+
enumValues: undefined;
|
|
2141
|
+
baseColumn: never;
|
|
2142
|
+
identity: undefined;
|
|
2143
|
+
generated: undefined;
|
|
2144
|
+
}, {}, {
|
|
2145
|
+
$type: Localized;
|
|
2146
|
+
}>;
|
|
2147
|
+
description: import("drizzle-orm/pg-core").PgColumn<{
|
|
2148
|
+
name: "description";
|
|
2149
|
+
tableName: "content_types";
|
|
2150
|
+
dataType: "json";
|
|
2151
|
+
columnType: "PgJsonb";
|
|
2152
|
+
data: Localized;
|
|
2153
|
+
driverParam: unknown;
|
|
2154
|
+
notNull: false;
|
|
2155
|
+
hasDefault: false;
|
|
2156
|
+
isPrimaryKey: false;
|
|
2157
|
+
isAutoincrement: false;
|
|
2158
|
+
hasRuntimeDefault: false;
|
|
2159
|
+
enumValues: undefined;
|
|
2160
|
+
baseColumn: never;
|
|
2161
|
+
identity: undefined;
|
|
2162
|
+
generated: undefined;
|
|
2163
|
+
}, {}, {
|
|
2164
|
+
$type: Localized;
|
|
2165
|
+
}>;
|
|
2166
|
+
icon: import("drizzle-orm/pg-core").PgColumn<{
|
|
2167
|
+
name: "icon";
|
|
2168
|
+
tableName: "content_types";
|
|
2169
|
+
dataType: "string";
|
|
2170
|
+
columnType: "PgText";
|
|
2171
|
+
data: string;
|
|
2172
|
+
driverParam: string;
|
|
2173
|
+
notNull: true;
|
|
2174
|
+
hasDefault: true;
|
|
2175
|
+
isPrimaryKey: false;
|
|
2176
|
+
isAutoincrement: false;
|
|
2177
|
+
hasRuntimeDefault: false;
|
|
2178
|
+
enumValues: [string, ...string[]];
|
|
2179
|
+
baseColumn: never;
|
|
2180
|
+
identity: undefined;
|
|
2181
|
+
generated: undefined;
|
|
2182
|
+
}, {}, {}>;
|
|
2183
|
+
mode: import("drizzle-orm/pg-core").PgColumn<{
|
|
2184
|
+
name: "mode";
|
|
2185
|
+
tableName: "content_types";
|
|
2186
|
+
dataType: "string";
|
|
2187
|
+
columnType: "PgText";
|
|
2188
|
+
data: CollectionMode;
|
|
2189
|
+
driverParam: string;
|
|
2190
|
+
notNull: true;
|
|
2191
|
+
hasDefault: true;
|
|
2192
|
+
isPrimaryKey: false;
|
|
2193
|
+
isAutoincrement: false;
|
|
2194
|
+
hasRuntimeDefault: false;
|
|
2195
|
+
enumValues: [string, ...string[]];
|
|
2196
|
+
baseColumn: never;
|
|
2197
|
+
identity: undefined;
|
|
2198
|
+
generated: undefined;
|
|
2199
|
+
}, {}, {
|
|
2200
|
+
$type: CollectionMode;
|
|
2201
|
+
}>;
|
|
2202
|
+
fieldSchema: import("drizzle-orm/pg-core").PgColumn<{
|
|
2203
|
+
name: "field_schema";
|
|
2204
|
+
tableName: "content_types";
|
|
2205
|
+
dataType: "json";
|
|
2206
|
+
columnType: "PgJsonb";
|
|
2207
|
+
data: Record<string, {
|
|
2208
|
+
label: Localized;
|
|
2209
|
+
fields: Record<string, DynamicFieldDefinition>;
|
|
2210
|
+
}>;
|
|
2211
|
+
driverParam: unknown;
|
|
2212
|
+
notNull: true;
|
|
2213
|
+
hasDefault: true;
|
|
2214
|
+
isPrimaryKey: false;
|
|
2215
|
+
isAutoincrement: false;
|
|
2216
|
+
hasRuntimeDefault: false;
|
|
2217
|
+
enumValues: undefined;
|
|
2218
|
+
baseColumn: never;
|
|
2219
|
+
identity: undefined;
|
|
2220
|
+
generated: undefined;
|
|
2221
|
+
}, {}, {
|
|
2222
|
+
$type: Record<string, {
|
|
2223
|
+
label: Localized;
|
|
2224
|
+
fields: Record<string, DynamicFieldDefinition>;
|
|
2225
|
+
}>;
|
|
2226
|
+
}>;
|
|
2227
|
+
ecomSettings: import("drizzle-orm/pg-core").PgColumn<{
|
|
2228
|
+
name: "ecom_settings";
|
|
2229
|
+
tableName: "content_types";
|
|
2230
|
+
dataType: "json";
|
|
2231
|
+
columnType: "PgJsonb";
|
|
2232
|
+
data: EcomSettings;
|
|
2233
|
+
driverParam: unknown;
|
|
2234
|
+
notNull: false;
|
|
2235
|
+
hasDefault: false;
|
|
2236
|
+
isPrimaryKey: false;
|
|
2237
|
+
isAutoincrement: false;
|
|
2238
|
+
hasRuntimeDefault: false;
|
|
2239
|
+
enumValues: undefined;
|
|
2240
|
+
baseColumn: never;
|
|
2241
|
+
identity: undefined;
|
|
2242
|
+
generated: undefined;
|
|
2243
|
+
}, {}, {
|
|
2244
|
+
$type: EcomSettings;
|
|
2245
|
+
}>;
|
|
2246
|
+
initialBlocks: import("drizzle-orm/pg-core").PgColumn<{
|
|
2247
|
+
name: "initial_blocks";
|
|
2248
|
+
tableName: "content_types";
|
|
2249
|
+
dataType: "json";
|
|
2250
|
+
columnType: "PgJsonb";
|
|
2251
|
+
data: BaseBlock[];
|
|
2252
|
+
driverParam: unknown;
|
|
2253
|
+
notNull: true;
|
|
2254
|
+
hasDefault: true;
|
|
2255
|
+
isPrimaryKey: false;
|
|
2256
|
+
isAutoincrement: false;
|
|
2257
|
+
hasRuntimeDefault: false;
|
|
2258
|
+
enumValues: undefined;
|
|
2259
|
+
baseColumn: never;
|
|
2260
|
+
identity: undefined;
|
|
2261
|
+
generated: undefined;
|
|
2262
|
+
}, {}, {
|
|
2263
|
+
$type: BaseBlock[];
|
|
2264
|
+
}>;
|
|
2265
|
+
isSystem: import("drizzle-orm/pg-core").PgColumn<{
|
|
2266
|
+
name: "is_system";
|
|
2267
|
+
tableName: "content_types";
|
|
2268
|
+
dataType: "boolean";
|
|
2269
|
+
columnType: "PgBoolean";
|
|
2270
|
+
data: boolean;
|
|
2271
|
+
driverParam: boolean;
|
|
2272
|
+
notNull: true;
|
|
2273
|
+
hasDefault: true;
|
|
2274
|
+
isPrimaryKey: false;
|
|
2275
|
+
isAutoincrement: false;
|
|
2276
|
+
hasRuntimeDefault: false;
|
|
2277
|
+
enumValues: undefined;
|
|
2278
|
+
baseColumn: never;
|
|
2279
|
+
identity: undefined;
|
|
2280
|
+
generated: undefined;
|
|
2281
|
+
}, {}, {}>;
|
|
2282
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
2283
|
+
name: "created_at";
|
|
2284
|
+
tableName: "content_types";
|
|
2285
|
+
dataType: "date";
|
|
2286
|
+
columnType: "PgTimestamp";
|
|
2287
|
+
data: Date;
|
|
2288
|
+
driverParam: string;
|
|
2289
|
+
notNull: true;
|
|
2290
|
+
hasDefault: true;
|
|
2291
|
+
isPrimaryKey: false;
|
|
2292
|
+
isAutoincrement: false;
|
|
2293
|
+
hasRuntimeDefault: false;
|
|
2294
|
+
enumValues: undefined;
|
|
2295
|
+
baseColumn: never;
|
|
2296
|
+
identity: undefined;
|
|
2297
|
+
generated: undefined;
|
|
2298
|
+
}, {}, {}>;
|
|
2299
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
2300
|
+
name: "updated_at";
|
|
2301
|
+
tableName: "content_types";
|
|
2302
|
+
dataType: "date";
|
|
2303
|
+
columnType: "PgTimestamp";
|
|
2304
|
+
data: Date;
|
|
2305
|
+
driverParam: string;
|
|
2306
|
+
notNull: false;
|
|
2307
|
+
hasDefault: true;
|
|
2308
|
+
isPrimaryKey: false;
|
|
2309
|
+
isAutoincrement: false;
|
|
2310
|
+
hasRuntimeDefault: false;
|
|
2311
|
+
enumValues: undefined;
|
|
2312
|
+
baseColumn: never;
|
|
2313
|
+
identity: undefined;
|
|
2314
|
+
generated: undefined;
|
|
2315
|
+
}, {}, {}>;
|
|
2316
|
+
};
|
|
2317
|
+
dialect: "pg";
|
|
2318
|
+
}>;
|
|
2062
2319
|
//#endregion
|
package/dist/schema/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { sql } from "drizzle-orm";
|
|
2
|
-
import { customType, foreignKey, index, integer, jsonb, pgTable, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
2
|
+
import { boolean, customType, foreignKey, index, integer, jsonb, pgTable, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
3
3
|
//#region src/schema/page_versions.ts
|
|
4
4
|
const pageVersions = pgTable("page_versions", {
|
|
5
5
|
id: uuid("id").defaultRandom().notNull().primaryKey(),
|
|
@@ -173,4 +173,20 @@ const bylines = pgTable("bylines", {
|
|
|
173
173
|
deletedAt: timestamp("deleted_at")
|
|
174
174
|
}, (table) => [uniqueIndex("bylines_slug_idx").on(table.slug)]);
|
|
175
175
|
//#endregion
|
|
176
|
-
|
|
176
|
+
//#region src/schema/content_types.ts
|
|
177
|
+
const contentTypes = pgTable("content_types", {
|
|
178
|
+
id: uuid("id").defaultRandom().notNull().primaryKey(),
|
|
179
|
+
slug: text("slug").notNull().unique(),
|
|
180
|
+
name: jsonb("name").$type().notNull(),
|
|
181
|
+
description: jsonb("description").$type(),
|
|
182
|
+
icon: text("icon").default("i-lucide-box").notNull(),
|
|
183
|
+
mode: text("mode").$type().default("document").notNull(),
|
|
184
|
+
fieldSchema: jsonb("field_schema").$type().default({}).notNull(),
|
|
185
|
+
ecomSettings: jsonb("ecom_settings").$type(),
|
|
186
|
+
initialBlocks: jsonb("initial_blocks").$type().default([]).notNull(),
|
|
187
|
+
isSystem: boolean("is_system").default(false).notNull(),
|
|
188
|
+
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
|
|
189
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).$onUpdate(() => /* @__PURE__ */ new Date())
|
|
190
|
+
});
|
|
191
|
+
//#endregion
|
|
192
|
+
export { bylines, contentSearchIndex, contentTypes, pageDraftLocks, pageDrafts, pageTaxonomyTerms, pageTemplates, pageVersionApprovals, pageVersionComments, pageVersions, pages, siteSettings, taxonomyTerms };
|
package/dist/schema/sqlite.d.mts
CHANGED
|
@@ -2128,4 +2128,236 @@ export type Byline = typeof bylines.$inferSelect;
|
|
|
2128
2128
|
export type NewByline = typeof bylines.$inferInsert;
|
|
2129
2129
|
export type SiteSettings = typeof siteSettings.$inferSelect;
|
|
2130
2130
|
export type InsertSiteSettings = typeof siteSettings.$inferInsert;
|
|
2131
|
+
export declare const contentTypes: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
2132
|
+
name: "content_types";
|
|
2133
|
+
schema: undefined;
|
|
2134
|
+
columns: {
|
|
2135
|
+
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
2136
|
+
name: "id";
|
|
2137
|
+
tableName: "content_types";
|
|
2138
|
+
dataType: "string";
|
|
2139
|
+
columnType: "SQLiteText";
|
|
2140
|
+
data: string;
|
|
2141
|
+
driverParam: string;
|
|
2142
|
+
notNull: true;
|
|
2143
|
+
hasDefault: true;
|
|
2144
|
+
isPrimaryKey: true;
|
|
2145
|
+
isAutoincrement: false;
|
|
2146
|
+
hasRuntimeDefault: true;
|
|
2147
|
+
enumValues: [string, ...string[]];
|
|
2148
|
+
baseColumn: never;
|
|
2149
|
+
identity: undefined;
|
|
2150
|
+
generated: undefined;
|
|
2151
|
+
}, {}, {
|
|
2152
|
+
length: number | undefined;
|
|
2153
|
+
}>;
|
|
2154
|
+
slug: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
2155
|
+
name: "slug";
|
|
2156
|
+
tableName: "content_types";
|
|
2157
|
+
dataType: "string";
|
|
2158
|
+
columnType: "SQLiteText";
|
|
2159
|
+
data: string;
|
|
2160
|
+
driverParam: string;
|
|
2161
|
+
notNull: true;
|
|
2162
|
+
hasDefault: false;
|
|
2163
|
+
isPrimaryKey: false;
|
|
2164
|
+
isAutoincrement: false;
|
|
2165
|
+
hasRuntimeDefault: false;
|
|
2166
|
+
enumValues: [string, ...string[]];
|
|
2167
|
+
baseColumn: never;
|
|
2168
|
+
identity: undefined;
|
|
2169
|
+
generated: undefined;
|
|
2170
|
+
}, {}, {
|
|
2171
|
+
length: number | undefined;
|
|
2172
|
+
}>;
|
|
2173
|
+
name: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
2174
|
+
name: "name";
|
|
2175
|
+
tableName: "content_types";
|
|
2176
|
+
dataType: "json";
|
|
2177
|
+
columnType: "SQLiteTextJson";
|
|
2178
|
+
data: Localized;
|
|
2179
|
+
driverParam: string;
|
|
2180
|
+
notNull: true;
|
|
2181
|
+
hasDefault: false;
|
|
2182
|
+
isPrimaryKey: false;
|
|
2183
|
+
isAutoincrement: false;
|
|
2184
|
+
hasRuntimeDefault: false;
|
|
2185
|
+
enumValues: undefined;
|
|
2186
|
+
baseColumn: never;
|
|
2187
|
+
identity: undefined;
|
|
2188
|
+
generated: undefined;
|
|
2189
|
+
}, {}, {
|
|
2190
|
+
$type: Localized;
|
|
2191
|
+
}>;
|
|
2192
|
+
description: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
2193
|
+
name: "description";
|
|
2194
|
+
tableName: "content_types";
|
|
2195
|
+
dataType: "json";
|
|
2196
|
+
columnType: "SQLiteTextJson";
|
|
2197
|
+
data: Localized;
|
|
2198
|
+
driverParam: string;
|
|
2199
|
+
notNull: false;
|
|
2200
|
+
hasDefault: false;
|
|
2201
|
+
isPrimaryKey: false;
|
|
2202
|
+
isAutoincrement: false;
|
|
2203
|
+
hasRuntimeDefault: false;
|
|
2204
|
+
enumValues: undefined;
|
|
2205
|
+
baseColumn: never;
|
|
2206
|
+
identity: undefined;
|
|
2207
|
+
generated: undefined;
|
|
2208
|
+
}, {}, {
|
|
2209
|
+
$type: Localized;
|
|
2210
|
+
}>;
|
|
2211
|
+
icon: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
2212
|
+
name: "icon";
|
|
2213
|
+
tableName: "content_types";
|
|
2214
|
+
dataType: "string";
|
|
2215
|
+
columnType: "SQLiteText";
|
|
2216
|
+
data: string;
|
|
2217
|
+
driverParam: string;
|
|
2218
|
+
notNull: true;
|
|
2219
|
+
hasDefault: true;
|
|
2220
|
+
isPrimaryKey: false;
|
|
2221
|
+
isAutoincrement: false;
|
|
2222
|
+
hasRuntimeDefault: false;
|
|
2223
|
+
enumValues: [string, ...string[]];
|
|
2224
|
+
baseColumn: never;
|
|
2225
|
+
identity: undefined;
|
|
2226
|
+
generated: undefined;
|
|
2227
|
+
}, {}, {
|
|
2228
|
+
length: number | undefined;
|
|
2229
|
+
}>;
|
|
2230
|
+
mode: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
2231
|
+
name: "mode";
|
|
2232
|
+
tableName: "content_types";
|
|
2233
|
+
dataType: "string";
|
|
2234
|
+
columnType: "SQLiteText";
|
|
2235
|
+
data: "data" | "document" | "singleton";
|
|
2236
|
+
driverParam: string;
|
|
2237
|
+
notNull: true;
|
|
2238
|
+
hasDefault: true;
|
|
2239
|
+
isPrimaryKey: false;
|
|
2240
|
+
isAutoincrement: false;
|
|
2241
|
+
hasRuntimeDefault: false;
|
|
2242
|
+
enumValues: [string, ...string[]];
|
|
2243
|
+
baseColumn: never;
|
|
2244
|
+
identity: undefined;
|
|
2245
|
+
generated: undefined;
|
|
2246
|
+
}, {}, {
|
|
2247
|
+
length: number | undefined;
|
|
2248
|
+
$type: "data" | "document" | "singleton";
|
|
2249
|
+
}>;
|
|
2250
|
+
fieldSchema: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
2251
|
+
name: "field_schema";
|
|
2252
|
+
tableName: "content_types";
|
|
2253
|
+
dataType: "json";
|
|
2254
|
+
columnType: "SQLiteTextJson";
|
|
2255
|
+
data: Record<string, any>;
|
|
2256
|
+
driverParam: string;
|
|
2257
|
+
notNull: true;
|
|
2258
|
+
hasDefault: true;
|
|
2259
|
+
isPrimaryKey: false;
|
|
2260
|
+
isAutoincrement: false;
|
|
2261
|
+
hasRuntimeDefault: false;
|
|
2262
|
+
enumValues: undefined;
|
|
2263
|
+
baseColumn: never;
|
|
2264
|
+
identity: undefined;
|
|
2265
|
+
generated: undefined;
|
|
2266
|
+
}, {}, {
|
|
2267
|
+
$type: Record<string, any>;
|
|
2268
|
+
}>;
|
|
2269
|
+
ecomSettings: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
2270
|
+
name: "ecom_settings";
|
|
2271
|
+
tableName: "content_types";
|
|
2272
|
+
dataType: "json";
|
|
2273
|
+
columnType: "SQLiteTextJson";
|
|
2274
|
+
data: Record<string, any>;
|
|
2275
|
+
driverParam: string;
|
|
2276
|
+
notNull: false;
|
|
2277
|
+
hasDefault: false;
|
|
2278
|
+
isPrimaryKey: false;
|
|
2279
|
+
isAutoincrement: false;
|
|
2280
|
+
hasRuntimeDefault: false;
|
|
2281
|
+
enumValues: undefined;
|
|
2282
|
+
baseColumn: never;
|
|
2283
|
+
identity: undefined;
|
|
2284
|
+
generated: undefined;
|
|
2285
|
+
}, {}, {
|
|
2286
|
+
$type: Record<string, any>;
|
|
2287
|
+
}>;
|
|
2288
|
+
initialBlocks: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
2289
|
+
name: "initial_blocks";
|
|
2290
|
+
tableName: "content_types";
|
|
2291
|
+
dataType: "json";
|
|
2292
|
+
columnType: "SQLiteTextJson";
|
|
2293
|
+
data: BaseBlock[];
|
|
2294
|
+
driverParam: string;
|
|
2295
|
+
notNull: true;
|
|
2296
|
+
hasDefault: true;
|
|
2297
|
+
isPrimaryKey: false;
|
|
2298
|
+
isAutoincrement: false;
|
|
2299
|
+
hasRuntimeDefault: false;
|
|
2300
|
+
enumValues: undefined;
|
|
2301
|
+
baseColumn: never;
|
|
2302
|
+
identity: undefined;
|
|
2303
|
+
generated: undefined;
|
|
2304
|
+
}, {}, {
|
|
2305
|
+
$type: BaseBlock[];
|
|
2306
|
+
}>;
|
|
2307
|
+
isSystem: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
2308
|
+
name: "is_system";
|
|
2309
|
+
tableName: "content_types";
|
|
2310
|
+
dataType: "boolean";
|
|
2311
|
+
columnType: "SQLiteBoolean";
|
|
2312
|
+
data: boolean;
|
|
2313
|
+
driverParam: number;
|
|
2314
|
+
notNull: true;
|
|
2315
|
+
hasDefault: true;
|
|
2316
|
+
isPrimaryKey: false;
|
|
2317
|
+
isAutoincrement: false;
|
|
2318
|
+
hasRuntimeDefault: false;
|
|
2319
|
+
enumValues: undefined;
|
|
2320
|
+
baseColumn: never;
|
|
2321
|
+
identity: undefined;
|
|
2322
|
+
generated: undefined;
|
|
2323
|
+
}, {}, {}>;
|
|
2324
|
+
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
2325
|
+
name: "created_at";
|
|
2326
|
+
tableName: "content_types";
|
|
2327
|
+
dataType: "date";
|
|
2328
|
+
columnType: "SQLiteTimestamp";
|
|
2329
|
+
data: Date;
|
|
2330
|
+
driverParam: number;
|
|
2331
|
+
notNull: true;
|
|
2332
|
+
hasDefault: true;
|
|
2333
|
+
isPrimaryKey: false;
|
|
2334
|
+
isAutoincrement: false;
|
|
2335
|
+
hasRuntimeDefault: true;
|
|
2336
|
+
enumValues: undefined;
|
|
2337
|
+
baseColumn: never;
|
|
2338
|
+
identity: undefined;
|
|
2339
|
+
generated: undefined;
|
|
2340
|
+
}, {}, {}>;
|
|
2341
|
+
updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
2342
|
+
name: "updated_at";
|
|
2343
|
+
tableName: "content_types";
|
|
2344
|
+
dataType: "date";
|
|
2345
|
+
columnType: "SQLiteTimestamp";
|
|
2346
|
+
data: Date;
|
|
2347
|
+
driverParam: number;
|
|
2348
|
+
notNull: false;
|
|
2349
|
+
hasDefault: true;
|
|
2350
|
+
isPrimaryKey: false;
|
|
2351
|
+
isAutoincrement: false;
|
|
2352
|
+
hasRuntimeDefault: true;
|
|
2353
|
+
enumValues: undefined;
|
|
2354
|
+
baseColumn: never;
|
|
2355
|
+
identity: undefined;
|
|
2356
|
+
generated: undefined;
|
|
2357
|
+
}, {}, {}>;
|
|
2358
|
+
};
|
|
2359
|
+
dialect: "sqlite";
|
|
2360
|
+
}>;
|
|
2361
|
+
export type ContentType = typeof contentTypes.$inferSelect;
|
|
2362
|
+
export type InsertContentType = typeof contentTypes.$inferInsert;
|
|
2131
2363
|
//#endregion
|
package/dist/schema/sqlite.mjs
CHANGED
|
@@ -133,5 +133,19 @@ const bylines = sqliteTable("bylines", {
|
|
|
133
133
|
updatedAt: integer("updated_at", { mode: "timestamp" }).$defaultFn(() => /* @__PURE__ */ new Date()).notNull(),
|
|
134
134
|
deletedAt: integer("deleted_at", { mode: "timestamp" })
|
|
135
135
|
}, (table) => [uniqueIndex("bylines_slug_idx").on(table.slug)]);
|
|
136
|
+
const contentTypes = sqliteTable("content_types", {
|
|
137
|
+
id: text("id").$defaultFn(() => crypto.randomUUID()).primaryKey(),
|
|
138
|
+
slug: text("slug").notNull(),
|
|
139
|
+
name: text("name", { mode: "json" }).$type().notNull(),
|
|
140
|
+
description: text("description", { mode: "json" }).$type(),
|
|
141
|
+
icon: text("icon").default("i-lucide-box").notNull(),
|
|
142
|
+
mode: text("mode").$type().default("document").notNull(),
|
|
143
|
+
fieldSchema: text("field_schema", { mode: "json" }).$type().default(sql`'{}'`).notNull(),
|
|
144
|
+
ecomSettings: text("ecom_settings", { mode: "json" }).$type(),
|
|
145
|
+
initialBlocks: text("initial_blocks", { mode: "json" }).$type().default(sql`'[]'`).notNull(),
|
|
146
|
+
isSystem: integer("is_system", { mode: "boolean" }).default(false).notNull(),
|
|
147
|
+
createdAt: integer("created_at", { mode: "timestamp" }).$defaultFn(() => /* @__PURE__ */ new Date()).notNull(),
|
|
148
|
+
updatedAt: integer("updated_at", { mode: "timestamp" }).$defaultFn(() => /* @__PURE__ */ new Date()).$onUpdate(() => /* @__PURE__ */ new Date())
|
|
149
|
+
}, (table) => [uniqueIndex("content_types_slug_idx").on(table.slug)]);
|
|
136
150
|
//#endregion
|
|
137
|
-
export { bylines, contentSearchIndex, pageDraftLocks, pageDrafts, pageTaxonomyTerms, pageTemplates, pageVersionApprovals, pageVersionComments, pageVersions, pages, siteSettings, taxonomyTerms };
|
|
151
|
+
export { bylines, contentSearchIndex, contentTypes, pageDraftLocks, pageDrafts, pageTaxonomyTerms, pageTemplates, pageVersionApprovals, pageVersionComments, pageVersions, pages, siteSettings, taxonomyTerms };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimelight/cms",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Rimelight Entertainment's Content Management System Package",
|
|
6
6
|
"homepage": "https://rimelight.com/docs",
|
|
@@ -22,24 +22,35 @@
|
|
|
22
22
|
"type": "module",
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
|
-
"types": "./
|
|
26
|
-
"import": "./
|
|
25
|
+
"types": "./src/index.ts",
|
|
26
|
+
"import": "./src/index.ts",
|
|
27
|
+
"default": "./src/index.ts"
|
|
27
28
|
},
|
|
28
29
|
"./schema": {
|
|
29
30
|
"types": "./dist/schema/index.d.mts",
|
|
30
|
-
"import": "./
|
|
31
|
+
"import": "./src/schema/index.ts",
|
|
32
|
+
"default": "./src/schema/index.ts"
|
|
31
33
|
},
|
|
32
34
|
"./schema/sqlite": {
|
|
33
35
|
"types": "./dist/schema/sqlite.d.mts",
|
|
34
|
-
"import": "./
|
|
36
|
+
"import": "./src/schema/sqlite.ts",
|
|
37
|
+
"default": "./src/schema/sqlite.ts"
|
|
35
38
|
},
|
|
39
|
+
"./schema/*": "./src/schema/*",
|
|
36
40
|
"./integration": {
|
|
37
41
|
"types": "./dist/integration.d.mts",
|
|
38
|
-
"import": "./
|
|
42
|
+
"import": "./src/integration.ts",
|
|
43
|
+
"default": "./src/integration.ts"
|
|
39
44
|
},
|
|
40
45
|
"./storage": {
|
|
41
46
|
"types": "./dist/storage/index.d.mts",
|
|
42
|
-
"import": "./
|
|
47
|
+
"import": "./src/storage/index.ts",
|
|
48
|
+
"default": "./src/storage/index.ts"
|
|
49
|
+
},
|
|
50
|
+
"./mcp": {
|
|
51
|
+
"types": "./src/mcp/index.ts",
|
|
52
|
+
"import": "./src/mcp/index.ts",
|
|
53
|
+
"default": "./src/mcp/index.ts"
|
|
43
54
|
},
|
|
44
55
|
"./core/*": "./src/core/*",
|
|
45
56
|
"./astro/*": "./src/astro/*",
|
|
@@ -63,17 +74,22 @@
|
|
|
63
74
|
"publishConfig": {
|
|
64
75
|
"access": "public"
|
|
65
76
|
},
|
|
77
|
+
"scripts": {
|
|
78
|
+
"build": "vp pack",
|
|
79
|
+
"prepack": "pnpm run build",
|
|
80
|
+
"check": "vp check --fix && astro check"
|
|
81
|
+
},
|
|
66
82
|
"dependencies": {
|
|
67
|
-
"@rimelight/auth": "
|
|
68
|
-
"@rimelight/i18n": "
|
|
69
|
-
"@rimelight/ui": "
|
|
83
|
+
"@rimelight/auth": "workspace:*",
|
|
84
|
+
"@rimelight/i18n": "workspace:*",
|
|
85
|
+
"@rimelight/ui": "workspace:*",
|
|
70
86
|
"drizzle-orm": "0.45.2",
|
|
71
87
|
"solid-js": "1.9.15",
|
|
72
88
|
"sortablejs": "1.15.7"
|
|
73
89
|
},
|
|
74
90
|
"devDependencies": {
|
|
75
91
|
"@astrojs/check": "0.9.10",
|
|
76
|
-
"@rimelight/config": "
|
|
92
|
+
"@rimelight/config": "workspace:*",
|
|
77
93
|
"@types/sortablejs": "1.15.9",
|
|
78
94
|
"astro": "7.3.2",
|
|
79
95
|
"typescript": "6.0.3",
|
|
@@ -85,8 +101,5 @@
|
|
|
85
101
|
"engines": {
|
|
86
102
|
"node": ">=26.8.2"
|
|
87
103
|
},
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
"check": "vp check --fix && astro check"
|
|
91
|
-
}
|
|
92
|
-
}
|
|
104
|
+
"packageManager": "pnpm@12.4.1"
|
|
105
|
+
}
|
package/src/admin/api/media.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { APIRoute } from "astro"
|
|
2
2
|
import { getR2Bucket, listR2Files, uploadR2File, deleteR2File } from "../../storage/index"
|
|
3
|
-
// @ts-ignore
|
|
4
3
|
import { storageConfig } from "virtual:rimelight-cms/storage"
|
|
5
|
-
// @ts-ignore
|
|
6
4
|
import authAdapter from "virtual:rimelight-cms/auth"
|
|
7
5
|
|
|
8
6
|
export const prerender = false
|
|
@@ -16,7 +16,13 @@ const session = await authAdapter.getSession(Astro.request);
|
|
|
16
16
|
if (!session) {
|
|
17
17
|
if (authAdapter.handleUnauthorized) {
|
|
18
18
|
const res = await authAdapter.handleUnauthorized(Astro.request);
|
|
19
|
-
if (res instanceof Response)
|
|
19
|
+
if (res instanceof Response) {
|
|
20
|
+
const location = res.headers.get("location");
|
|
21
|
+
if (location) {
|
|
22
|
+
return Astro.redirect(location);
|
|
23
|
+
}
|
|
24
|
+
return res;
|
|
25
|
+
}
|
|
20
26
|
}
|
|
21
27
|
return Astro.redirect(getRelativeLocaleUrl(Astro.currentLocale ?? "en", "/auth/sign-in"));
|
|
22
28
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import UIHead from "@rimelight/ui/components/head/UIHead.astro";
|
|
3
3
|
import RLAMain from "@rimelight/ui/components/main/RLAMain.astro";
|
|
4
4
|
import RLAToaster from "@rimelight/ui/components/toaster/RLAToaster.astro";
|
|
5
|
-
import "virtual:uno.css";
|
|
6
5
|
import "../../client/styles/cms-editor.css";
|
|
7
6
|
|
|
8
7
|
interface Props {
|
|
@@ -581,7 +581,10 @@ const isPublished = !!page.publishedVersionId;
|
|
|
581
581
|
if (confirmDeletePageBtn) (confirmDeletePageBtn as HTMLButtonElement).disabled = true;
|
|
582
582
|
const res = await fetch(`/api/cms/pages/${initialData.id}`, { method: 'DELETE' });
|
|
583
583
|
if (res.ok) {
|
|
584
|
-
window.location.
|
|
584
|
+
const currentPath = window.location.pathname;
|
|
585
|
+
const match = currentPath.match(/^\/([a-z]{2}(?:-[a-z]{2})?)\/cms/i);
|
|
586
|
+
const localePrefix = match ? `/${match[1]}` : '';
|
|
587
|
+
window.location.href = `${localePrefix}/cms/pages`;
|
|
585
588
|
} else {
|
|
586
589
|
alert('Failed to delete page');
|
|
587
590
|
if (confirmDeletePageBtn) (confirmDeletePageBtn as HTMLButtonElement).disabled = false;
|