@llmops/core 0.1.2-beta.1 → 0.1.2-beta.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/index.cjs CHANGED
@@ -439,11 +439,16 @@ const providerEntries = Object.values(SupportedProviders).map((provider) => [pro
439
439
  * All providers are optional, but at least one must be configured
440
440
  */
441
441
  const providersSchema = require_db.object(Object.fromEntries(providerEntries)).refine((providers) => Object.values(providers).some((v) => v !== void 0 && v !== null), "At least one provider must be configured");
442
- const authSchema = require_db.object({
443
- type: require_db.literal("basic"),
444
- defaultUser: require_db.string(),
445
- defaultPassword: require_db.string()
446
- });
442
+ /**
443
+ * Auth configuration schema
444
+ *
445
+ * Uses a flexible schema with passthrough to allow different auth providers.
446
+ * - Open source: basicAuth() from @llmops/sdk (type: 'basic')
447
+ * - Enterprise: enterpriseAuth() from @llmops/enterprise (type: 'better-auth', etc.)
448
+ *
449
+ * The actual auth handling is done by the auth middleware based on the type.
450
+ */
451
+ const authSchema = require_db.object({ type: require_db.string().min(1, "Auth type is required") }).passthrough();
447
452
  const llmopsConfigSchema = require_db.object({
448
453
  database: require_db.any(),
449
454
  auth: authSchema,
package/dist/index.d.cts CHANGED
@@ -393,10 +393,8 @@ type AutoMigrateConfig = boolean | 'development';
393
393
  declare const llmopsConfigSchema: z.ZodObject<{
394
394
  database: z.ZodAny;
395
395
  auth: z.ZodObject<{
396
- type: z.ZodLiteral<"basic">;
397
- defaultUser: z.ZodString;
398
- defaultPassword: z.ZodString;
399
- }, z.core.$strip>;
396
+ type: z.ZodString;
397
+ }, z.core.$loose>;
400
398
  basePath: z.ZodString;
401
399
  providers: z.ZodObject<{
402
400
  openai: z.ZodOptional<z.ZodObject<{
@@ -829,16 +827,33 @@ declare const llmopsConfigSchema: z.ZodObject<{
829
827
  autoMigrate: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"development">]>>>;
830
828
  schema: z.ZodDefault<z.ZodOptional<z.ZodString>>;
831
829
  }, z.core.$strip>;
830
+ /**
831
+ * Base auth configuration interface
832
+ * All auth providers must have at least a type field
833
+ */
834
+ interface AuthConfig {
835
+ readonly type: string;
836
+ [key: string]: unknown;
837
+ }
838
+ /**
839
+ * Basic auth configuration (open source)
840
+ */
841
+ interface BasicAuthConfig extends AuthConfig {
842
+ readonly type: 'basic';
843
+ readonly defaultUser: string;
844
+ readonly defaultPassword: string;
845
+ }
832
846
  /**
833
847
  * Validated LLMOps configuration with typed providers
834
848
  * Uses ProvidersConfig for proper provider-specific typing
835
849
  *
836
850
  * Note: autoMigrate and schema are optional in input but always present after validation
837
851
  */
838
- type ValidatedLLMOpsConfig = Omit<z.infer<typeof llmopsConfigSchema>, 'providers' | 'autoMigrate' | 'schema'> & {
852
+ type ValidatedLLMOpsConfig = Omit<z.infer<typeof llmopsConfigSchema>, 'providers' | 'autoMigrate' | 'schema' | 'auth'> & {
839
853
  providers: ProvidersConfig;
840
854
  autoMigrate?: AutoMigrateConfig;
841
855
  schema: string;
856
+ auth: AuthConfig;
842
857
  };
843
858
  /**
844
859
  * Input type for LLMOps configuration (before validation)
@@ -2085,4 +2100,4 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
2085
2100
  }[]>;
2086
2101
  }>;
2087
2102
  //#endregion
2088
- export { type AnthropicProviderConfig, type AnyProviderConfig, AutoMigrateConfig, type AzureAIProviderConfig, type AzureOpenAIProviderConfig, type BaseProviderConfig, type BedrockProviderConfig, ChatCompletionCreateParamsBase, Config, ConfigVariant, ConfigVariantsTable, ConfigsTable, type CortexProviderConfig, Database, DatabaseConnection, DatabaseOptions, DatabaseType, Environment, EnvironmentSecret, EnvironmentSecretsTable, EnvironmentsTable, type FireworksAIProviderConfig, type GoogleProviderConfig, type HuggingFaceProviderConfig, Insertable, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, MigrationOptions, MigrationResult, type MistralAIProviderConfig, type OpenAIProviderConfig, type OracleProviderConfig, Prettify, type ProviderConfigMap, type ProvidersConfig, SCHEMA_METADATA, type SagemakerProviderConfig, Selectable, type StabilityAIProviderConfig, SupportedProviders, TableName, TargetingRule, TargetingRulesTable, Updateable, type ValidatedLLMOpsConfig, Variant, VariantJsonData, VariantVersion, VariantVersionsTable, VariantsTable, type VertexAIProviderConfig, type WorkersAIProviderConfig, WorkspaceSettings, WorkspaceSettingsTable, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createDataLayer, createDatabase, createDatabaseFromConnection, detectDatabaseType, environmentSecretsSchema, environmentsSchema, gateway, generateId, getMigrations, llmopsConfigSchema, logger, matchType, parsePartialTableData, parseTableData, runAutoMigrations, schemas, targetingRulesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
2103
+ export { type AnthropicProviderConfig, type AnyProviderConfig, type AuthConfig, AutoMigrateConfig, type AzureAIProviderConfig, type AzureOpenAIProviderConfig, type BaseProviderConfig, type BasicAuthConfig, type BedrockProviderConfig, ChatCompletionCreateParamsBase, Config, ConfigVariant, ConfigVariantsTable, ConfigsTable, type CortexProviderConfig, Database, DatabaseConnection, DatabaseOptions, DatabaseType, Environment, EnvironmentSecret, EnvironmentSecretsTable, EnvironmentsTable, type FireworksAIProviderConfig, type GoogleProviderConfig, type HuggingFaceProviderConfig, Insertable, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, MigrationOptions, MigrationResult, type MistralAIProviderConfig, type OpenAIProviderConfig, type OracleProviderConfig, Prettify, type ProviderConfigMap, type ProvidersConfig, SCHEMA_METADATA, type SagemakerProviderConfig, Selectable, type StabilityAIProviderConfig, SupportedProviders, TableName, TargetingRule, TargetingRulesTable, Updateable, type ValidatedLLMOpsConfig, Variant, VariantJsonData, VariantVersion, VariantVersionsTable, VariantsTable, type VertexAIProviderConfig, type WorkersAIProviderConfig, WorkspaceSettings, WorkspaceSettingsTable, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createDataLayer, createDatabase, createDatabaseFromConnection, detectDatabaseType, environmentSecretsSchema, environmentsSchema, gateway, generateId, getMigrations, llmopsConfigSchema, logger, matchType, parsePartialTableData, parseTableData, runAutoMigrations, schemas, targetingRulesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
package/dist/index.d.mts CHANGED
@@ -393,10 +393,8 @@ type AutoMigrateConfig = boolean | 'development';
393
393
  declare const llmopsConfigSchema: z.ZodObject<{
394
394
  database: z.ZodAny;
395
395
  auth: z.ZodObject<{
396
- type: z.ZodLiteral<"basic">;
397
- defaultUser: z.ZodString;
398
- defaultPassword: z.ZodString;
399
- }, z.core.$strip>;
396
+ type: z.ZodString;
397
+ }, z.core.$loose>;
400
398
  basePath: z.ZodString;
401
399
  providers: z.ZodObject<{
402
400
  openai: z.ZodOptional<z.ZodObject<{
@@ -829,16 +827,33 @@ declare const llmopsConfigSchema: z.ZodObject<{
829
827
  autoMigrate: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"development">]>>>;
830
828
  schema: z.ZodDefault<z.ZodOptional<z.ZodString>>;
831
829
  }, z.core.$strip>;
830
+ /**
831
+ * Base auth configuration interface
832
+ * All auth providers must have at least a type field
833
+ */
834
+ interface AuthConfig {
835
+ readonly type: string;
836
+ [key: string]: unknown;
837
+ }
838
+ /**
839
+ * Basic auth configuration (open source)
840
+ */
841
+ interface BasicAuthConfig extends AuthConfig {
842
+ readonly type: 'basic';
843
+ readonly defaultUser: string;
844
+ readonly defaultPassword: string;
845
+ }
832
846
  /**
833
847
  * Validated LLMOps configuration with typed providers
834
848
  * Uses ProvidersConfig for proper provider-specific typing
835
849
  *
836
850
  * Note: autoMigrate and schema are optional in input but always present after validation
837
851
  */
838
- type ValidatedLLMOpsConfig = Omit<z.infer<typeof llmopsConfigSchema>, 'providers' | 'autoMigrate' | 'schema'> & {
852
+ type ValidatedLLMOpsConfig = Omit<z.infer<typeof llmopsConfigSchema>, 'providers' | 'autoMigrate' | 'schema' | 'auth'> & {
839
853
  providers: ProvidersConfig;
840
854
  autoMigrate?: AutoMigrateConfig;
841
855
  schema: string;
856
+ auth: AuthConfig;
842
857
  };
843
858
  /**
844
859
  * Input type for LLMOps configuration (before validation)
@@ -2085,4 +2100,4 @@ declare const createDataLayer: (db: Kysely<Database>) => Promise<{
2085
2100
  }[]>;
2086
2101
  }>;
2087
2102
  //#endregion
2088
- export { type AnthropicProviderConfig, type AnyProviderConfig, AutoMigrateConfig, type AzureAIProviderConfig, type AzureOpenAIProviderConfig, type BaseProviderConfig, type BedrockProviderConfig, ChatCompletionCreateParamsBase, Config, ConfigVariant, type ConfigVariantsTable, type ConfigsTable, type CortexProviderConfig, type Database, DatabaseConnection, DatabaseOptions, DatabaseType, Environment, EnvironmentSecret, type EnvironmentSecretsTable, type EnvironmentsTable, type FireworksAIProviderConfig, type GoogleProviderConfig, type HuggingFaceProviderConfig, Insertable, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, MigrationOptions, MigrationResult, type MistralAIProviderConfig, type OpenAIProviderConfig, type OracleProviderConfig, Prettify, type ProviderConfigMap, type ProvidersConfig, SCHEMA_METADATA, type SagemakerProviderConfig, Selectable, type StabilityAIProviderConfig, SupportedProviders, type TableName, TargetingRule, type TargetingRulesTable, Updateable, type ValidatedLLMOpsConfig, Variant, VariantJsonData, VariantVersion, VariantVersionsTable, type VariantsTable, type VertexAIProviderConfig, type WorkersAIProviderConfig, WorkspaceSettings, WorkspaceSettingsTable, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createDataLayer, createDatabase, createDatabaseFromConnection, detectDatabaseType, environmentSecretsSchema, environmentsSchema, gateway, generateId, getMigrations, llmopsConfigSchema, logger, matchType, parsePartialTableData, parseTableData, runAutoMigrations, schemas, targetingRulesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
2103
+ export { type AnthropicProviderConfig, type AnyProviderConfig, type AuthConfig, AutoMigrateConfig, type AzureAIProviderConfig, type AzureOpenAIProviderConfig, type BaseProviderConfig, type BasicAuthConfig, type BedrockProviderConfig, ChatCompletionCreateParamsBase, Config, ConfigVariant, type ConfigVariantsTable, type ConfigsTable, type CortexProviderConfig, type Database, DatabaseConnection, DatabaseOptions, DatabaseType, Environment, EnvironmentSecret, type EnvironmentSecretsTable, type EnvironmentsTable, type FireworksAIProviderConfig, type GoogleProviderConfig, type HuggingFaceProviderConfig, Insertable, LLMOpsClient, LLMOpsConfig, type LLMOpsConfigInput, MigrationOptions, MigrationResult, type MistralAIProviderConfig, type OpenAIProviderConfig, type OracleProviderConfig, Prettify, type ProviderConfigMap, type ProvidersConfig, SCHEMA_METADATA, type SagemakerProviderConfig, Selectable, type StabilityAIProviderConfig, SupportedProviders, type TableName, TargetingRule, type TargetingRulesTable, Updateable, type ValidatedLLMOpsConfig, Variant, VariantJsonData, VariantVersion, VariantVersionsTable, type VariantsTable, type VertexAIProviderConfig, type WorkersAIProviderConfig, WorkspaceSettings, WorkspaceSettingsTable, chatCompletionCreateParamsBaseSchema, configVariantsSchema, configsSchema, createDataLayer, createDatabase, createDatabaseFromConnection, detectDatabaseType, environmentSecretsSchema, environmentsSchema, gateway, generateId, getMigrations, llmopsConfigSchema, logger, matchType, parsePartialTableData, parseTableData, runAutoMigrations, schemas, targetingRulesSchema, validateLLMOpsConfig, validatePartialTableData, validateTableData, variantJsonDataSchema, variantVersionsSchema, variantsSchema, workspaceSettingsSchema };
package/dist/index.mjs CHANGED
@@ -438,11 +438,16 @@ const providerEntries = Object.values(SupportedProviders).map((provider) => [pro
438
438
  * All providers are optional, but at least one must be configured
439
439
  */
440
440
  const providersSchema = object(Object.fromEntries(providerEntries)).refine((providers) => Object.values(providers).some((v) => v !== void 0 && v !== null), "At least one provider must be configured");
441
- const authSchema = object({
442
- type: literal("basic"),
443
- defaultUser: string(),
444
- defaultPassword: string()
445
- });
441
+ /**
442
+ * Auth configuration schema
443
+ *
444
+ * Uses a flexible schema with passthrough to allow different auth providers.
445
+ * - Open source: basicAuth() from @llmops/sdk (type: 'basic')
446
+ * - Enterprise: enterpriseAuth() from @llmops/enterprise (type: 'better-auth', etc.)
447
+ *
448
+ * The actual auth handling is done by the auth middleware based on the type.
449
+ */
450
+ const authSchema = object({ type: string().min(1, "Auth type is required") }).passthrough();
446
451
  const llmopsConfigSchema = object({
447
452
  database: any(),
448
453
  auth: authSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmops/core",
3
- "version": "0.1.2-beta.1",
3
+ "version": "0.1.2-beta.2",
4
4
  "description": "Core LLMOps functionality and utilities",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -51,7 +51,7 @@
51
51
  "hono": "^4.10.7",
52
52
  "kysely": "^0.28.8",
53
53
  "pino": "^10.1.0",
54
- "@llmops/gateway": "^0.1.2-beta.1"
54
+ "@llmops/gateway": "^0.1.2-beta.2"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "tsdown",