@kyro-cms/core 0.5.0 → 0.5.2
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/api-handler.cjs +5 -5
- package/dist/api-handler.js +4 -4
- package/dist/bootstrap-PBMMLBQC.js +6 -0
- package/dist/{bootstrap-LI3Q7ROO.js.map → bootstrap-PBMMLBQC.js.map} +1 -1
- package/dist/bootstrap-QN77EVI3.cjs +31 -0
- package/dist/{bootstrap-GPXZWJXU.cjs.map → bootstrap-QN77EVI3.cjs.map} +1 -1
- package/dist/{chunk-JINGZG7I.cjs → chunk-7SXPHG3M.cjs} +8 -5
- package/dist/chunk-7SXPHG3M.cjs.map +1 -0
- package/dist/{chunk-FG4PAYML.cjs → chunk-AGAIUDAV.cjs} +4 -4
- package/dist/{chunk-FG4PAYML.cjs.map → chunk-AGAIUDAV.cjs.map} +1 -1
- package/dist/{chunk-XKVPPGLX.cjs → chunk-EVEJC22G.cjs} +8 -5
- package/dist/chunk-EVEJC22G.cjs.map +1 -0
- package/dist/{chunk-7DSDEVBA.js → chunk-L4E76X2K.js} +7 -4
- package/dist/chunk-L4E76X2K.js.map +1 -0
- package/dist/{chunk-QSVSNOKK.js → chunk-Q4DNT7FO.js} +3 -3
- package/dist/{chunk-QSVSNOKK.js.map → chunk-Q4DNT7FO.js.map} +1 -1
- package/dist/{chunk-RCRCW2TQ.js → chunk-SO25EHOE.js} +4 -4
- package/dist/{chunk-RCRCW2TQ.js.map → chunk-SO25EHOE.js.map} +1 -1
- package/dist/{chunk-V3423DUL.cjs → chunk-SYRDCLH7.cjs} +9 -9
- package/dist/{chunk-V3423DUL.cjs.map → chunk-SYRDCLH7.cjs.map} +1 -1
- package/dist/{chunk-SCRAGYNM.js → chunk-WH4Y5MT6.js} +7 -4
- package/dist/chunk-WH4Y5MT6.js.map +1 -0
- package/dist/{chunk-ALAAPA3U.cjs → chunk-XJ2VYR47.cjs} +6 -6
- package/dist/{chunk-ALAAPA3U.cjs.map → chunk-XJ2VYR47.cjs.map} +1 -1
- package/dist/{chunk-6R37DO2Z.js → chunk-XR5EJS3C.js} +3 -3
- package/dist/{chunk-6R37DO2Z.js.map → chunk-XR5EJS3C.js.map} +1 -1
- package/dist/cli/index.cjs +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/drizzle/index.cjs +5 -5
- package/dist/drizzle/index.js +1 -1
- package/dist/index.cjs +72 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/dist/rest/index.cjs +5 -5
- package/dist/rest/index.js +3 -3
- package/package.json +2 -2
- package/dist/bootstrap-GPXZWJXU.cjs +0 -31
- package/dist/bootstrap-LI3Q7ROO.js +0 -6
- package/dist/chunk-7DSDEVBA.js.map +0 -1
- package/dist/chunk-JINGZG7I.cjs.map +0 -1
- package/dist/chunk-SCRAGYNM.js.map +0 -1
- package/dist/chunk-XKVPPGLX.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export { RedisAuthAdapter } from './chunk-E3BZLMX6.js';
|
|
2
|
-
export { autoBootstrap, bootstrapAdmin, getBootstrapFromEnv } from './chunk-
|
|
2
|
+
export { autoBootstrap, bootstrapAdmin, getBootstrapFromEnv } from './chunk-XR5EJS3C.js';
|
|
3
3
|
export { allSettingsGlobals, blogCollections, blogGlobals, coreSettingsGlobals, createTemplateConfig, ecommerceCollections, ecommerceGlobals, ecommerceSettingsGlobals, kitchenSinkCollections, mediaCollections, minimalCollections } from './chunk-WSCJQI2B.js';
|
|
4
|
-
export { ConfigValidationError, Kyro, Registry, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createKyro, createRegistry, fieldToZod, getRegistry, globalToZod, resetRegistry, validateCollection, validateConfig, validateFields, validateGlobal } from './chunk-
|
|
4
|
+
export { ConfigValidationError, Kyro, Registry, collectionToCreateZod, collectionToUpdateZod, collectionToWhereZod, collectionToZod, createKyro, createRegistry, fieldToZod, getRegistry, globalToZod, resetRegistry, validateCollection, validateConfig, validateFields, validateGlobal } from './chunk-Q4DNT7FO.js';
|
|
5
5
|
export { CSSGenerator, createAdminStyling, defaultDarkTheme, defaultFieldStyling, defaultLightTheme, ecommerce2026Theme, generateCSSVariables, generateTailwindConfig } from './chunk-2HFJUUFZ.js';
|
|
6
6
|
export { ALL_FIELD_TYPES, COMPLEX_FIELD_TYPES, LAYOUT_FIELD_TYPES, PRIMITIVE_FIELD_TYPES, RELATIONAL_FIELD_TYPES, createColumnsNode, isArrayField, isBlocksField, isGroupField, isImageField, isLayoutField, isNumberField, isRelationshipField, isRichTextField, isSelectField, isTextField, isUploadField, normalizeRichTextDocument, normalizeRichTextValue, renderRichText, richTextStyles } from './chunk-Q23JB3KL.js';
|
|
7
7
|
export { createContext, createCountProcedure, createCreateProcedure, createDeleteProcedure, createDynamicRouter, createFindByIDProcedure, createFindProcedure, createKyroServer, createUpdateProcedure } from './chunk-3AJE4SEG.js';
|
|
8
|
-
import { init_secret, AuditLogger, InMemoryRateLimiter, InMemoryAuditLogger, AuthRoutes } from './chunk-
|
|
9
|
-
export { AuditLogger, InMemoryAuditLogger, InMemoryRateLimiter, MediaService, createAuditContext, createHonoApp, createLocalStorage, createRESTAPI, getAppSecret, getEncryptionKey, getSessionConfig, loadSecrets, resolveProvider, setDbAdapter } from './chunk-
|
|
10
|
-
import { EmailTransport, PasswordPolicy, SQLiteAuthAdapter } from './chunk-
|
|
11
|
-
export { ConfigService, EmailTransport, PasswordPolicy, SQLiteAuthAdapter } from './chunk-
|
|
8
|
+
import { init_secret, AuditLogger, InMemoryRateLimiter, InMemoryAuditLogger, AuthRoutes } from './chunk-SO25EHOE.js';
|
|
9
|
+
export { AuditLogger, InMemoryAuditLogger, InMemoryRateLimiter, MediaService, createAuditContext, createHonoApp, createLocalStorage, createRESTAPI, getAppSecret, getEncryptionKey, getSessionConfig, loadSecrets, resolveProvider, setDbAdapter } from './chunk-SO25EHOE.js';
|
|
10
|
+
import { EmailTransport, PasswordPolicy, SQLiteAuthAdapter } from './chunk-WH4Y5MT6.js';
|
|
11
|
+
export { ConfigService, EmailTransport, PasswordPolicy, SQLiteAuthAdapter } from './chunk-WH4Y5MT6.js';
|
|
12
12
|
import './chunk-YT7HXXVN.js';
|
|
13
13
|
import './chunk-P2YW545G.js';
|
|
14
14
|
export { ALL_WEBHOOK_EVENTS, WEBHOOK_COLLECTION, WEBHOOK_DELIVERY_COLLECTION, WEBHOOK_EVENTS, WebhookService, buildDeliveryRecord, createTestPayload, createWebhookService, deliverWebhook, deliverWithRetry, generateWebhookSecret, signPayload } from './chunk-QXIQWPAP.js';
|
|
@@ -18,17 +18,18 @@ export { KyroPubSub, KyroWSServer, PubSub, createWSServer } from './chunk-3TPQ2B
|
|
|
18
18
|
export { DrizzleAdapter, collectionToDrizzleSchema, createDrizzleAdapter, fieldToDrizzleType } from './chunk-C4JJEE42.js';
|
|
19
19
|
export { PostgresAuthAdapter } from './chunk-DBUYB32X.js';
|
|
20
20
|
import './chunk-WOWUL7ZY.js';
|
|
21
|
-
export { createDatabase, runMigrations, seedDefaultRoles } from './chunk-
|
|
21
|
+
export { createDatabase, runMigrations, seedDefaultRoles } from './chunk-L4E76X2K.js';
|
|
22
22
|
export { MongoDBAdapter, createMongoDBAdapter } from './chunk-342BJNBI.js';
|
|
23
23
|
import { AbstractBaseAdapter } from './chunk-A4USRVTQ.js';
|
|
24
24
|
export { AbstractBaseAdapter } from './chunk-A4USRVTQ.js';
|
|
25
|
-
import
|
|
26
|
-
import
|
|
25
|
+
import './chunk-Z6ZWNWWR.js';
|
|
26
|
+
import { createRequire } from 'module';
|
|
27
27
|
import crypto2, { randomBytes } from 'crypto';
|
|
28
|
+
import { readFileSync } from 'fs';
|
|
29
|
+
import path, { join, resolve } from 'path';
|
|
28
30
|
export { z } from 'zod';
|
|
29
31
|
import { createStorage } from 'unstorage';
|
|
30
32
|
import indexedbDriver from 'unstorage/drivers/indexedb';
|
|
31
|
-
import path from 'path';
|
|
32
33
|
import fsDriver from 'unstorage/drivers/fs';
|
|
33
34
|
|
|
34
35
|
// src/hooks/types.ts
|
|
@@ -48,6 +49,9 @@ async function runHooks(hooks, args) {
|
|
|
48
49
|
async function runFieldHooks(hooks, args) {
|
|
49
50
|
return runHooks(hooks, args);
|
|
50
51
|
}
|
|
52
|
+
var _require = createRequire(import.meta.url);
|
|
53
|
+
var modPath = "node:sqlite";
|
|
54
|
+
var { DatabaseSync } = _require(modPath);
|
|
51
55
|
function flattenFields(fields) {
|
|
52
56
|
const result = [];
|
|
53
57
|
for (const field of fields) {
|
|
@@ -162,7 +166,7 @@ var LocalAdapter = class extends AbstractBaseAdapter {
|
|
|
162
166
|
}
|
|
163
167
|
async connect() {
|
|
164
168
|
if (!this.db) {
|
|
165
|
-
this.db = new
|
|
169
|
+
this.db = new DatabaseSync(this.path || ":memory:");
|
|
166
170
|
}
|
|
167
171
|
this.db.exec("PRAGMA journal_mode = WAL");
|
|
168
172
|
this.db.exec("PRAGMA foreign_keys = ON");
|
|
@@ -978,13 +982,13 @@ var LocalAdapter = class extends AbstractBaseAdapter {
|
|
|
978
982
|
// Transaction Support
|
|
979
983
|
// ========================================================================
|
|
980
984
|
async transaction(fn) {
|
|
981
|
-
return new Promise((
|
|
985
|
+
return new Promise((resolve2, reject) => {
|
|
982
986
|
const tx = this.db.transaction(async () => {
|
|
983
987
|
return fn({ db: this.db });
|
|
984
988
|
});
|
|
985
989
|
try {
|
|
986
990
|
const result = tx();
|
|
987
|
-
|
|
991
|
+
resolve2(result);
|
|
988
992
|
} catch (error) {
|
|
989
993
|
reject(error);
|
|
990
994
|
}
|
|
@@ -1911,8 +1915,6 @@ var InMemoryAccountLockout = class {
|
|
|
1911
1915
|
this.config = { ...this.config, ...config };
|
|
1912
1916
|
}
|
|
1913
1917
|
};
|
|
1914
|
-
|
|
1915
|
-
// src/auth/config.ts
|
|
1916
1918
|
function getEnv(key, fallback = "") {
|
|
1917
1919
|
return process.env[key] || fallback;
|
|
1918
1920
|
}
|
|
@@ -1932,8 +1934,6 @@ function detectDatabaseType() {
|
|
|
1932
1934
|
return envDb;
|
|
1933
1935
|
}
|
|
1934
1936
|
try {
|
|
1935
|
-
const { readFileSync } = __require("fs");
|
|
1936
|
-
const { join } = __require("path");
|
|
1937
1937
|
const configPath = join(process.cwd(), "kyro.config.ts");
|
|
1938
1938
|
const configContent = readFileSync(configPath, "utf8");
|
|
1939
1939
|
if (configContent.includes("createLocalAdapter")) {
|
|
@@ -1952,8 +1952,8 @@ function detectDatabaseType() {
|
|
|
1952
1952
|
}
|
|
1953
1953
|
async function createAuthAdapter(databaseType) {
|
|
1954
1954
|
const cwd = process.cwd();
|
|
1955
|
-
const rootDir = cwd.endsWith("admin") ?
|
|
1956
|
-
const defaultAuthDbPath =
|
|
1955
|
+
const rootDir = cwd.endsWith("admin") ? join(cwd, "..") : cwd;
|
|
1956
|
+
const defaultAuthDbPath = resolve(rootDir, "data", "auth.db");
|
|
1957
1957
|
switch (databaseType) {
|
|
1958
1958
|
case "sqlite":
|
|
1959
1959
|
return new SQLiteAuthAdapter({
|