@llmops/core 0.2.10 → 0.2.11-beta.1
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/{bun-sqlite-dialect-DWVuvIoz.cjs → bun-sqlite-dialect-DxPi9X8H.cjs} +1 -1
- package/dist/db/index.cjs +1 -1
- package/dist/db/index.d.cts +1 -1
- package/dist/db/index.d.mts +1 -1
- package/dist/db/index.mjs +1 -1
- package/dist/{db-8mMoL2a6.cjs → db-CzLvkATK.cjs} +50 -4
- package/dist/{db-BgX8EJ1K.mjs → db-DA8xIZ3w.mjs} +48 -2
- package/dist/{index-5GfBoyiq.d.mts → index-8czO0OIS.d.cts} +49 -36
- package/dist/{index-zQzOuWsM.d.cts → index-BEoqwM0H.d.mts} +49 -36
- package/dist/index.cjs +10 -4
- package/dist/index.d.cts +242 -223
- package/dist/index.d.mts +505 -486
- package/dist/index.mjs +10 -4
- package/dist/{node-sqlite-dialect-C9LjudrZ.cjs → node-sqlite-dialect-Ckt6QTf5.cjs} +1 -1
- package/package.json +2 -2
package/dist/db/index.cjs
CHANGED
package/dist/db/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as SCHEMA_METADATA, B as WorkspaceSettings, C as EnvironmentSecretsTable, D as LLMRequestsTable, E as LLMRequest, F as Updateable, G as environmentsSchema, H as configVariantsSchema, I as Variant, J as schemas, K as llmRequestsSchema, L as VariantVersion, M as TableName, N as TargetingRule, O as ProviderConfig, P as TargetingRulesTable, Q as workspaceSettingsSchema, R as VariantVersionsTable, S as EnvironmentSecret, T as Insertable, U as configsSchema, V as WorkspaceSettingsTable, W as environmentSecretsSchema, X as variantVersionsSchema, Y as targetingRulesSchema, Z as variantsSchema, _ as ConfigVariant, a as createDatabaseFromConnection, b as Database, c as MigrationResult, d as runAutoMigrations, f as parsePartialTableData, g as Config, h as validateTableData, i as createDatabase, j as Selectable, k as ProviderConfigsTable, l as getMigrations, m as validatePartialTableData, n as DatabaseOptions, o as detectDatabaseType, p as parseTableData, q as providerConfigsSchema, r as DatabaseType, s as MigrationOptions, t as DatabaseConnection, u as matchType, v as ConfigVariantsTable, w as EnvironmentsTable, x as Environment, y as ConfigsTable, z as VariantsTable } from "../index-
|
|
1
|
+
import { A as SCHEMA_METADATA, B as WorkspaceSettings, C as EnvironmentSecretsTable, D as LLMRequestsTable, E as LLMRequest, F as Updateable, G as environmentsSchema, H as configVariantsSchema, I as Variant, J as schemas, K as llmRequestsSchema, L as VariantVersion, M as TableName, N as TargetingRule, O as ProviderConfig, P as TargetingRulesTable, Q as workspaceSettingsSchema, R as VariantVersionsTable, S as EnvironmentSecret, T as Insertable, U as configsSchema, V as WorkspaceSettingsTable, W as environmentSecretsSchema, X as variantVersionsSchema, Y as targetingRulesSchema, Z as variantsSchema, _ as ConfigVariant, a as createDatabaseFromConnection, b as Database, c as MigrationResult, d as runAutoMigrations, f as parsePartialTableData, g as Config, h as validateTableData, i as createDatabase, j as Selectable, k as ProviderConfigsTable, l as getMigrations, m as validatePartialTableData, n as DatabaseOptions, o as detectDatabaseType, p as parseTableData, q as providerConfigsSchema, r as DatabaseType, s as MigrationOptions, t as DatabaseConnection, u as matchType, v as ConfigVariantsTable, w as EnvironmentsTable, x as Environment, y as ConfigsTable, z as VariantsTable } from "../index-8czO0OIS.cjs";
|
|
2
2
|
export { Config, ConfigVariant, ConfigVariantsTable, ConfigsTable, Database, DatabaseConnection, DatabaseOptions, DatabaseType, Environment, EnvironmentSecret, EnvironmentSecretsTable, EnvironmentsTable, Insertable, LLMRequest, LLMRequestsTable, MigrationOptions, MigrationResult, ProviderConfig, ProviderConfigsTable, SCHEMA_METADATA, Selectable, TableName, TargetingRule, TargetingRulesTable, Updateable, Variant, VariantVersion, VariantVersionsTable, VariantsTable, WorkspaceSettings, WorkspaceSettingsTable, configVariantsSchema, configsSchema, createDatabase, createDatabaseFromConnection, detectDatabaseType, environmentSecretsSchema, environmentsSchema, getMigrations, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, providerConfigsSchema, runAutoMigrations, schemas, targetingRulesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
package/dist/db/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as SCHEMA_METADATA, B as WorkspaceSettings, C as EnvironmentSecretsTable, D as LLMRequestsTable, E as LLMRequest, F as Updateable, G as environmentsSchema, H as configVariantsSchema, I as Variant, J as schemas, K as llmRequestsSchema, L as VariantVersion, M as TableName, N as TargetingRule, O as ProviderConfig, P as TargetingRulesTable, Q as workspaceSettingsSchema, R as VariantVersionsTable, S as EnvironmentSecret, T as Insertable, U as configsSchema, V as WorkspaceSettingsTable, W as environmentSecretsSchema, X as variantVersionsSchema, Y as targetingRulesSchema, Z as variantsSchema, _ as ConfigVariant, a as createDatabaseFromConnection, b as Database, c as MigrationResult, d as runAutoMigrations, f as parsePartialTableData, g as Config, h as validateTableData, i as createDatabase, j as Selectable, k as ProviderConfigsTable, l as getMigrations, m as validatePartialTableData, n as DatabaseOptions, o as detectDatabaseType, p as parseTableData, q as providerConfigsSchema, r as DatabaseType, s as MigrationOptions, t as DatabaseConnection, u as matchType, v as ConfigVariantsTable, w as EnvironmentsTable, x as Environment, y as ConfigsTable, z as VariantsTable } from "../index-
|
|
1
|
+
import { A as SCHEMA_METADATA, B as WorkspaceSettings, C as EnvironmentSecretsTable, D as LLMRequestsTable, E as LLMRequest, F as Updateable, G as environmentsSchema, H as configVariantsSchema, I as Variant, J as schemas, K as llmRequestsSchema, L as VariantVersion, M as TableName, N as TargetingRule, O as ProviderConfig, P as TargetingRulesTable, Q as workspaceSettingsSchema, R as VariantVersionsTable, S as EnvironmentSecret, T as Insertable, U as configsSchema, V as WorkspaceSettingsTable, W as environmentSecretsSchema, X as variantVersionsSchema, Y as targetingRulesSchema, Z as variantsSchema, _ as ConfigVariant, a as createDatabaseFromConnection, b as Database, c as MigrationResult, d as runAutoMigrations, f as parsePartialTableData, g as Config, h as validateTableData, i as createDatabase, j as Selectable, k as ProviderConfigsTable, l as getMigrations, m as validatePartialTableData, n as DatabaseOptions, o as detectDatabaseType, p as parseTableData, q as providerConfigsSchema, r as DatabaseType, s as MigrationOptions, t as DatabaseConnection, u as matchType, v as ConfigVariantsTable, w as EnvironmentsTable, x as Environment, y as ConfigsTable, z as VariantsTable } from "../index-BEoqwM0H.mjs";
|
|
2
2
|
export { Config, ConfigVariant, ConfigVariantsTable, ConfigsTable, Database, DatabaseConnection, DatabaseOptions, DatabaseType, Environment, EnvironmentSecret, EnvironmentSecretsTable, EnvironmentsTable, Insertable, LLMRequest, LLMRequestsTable, MigrationOptions, MigrationResult, ProviderConfig, ProviderConfigsTable, SCHEMA_METADATA, Selectable, TableName, TargetingRule, TargetingRulesTable, Updateable, Variant, VariantVersion, VariantVersionsTable, VariantsTable, WorkspaceSettings, WorkspaceSettingsTable, configVariantsSchema, configsSchema, createDatabase, createDatabaseFromConnection, detectDatabaseType, environmentSecretsSchema, environmentsSchema, getMigrations, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, providerConfigsSchema, runAutoMigrations, schemas, targetingRulesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
package/dist/db/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as variantsSchema, S as variantVersionsSchema, _ as environmentsSchema, a as matchType, b as schemas, d as validatePartialTableData, f as validateTableData, g as environmentSecretsSchema, h as configsSchema, i as getMigrations, l as parsePartialTableData, m as configVariantsSchema, n as createDatabaseFromConnection, o as runAutoMigrations, p as SCHEMA_METADATA, r as detectDatabaseType, t as createDatabase, u as parseTableData, v as llmRequestsSchema, w as workspaceSettingsSchema, x as targetingRulesSchema, y as providerConfigsSchema } from "../db-
|
|
1
|
+
import { C as variantsSchema, S as variantVersionsSchema, _ as environmentsSchema, a as matchType, b as schemas, d as validatePartialTableData, f as validateTableData, g as environmentSecretsSchema, h as configsSchema, i as getMigrations, l as parsePartialTableData, m as configVariantsSchema, n as createDatabaseFromConnection, o as runAutoMigrations, p as SCHEMA_METADATA, r as detectDatabaseType, t as createDatabase, u as parseTableData, v as llmRequestsSchema, w as workspaceSettingsSchema, x as targetingRulesSchema, y as providerConfigsSchema } from "../db-DA8xIZ3w.mjs";
|
|
2
2
|
|
|
3
3
|
export { SCHEMA_METADATA, configVariantsSchema, configsSchema, createDatabase, createDatabaseFromConnection, detectDatabaseType, environmentSecretsSchema, environmentsSchema, getMigrations, llmRequestsSchema, matchType, parsePartialTableData, parseTableData, providerConfigsSchema, runAutoMigrations, schemas, targetingRulesSchema, validatePartialTableData, validateTableData, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
|
|
@@ -12961,6 +12961,7 @@ const workspaceSettingsSchema = object({
|
|
|
12961
12961
|
const providerConfigsSchema = object({
|
|
12962
12962
|
...baseSchema,
|
|
12963
12963
|
providerId: string$1(),
|
|
12964
|
+
name: string$1().nullable().optional(),
|
|
12964
12965
|
config: record(string$1(), unknown()),
|
|
12965
12966
|
enabled: boolean$1().default(true)
|
|
12966
12967
|
});
|
|
@@ -13261,9 +13262,10 @@ const SCHEMA_METADATA = { tables: {
|
|
|
13261
13262
|
type: "uuid",
|
|
13262
13263
|
primaryKey: true
|
|
13263
13264
|
},
|
|
13264
|
-
providerId: {
|
|
13265
|
+
providerId: { type: "text" },
|
|
13266
|
+
name: {
|
|
13265
13267
|
type: "text",
|
|
13266
|
-
|
|
13268
|
+
nullable: true
|
|
13267
13269
|
},
|
|
13268
13270
|
config: {
|
|
13269
13271
|
type: "jsonb",
|
|
@@ -13702,6 +13704,43 @@ async function getMigrations(db, dbType, options) {
|
|
|
13702
13704
|
};
|
|
13703
13705
|
}
|
|
13704
13706
|
/**
|
|
13707
|
+
* Fix legacy constraints that may exist from previous schema versions
|
|
13708
|
+
*/
|
|
13709
|
+
async function fixLegacyConstraints(db, dbType, schema = "public") {
|
|
13710
|
+
if (dbType === "postgres") {
|
|
13711
|
+
logger.info(`Auto-migration: Checking for legacy constraints in schema '${schema}'...`);
|
|
13712
|
+
try {
|
|
13713
|
+
await kysely.sql`ALTER TABLE ${kysely.sql.ref(schema)}."provider_configs" DROP CONSTRAINT IF EXISTS "provider_configs_providerId_key"`.execute(db);
|
|
13714
|
+
await kysely.sql`ALTER TABLE ${kysely.sql.ref(schema)}."provider_configs" DROP CONSTRAINT IF EXISTS "provider_configs_providerid_key"`.execute(db);
|
|
13715
|
+
} catch (err) {
|
|
13716
|
+
logger.warn(`Auto-migration: Failed to drop specific legacy constraint: ${err}`);
|
|
13717
|
+
}
|
|
13718
|
+
try {
|
|
13719
|
+
const result = await kysely.sql`
|
|
13720
|
+
SELECT conname
|
|
13721
|
+
FROM pg_constraint c
|
|
13722
|
+
JOIN pg_namespace n ON n.oid = c.connamespace
|
|
13723
|
+
JOIN pg_class t ON t.oid = c.conrelid
|
|
13724
|
+
WHERE n.nspname = ${schema}
|
|
13725
|
+
AND t.relname = 'provider_configs'
|
|
13726
|
+
AND c.contype = 'u'
|
|
13727
|
+
AND EXISTS (
|
|
13728
|
+
SELECT 1 FROM pg_attribute a
|
|
13729
|
+
WHERE a.attrelid = c.conrelid
|
|
13730
|
+
AND a.attnum = ANY(c.conkey)
|
|
13731
|
+
AND lower(a.attname) = 'providerid'
|
|
13732
|
+
)
|
|
13733
|
+
`.execute(db);
|
|
13734
|
+
for (const row of result.rows) {
|
|
13735
|
+
logger.info(`Auto-migration: Removing legacy unique constraint '${row.conname}' from provider_configs`);
|
|
13736
|
+
await kysely.sql`ALTER TABLE ${kysely.sql.ref(schema)}."provider_configs" DROP CONSTRAINT ${kysely.sql.ref(row.conname)}`.execute(db);
|
|
13737
|
+
}
|
|
13738
|
+
} catch (err) {
|
|
13739
|
+
logger.warn(`Auto-migration: Failed to cleanup legacy constraints: ${err}`);
|
|
13740
|
+
}
|
|
13741
|
+
}
|
|
13742
|
+
}
|
|
13743
|
+
/**
|
|
13705
13744
|
* Run migrations if needed
|
|
13706
13745
|
* @param db - Kysely database instance
|
|
13707
13746
|
* @param dbType - Database type
|
|
@@ -13709,6 +13748,13 @@ async function getMigrations(db, dbType, options) {
|
|
|
13709
13748
|
* @returns true if migrations were run, false otherwise
|
|
13710
13749
|
*/
|
|
13711
13750
|
async function runAutoMigrations(db, dbType, options) {
|
|
13751
|
+
let currentSchema = options?.schema || "public";
|
|
13752
|
+
if (dbType === "postgres" && !options?.schema) currentSchema = await getPostgresSchema(db);
|
|
13753
|
+
try {
|
|
13754
|
+
await fixLegacyConstraints(db, dbType, currentSchema);
|
|
13755
|
+
} catch (error$47) {
|
|
13756
|
+
logger.debug(`Constraint fixup skipped or failed: ${error$47}`);
|
|
13757
|
+
}
|
|
13712
13758
|
const { toBeCreated, toBeAdded, runMigrations, needsMigration } = await getMigrations(db, dbType, options);
|
|
13713
13759
|
if (!needsMigration) {
|
|
13714
13760
|
logger.debug("Auto-migration: No migrations needed");
|
|
@@ -13774,12 +13820,12 @@ async function createDatabaseFromConnection(rawConnection, options) {
|
|
|
13774
13820
|
case "sqlite":
|
|
13775
13821
|
if ("aggregate" in rawConnection && !("createSession" in rawConnection)) dialect = new kysely.SqliteDialect({ database: rawConnection });
|
|
13776
13822
|
else if ("fileControl" in rawConnection) {
|
|
13777
|
-
const { BunSqliteDialect } = await Promise.resolve().then(() => require("./bun-sqlite-dialect-
|
|
13823
|
+
const { BunSqliteDialect } = await Promise.resolve().then(() => require("./bun-sqlite-dialect-DxPi9X8H.cjs"));
|
|
13778
13824
|
dialect = new BunSqliteDialect({ database: rawConnection });
|
|
13779
13825
|
} else if ("createSession" in rawConnection && typeof window === "undefined") try {
|
|
13780
13826
|
const { DatabaseSync } = await import("node:sqlite");
|
|
13781
13827
|
if (rawConnection instanceof DatabaseSync) {
|
|
13782
|
-
const { NodeSqliteDialect } = await Promise.resolve().then(() => require("./node-sqlite-dialect-
|
|
13828
|
+
const { NodeSqliteDialect } = await Promise.resolve().then(() => require("./node-sqlite-dialect-Ckt6QTf5.cjs"));
|
|
13783
13829
|
dialect = new NodeSqliteDialect({ database: rawConnection });
|
|
13784
13830
|
}
|
|
13785
13831
|
} catch {}
|
|
@@ -12937,6 +12937,7 @@ const workspaceSettingsSchema = object({
|
|
|
12937
12937
|
const providerConfigsSchema = object({
|
|
12938
12938
|
...baseSchema,
|
|
12939
12939
|
providerId: string$1(),
|
|
12940
|
+
name: string$1().nullable().optional(),
|
|
12940
12941
|
config: record(string$1(), unknown()),
|
|
12941
12942
|
enabled: boolean$1().default(true)
|
|
12942
12943
|
});
|
|
@@ -13237,9 +13238,10 @@ const SCHEMA_METADATA = { tables: {
|
|
|
13237
13238
|
type: "uuid",
|
|
13238
13239
|
primaryKey: true
|
|
13239
13240
|
},
|
|
13240
|
-
providerId: {
|
|
13241
|
+
providerId: { type: "text" },
|
|
13242
|
+
name: {
|
|
13241
13243
|
type: "text",
|
|
13242
|
-
|
|
13244
|
+
nullable: true
|
|
13243
13245
|
},
|
|
13244
13246
|
config: {
|
|
13245
13247
|
type: "jsonb",
|
|
@@ -13678,6 +13680,43 @@ async function getMigrations$1(db, dbType, options) {
|
|
|
13678
13680
|
};
|
|
13679
13681
|
}
|
|
13680
13682
|
/**
|
|
13683
|
+
* Fix legacy constraints that may exist from previous schema versions
|
|
13684
|
+
*/
|
|
13685
|
+
async function fixLegacyConstraints(db, dbType, schema = "public") {
|
|
13686
|
+
if (dbType === "postgres") {
|
|
13687
|
+
logger.info(`Auto-migration: Checking for legacy constraints in schema '${schema}'...`);
|
|
13688
|
+
try {
|
|
13689
|
+
await sql`ALTER TABLE ${sql.ref(schema)}."provider_configs" DROP CONSTRAINT IF EXISTS "provider_configs_providerId_key"`.execute(db);
|
|
13690
|
+
await sql`ALTER TABLE ${sql.ref(schema)}."provider_configs" DROP CONSTRAINT IF EXISTS "provider_configs_providerid_key"`.execute(db);
|
|
13691
|
+
} catch (err) {
|
|
13692
|
+
logger.warn(`Auto-migration: Failed to drop specific legacy constraint: ${err}`);
|
|
13693
|
+
}
|
|
13694
|
+
try {
|
|
13695
|
+
const result = await sql`
|
|
13696
|
+
SELECT conname
|
|
13697
|
+
FROM pg_constraint c
|
|
13698
|
+
JOIN pg_namespace n ON n.oid = c.connamespace
|
|
13699
|
+
JOIN pg_class t ON t.oid = c.conrelid
|
|
13700
|
+
WHERE n.nspname = ${schema}
|
|
13701
|
+
AND t.relname = 'provider_configs'
|
|
13702
|
+
AND c.contype = 'u'
|
|
13703
|
+
AND EXISTS (
|
|
13704
|
+
SELECT 1 FROM pg_attribute a
|
|
13705
|
+
WHERE a.attrelid = c.conrelid
|
|
13706
|
+
AND a.attnum = ANY(c.conkey)
|
|
13707
|
+
AND lower(a.attname) = 'providerid'
|
|
13708
|
+
)
|
|
13709
|
+
`.execute(db);
|
|
13710
|
+
for (const row of result.rows) {
|
|
13711
|
+
logger.info(`Auto-migration: Removing legacy unique constraint '${row.conname}' from provider_configs`);
|
|
13712
|
+
await sql`ALTER TABLE ${sql.ref(schema)}."provider_configs" DROP CONSTRAINT ${sql.ref(row.conname)}`.execute(db);
|
|
13713
|
+
}
|
|
13714
|
+
} catch (err) {
|
|
13715
|
+
logger.warn(`Auto-migration: Failed to cleanup legacy constraints: ${err}`);
|
|
13716
|
+
}
|
|
13717
|
+
}
|
|
13718
|
+
}
|
|
13719
|
+
/**
|
|
13681
13720
|
* Run migrations if needed
|
|
13682
13721
|
* @param db - Kysely database instance
|
|
13683
13722
|
* @param dbType - Database type
|
|
@@ -13685,6 +13724,13 @@ async function getMigrations$1(db, dbType, options) {
|
|
|
13685
13724
|
* @returns true if migrations were run, false otherwise
|
|
13686
13725
|
*/
|
|
13687
13726
|
async function runAutoMigrations(db, dbType, options) {
|
|
13727
|
+
let currentSchema = options?.schema || "public";
|
|
13728
|
+
if (dbType === "postgres" && !options?.schema) currentSchema = await getPostgresSchema(db);
|
|
13729
|
+
try {
|
|
13730
|
+
await fixLegacyConstraints(db, dbType, currentSchema);
|
|
13731
|
+
} catch (error$47) {
|
|
13732
|
+
logger.debug(`Constraint fixup skipped or failed: ${error$47}`);
|
|
13733
|
+
}
|
|
13688
13734
|
const { toBeCreated, toBeAdded, runMigrations, needsMigration } = await getMigrations$1(db, dbType, options);
|
|
13689
13735
|
if (!needsMigration) {
|
|
13690
13736
|
logger.debug("Auto-migration: No migrations needed");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ColumnType, Generated, Kysely, MssqlDialect, MysqlDialect, PostgresDialect, SqliteDialect } from "kysely";
|
|
2
|
-
import * as
|
|
2
|
+
import * as zod495 from "zod";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/db/schema.d.ts
|
|
@@ -72,6 +72,7 @@ declare const workspaceSettingsSchema: z.ZodObject<{
|
|
|
72
72
|
}, z.core.$strip>;
|
|
73
73
|
declare const providerConfigsSchema: z.ZodObject<{
|
|
74
74
|
providerId: z.ZodString;
|
|
75
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
76
|
config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
76
77
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
77
78
|
id: z.ZodString;
|
|
@@ -169,6 +170,7 @@ interface WorkspaceSettingsTable extends BaseTable {
|
|
|
169
170
|
}
|
|
170
171
|
interface ProviderConfigsTable extends BaseTable {
|
|
171
172
|
providerId: string;
|
|
173
|
+
name: string | null;
|
|
172
174
|
config: ColumnType<Record<string, unknown>, string, string>;
|
|
173
175
|
enabled: ColumnType<boolean, boolean | undefined, boolean | undefined>;
|
|
174
176
|
}
|
|
@@ -567,6 +569,7 @@ declare const SCHEMA_METADATA: {
|
|
|
567
569
|
readonly order: 9;
|
|
568
570
|
readonly schema: z.ZodObject<{
|
|
569
571
|
providerId: z.ZodString;
|
|
572
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
570
573
|
config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
571
574
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
572
575
|
id: z.ZodString;
|
|
@@ -580,7 +583,10 @@ declare const SCHEMA_METADATA: {
|
|
|
580
583
|
};
|
|
581
584
|
readonly providerId: {
|
|
582
585
|
readonly type: "text";
|
|
583
|
-
|
|
586
|
+
};
|
|
587
|
+
readonly name: {
|
|
588
|
+
readonly type: "text";
|
|
589
|
+
readonly nullable: true;
|
|
584
590
|
};
|
|
585
591
|
readonly config: {
|
|
586
592
|
readonly type: "jsonb";
|
|
@@ -801,6 +807,7 @@ declare const schemas: {
|
|
|
801
807
|
}, z.core.$strip>;
|
|
802
808
|
readonly provider_configs: z.ZodObject<{
|
|
803
809
|
providerId: z.ZodString;
|
|
810
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
804
811
|
config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
805
812
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
806
813
|
id: z.ZodString;
|
|
@@ -838,29 +845,29 @@ declare const schemas: {
|
|
|
838
845
|
* Validate data against table schema
|
|
839
846
|
* Useful for runtime validation before inserting/updating
|
|
840
847
|
*/
|
|
841
|
-
declare function validateTableData<T extends TableName>(table: T, data: unknown):
|
|
848
|
+
declare function validateTableData<T extends TableName>(table: T, data: unknown): zod495.ZodSafeParseSuccess<{
|
|
842
849
|
slug: string;
|
|
843
850
|
id: string;
|
|
844
851
|
createdAt: Date;
|
|
845
852
|
updatedAt: Date;
|
|
846
853
|
name?: string | undefined;
|
|
847
|
-
}> |
|
|
854
|
+
}> | zod495.ZodSafeParseError<{
|
|
848
855
|
slug: string;
|
|
849
856
|
id: string;
|
|
850
857
|
createdAt: Date;
|
|
851
858
|
updatedAt: Date;
|
|
852
859
|
name?: string | undefined;
|
|
853
|
-
}> |
|
|
860
|
+
}> | zod495.ZodSafeParseSuccess<{
|
|
854
861
|
name: string;
|
|
855
862
|
id: string;
|
|
856
863
|
createdAt: Date;
|
|
857
864
|
updatedAt: Date;
|
|
858
|
-
}> |
|
|
865
|
+
}> | zod495.ZodSafeParseError<{
|
|
859
866
|
name: string;
|
|
860
867
|
id: string;
|
|
861
868
|
createdAt: Date;
|
|
862
869
|
updatedAt: Date;
|
|
863
|
-
}> |
|
|
870
|
+
}> | zod495.ZodSafeParseSuccess<{
|
|
864
871
|
variantId: string;
|
|
865
872
|
version: number;
|
|
866
873
|
provider: string;
|
|
@@ -869,7 +876,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
869
876
|
id: string;
|
|
870
877
|
createdAt: Date;
|
|
871
878
|
updatedAt: Date;
|
|
872
|
-
}> |
|
|
879
|
+
}> | zod495.ZodSafeParseError<{
|
|
873
880
|
variantId: string;
|
|
874
881
|
version: number;
|
|
875
882
|
provider: string;
|
|
@@ -878,33 +885,33 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
878
885
|
id: string;
|
|
879
886
|
createdAt: Date;
|
|
880
887
|
updatedAt: Date;
|
|
881
|
-
}> |
|
|
888
|
+
}> | zod495.ZodSafeParseSuccess<{
|
|
882
889
|
environmentId: string;
|
|
883
890
|
keyName: string;
|
|
884
891
|
keyValue: string;
|
|
885
892
|
id: string;
|
|
886
893
|
createdAt: Date;
|
|
887
894
|
updatedAt: Date;
|
|
888
|
-
}> |
|
|
895
|
+
}> | zod495.ZodSafeParseError<{
|
|
889
896
|
environmentId: string;
|
|
890
897
|
keyName: string;
|
|
891
898
|
keyValue: string;
|
|
892
899
|
id: string;
|
|
893
900
|
createdAt: Date;
|
|
894
901
|
updatedAt: Date;
|
|
895
|
-
}> |
|
|
902
|
+
}> | zod495.ZodSafeParseSuccess<{
|
|
896
903
|
configId: string;
|
|
897
904
|
variantId: string;
|
|
898
905
|
id: string;
|
|
899
906
|
createdAt: Date;
|
|
900
907
|
updatedAt: Date;
|
|
901
|
-
}> |
|
|
908
|
+
}> | zod495.ZodSafeParseError<{
|
|
902
909
|
configId: string;
|
|
903
910
|
variantId: string;
|
|
904
911
|
id: string;
|
|
905
912
|
createdAt: Date;
|
|
906
913
|
updatedAt: Date;
|
|
907
|
-
}> |
|
|
914
|
+
}> | zod495.ZodSafeParseSuccess<{
|
|
908
915
|
environmentId: string;
|
|
909
916
|
configId: string;
|
|
910
917
|
configVariantId: string;
|
|
@@ -916,7 +923,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
916
923
|
createdAt: Date;
|
|
917
924
|
updatedAt: Date;
|
|
918
925
|
variantVersionId?: string | null | undefined;
|
|
919
|
-
}> |
|
|
926
|
+
}> | zod495.ZodSafeParseError<{
|
|
920
927
|
environmentId: string;
|
|
921
928
|
configId: string;
|
|
922
929
|
configVariantId: string;
|
|
@@ -928,35 +935,37 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
928
935
|
createdAt: Date;
|
|
929
936
|
updatedAt: Date;
|
|
930
937
|
variantVersionId?: string | null | undefined;
|
|
931
|
-
}> |
|
|
938
|
+
}> | zod495.ZodSafeParseSuccess<{
|
|
932
939
|
setupComplete: boolean;
|
|
933
940
|
id: string;
|
|
934
941
|
createdAt: Date;
|
|
935
942
|
updatedAt: Date;
|
|
936
943
|
name?: string | null | undefined;
|
|
937
944
|
superAdminId?: string | null | undefined;
|
|
938
|
-
}> |
|
|
945
|
+
}> | zod495.ZodSafeParseError<{
|
|
939
946
|
setupComplete: boolean;
|
|
940
947
|
id: string;
|
|
941
948
|
createdAt: Date;
|
|
942
949
|
updatedAt: Date;
|
|
943
950
|
name?: string | null | undefined;
|
|
944
951
|
superAdminId?: string | null | undefined;
|
|
945
|
-
}> |
|
|
952
|
+
}> | zod495.ZodSafeParseSuccess<{
|
|
946
953
|
providerId: string;
|
|
947
954
|
config: Record<string, unknown>;
|
|
948
955
|
enabled: boolean;
|
|
949
956
|
id: string;
|
|
950
957
|
createdAt: Date;
|
|
951
958
|
updatedAt: Date;
|
|
952
|
-
|
|
959
|
+
name?: string | null | undefined;
|
|
960
|
+
}> | zod495.ZodSafeParseError<{
|
|
953
961
|
providerId: string;
|
|
954
962
|
config: Record<string, unknown>;
|
|
955
963
|
enabled: boolean;
|
|
956
964
|
id: string;
|
|
957
965
|
createdAt: Date;
|
|
958
966
|
updatedAt: Date;
|
|
959
|
-
|
|
967
|
+
name?: string | null | undefined;
|
|
968
|
+
}> | zod495.ZodSafeParseSuccess<{
|
|
960
969
|
requestId: string;
|
|
961
970
|
provider: string;
|
|
962
971
|
model: string;
|
|
@@ -979,7 +988,7 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
979
988
|
variantId?: string | null | undefined;
|
|
980
989
|
environmentId?: string | null | undefined;
|
|
981
990
|
userId?: string | null | undefined;
|
|
982
|
-
}> |
|
|
991
|
+
}> | zod495.ZodSafeParseError<{
|
|
983
992
|
requestId: string;
|
|
984
993
|
provider: string;
|
|
985
994
|
model: string;
|
|
@@ -1006,17 +1015,17 @@ declare function validateTableData<T extends TableName>(table: T, data: unknown)
|
|
|
1006
1015
|
/**
|
|
1007
1016
|
* Validate partial data (for updates)
|
|
1008
1017
|
*/
|
|
1009
|
-
declare function validatePartialTableData<T extends TableName>(table: T, data: unknown):
|
|
1018
|
+
declare function validatePartialTableData<T extends TableName>(table: T, data: unknown): zod495.ZodSafeParseSuccess<{
|
|
1010
1019
|
name?: string | undefined;
|
|
1011
1020
|
id?: string | undefined;
|
|
1012
1021
|
createdAt?: Date | undefined;
|
|
1013
1022
|
updatedAt?: Date | undefined;
|
|
1014
|
-
}> |
|
|
1023
|
+
}> | zod495.ZodSafeParseError<{
|
|
1015
1024
|
name?: string | undefined;
|
|
1016
1025
|
id?: string | undefined;
|
|
1017
1026
|
createdAt?: Date | undefined;
|
|
1018
1027
|
updatedAt?: Date | undefined;
|
|
1019
|
-
}> |
|
|
1028
|
+
}> | zod495.ZodSafeParseSuccess<{
|
|
1020
1029
|
variantId?: string | undefined;
|
|
1021
1030
|
version?: number | undefined;
|
|
1022
1031
|
provider?: string | undefined;
|
|
@@ -1025,7 +1034,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
1025
1034
|
id?: string | undefined;
|
|
1026
1035
|
createdAt?: Date | undefined;
|
|
1027
1036
|
updatedAt?: Date | undefined;
|
|
1028
|
-
}> |
|
|
1037
|
+
}> | zod495.ZodSafeParseError<{
|
|
1029
1038
|
variantId?: string | undefined;
|
|
1030
1039
|
version?: number | undefined;
|
|
1031
1040
|
provider?: string | undefined;
|
|
@@ -1034,33 +1043,33 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
1034
1043
|
id?: string | undefined;
|
|
1035
1044
|
createdAt?: Date | undefined;
|
|
1036
1045
|
updatedAt?: Date | undefined;
|
|
1037
|
-
}> |
|
|
1046
|
+
}> | zod495.ZodSafeParseSuccess<{
|
|
1038
1047
|
environmentId?: string | undefined;
|
|
1039
1048
|
keyName?: string | undefined;
|
|
1040
1049
|
keyValue?: string | undefined;
|
|
1041
1050
|
id?: string | undefined;
|
|
1042
1051
|
createdAt?: Date | undefined;
|
|
1043
1052
|
updatedAt?: Date | undefined;
|
|
1044
|
-
}> |
|
|
1053
|
+
}> | zod495.ZodSafeParseError<{
|
|
1045
1054
|
environmentId?: string | undefined;
|
|
1046
1055
|
keyName?: string | undefined;
|
|
1047
1056
|
keyValue?: string | undefined;
|
|
1048
1057
|
id?: string | undefined;
|
|
1049
1058
|
createdAt?: Date | undefined;
|
|
1050
1059
|
updatedAt?: Date | undefined;
|
|
1051
|
-
}> |
|
|
1060
|
+
}> | zod495.ZodSafeParseSuccess<{
|
|
1052
1061
|
configId?: string | undefined;
|
|
1053
1062
|
variantId?: string | undefined;
|
|
1054
1063
|
id?: string | undefined;
|
|
1055
1064
|
createdAt?: Date | undefined;
|
|
1056
1065
|
updatedAt?: Date | undefined;
|
|
1057
|
-
}> |
|
|
1066
|
+
}> | zod495.ZodSafeParseError<{
|
|
1058
1067
|
configId?: string | undefined;
|
|
1059
1068
|
variantId?: string | undefined;
|
|
1060
1069
|
id?: string | undefined;
|
|
1061
1070
|
createdAt?: Date | undefined;
|
|
1062
1071
|
updatedAt?: Date | undefined;
|
|
1063
|
-
}> |
|
|
1072
|
+
}> | zod495.ZodSafeParseSuccess<{
|
|
1064
1073
|
environmentId?: string | undefined;
|
|
1065
1074
|
configId?: string | undefined;
|
|
1066
1075
|
configVariantId?: string | undefined;
|
|
@@ -1072,7 +1081,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
1072
1081
|
id?: string | undefined;
|
|
1073
1082
|
createdAt?: Date | undefined;
|
|
1074
1083
|
updatedAt?: Date | undefined;
|
|
1075
|
-
}> |
|
|
1084
|
+
}> | zod495.ZodSafeParseError<{
|
|
1076
1085
|
environmentId?: string | undefined;
|
|
1077
1086
|
configId?: string | undefined;
|
|
1078
1087
|
configVariantId?: string | undefined;
|
|
@@ -1084,35 +1093,37 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
1084
1093
|
id?: string | undefined;
|
|
1085
1094
|
createdAt?: Date | undefined;
|
|
1086
1095
|
updatedAt?: Date | undefined;
|
|
1087
|
-
}> |
|
|
1096
|
+
}> | zod495.ZodSafeParseSuccess<{
|
|
1088
1097
|
name?: string | null | undefined;
|
|
1089
1098
|
setupComplete?: boolean | undefined;
|
|
1090
1099
|
superAdminId?: string | null | undefined;
|
|
1091
1100
|
id?: string | undefined;
|
|
1092
1101
|
createdAt?: Date | undefined;
|
|
1093
1102
|
updatedAt?: Date | undefined;
|
|
1094
|
-
}> |
|
|
1103
|
+
}> | zod495.ZodSafeParseError<{
|
|
1095
1104
|
name?: string | null | undefined;
|
|
1096
1105
|
setupComplete?: boolean | undefined;
|
|
1097
1106
|
superAdminId?: string | null | undefined;
|
|
1098
1107
|
id?: string | undefined;
|
|
1099
1108
|
createdAt?: Date | undefined;
|
|
1100
1109
|
updatedAt?: Date | undefined;
|
|
1101
|
-
}> |
|
|
1110
|
+
}> | zod495.ZodSafeParseSuccess<{
|
|
1102
1111
|
providerId?: string | undefined;
|
|
1112
|
+
name?: string | null | undefined;
|
|
1103
1113
|
config?: Record<string, unknown> | undefined;
|
|
1104
1114
|
enabled?: boolean | undefined;
|
|
1105
1115
|
id?: string | undefined;
|
|
1106
1116
|
createdAt?: Date | undefined;
|
|
1107
1117
|
updatedAt?: Date | undefined;
|
|
1108
|
-
}> |
|
|
1118
|
+
}> | zod495.ZodSafeParseError<{
|
|
1109
1119
|
providerId?: string | undefined;
|
|
1120
|
+
name?: string | null | undefined;
|
|
1110
1121
|
config?: Record<string, unknown> | undefined;
|
|
1111
1122
|
enabled?: boolean | undefined;
|
|
1112
1123
|
id?: string | undefined;
|
|
1113
1124
|
createdAt?: Date | undefined;
|
|
1114
1125
|
updatedAt?: Date | undefined;
|
|
1115
|
-
}> |
|
|
1126
|
+
}> | zod495.ZodSafeParseSuccess<{
|
|
1116
1127
|
requestId?: string | undefined;
|
|
1117
1128
|
configId?: string | null | undefined;
|
|
1118
1129
|
variantId?: string | null | undefined;
|
|
@@ -1135,7 +1146,7 @@ declare function validatePartialTableData<T extends TableName>(table: T, data: u
|
|
|
1135
1146
|
id?: string | undefined;
|
|
1136
1147
|
createdAt?: Date | undefined;
|
|
1137
1148
|
updatedAt?: Date | undefined;
|
|
1138
|
-
}> |
|
|
1149
|
+
}> | zod495.ZodSafeParseError<{
|
|
1139
1150
|
requestId?: string | undefined;
|
|
1140
1151
|
configId?: string | null | undefined;
|
|
1141
1152
|
variantId?: string | null | undefined;
|
|
@@ -1221,6 +1232,7 @@ declare function parseTableData<T extends TableName>(table: T, data: unknown): {
|
|
|
1221
1232
|
id: string;
|
|
1222
1233
|
createdAt: Date;
|
|
1223
1234
|
updatedAt: Date;
|
|
1235
|
+
name?: string | null | undefined;
|
|
1224
1236
|
} | {
|
|
1225
1237
|
requestId: string;
|
|
1226
1238
|
provider: string;
|
|
@@ -1296,6 +1308,7 @@ declare function parsePartialTableData<T extends TableName>(table: T, data: unkn
|
|
|
1296
1308
|
updatedAt?: Date | undefined;
|
|
1297
1309
|
} | {
|
|
1298
1310
|
providerId?: string | undefined;
|
|
1311
|
+
name?: string | null | undefined;
|
|
1299
1312
|
config?: Record<string, unknown> | undefined;
|
|
1300
1313
|
enabled?: boolean | undefined;
|
|
1301
1314
|
id?: string | undefined;
|