@seedprotocol/sdk 0.4.5 → 0.4.7
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/{ArweaveClient-WcG8CZAE.js → ArweaveClient-BdQaTOZ4.js} +3 -3
- package/dist/{ArweaveClient-WcG8CZAE.js.map → ArweaveClient-BdQaTOZ4.js.map} +1 -1
- package/dist/{ArweaveClient-CgWK-JgT.js → ArweaveClient-nrTU_rhU.js} +3 -3
- package/dist/{ArweaveClient-CgWK-JgT.js.map → ArweaveClient-nrTU_rhU.js.map} +1 -1
- package/dist/{Db-DjofXdeU.js → Db-CWKaeNQH.js} +7 -104
- package/dist/Db-CWKaeNQH.js.map +1 -0
- package/dist/{Db-DjFdIdR9.js → Db-Cq4q88X_.js} +21 -5
- package/dist/Db-Cq4q88X_.js.map +1 -0
- package/dist/{EasClient-Aojewp6P.js → EasClient-Du9_TULE.js} +2 -2
- package/dist/{EasClient-BVFXp2O6.js.map → EasClient-Du9_TULE.js.map} +1 -1
- package/dist/{EasClient-BVFXp2O6.js → EasClient-ZCIE6UQq.js} +2 -2
- package/dist/{EasClient-Aojewp6P.js.map → EasClient-ZCIE6UQq.js.map} +1 -1
- package/dist/{FileManager-C9zr4AJe.js → FileManager-Cub9icdd.js} +4 -3
- package/dist/FileManager-Cub9icdd.js.map +1 -0
- package/dist/{FileManager-CxGJLw5C.js → FileManager-HSFEess-.js} +2 -2
- package/dist/{FileManager-CxGJLw5C.js.map → FileManager-HSFEess-.js.map} +1 -1
- package/dist/Item/Item.d.ts +2 -0
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/service/actors/fetchDataFromEas.d.ts.map +1 -1
- package/dist/Item/service/actors/loadOrCreateItem.d.ts.map +1 -1
- package/dist/Item/service/actors/runPublish.d.ts.map +1 -1
- package/dist/Item/service/itemMachineSingle.d.ts.map +1 -1
- package/dist/ItemProperty/ItemProperty.d.ts.map +1 -1
- package/dist/ItemProperty/service/actors/hydrateFromDb.d.ts.map +1 -1
- package/dist/ItemProperty/service/actors/loadOrCreateProperty.d.ts.map +1 -1
- package/dist/ItemProperty/service/actors/resolveRelatedValue.d.ts.map +1 -1
- package/dist/ItemProperty/service/actors/saveValueToDb/analyzeInput.d.ts.map +1 -1
- package/dist/ItemProperty/service/actors/saveValueToDb/saveRelation.d.ts.map +1 -1
- package/dist/Model/Model.d.ts +5 -0
- package/dist/Model/Model.d.ts.map +1 -1
- package/dist/Model/service/actors/createModelProperties.d.ts.map +1 -1
- package/dist/Model/service/actors/loadOrCreateModel.d.ts.map +1 -1
- package/dist/Model/service/actors/validateModel.d.ts.map +1 -1
- package/dist/ModelProperty/service/actors/compareAndMarkDraft.d.ts.map +1 -1
- package/dist/ModelProperty/service/actors/saveToSchema.d.ts.map +1 -1
- package/dist/ModelProperty/service/actors/validateProperty.d.ts.map +1 -1
- package/dist/{ModelProperty-CGdkocQ8.js → ModelProperty-D4zaeIOT.js} +52 -18
- package/dist/ModelProperty-D4zaeIOT.js.map +1 -0
- package/dist/{PathResolver-z_WX47_o.js → PathResolver-DVLBs_qi.js} +2 -2
- package/dist/{PathResolver-z_WX47_o.js.map → PathResolver-DVLBs_qi.js.map} +1 -1
- package/dist/{PathResolver-CX6GHoTS.js → PathResolver-T1yEDECb.js} +2 -2
- package/dist/{PathResolver-CX6GHoTS.js.map → PathResolver-T1yEDECb.js.map} +1 -1
- package/dist/{QueryClient-Cb1iJO-x.js → QueryClient-DcKDQuwz.js} +2 -2
- package/dist/{QueryClient-Cb1iJO-x.js.map → QueryClient-DcKDQuwz.js.map} +1 -1
- package/dist/{QueryClient-ByKPdRmE.js → QueryClient-Vs9KN5kS.js} +2 -2
- package/dist/{QueryClient-ByKPdRmE.js.map → QueryClient-Vs9KN5kS.js.map} +1 -1
- package/dist/Schema/Schema.d.ts.map +1 -1
- package/dist/Schema/service/actors/createModelInstances.d.ts.map +1 -1
- package/dist/Schema/service/actors/loadOrCreateSchema.d.ts.map +1 -1
- package/dist/Schema/service/actors/verifyModelInstancesInCache.d.ts.map +1 -1
- package/dist/Schema/service/actors/writePropertiesToDb.d.ts.map +1 -1
- package/dist/Schema/service/addModelsMachine.d.ts.map +1 -1
- package/dist/{Schema-D1eqDHyt.js → Schema-SbwqmoMM.js} +63 -24
- package/dist/Schema-SbwqmoMM.js.map +1 -0
- package/dist/{SchemaValidationService-DyttFaV_.js → SchemaValidationService-DHGIw4Nx.js} +2 -2
- package/dist/{SchemaValidationService-DyttFaV_.js.map → SchemaValidationService-DHGIw4Nx.js.map} +1 -1
- package/dist/browser/db/drizzleFiles.d.ts +3 -2
- package/dist/browser/db/drizzleFiles.d.ts.map +1 -1
- package/dist/browser/helpers/FileManager.d.ts.map +1 -1
- package/dist/browser/react/item.d.ts +2 -0
- package/dist/browser/react/item.d.ts.map +1 -1
- package/dist/browser/react/itemProperty.d.ts.map +1 -1
- package/dist/cjs/{ModelProperty-BeJvgKMw.js → ModelProperty-DpjD0o0E.js} +32 -18
- package/dist/cjs/ModelProperty-DpjD0o0E.js.map +1 -0
- package/dist/cjs/{Schema-CVs9J6eP.js → Schema-DkSBMBwz.js} +33 -24
- package/dist/cjs/Schema-DkSBMBwz.js.map +1 -0
- package/dist/cjs/{SchemaValidationService-CDKcVRFQ.js → SchemaValidationService-O3FCMROl.js} +2 -2
- package/dist/cjs/{SchemaValidationService-CDKcVRFQ.js.map → SchemaValidationService-O3FCMROl.js.map} +1 -1
- package/dist/cjs/{getItem-B5RYPvrG.js → getItem-BeAVMk54.js} +2 -2
- package/dist/cjs/{getItem-B5RYPvrG.js.map → getItem-BeAVMk54.js.map} +1 -1
- package/dist/cjs/{getPublishPayload-BD1qRob1.js → getPublishPayload-CoLriAMV.js} +7 -5
- package/dist/cjs/getPublishPayload-CoLriAMV.js.map +1 -0
- package/dist/cjs/{getPublishUploads-CnC9aYxs.js → getPublishUploads-DDsT9zZ6.js} +3 -3
- package/dist/cjs/{getPublishUploads-CnC9aYxs.js.map → getPublishUploads-DDsT9zZ6.js.map} +1 -1
- package/dist/cjs/{getSegmentedItemProperties-B_njnntx.js → getSegmentedItemProperties-DGR0utR5.js} +2 -2
- package/dist/cjs/{getSegmentedItemProperties-B_njnntx.js.map → getSegmentedItemProperties-DGR0utR5.js.map} +1 -1
- package/dist/cjs/{index-BeKPbbk0.js → index-B95Ng80C.js} +629 -241
- package/dist/cjs/index-B95Ng80C.js.map +1 -0
- package/dist/cjs/{index-Dnywap_P.js → index-CvcOtzbi.js} +2 -2
- package/dist/cjs/index-CvcOtzbi.js.map +1 -0
- package/dist/cjs/ownership-Dm5ER1nI.js +103 -0
- package/dist/cjs/ownership-Dm5ER1nI.js.map +1 -0
- package/dist/client/ClientManager.d.ts +54 -43
- package/dist/client/ClientManager.d.ts.map +1 -1
- package/dist/client/actors/platformClassesInit.d.ts.map +1 -1
- package/dist/client/actors/saveConfig.d.ts.map +1 -1
- package/dist/client/clientManagerMachine.d.ts.map +1 -1
- package/dist/db/drizzle/drizzle/0004_add_publisher_to_seeds.sql +1 -0
- package/dist/db/drizzle/drizzle/meta/0004_snapshot.json +857 -0
- package/dist/db/drizzle/drizzle/meta/_journal.json +7 -0
- package/dist/db/read/getItemData.d.ts.map +1 -1
- package/dist/db/read/getItems.d.ts +2 -0
- package/dist/db/read/getItems.d.ts.map +1 -1
- package/dist/db/read/getModelSchemas.d.ts.map +1 -1
- package/dist/db/read/getPublishPayload.d.ts.map +1 -1
- package/dist/db/write/createNewItem.d.ts.map +1 -1
- package/dist/eas.d.ts.map +1 -1
- package/dist/events/files/download.d.ts.map +1 -1
- package/dist/events/item/syncDbWithEas.d.ts.map +1 -1
- package/dist/{getItem-BB5HBCbK.js → getItem-CqrJt-Ee.js} +2 -2
- package/dist/{getItem-BB5HBCbK.js.map → getItem-CqrJt-Ee.js.map} +1 -1
- package/dist/{getPublishPayload-uLm0AqN_.js → getPublishPayload-BRgULCf3.js} +7 -5
- package/dist/getPublishPayload-BRgULCf3.js.map +1 -0
- package/dist/{getPublishUploads-Dc-HqhO8.js → getPublishUploads-B0WArDfp.js} +3 -3
- package/dist/{getPublishUploads-Dc-HqhO8.js.map → getPublishUploads-B0WArDfp.js.map} +1 -1
- package/dist/{getSegmentedItemProperties-BrIqFNfD.js → getSegmentedItemProperties-DZL9Ymd4.js} +2 -2
- package/dist/{getSegmentedItemProperties-BrIqFNfD.js.map → getSegmentedItemProperties-DZL9Ymd4.js.map} +1 -1
- package/dist/helpers/addresses.d.ts +12 -0
- package/dist/helpers/addresses.d.ts.map +1 -0
- package/dist/helpers/db.d.ts +11 -0
- package/dist/helpers/db.d.ts.map +1 -1
- package/dist/helpers/ownership.d.ts +16 -0
- package/dist/helpers/ownership.d.ts.map +1 -0
- package/dist/helpers/property.d.ts.map +1 -1
- package/dist/helpers/updateSchema.d.ts.map +1 -1
- package/dist/imports/json.d.ts.map +1 -1
- package/dist/{index-2FcQHgKp.js → index-BIPPEMVY.js} +2 -2
- package/dist/index-BIPPEMVY.js.map +1 -0
- package/dist/{index-LEY0Og1p.js → index-BnF3MRZ8.js} +3 -3
- package/dist/index-BnF3MRZ8.js.map +1 -0
- package/dist/{index-DPll6EAp.js → index-zsq08F5p.js} +644 -154
- package/dist/index-zsq08F5p.js.map +1 -0
- package/dist/main.cjs +1 -1
- package/dist/main.js +20 -14
- package/dist/main.js.map +1 -1
- package/dist/node/db/Db.d.ts.map +1 -1
- package/dist/node.js +10 -10
- package/dist/ownership-CSsweVap.js +85 -0
- package/dist/ownership-CSsweVap.js.map +1 -0
- package/dist/{property-B15X7jLX.js → property-Cqh_o0zx.js} +10 -4
- package/dist/property-Cqh_o0zx.js.map +1 -0
- package/dist/{queries-BPDSpiEX.js → queries-DSBgjcJJ.js} +2 -2
- package/dist/{queries-BPDSpiEX.js.map → queries-DSBgjcJJ.js.map} +1 -1
- package/dist/seedSchema/ModelSchemaSchema.d.ts +1 -1
- package/dist/seedSchema/ModelSchemaSchema.ts +4 -4
- package/dist/seedSchema/ModelUidSchema.ts +1 -1
- package/dist/seedSchema/PropertyUidSchema.ts +1 -1
- package/dist/seedSchema/SeedSchema.d.ts +19 -0
- package/dist/seedSchema/SeedSchema.d.ts.map +1 -1
- package/dist/seedSchema/SeedSchema.ts +1 -0
- package/dist/seedSchema/index.d.ts +10 -10
- package/dist/seedSchema/index.d.ts.map +1 -1
- package/dist/seedSchema/index.ts +10 -10
- package/dist/services/publish/actors/preparePublishRequestData.d.ts.map +1 -1
- package/dist/services/publish/actors/upload.d.ts.map +1 -1
- package/dist/services/write/actors/validateEntity.d.ts.map +1 -1
- package/dist/types/index.d.ts +11 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/item.d.ts +1 -0
- package/dist/types/item.d.ts.map +1 -1
- package/dist/types/machines.d.ts +2 -0
- package/dist/types/machines.d.ts.map +1 -1
- package/package.json +4 -11
- package/dist/Db-DjFdIdR9.js.map +0 -1
- package/dist/Db-DjofXdeU.js.map +0 -1
- package/dist/FileManager-C9zr4AJe.js.map +0 -1
- package/dist/ModelProperty-CGdkocQ8.js.map +0 -1
- package/dist/Schema-D1eqDHyt.js.map +0 -1
- package/dist/cjs/ModelProperty-BeJvgKMw.js.map +0 -1
- package/dist/cjs/Schema-CVs9J6eP.js.map +0 -1
- package/dist/cjs/getPublishPayload-BD1qRob1.js.map +0 -1
- package/dist/cjs/index-BeKPbbk0.js.map +0 -1
- package/dist/cjs/index-Dnywap_P.js.map +0 -1
- package/dist/getPublishPayload-uLm0AqN_.js.map +0 -1
- package/dist/index-2FcQHgKp.js.map +0 -1
- package/dist/index-DPll6EAp.js.map +0 -1
- package/dist/index-LEY0Og1p.js.map +0 -1
- package/dist/property-B15X7jLX.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Value } from '@sinclair/typebox/value';
|
|
2
2
|
import 'reflect-metadata';
|
|
3
|
-
import { a as ModelPropertyDataTypes, T as TPropertyDataType, c as TProperty } from './index-
|
|
3
|
+
import { a as ModelPropertyDataTypes, T as TPropertyDataType, c as TProperty } from './index-zsq08F5p.js';
|
|
4
4
|
import 'pluralize';
|
|
5
5
|
import 'drizzle-orm';
|
|
6
6
|
import { Type } from '@sinclair/typebox';
|
|
@@ -560,4 +560,4 @@ class SchemaValidationService {
|
|
|
560
560
|
}
|
|
561
561
|
|
|
562
562
|
export { SchemaValidationService };
|
|
563
|
-
//# sourceMappingURL=SchemaValidationService-
|
|
563
|
+
//# sourceMappingURL=SchemaValidationService-DHGIw4Nx.js.map
|
package/dist/{SchemaValidationService-DyttFaV_.js.map → SchemaValidationService-DHGIw4Nx.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaValidationService-DyttFaV_.js","sources":["../src/Schema/service/validation/SchemaValidationService.ts"],"sourcesContent":["import { Value } from '@sinclair/typebox/value'\nimport { TProperty } from '@/Schema'\nimport { ModelPropertyDataTypes, TPropertyDataType } from '@/helpers/property'\nimport { ValidationResult, ValidationError, ValidationRules } from '@/Schema/validation'\nimport { SchemaMachineContext } from '../schemaMachine'\nimport { ModelPropertyMachineContext } from '@/ModelProperty/service/modelPropertyMachine'\nimport { ModelMachineContext } from '@/Model/service/modelMachine'\nimport { Type, TSchema, TUnion, TLiteral } from '@sinclair/typebox'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:schema:validation')\n\n/**\n * Service for validating schemas, models, and properties using TypeBox\n */\nexport class SchemaValidationService {\n /**\n * Enhance TypeBox error message with expected values for union/literal types\n */\n private enhanceErrorMessage(\n error: any,\n schema: TSchema,\n fieldPath: string\n ): string {\n const originalMessage = error.message || 'Validation failed'\n \n // Handle Union type errors (like TPropertyDataType)\n if (error.type === 'Union' || originalMessage.includes('union')) {\n const expectedValues = this.extractExpectedValues(schema, fieldPath)\n if (expectedValues.length > 0) {\n return `Expected one of: ${expectedValues.join(', ')}. Received: ${JSON.stringify(error.value)}`\n }\n }\n \n // Handle Literal type errors\n if (error.type === 'Literal') {\n const expectedValue = this.extractLiteralValue(schema, fieldPath)\n if (expectedValue !== undefined) {\n return `Expected: ${JSON.stringify(expectedValue)}. Received: ${JSON.stringify(error.value)}`\n }\n }\n \n // Return enhanced message with value info if available\n if (error.value !== undefined) {\n return `${originalMessage}. Received: ${JSON.stringify(error.value)}`\n }\n \n return originalMessage\n }\n\n /**\n * Extract expected values from a schema for a given field path\n */\n private extractExpectedValues(schema: TSchema | null, fieldPath: string): string[] {\n try {\n // Handle TProperty schema - check if this is the dataType field\n if (fieldPath === '/dataType' || fieldPath.endsWith('/dataType')) {\n // Return all ModelPropertyDataTypes enum values\n return Object.values(ModelPropertyDataTypes) as string[]\n }\n \n // Handle TStorageType\n if (fieldPath === '/storageType' || fieldPath.endsWith('/storageType')) {\n return ['ItemStorage', 'PropertyStorage']\n }\n \n // If we have a schema, try to extract from it\n if (!schema) {\n return []\n }\n \n // Try to extract from TypeBox Union type using the schema directly\n const schemaObj = schema as any\n const kind = schemaObj[Symbol.for('TypeBox.Kind')]\n \n if (kind === 'Union') {\n const union = schemaObj as TUnion<any>\n const anyOf = union.anyOf || []\n const values: string[] = []\n \n for (const item of anyOf) {\n const itemKind = item?.[Symbol.for('TypeBox.Kind')]\n if (itemKind === 'Literal') {\n const literal = item as TLiteral<any>\n if (literal.const !== undefined) {\n values.push(String(literal.const))\n }\n }\n }\n \n if (values.length > 0) {\n return values\n }\n }\n \n // Fallback: try to extract from JSON schema format\n if (typeof schema === 'object' && 'anyOf' in schema) {\n const union = schema as any\n if (Array.isArray(union.anyOf)) {\n return union.anyOf\n .map((item: any) => {\n if (item.const !== undefined) return String(item.const)\n if (item.enum && Array.isArray(item.enum)) return item.enum.map(String)\n return null\n })\n .filter((val: any) => val !== null)\n .flat()\n .map(String)\n }\n }\n } catch (error) {\n logger('Error extracting expected values:', error)\n }\n \n return []\n }\n\n /**\n * Extract literal value from a schema\n */\n private extractLiteralValue(schema: TSchema, fieldPath: string): any {\n try {\n if (schema && typeof schema === 'object') {\n const schemaObj = schema as any\n if (schemaObj[Symbol.for('TypeBox.Kind')] === 'Literal') {\n return (schemaObj as TLiteral<any>).const\n }\n if (schemaObj.const !== undefined) {\n return schemaObj.const\n }\n }\n } catch (error) {\n logger('Error extracting literal value:', error)\n }\n \n return undefined\n }\n\n /**\n * Get the schema for a specific field path\n */\n private getSchemaForField(schema: TSchema, fieldPath: string): TSchema | null {\n try {\n if (!schema || typeof schema !== 'object') return null\n \n // Remove leading slash\n const path = fieldPath.replace(/^\\//, '')\n if (!path) return schema\n \n const schemaObj = schema as any\n const kind = schemaObj[Symbol.for('TypeBox.Kind')]\n \n // For TProperty (Object type), check properties\n if (kind === 'Object') {\n const properties = schemaObj.properties\n if (properties && properties[path]) {\n return properties[path]\n }\n }\n \n // Special handling for known fields - return the actual schema\n if (path === 'dataType') {\n return TPropertyDataType as TSchema\n }\n \n // Fallback: check if schema has the property\n if (path in schemaObj) {\n return schemaObj[path]\n }\n } catch (error) {\n logger('Error getting schema for field:', error)\n }\n \n return null\n }\n\n /**\n * Validate a property structure against TProperty schema\n */\n validatePropertyStructure(\n property: ModelPropertyMachineContext\n ): ValidationResult {\n try {\n const isValid = Value.Check(TProperty, property)\n \n const errors: ValidationError[] = []\n \n if (!isValid) {\n const typeBoxErrors = [...Value.Errors(TProperty, property)]\n errors.push(...typeBoxErrors.map(err => {\n const fieldPath = err.path || 'unknown'\n const fieldSchema = this.getSchemaForField(TProperty, fieldPath)\n const enhancedMessage = this.enhanceErrorMessage(err, fieldSchema || TProperty, fieldPath)\n \n return {\n field: fieldPath,\n message: enhancedMessage,\n code: String(err.type || 'validation_error'),\n severity: 'error' as const,\n }\n }))\n }\n \n // Validate that Relation and List properties have a ref defined\n if (property.dataType === ModelPropertyDataTypes.Relation || property.dataType === ModelPropertyDataTypes.List) {\n const hasRef = property.ref && property.ref.trim() !== ''\n const hasRefModelName = property.refModelName && property.refModelName.trim() !== ''\n const hasRefModelId = property.refModelId !== undefined && property.refModelId !== null\n \n if (!hasRef && !hasRefModelName && !hasRefModelId) {\n errors.push({\n field: 'ref',\n message: `Property with dataType \"${property.dataType}\" requires either a \"ref\", \"refModelName\", or \"refModelId\" field to be defined`,\n code: 'missing_ref',\n severity: 'error' as const,\n })\n }\n \n // For Relation type, prefer having refModelId when ref/refModelName is provided\n // This is a warning, not an error, as refModelId can be resolved asynchronously\n if (property.dataType === ModelPropertyDataTypes.Relation && (hasRef || hasRefModelName) && !hasRefModelId) {\n // This is acceptable - refModelId will be resolved asynchronously\n // We don't add an error here, just log for debugging\n logger(`Property \"${property.name}\" has ref/refModelName but no refModelId - will be resolved asynchronously`)\n }\n }\n \n return {\n isValid: errors.length === 0,\n errors,\n }\n } catch (error) {\n logger('Error validating property structure:', error)\n return {\n isValid: false,\n errors: [{\n field: 'property',\n message: error instanceof Error ? error.message : 'Unknown validation error',\n code: 'validation_exception',\n severity: 'error' as const,\n }],\n }\n }\n }\n\n /**\n * Validate a property value against its validation rules\n */\n validatePropertyValue(\n value: any,\n dataType: ModelPropertyDataTypes,\n validationRules?: ValidationRules\n ): ValidationResult {\n const errors: ValidationError[] = []\n const warnings: ValidationError[] = []\n\n try {\n // Build base TypeBox schema from dataType\n let schema: TSchema = this.getBaseSchemaForDataType(dataType)\n\n // Apply validation rules\n if (validationRules) {\n schema = this.applyValidationRules(schema, dataType, validationRules)\n }\n\n // Validate using TypeBox\n const isValid = Value.Check(schema, value)\n \n if (!isValid) {\n const typeBoxErrors = [...Value.Errors(schema, value)]\n errors.push(...typeBoxErrors.map(err => {\n const fieldPath = err.path || 'value'\n const enhancedMessage = this.enhanceErrorMessage(err, schema, fieldPath)\n \n return {\n field: fieldPath,\n message: enhancedMessage,\n code: String(err.type || 'value_validation_error'),\n severity: 'error' as const,\n }\n }))\n }\n\n // Additional custom validations\n if (validationRules) {\n const customErrors = this.validateCustomRules(value, validationRules)\n errors.push(...customErrors)\n }\n\n return {\n isValid: errors.length === 0,\n errors,\n warnings: warnings.length > 0 ? warnings : undefined,\n }\n } catch (error) {\n logger('Error validating property value:', error)\n return {\n isValid: false,\n errors: [{\n field: 'value',\n message: error instanceof Error ? error.message : 'Unknown validation error',\n code: 'validation_exception',\n severity: 'error' as const,\n }],\n }\n }\n }\n\n /**\n * Validate a specific property within a schema\n */\n validateProperty(\n schema: SchemaMachineContext,\n modelName: string,\n propertyName: string,\n propertyData?: ModelPropertyMachineContext\n ): ValidationResult {\n const errors: ValidationError[] = []\n\n // Check if model exists\n if (!schema.models || !schema.models[modelName]) {\n errors.push({\n field: 'model',\n message: `Model \"${modelName}\" not found in schema`,\n code: 'model_not_found',\n severity: 'error' as const,\n })\n return { isValid: false, errors }\n }\n\n const model = schema.models[modelName]\n\n // Check if property exists in model\n // If the property name has changed (renamed), check if the original name exists\n let propertyDefinition = model.properties?.[propertyName]\n let actualPropertyName = propertyName\n \n if (!propertyDefinition && propertyData?._originalValues?.name) {\n const originalName = propertyData._originalValues.name\n // If the current name differs from the original, check if original exists\n if (originalName !== propertyName && model.properties?.[originalName]) {\n propertyDefinition = model.properties[originalName]\n actualPropertyName = originalName\n // Property is being renamed, which is allowed - continue validation\n }\n }\n \n if (!propertyDefinition) {\n errors.push({\n field: 'property',\n message: `Property \"${propertyName}\" not found in model \"${modelName}\"`,\n code: 'property_not_found',\n severity: 'error' as const,\n })\n return { isValid: false, errors }\n }\n\n // If propertyData is provided, validate its structure\n if (propertyData) {\n const structureResult = this.validatePropertyStructure(propertyData)\n errors.push(...structureResult.errors)\n }\n\n // Validate property definition structure\n if (!propertyDefinition.type) {\n errors.push({\n field: 'property.type',\n message: 'Property type is required',\n code: 'missing_type',\n severity: 'error' as const,\n })\n }\n\n // Validate Relation and List properties have a ref/model defined\n if (propertyDefinition.type === 'Relation' || propertyDefinition.type === 'List') {\n if (!propertyDefinition.model || propertyDefinition.model.trim() === '') {\n errors.push({\n field: 'property.model',\n message: `Property with type \"${propertyDefinition.type}\" requires a \"model\" field to be defined`,\n code: 'missing_ref',\n severity: 'error' as const,\n })\n } else if (!schema.models[propertyDefinition.model]) {\n errors.push({\n field: 'property.model',\n message: `Referenced model \"${propertyDefinition.model}\" not found in schema`,\n code: 'invalid_reference',\n severity: 'error' as const,\n })\n }\n }\n\n return {\n isValid: errors.length === 0,\n errors,\n }\n }\n\n /**\n * Validate model structure (basic structure checks)\n */\n validateModelStructure(\n model: ModelMachineContext & { properties?: { [key: string]: any } }\n ): ValidationResult {\n const errors: ValidationError[] = []\n\n // Validate model name\n if (!model.modelName || model.modelName.trim() === '') {\n errors.push({\n field: 'modelName',\n message: 'Model name is required',\n code: 'missing_model_name',\n severity: 'error' as const,\n })\n }\n\n // Validate schema name\n if (!model.schemaName || model.schemaName.trim() === '') {\n errors.push({\n field: 'schemaName',\n message: 'Schema name is required',\n code: 'missing_schema_name',\n severity: 'error' as const,\n })\n }\n\n // Validate properties is an object\n if (model.properties && typeof model.properties !== 'object') {\n errors.push({\n field: 'properties',\n message: 'Properties must be an object',\n code: 'invalid_properties',\n severity: 'error' as const,\n })\n }\n\n return {\n isValid: errors.length === 0,\n errors,\n }\n }\n\n /**\n * Validate a model against a schema WITHOUT requiring it to be in the schema's context\n * This allows validation before registration, preventing update loops\n */\n validateModelAgainstSchema(\n schema: SchemaMachineContext,\n modelName: string,\n modelData: ModelMachineContext & { properties?: { [key: string]: any } }\n ): ValidationResult {\n const errors: ValidationError[] = []\n\n // Create a temporary schema context that includes this model for validation purposes\n // This allows validateProperty to work without actually adding the model to the real schema\n const tempSchemaContext: SchemaMachineContext = {\n ...schema,\n models: {\n ...schema.models,\n [modelName]: {\n properties: modelData.properties || {},\n },\n },\n }\n\n // Use validateModel which now works because the model is in the temp context\n return this.validateModel(tempSchemaContext, modelName, modelData)\n }\n\n /**\n * Validate a model within a schema (requires model to already be in schema context)\n */\n validateModel(\n schema: SchemaMachineContext,\n modelName: string,\n modelData?: ModelMachineContext\n ): ValidationResult {\n const errors: ValidationError[] = []\n\n if (!schema.models || !schema.models[modelName]) {\n errors.push({\n field: 'model',\n message: `Model \"${modelName}\" not found in schema`,\n code: 'model_not_found',\n severity: 'error' as const,\n })\n return { isValid: false, errors }\n }\n\n const model = schema.models[modelName]\n\n // Validate all properties in the model\n if (model.properties) {\n for (const [propertyName, propertyDef] of Object.entries(model.properties)) {\n const propertyResult = this.validateProperty(schema, modelName, propertyName)\n if (!propertyResult.isValid) {\n errors.push(...propertyResult.errors.map(err => ({\n ...err,\n field: `${modelName}.${propertyName}.${err.field}`,\n })))\n }\n }\n }\n\n return {\n isValid: errors.length === 0,\n errors,\n }\n }\n\n /**\n * Validate entire schema\n */\n validateSchema(schema: SchemaMachineContext): ValidationResult {\n const errors: ValidationError[] = []\n\n // Validate schema name\n if (!schema.schemaName || schema.schemaName.trim() === '') {\n errors.push({\n field: 'schemaName',\n message: 'Schema name is required',\n code: 'missing_schema_name',\n severity: 'error' as const,\n })\n }\n\n // Validate metadata\n if (!schema.metadata) {\n errors.push({\n field: 'metadata',\n message: 'Schema metadata is required',\n code: 'missing_metadata',\n severity: 'error' as const,\n })\n } else {\n if (!schema.metadata.name || schema.metadata.name.trim() === '') {\n errors.push({\n field: 'metadata.name',\n message: 'Schema metadata name is required',\n code: 'missing_metadata_name',\n severity: 'error' as const,\n })\n }\n }\n\n // Validate models if they exist\n if (schema.models && Object.keys(schema.models).length > 0) {\n // Validate each model\n for (const modelName of Object.keys(schema.models)) {\n const modelResult = this.validateModel(schema, modelName)\n if (!modelResult.isValid) {\n errors.push(...modelResult.errors)\n }\n }\n }\n\n return {\n isValid: errors.length === 0,\n errors,\n }\n }\n\n /**\n * Get base TypeBox schema for a data type\n */\n private getBaseSchemaForDataType(dataType: ModelPropertyDataTypes): TSchema {\n switch (dataType) {\n case ModelPropertyDataTypes.Text:\n case ModelPropertyDataTypes.Html:\n return Type.String()\n case ModelPropertyDataTypes.Number:\n return Type.Number()\n case ModelPropertyDataTypes.Boolean:\n return Type.Boolean()\n case ModelPropertyDataTypes.Date:\n return Type.String({ format: 'date-time' })\n case ModelPropertyDataTypes.Json:\n return Type.Any()\n case ModelPropertyDataTypes.List:\n return Type.Array(Type.Any())\n case ModelPropertyDataTypes.Relation:\n case ModelPropertyDataTypes.Image:\n case ModelPropertyDataTypes.File:\n return Type.Union([Type.String(), Type.Null()])\n default:\n return Type.Any()\n }\n }\n\n /**\n * Apply validation rules to a TypeBox schema\n */\n private applyValidationRules(\n schema: TSchema,\n dataType: ModelPropertyDataTypes,\n rules: ValidationRules\n ): TSchema {\n let result = schema\n\n // Apply pattern (regex) for strings\n if (rules.pattern && (dataType === ModelPropertyDataTypes.Text || dataType === ModelPropertyDataTypes.Html)) {\n try {\n const regex = new RegExp(rules.pattern)\n result = Type.RegExp(regex)\n } catch (error) {\n logger('Invalid regex pattern:', rules.pattern, error)\n }\n }\n\n // Apply minLength/maxLength for strings\n if (dataType === ModelPropertyDataTypes.Text || dataType === ModelPropertyDataTypes.Html) {\n const stringSchema = Type.String()\n if (rules.minLength !== undefined) {\n result = Type.String({ minLength: rules.minLength })\n }\n if (rules.maxLength !== undefined) {\n if (rules.minLength !== undefined) {\n result = Type.String({ minLength: rules.minLength, maxLength: rules.maxLength })\n } else {\n result = Type.String({ maxLength: rules.maxLength })\n }\n }\n }\n\n // Apply enum\n if (rules.enum && Array.isArray(rules.enum) && rules.enum.length > 0) {\n result = Type.Union(rules.enum.map(val => Type.Literal(val)))\n }\n\n return result\n }\n\n /**\n * Validate custom validation rules\n */\n private validateCustomRules(\n value: any,\n rules: ValidationRules\n ): ValidationError[] {\n const errors: ValidationError[] = []\n\n // Custom validator reference (would need to be implemented based on your needs)\n if (rules.custom) {\n // TODO: Implement custom validator lookup and execution\n logger('Custom validator not yet implemented:', rules.custom)\n }\n\n return errors\n }\n}\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAUA,MAAM,MAAM,GAAG,KAAK,CAAC,2BAA2B,CAAC;AAEjD;;AAEG;MACU,uBAAuB,CAAA;AAClC;;AAEG;AACK,IAAA,mBAAmB,CACzB,KAAU,EACV,MAAe,EACf,SAAiB,EAAA;AAEjB,QAAA,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,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AE;;AAEhB,YAAA,MAAM,CAAC,uCAAuC,EAAE,KAAK,CAAC,MAAM,CAAC;QAC/D;AAEA,QAAA,OAAO,MAAM;IACf;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"SchemaValidationService-DHGIw4Nx.js","sources":["../src/Schema/service/validation/SchemaValidationService.ts"],"sourcesContent":["import { Value } from '@sinclair/typebox/value'\nimport { TProperty } from '@/Schema'\nimport { ModelPropertyDataTypes, TPropertyDataType } from '@/helpers/property'\nimport { ValidationResult, ValidationError, ValidationRules } from '@/Schema/validation'\nimport { SchemaMachineContext } from '../schemaMachine'\nimport { ModelPropertyMachineContext } from '@/ModelProperty/service/modelPropertyMachine'\nimport { ModelMachineContext } from '@/Model/service/modelMachine'\nimport { Type, TSchema, TUnion, TLiteral } from '@sinclair/typebox'\nimport debug from 'debug'\n\nconst logger = debug('seedSdk:schema:validation')\n\n/**\n * Service for validating schemas, models, and properties using TypeBox\n */\nexport class SchemaValidationService {\n /**\n * Enhance TypeBox error message with expected values for union/literal types\n */\n private enhanceErrorMessage(\n error: any,\n schema: TSchema,\n fieldPath: string\n ): string {\n const originalMessage = error.message || 'Validation failed'\n \n // Handle Union type errors (like TPropertyDataType)\n if (error.type === 'Union' || originalMessage.includes('union')) {\n const expectedValues = this.extractExpectedValues(schema, fieldPath)\n if (expectedValues.length > 0) {\n return `Expected one of: ${expectedValues.join(', ')}. Received: ${JSON.stringify(error.value)}`\n }\n }\n \n // Handle Literal type errors\n if (error.type === 'Literal') {\n const expectedValue = this.extractLiteralValue(schema, fieldPath)\n if (expectedValue !== undefined) {\n return `Expected: ${JSON.stringify(expectedValue)}. Received: ${JSON.stringify(error.value)}`\n }\n }\n \n // Return enhanced message with value info if available\n if (error.value !== undefined) {\n return `${originalMessage}. Received: ${JSON.stringify(error.value)}`\n }\n \n return originalMessage\n }\n\n /**\n * Extract expected values from a schema for a given field path\n */\n private extractExpectedValues(schema: TSchema | null, fieldPath: string): string[] {\n try {\n // Handle TProperty schema - check if this is the dataType field\n if (fieldPath === '/dataType' || fieldPath.endsWith('/dataType')) {\n // Return all ModelPropertyDataTypes enum values\n return Object.values(ModelPropertyDataTypes) as string[]\n }\n \n // Handle TStorageType\n if (fieldPath === '/storageType' || fieldPath.endsWith('/storageType')) {\n return ['ItemStorage', 'PropertyStorage']\n }\n \n // If we have a schema, try to extract from it\n if (!schema) {\n return []\n }\n \n // Try to extract from TypeBox Union type using the schema directly\n const schemaObj = schema as any\n const kind = schemaObj[Symbol.for('TypeBox.Kind')]\n \n if (kind === 'Union') {\n const union = schemaObj as TUnion<any>\n const anyOf = union.anyOf || []\n const values: string[] = []\n \n for (const item of anyOf) {\n const itemKind = item?.[Symbol.for('TypeBox.Kind')]\n if (itemKind === 'Literal') {\n const literal = item as TLiteral<any>\n if (literal.const !== undefined) {\n values.push(String(literal.const))\n }\n }\n }\n \n if (values.length > 0) {\n return values\n }\n }\n \n // Fallback: try to extract from JSON schema format\n if (typeof schema === 'object' && 'anyOf' in schema) {\n const union = schema as any\n if (Array.isArray(union.anyOf)) {\n return union.anyOf\n .map((item: any) => {\n if (item.const !== undefined) return String(item.const)\n if (item.enum && Array.isArray(item.enum)) return item.enum.map(String)\n return null\n })\n .filter((val: any) => val !== null)\n .flat()\n .map(String)\n }\n }\n } catch (error) {\n logger('Error extracting expected values:', error)\n }\n \n return []\n }\n\n /**\n * Extract literal value from a schema\n */\n private extractLiteralValue(schema: TSchema, fieldPath: string): any {\n try {\n if (schema && typeof schema === 'object') {\n const schemaObj = schema as any\n if (schemaObj[Symbol.for('TypeBox.Kind')] === 'Literal') {\n return (schemaObj as TLiteral<any>).const\n }\n if (schemaObj.const !== undefined) {\n return schemaObj.const\n }\n }\n } catch (error) {\n logger('Error extracting literal value:', error)\n }\n \n return undefined\n }\n\n /**\n * Get the schema for a specific field path\n */\n private getSchemaForField(schema: TSchema, fieldPath: string): TSchema | null {\n try {\n if (!schema || typeof schema !== 'object') return null\n \n // Remove leading slash\n const path = fieldPath.replace(/^\\//, '')\n if (!path) return schema\n \n const schemaObj = schema as any\n const kind = schemaObj[Symbol.for('TypeBox.Kind')]\n \n // For TProperty (Object type), check properties\n if (kind === 'Object') {\n const properties = schemaObj.properties\n if (properties && properties[path]) {\n return properties[path]\n }\n }\n \n // Special handling for known fields - return the actual schema\n if (path === 'dataType') {\n return TPropertyDataType as TSchema\n }\n \n // Fallback: check if schema has the property\n if (path in schemaObj) {\n return schemaObj[path]\n }\n } catch (error) {\n logger('Error getting schema for field:', error)\n }\n \n return null\n }\n\n /**\n * Validate a property structure against TProperty schema\n */\n validatePropertyStructure(\n property: ModelPropertyMachineContext\n ): ValidationResult {\n try {\n const isValid = Value.Check(TProperty, property)\n \n const errors: ValidationError[] = []\n \n if (!isValid) {\n const typeBoxErrors = [...Value.Errors(TProperty, property)]\n errors.push(...typeBoxErrors.map(err => {\n const fieldPath = err.path || 'unknown'\n const fieldSchema = this.getSchemaForField(TProperty, fieldPath)\n const enhancedMessage = this.enhanceErrorMessage(err, fieldSchema || TProperty, fieldPath)\n \n return {\n field: fieldPath,\n message: enhancedMessage,\n code: String(err.type || 'validation_error'),\n severity: 'error' as const,\n }\n }))\n }\n \n // Validate that Relation and List properties have a ref defined\n if (property.dataType === ModelPropertyDataTypes.Relation || property.dataType === ModelPropertyDataTypes.List) {\n const hasRef = property.ref && property.ref.trim() !== ''\n const hasRefModelName = property.refModelName && property.refModelName.trim() !== ''\n const hasRefModelId = property.refModelId !== undefined && property.refModelId !== null\n \n if (!hasRef && !hasRefModelName && !hasRefModelId) {\n errors.push({\n field: 'ref',\n message: `Property with dataType \"${property.dataType}\" requires either a \"ref\", \"refModelName\", or \"refModelId\" field to be defined`,\n code: 'missing_ref',\n severity: 'error' as const,\n })\n }\n \n // For Relation type, prefer having refModelId when ref/refModelName is provided\n // This is a warning, not an error, as refModelId can be resolved asynchronously\n if (property.dataType === ModelPropertyDataTypes.Relation && (hasRef || hasRefModelName) && !hasRefModelId) {\n // This is acceptable - refModelId will be resolved asynchronously\n // We don't add an error here, just log for debugging\n logger(`Property \"${property.name}\" has ref/refModelName but no refModelId - will be resolved asynchronously`)\n }\n }\n \n return {\n isValid: errors.length === 0,\n errors,\n }\n } catch (error) {\n logger('Error validating property structure:', error)\n return {\n isValid: false,\n errors: [{\n field: 'property',\n message: error instanceof Error ? error.message : 'Unknown validation error',\n code: 'validation_exception',\n severity: 'error' as const,\n }],\n }\n }\n }\n\n /**\n * Validate a property value against its validation rules\n */\n validatePropertyValue(\n value: any,\n dataType: ModelPropertyDataTypes,\n validationRules?: ValidationRules\n ): ValidationResult {\n const errors: ValidationError[] = []\n const warnings: ValidationError[] = []\n\n try {\n // Build base TypeBox schema from dataType\n let schema: TSchema = this.getBaseSchemaForDataType(dataType)\n\n // Apply validation rules\n if (validationRules) {\n schema = this.applyValidationRules(schema, dataType, validationRules)\n }\n\n // Validate using TypeBox\n const isValid = Value.Check(schema, value)\n \n if (!isValid) {\n const typeBoxErrors = [...Value.Errors(schema, value)]\n errors.push(...typeBoxErrors.map(err => {\n const fieldPath = err.path || 'value'\n const enhancedMessage = this.enhanceErrorMessage(err, schema, fieldPath)\n \n return {\n field: fieldPath,\n message: enhancedMessage,\n code: String(err.type || 'value_validation_error'),\n severity: 'error' as const,\n }\n }))\n }\n\n // Additional custom validations\n if (validationRules) {\n const customErrors = this.validateCustomRules(value, validationRules)\n errors.push(...customErrors)\n }\n\n return {\n isValid: errors.length === 0,\n errors,\n warnings: warnings.length > 0 ? warnings : undefined,\n }\n } catch (error) {\n logger('Error validating property value:', error)\n return {\n isValid: false,\n errors: [{\n field: 'value',\n message: error instanceof Error ? error.message : 'Unknown validation error',\n code: 'validation_exception',\n severity: 'error' as const,\n }],\n }\n }\n }\n\n /**\n * Validate a specific property within a schema\n */\n validateProperty(\n schema: SchemaMachineContext,\n modelName: string,\n propertyName: string,\n propertyData?: ModelPropertyMachineContext\n ): ValidationResult {\n const errors: ValidationError[] = []\n\n // Check if model exists\n if (!schema.models || !schema.models[modelName]) {\n errors.push({\n field: 'model',\n message: `Model \"${modelName}\" not found in schema`,\n code: 'model_not_found',\n severity: 'error' as const,\n })\n return { isValid: false, errors }\n }\n\n const model = schema.models[modelName]\n\n // Check if property exists in model\n // If the property name has changed (renamed), check if the original name exists\n let propertyDefinition = model.properties?.[propertyName]\n let actualPropertyName = propertyName\n \n if (!propertyDefinition && propertyData?._originalValues?.name) {\n const originalName = propertyData._originalValues.name\n // If the current name differs from the original, check if original exists\n if (originalName !== propertyName && model.properties?.[originalName]) {\n propertyDefinition = model.properties[originalName]\n actualPropertyName = originalName\n // Property is being renamed, which is allowed - continue validation\n }\n }\n \n if (!propertyDefinition) {\n errors.push({\n field: 'property',\n message: `Property \"${propertyName}\" not found in model \"${modelName}\"`,\n code: 'property_not_found',\n severity: 'error' as const,\n })\n return { isValid: false, errors }\n }\n\n // If propertyData is provided, validate its structure\n if (propertyData) {\n const structureResult = this.validatePropertyStructure(propertyData)\n errors.push(...structureResult.errors)\n }\n\n // Validate property definition structure\n if (!propertyDefinition.type) {\n errors.push({\n field: 'property.type',\n message: 'Property type is required',\n code: 'missing_type',\n severity: 'error' as const,\n })\n }\n\n // Validate Relation and List properties have a ref/model defined\n if (propertyDefinition.type === 'Relation' || propertyDefinition.type === 'List') {\n if (!propertyDefinition.model || propertyDefinition.model.trim() === '') {\n errors.push({\n field: 'property.model',\n message: `Property with type \"${propertyDefinition.type}\" requires a \"model\" field to be defined`,\n code: 'missing_ref',\n severity: 'error' as const,\n })\n } else if (!schema.models[propertyDefinition.model]) {\n errors.push({\n field: 'property.model',\n message: `Referenced model \"${propertyDefinition.model}\" not found in schema`,\n code: 'invalid_reference',\n severity: 'error' as const,\n })\n }\n }\n\n return {\n isValid: errors.length === 0,\n errors,\n }\n }\n\n /**\n * Validate model structure (basic structure checks)\n */\n validateModelStructure(\n model: ModelMachineContext & { properties?: { [key: string]: any } }\n ): ValidationResult {\n const errors: ValidationError[] = []\n\n // Validate model name\n if (!model.modelName || model.modelName.trim() === '') {\n errors.push({\n field: 'modelName',\n message: 'Model name is required',\n code: 'missing_model_name',\n severity: 'error' as const,\n })\n }\n\n // Validate schema name\n if (!model.schemaName || model.schemaName.trim() === '') {\n errors.push({\n field: 'schemaName',\n message: 'Schema name is required',\n code: 'missing_schema_name',\n severity: 'error' as const,\n })\n }\n\n // Validate properties is an object\n if (model.properties && typeof model.properties !== 'object') {\n errors.push({\n field: 'properties',\n message: 'Properties must be an object',\n code: 'invalid_properties',\n severity: 'error' as const,\n })\n }\n\n return {\n isValid: errors.length === 0,\n errors,\n }\n }\n\n /**\n * Validate a model against a schema WITHOUT requiring it to be in the schema's context\n * This allows validation before registration, preventing update loops\n */\n validateModelAgainstSchema(\n schema: SchemaMachineContext,\n modelName: string,\n modelData: ModelMachineContext & { properties?: { [key: string]: any } }\n ): ValidationResult {\n const errors: ValidationError[] = []\n\n // Create a temporary schema context that includes this model for validation purposes\n // This allows validateProperty to work without actually adding the model to the real schema\n const tempSchemaContext: SchemaMachineContext = {\n ...schema,\n models: {\n ...schema.models,\n [modelName]: {\n properties: modelData.properties || {},\n },\n },\n }\n\n // Use validateModel which now works because the model is in the temp context\n return this.validateModel(tempSchemaContext, modelName, modelData)\n }\n\n /**\n * Validate a model within a schema (requires model to already be in schema context)\n */\n validateModel(\n schema: SchemaMachineContext,\n modelName: string,\n modelData?: ModelMachineContext\n ): ValidationResult {\n const errors: ValidationError[] = []\n\n if (!schema.models || !schema.models[modelName]) {\n errors.push({\n field: 'model',\n message: `Model \"${modelName}\" not found in schema`,\n code: 'model_not_found',\n severity: 'error' as const,\n })\n return { isValid: false, errors }\n }\n\n const model = schema.models[modelName]\n\n // Validate all properties in the model\n if (model.properties) {\n for (const [propertyName, propertyDef] of Object.entries(model.properties)) {\n const propertyResult = this.validateProperty(schema, modelName, propertyName)\n if (!propertyResult.isValid) {\n errors.push(...propertyResult.errors.map(err => ({\n ...err,\n field: `${modelName}.${propertyName}.${err.field}`,\n })))\n }\n }\n }\n\n return {\n isValid: errors.length === 0,\n errors,\n }\n }\n\n /**\n * Validate entire schema\n */\n validateSchema(schema: SchemaMachineContext): ValidationResult {\n const errors: ValidationError[] = []\n\n // Validate schema name\n if (!schema.schemaName || schema.schemaName.trim() === '') {\n errors.push({\n field: 'schemaName',\n message: 'Schema name is required',\n code: 'missing_schema_name',\n severity: 'error' as const,\n })\n }\n\n // Validate metadata\n if (!schema.metadata) {\n errors.push({\n field: 'metadata',\n message: 'Schema metadata is required',\n code: 'missing_metadata',\n severity: 'error' as const,\n })\n } else {\n if (!schema.metadata.name || schema.metadata.name.trim() === '') {\n errors.push({\n field: 'metadata.name',\n message: 'Schema metadata name is required',\n code: 'missing_metadata_name',\n severity: 'error' as const,\n })\n }\n }\n\n // Validate models if they exist\n if (schema.models && Object.keys(schema.models).length > 0) {\n // Validate each model\n for (const modelName of Object.keys(schema.models)) {\n const modelResult = this.validateModel(schema, modelName)\n if (!modelResult.isValid) {\n errors.push(...modelResult.errors)\n }\n }\n }\n\n return {\n isValid: errors.length === 0,\n errors,\n }\n }\n\n /**\n * Get base TypeBox schema for a data type\n */\n private getBaseSchemaForDataType(dataType: ModelPropertyDataTypes): TSchema {\n switch (dataType) {\n case ModelPropertyDataTypes.Text:\n case ModelPropertyDataTypes.Html:\n return Type.String()\n case ModelPropertyDataTypes.Number:\n return Type.Number()\n case ModelPropertyDataTypes.Boolean:\n return Type.Boolean()\n case ModelPropertyDataTypes.Date:\n return Type.String({ format: 'date-time' })\n case ModelPropertyDataTypes.Json:\n return Type.Any()\n case ModelPropertyDataTypes.List:\n return Type.Array(Type.Any())\n case ModelPropertyDataTypes.Relation:\n case ModelPropertyDataTypes.Image:\n case ModelPropertyDataTypes.File:\n return Type.Union([Type.String(), Type.Null()])\n default:\n return Type.Any()\n }\n }\n\n /**\n * Apply validation rules to a TypeBox schema\n */\n private applyValidationRules(\n schema: TSchema,\n dataType: ModelPropertyDataTypes,\n rules: ValidationRules\n ): TSchema {\n let result = schema\n\n // Apply pattern (regex) for strings\n if (rules.pattern && (dataType === ModelPropertyDataTypes.Text || dataType === ModelPropertyDataTypes.Html)) {\n try {\n const regex = new RegExp(rules.pattern)\n result = Type.RegExp(regex)\n } catch (error) {\n logger('Invalid regex pattern:', rules.pattern, error)\n }\n }\n\n // Apply minLength/maxLength for strings\n if (dataType === ModelPropertyDataTypes.Text || dataType === ModelPropertyDataTypes.Html) {\n const stringSchema = Type.String()\n if (rules.minLength !== undefined) {\n result = Type.String({ minLength: rules.minLength })\n }\n if (rules.maxLength !== undefined) {\n if (rules.minLength !== undefined) {\n result = Type.String({ minLength: rules.minLength, maxLength: rules.maxLength })\n } else {\n result = Type.String({ maxLength: rules.maxLength })\n }\n }\n }\n\n // Apply enum\n if (rules.enum && Array.isArray(rules.enum) && rules.enum.length > 0) {\n result = Type.Union(rules.enum.map(val => Type.Literal(val)))\n }\n\n return result\n }\n\n /**\n * Validate custom validation rules\n */\n private validateCustomRules(\n value: any,\n rules: ValidationRules\n ): ValidationError[] {\n const errors: ValidationError[] = []\n\n // Custom validator reference (would need to be implemented based on your needs)\n if (rules.custom) {\n // TODO: Implement custom validator lookup and execution\n logger('Custom validator not yet implemented:', rules.custom)\n }\n\n return errors\n }\n}\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAUA,MAAM,MAAM,GAAG,KAAK,CAAC,2BAA2B,CAAC;AAEjD;;AAEG;MACU,uBAAuB,CAAA;AAClC;;AAEG;AACK,IAAA,mBAAmB,CACzB,KAAU,EACV,MAAe,EACf,SAAiB,EAAA;AAEjB,QAAA,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,IAAI,mBAAmB;;AAG5D,QAAA,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,IAAI,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YAC/D,MAAM,cAAc,GAAG,IAAI,CAAC,qBAAqB,CAAC,MAAM,EAAE,SAAS,CAAC;AACpE,YAAA,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;AAC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,CAAC,MAAM;AAChC,YAAA,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,EAAE;AACjC,gBAAA,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;YACtD;AACA,YAAA,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,EAAE;AACjC,gBAAA,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,EAAE;AACjC,oBAAA,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;gBAClF;qBAAO;AACL,oBAAA,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;gBACtD;YACF;QACF;;QAGA,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YACpE,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;QAC/D;AAEA,QAAA,OAAO,MAAM;IACf;AAEA;;AAEG;IACK,mBAAmB,CACzB,KAAU,EACV,KAAsB,EAAA;QAEtB,MAAM,MAAM,GAAsB,EAAE;;AAGpC,QAAA,IAAI,KAAK,CAAC,MAAM,EAAE;;AAEhB,YAAA,MAAM,CAAC,uCAAuC,EAAE,KAAK,CAAC,MAAM,CAAC;QAC/D;AAEA,QAAA,OAAO,MAAM;IACf;AACD;;;;"}
|
|
@@ -2,6 +2,7 @@ export declare const migrationSql_0000_married_malice = "CREATE TABLE `appState`
|
|
|
2
2
|
export declare const migrationSql_0001_sweet_bruce_banner = "ALTER TABLE `schemas` ADD `schema_data` text;--> statement-breakpoint\nALTER TABLE `schemas` ADD `is_draft` integer;";
|
|
3
3
|
export declare const migrationSql_0002_bitter_proudstar = "CREATE UNIQUE INDEX `unique_schema_file_id` ON `models` (`schema_file_id`);--> statement-breakpoint\nCREATE UNIQUE INDEX `unique_property_schema_file_id` ON `properties` (`schema_file_id`);--> statement-breakpoint\nCREATE UNIQUE INDEX `unique_schema_schema_file_id` ON `schemas` (`schema_file_id`);";
|
|
4
4
|
export declare const migrationSql_0003_cultured_senator_kelly = "ALTER TABLE `models` ADD `is_edited` integer;--> statement-breakpoint\nALTER TABLE `properties` ADD `is_edited` integer;--> statement-breakpoint\nALTER TABLE `schemas` ADD `is_edited` integer;";
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const snapshotJson = "{\n \"version\": \"6\",\n \"dialect\": \"sqlite\",\n \"id\": \"0e6a6a99-2eb1-4b1d-815b-3d45dcae04a1\",\n \"prevId\": \"49b9a020-1b1c-4107-85ee-a5f8a958f1a2\",\n \"tables\": {\n \"appState\": {\n \"name\": \"appState\",\n \"columns\": {\n \"key\": {\n \"name\": \"key\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"value\": {\n \"name\": \"value\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"created_at\": {\n \"name\": \"created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"updated_at\": {\n \"name\": \"updated_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"appState_key_unique\": {\n \"name\": \"appState_key_unique\",\n \"columns\": [\n \"key\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {},\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"config\": {\n \"name\": \"config\",\n \"columns\": {\n \"id\": {\n \"name\": \"id\",\n \"type\": \"integer\",\n \"primaryKey\": true,\n \"notNull\": true,\n \"autoincrement\": true\n },\n \"key\": {\n \"name\": \"key\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"text\": {\n \"name\": \"text\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"json\": {\n \"name\": \"json\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"blob\": {\n \"name\": \"blob\",\n \"type\": \"blob\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {},\n \"foreignKeys\": {},\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"metadata\": {\n \"name\": \"metadata\",\n \"columns\": {\n \"local_id\": {\n \"name\": \"local_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"uid\": {\n \"name\": \"uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"property_name\": {\n \"name\": \"property_name\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"property_value\": {\n \"name\": \"property_value\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"schema_uid\": {\n \"name\": \"schema_uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"model_type\": {\n \"name\": \"model_type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"seed_local_id\": {\n \"name\": \"seed_local_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"seed_uid\": {\n \"name\": \"seed_uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"version_local_id\": {\n \"name\": \"version_local_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"version_uid\": {\n \"name\": \"version_uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"eas_data_type\": {\n \"name\": \"eas_data_type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"ref_value_type\": {\n \"name\": \"ref_value_type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"ref_schema_uid\": {\n \"name\": \"ref_schema_uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"ref_seed_type\": {\n \"name\": \"ref_seed_type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"ref_resolved_value\": {\n \"name\": \"ref_resolved_value\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"ref_resolved_display_value\": {\n \"name\": \"ref_resolved_display_value\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"local_storage_dir\": {\n \"name\": \"local_storage_dir\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"attestation_raw\": {\n \"name\": \"attestation_raw\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"attestation_created_at\": {\n \"name\": \"attestation_created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"content_hash\": {\n \"name\": \"content_hash\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"created_at\": {\n \"name\": \"created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"updated_at\": {\n \"name\": \"updated_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"metadata_local_id_unique\": {\n \"name\": \"metadata_local_id_unique\",\n \"columns\": [\n \"local_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {},\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"models\": {\n \"name\": \"models\",\n \"columns\": {\n \"id\": {\n \"name\": \"id\",\n \"type\": \"integer\",\n \"primaryKey\": true,\n \"notNull\": true,\n \"autoincrement\": true\n },\n \"name\": {\n \"name\": \"name\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"schema_file_id\": {\n \"name\": \"schema_file_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"is_edited\": {\n \"name\": \"is_edited\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"unique_schema_file_id\": {\n \"name\": \"unique_schema_file_id\",\n \"columns\": [\n \"schema_file_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {},\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"properties\": {\n \"name\": \"properties\",\n \"columns\": {\n \"id\": {\n \"name\": \"id\",\n \"type\": \"integer\",\n \"primaryKey\": true,\n \"notNull\": true,\n \"autoincrement\": true\n },\n \"name\": {\n \"name\": \"name\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"data_type\": {\n \"name\": \"data_type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"model_id\": {\n \"name\": \"model_id\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"ref_model_id\": {\n \"name\": \"ref_model_id\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"ref_value_type\": {\n \"name\": \"ref_value_type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"schema_file_id\": {\n \"name\": \"schema_file_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"is_edited\": {\n \"name\": \"is_edited\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"unique_name_model_id\": {\n \"name\": \"unique_name_model_id\",\n \"columns\": [\n \"name\",\n \"model_id\"\n ],\n \"isUnique\": true\n },\n \"unique_property_schema_file_id\": {\n \"name\": \"unique_property_schema_file_id\",\n \"columns\": [\n \"schema_file_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {\n \"properties_model_id_models_id_fk\": {\n \"name\": \"properties_model_id_models_id_fk\",\n \"tableFrom\": \"properties\",\n \"tableTo\": \"models\",\n \"columnsFrom\": [\n \"model_id\"\n ],\n \"columnsTo\": [\n \"id\"\n ],\n \"onDelete\": \"no action\",\n \"onUpdate\": \"no action\"\n },\n \"properties_ref_model_id_models_id_fk\": {\n \"name\": \"properties_ref_model_id_models_id_fk\",\n \"tableFrom\": \"properties\",\n \"tableTo\": \"models\",\n \"columnsFrom\": [\n \"ref_model_id\"\n ],\n \"columnsTo\": [\n \"id\"\n ],\n \"onDelete\": \"no action\",\n \"onUpdate\": \"no action\"\n }\n },\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"model_schemas\": {\n \"name\": \"model_schemas\",\n \"columns\": {\n \"id\": {\n \"name\": \"id\",\n \"type\": \"integer\",\n \"primaryKey\": true,\n \"notNull\": true,\n \"autoincrement\": true\n },\n \"model_id\": {\n \"name\": \"model_id\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"schema_id\": {\n \"name\": \"schema_id\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {},\n \"foreignKeys\": {\n \"model_schemas_model_id_models_id_fk\": {\n \"name\": \"model_schemas_model_id_models_id_fk\",\n \"tableFrom\": \"model_schemas\",\n \"tableTo\": \"models\",\n \"columnsFrom\": [\n \"model_id\"\n ],\n \"columnsTo\": [\n \"id\"\n ],\n \"onDelete\": \"no action\",\n \"onUpdate\": \"no action\"\n },\n \"model_schemas_schema_id_schemas_id_fk\": {\n \"name\": \"model_schemas_schema_id_schemas_id_fk\",\n \"tableFrom\": \"model_schemas\",\n \"tableTo\": \"schemas\",\n \"columnsFrom\": [\n \"schema_id\"\n ],\n \"columnsTo\": [\n \"id\"\n ],\n \"onDelete\": \"no action\",\n \"onUpdate\": \"no action\"\n }\n },\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"model_uids\": {\n \"name\": \"model_uids\",\n \"columns\": {\n \"id\": {\n \"name\": \"id\",\n \"type\": \"integer\",\n \"primaryKey\": true,\n \"notNull\": true,\n \"autoincrement\": true\n },\n \"uid\": {\n \"name\": \"uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"model_id\": {\n \"name\": \"model_id\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"model_uids_model_id_unique\": {\n \"name\": \"model_uids_model_id_unique\",\n \"columns\": [\n \"model_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {\n \"model_uids_model_id_models_id_fk\": {\n \"name\": \"model_uids_model_id_models_id_fk\",\n \"tableFrom\": \"model_uids\",\n \"tableTo\": \"models\",\n \"columnsFrom\": [\n \"model_id\"\n ],\n \"columnsTo\": [\n \"id\"\n ],\n \"onDelete\": \"no action\",\n \"onUpdate\": \"no action\"\n }\n },\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"property_uids\": {\n \"name\": \"property_uids\",\n \"columns\": {\n \"id\": {\n \"name\": \"id\",\n \"type\": \"integer\",\n \"primaryKey\": true,\n \"notNull\": true,\n \"autoincrement\": true\n },\n \"uid\": {\n \"name\": \"uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"property_id\": {\n \"name\": \"property_id\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"property_uids_property_id_unique\": {\n \"name\": \"property_uids_property_id_unique\",\n \"columns\": [\n \"property_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {\n \"property_uids_property_id_models_id_fk\": {\n \"name\": \"property_uids_property_id_models_id_fk\",\n \"tableFrom\": \"property_uids\",\n \"tableTo\": \"models\",\n \"columnsFrom\": [\n \"property_id\"\n ],\n \"columnsTo\": [\n \"id\"\n ],\n \"onDelete\": \"no action\",\n \"onUpdate\": \"no action\"\n }\n },\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"schemas\": {\n \"name\": \"schemas\",\n \"columns\": {\n \"id\": {\n \"name\": \"id\",\n \"type\": \"integer\",\n \"primaryKey\": true,\n \"notNull\": true,\n \"autoincrement\": true\n },\n \"name\": {\n \"name\": \"name\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"version\": {\n \"name\": \"version\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"schema_file_id\": {\n \"name\": \"schema_file_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"schema_data\": {\n \"name\": \"schema_data\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"is_draft\": {\n \"name\": \"is_draft\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"is_edited\": {\n \"name\": \"is_edited\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"created_at\": {\n \"name\": \"created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"updated_at\": {\n \"name\": \"updated_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"unique_schema_schema_file_id\": {\n \"name\": \"unique_schema_schema_file_id\",\n \"columns\": [\n \"schema_file_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {},\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"seeds\": {\n \"name\": \"seeds\",\n \"columns\": {\n \"local_id\": {\n \"name\": \"local_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"uid\": {\n \"name\": \"uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"schema_uid\": {\n \"name\": \"schema_uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"type\": {\n \"name\": \"type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"attestation_raw\": {\n \"name\": \"attestation_raw\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"attestation_created_at\": {\n \"name\": \"attestation_created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"created_at\": {\n \"name\": \"created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"updated_at\": {\n \"name\": \"updated_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"_marked_for_deletion\": {\n \"name\": \"_marked_for_deletion\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"seeds_local_id_unique\": {\n \"name\": \"seeds_local_id_unique\",\n \"columns\": [\n \"local_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {},\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"versions\": {\n \"name\": \"versions\",\n \"columns\": {\n \"local_id\": {\n \"name\": \"local_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"uid\": {\n \"name\": \"uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"seed_local_id\": {\n \"name\": \"seed_local_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"seed_uid\": {\n \"name\": \"seed_uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"seed_type\": {\n \"name\": \"seed_type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"note\": {\n \"name\": \"note\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"created_at\": {\n \"name\": \"created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"updated_at\": {\n \"name\": \"updated_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"attestation_created_at\": {\n \"name\": \"attestation_created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"attestation_raw\": {\n \"name\": \"attestation_raw\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"versions_local_id_unique\": {\n \"name\": \"versions_local_id_unique\",\n \"columns\": [\n \"local_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {},\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n }\n },\n \"views\": {},\n \"enums\": {},\n \"_meta\": {\n \"schemas\": {},\n \"tables\": {},\n \"columns\": {}\n },\n \"internal\": {\n \"indexes\": {}\n }\n}";
|
|
5
|
+
export declare const migrationSql_0004_add_publisher_to_seeds = "ALTER TABLE `seeds` ADD `publisher` text;";
|
|
6
|
+
export declare const journalJson = "{\n \"version\": \"7\",\n \"dialect\": \"sqlite\",\n \"entries\": [\n {\n \"idx\": 0,\n \"version\": \"6\",\n \"when\": 1765976502903,\n \"tag\": \"0000_married_malice\",\n \"breakpoints\": true\n },\n {\n \"idx\": 1,\n \"version\": \"6\",\n \"when\": 1766010851770,\n \"tag\": \"0001_sweet_bruce_banner\",\n \"breakpoints\": true\n },\n {\n \"idx\": 2,\n \"version\": \"6\",\n \"when\": 1767621120087,\n \"tag\": \"0002_bitter_proudstar\",\n \"breakpoints\": true\n },\n {\n \"idx\": 3,\n \"version\": \"6\",\n \"when\": 1768415440282,\n \"tag\": \"0003_cultured_senator_kelly\",\n \"breakpoints\": true\n },\n {\n \"idx\": 4,\n \"version\": \"6\",\n \"when\": 1768500000000,\n \"tag\": \"0004_add_publisher_to_seeds\",\n \"breakpoints\": true\n }\n ]\n}";
|
|
7
|
+
export declare const snapshotJson = "{\n \"version\": \"6\",\n \"dialect\": \"sqlite\",\n \"id\": \"6450cc9b-cbee-45c0-92ff-794e832eb2ea\",\n \"prevId\": \"0e6a6a99-2eb1-4b1d-815b-3d45dcae04a1\",\n \"tables\": {\n \"appState\": {\n \"name\": \"appState\",\n \"columns\": {\n \"key\": {\n \"name\": \"key\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"value\": {\n \"name\": \"value\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"created_at\": {\n \"name\": \"created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"updated_at\": {\n \"name\": \"updated_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"appState_key_unique\": {\n \"name\": \"appState_key_unique\",\n \"columns\": [\n \"key\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {},\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"config\": {\n \"name\": \"config\",\n \"columns\": {\n \"id\": {\n \"name\": \"id\",\n \"type\": \"integer\",\n \"primaryKey\": true,\n \"notNull\": true,\n \"autoincrement\": true\n },\n \"key\": {\n \"name\": \"key\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"text\": {\n \"name\": \"text\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"json\": {\n \"name\": \"json\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"blob\": {\n \"name\": \"blob\",\n \"type\": \"blob\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {},\n \"foreignKeys\": {},\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"metadata\": {\n \"name\": \"metadata\",\n \"columns\": {\n \"local_id\": {\n \"name\": \"local_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"uid\": {\n \"name\": \"uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"property_name\": {\n \"name\": \"property_name\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"property_value\": {\n \"name\": \"property_value\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"schema_uid\": {\n \"name\": \"schema_uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"model_type\": {\n \"name\": \"model_type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"seed_local_id\": {\n \"name\": \"seed_local_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"seed_uid\": {\n \"name\": \"seed_uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"version_local_id\": {\n \"name\": \"version_local_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"version_uid\": {\n \"name\": \"version_uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"eas_data_type\": {\n \"name\": \"eas_data_type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"ref_value_type\": {\n \"name\": \"ref_value_type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"ref_schema_uid\": {\n \"name\": \"ref_schema_uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"ref_seed_type\": {\n \"name\": \"ref_seed_type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"ref_resolved_value\": {\n \"name\": \"ref_resolved_value\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"ref_resolved_display_value\": {\n \"name\": \"ref_resolved_display_value\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"local_storage_dir\": {\n \"name\": \"local_storage_dir\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"attestation_raw\": {\n \"name\": \"attestation_raw\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"attestation_created_at\": {\n \"name\": \"attestation_created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"content_hash\": {\n \"name\": \"content_hash\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"created_at\": {\n \"name\": \"created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"updated_at\": {\n \"name\": \"updated_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"metadata_local_id_unique\": {\n \"name\": \"metadata_local_id_unique\",\n \"columns\": [\n \"local_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {},\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"models\": {\n \"name\": \"models\",\n \"columns\": {\n \"id\": {\n \"name\": \"id\",\n \"type\": \"integer\",\n \"primaryKey\": true,\n \"notNull\": true,\n \"autoincrement\": true\n },\n \"name\": {\n \"name\": \"name\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"schema_file_id\": {\n \"name\": \"schema_file_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"is_edited\": {\n \"name\": \"is_edited\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"unique_schema_file_id\": {\n \"name\": \"unique_schema_file_id\",\n \"columns\": [\n \"schema_file_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {},\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"properties\": {\n \"name\": \"properties\",\n \"columns\": {\n \"id\": {\n \"name\": \"id\",\n \"type\": \"integer\",\n \"primaryKey\": true,\n \"notNull\": true,\n \"autoincrement\": true\n },\n \"name\": {\n \"name\": \"name\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"data_type\": {\n \"name\": \"data_type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"model_id\": {\n \"name\": \"model_id\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"ref_model_id\": {\n \"name\": \"ref_model_id\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"ref_value_type\": {\n \"name\": \"ref_value_type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"schema_file_id\": {\n \"name\": \"schema_file_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"is_edited\": {\n \"name\": \"is_edited\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"unique_name_model_id\": {\n \"name\": \"unique_name_model_id\",\n \"columns\": [\n \"name\",\n \"model_id\"\n ],\n \"isUnique\": true\n },\n \"unique_property_schema_file_id\": {\n \"name\": \"unique_property_schema_file_id\",\n \"columns\": [\n \"schema_file_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {\n \"properties_model_id_models_id_fk\": {\n \"name\": \"properties_model_id_models_id_fk\",\n \"tableFrom\": \"properties\",\n \"tableTo\": \"models\",\n \"columnsFrom\": [\n \"model_id\"\n ],\n \"columnsTo\": [\n \"id\"\n ],\n \"onDelete\": \"no action\",\n \"onUpdate\": \"no action\"\n },\n \"properties_ref_model_id_models_id_fk\": {\n \"name\": \"properties_ref_model_id_models_id_fk\",\n \"tableFrom\": \"properties\",\n \"tableTo\": \"models\",\n \"columnsFrom\": [\n \"ref_model_id\"\n ],\n \"columnsTo\": [\n \"id\"\n ],\n \"onDelete\": \"no action\",\n \"onUpdate\": \"no action\"\n }\n },\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"model_schemas\": {\n \"name\": \"model_schemas\",\n \"columns\": {\n \"id\": {\n \"name\": \"id\",\n \"type\": \"integer\",\n \"primaryKey\": true,\n \"notNull\": true,\n \"autoincrement\": true\n },\n \"model_id\": {\n \"name\": \"model_id\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"schema_id\": {\n \"name\": \"schema_id\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {},\n \"foreignKeys\": {\n \"model_schemas_model_id_models_id_fk\": {\n \"name\": \"model_schemas_model_id_models_id_fk\",\n \"tableFrom\": \"model_schemas\",\n \"tableTo\": \"models\",\n \"columnsFrom\": [\n \"model_id\"\n ],\n \"columnsTo\": [\n \"id\"\n ],\n \"onDelete\": \"no action\",\n \"onUpdate\": \"no action\"\n },\n \"model_schemas_schema_id_schemas_id_fk\": {\n \"name\": \"model_schemas_schema_id_schemas_id_fk\",\n \"tableFrom\": \"model_schemas\",\n \"tableTo\": \"schemas\",\n \"columnsFrom\": [\n \"schema_id\"\n ],\n \"columnsTo\": [\n \"id\"\n ],\n \"onDelete\": \"no action\",\n \"onUpdate\": \"no action\"\n }\n },\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"model_uids\": {\n \"name\": \"model_uids\",\n \"columns\": {\n \"id\": {\n \"name\": \"id\",\n \"type\": \"integer\",\n \"primaryKey\": true,\n \"notNull\": true,\n \"autoincrement\": true\n },\n \"uid\": {\n \"name\": \"uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"model_id\": {\n \"name\": \"model_id\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"model_uids_model_id_unique\": {\n \"name\": \"model_uids_model_id_unique\",\n \"columns\": [\n \"model_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {\n \"model_uids_model_id_models_id_fk\": {\n \"name\": \"model_uids_model_id_models_id_fk\",\n \"tableFrom\": \"model_uids\",\n \"tableTo\": \"models\",\n \"columnsFrom\": [\n \"model_id\"\n ],\n \"columnsTo\": [\n \"id\"\n ],\n \"onDelete\": \"no action\",\n \"onUpdate\": \"no action\"\n }\n },\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"property_uids\": {\n \"name\": \"property_uids\",\n \"columns\": {\n \"id\": {\n \"name\": \"id\",\n \"type\": \"integer\",\n \"primaryKey\": true,\n \"notNull\": true,\n \"autoincrement\": true\n },\n \"uid\": {\n \"name\": \"uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"property_id\": {\n \"name\": \"property_id\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"property_uids_property_id_unique\": {\n \"name\": \"property_uids_property_id_unique\",\n \"columns\": [\n \"property_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {\n \"property_uids_property_id_models_id_fk\": {\n \"name\": \"property_uids_property_id_models_id_fk\",\n \"tableFrom\": \"property_uids\",\n \"tableTo\": \"models\",\n \"columnsFrom\": [\n \"property_id\"\n ],\n \"columnsTo\": [\n \"id\"\n ],\n \"onDelete\": \"no action\",\n \"onUpdate\": \"no action\"\n }\n },\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"schemas\": {\n \"name\": \"schemas\",\n \"columns\": {\n \"id\": {\n \"name\": \"id\",\n \"type\": \"integer\",\n \"primaryKey\": true,\n \"notNull\": true,\n \"autoincrement\": true\n },\n \"name\": {\n \"name\": \"name\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"version\": {\n \"name\": \"version\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": true,\n \"autoincrement\": false\n },\n \"schema_file_id\": {\n \"name\": \"schema_file_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"schema_data\": {\n \"name\": \"schema_data\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"is_draft\": {\n \"name\": \"is_draft\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"is_edited\": {\n \"name\": \"is_edited\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"created_at\": {\n \"name\": \"created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"updated_at\": {\n \"name\": \"updated_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"unique_schema_schema_file_id\": {\n \"name\": \"unique_schema_schema_file_id\",\n \"columns\": [\n \"schema_file_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {},\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"seeds\": {\n \"name\": \"seeds\",\n \"columns\": {\n \"local_id\": {\n \"name\": \"local_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"uid\": {\n \"name\": \"uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"schema_uid\": {\n \"name\": \"schema_uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"type\": {\n \"name\": \"type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"publisher\": {\n \"name\": \"publisher\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"attestation_raw\": {\n \"name\": \"attestation_raw\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"attestation_created_at\": {\n \"name\": \"attestation_created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"created_at\": {\n \"name\": \"created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"updated_at\": {\n \"name\": \"updated_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"_marked_for_deletion\": {\n \"name\": \"_marked_for_deletion\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"seeds_local_id_unique\": {\n \"name\": \"seeds_local_id_unique\",\n \"columns\": [\n \"local_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {},\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n },\n \"versions\": {\n \"name\": \"versions\",\n \"columns\": {\n \"local_id\": {\n \"name\": \"local_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"uid\": {\n \"name\": \"uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"seed_local_id\": {\n \"name\": \"seed_local_id\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"seed_uid\": {\n \"name\": \"seed_uid\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"seed_type\": {\n \"name\": \"seed_type\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"note\": {\n \"name\": \"note\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"created_at\": {\n \"name\": \"created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"updated_at\": {\n \"name\": \"updated_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"attestation_created_at\": {\n \"name\": \"attestation_created_at\",\n \"type\": \"integer\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n },\n \"attestation_raw\": {\n \"name\": \"attestation_raw\",\n \"type\": \"text\",\n \"primaryKey\": false,\n \"notNull\": false,\n \"autoincrement\": false\n }\n },\n \"indexes\": {\n \"versions_local_id_unique\": {\n \"name\": \"versions_local_id_unique\",\n \"columns\": [\n \"local_id\"\n ],\n \"isUnique\": true\n }\n },\n \"foreignKeys\": {},\n \"compositePrimaryKeys\": {},\n \"uniqueConstraints\": {},\n \"checkConstraints\": {}\n }\n },\n \"views\": {},\n \"enums\": {},\n \"_meta\": {\n \"schemas\": {},\n \"tables\": {},\n \"columns\": {}\n },\n \"internal\": {\n \"indexes\": {}\n }\n}";
|
|
7
8
|
//# sourceMappingURL=drizzleFiles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drizzleFiles.d.ts","sourceRoot":"","sources":["../../../src/browser/db/drizzleFiles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gCAAgC,81HAwHoC,CAAA;AAEjF,eAAO,MAAM,oCAAoC,yHACC,CAAA;AAElD,eAAO,MAAM,kCAAkC,+SAE2C,CAAA;AAE1F,eAAO,MAAM,wCAAwC,qMAEF,CAAA;
|
|
1
|
+
{"version":3,"file":"drizzleFiles.d.ts","sourceRoot":"","sources":["../../../src/browser/db/drizzleFiles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gCAAgC,81HAwHoC,CAAA;AAEjF,eAAO,MAAM,oCAAoC,yHACC,CAAA;AAElD,eAAO,MAAM,kCAAkC,+SAE2C,CAAA;AAE1F,eAAO,MAAM,wCAAwC,qMAEF,CAAA;AAEnD,eAAO,MAAM,wCAAwC,8CAAkD,CAAA;AAGvG,eAAO,MAAM,WAAW,u5BAwCtB,CAAA;AAIF,eAAO,MAAM,YAAY,i/vBAw1BvB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileManager.d.ts","sourceRoot":"","sources":["../../../src/browser/helpers/FileManager.ts"],"names":[],"mappings":"AAAA,OA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AAQ,GAAE,MAAa,EAAE,OAAO,GAAE,MAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IA4F9G;;;;;;;OAOG;WACU,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY,EAAE,OAAO,GAAE,MAAa,GAAG,OAAO,CAAC,OAAO,CAAC;WAuD1G,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA0D5F,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW,GAAG,IAAI;WAsBpE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgCtD,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;WAS9B,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;WAgBjD,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKhE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAIjD,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAIpD,MAAM,CAAC,aAAa,IAAI,GAAG;CAG5B;AAsDD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -21,6 +21,8 @@ type UseItemsReturn = {
|
|
|
21
21
|
type UseItemsProps = {
|
|
22
22
|
modelName?: string;
|
|
23
23
|
deleted?: boolean;
|
|
24
|
+
includeEas?: boolean;
|
|
25
|
+
addressFilter?: 'owned' | 'watched' | 'all';
|
|
24
26
|
};
|
|
25
27
|
type UseItems = (props: UseItemsProps) => UseItemsReturn;
|
|
26
28
|
export declare const useItems: UseItems;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../src/browser/react/item.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAGlC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAYpC,KAAK,aAAa,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,IAAI;IAC7C,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CACpB,CAAA;AAED,KAAK,YAAY,GAAG;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,OAAO,GAAG,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,KAAK,aAAa,CAAC,CAAC,CAAC,CAAA;AAElF,eAAO,MAAM,OAAO,EAAE,OA6IrB,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CACpB,CAAA;AAED,KAAK,aAAa,GAAG;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../src/browser/react/item.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAGlC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAYpC,KA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AAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,GAAG,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,MAAM,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,aAAa,GAAG,SAAS,CAAA;IACxE,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;IACnB,UAAU,EAAE,MAAM,IAAI,CAAA;CACvB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAO,2BAsDxC,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACvD,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;IACnB,UAAU,EAAE,MAAM,IAAI,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,sBAAsB,QAAO,4BA8CzC,CAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var xstate = require('xstate');
|
|
4
|
-
var Schema = require('./Schema-
|
|
5
|
-
var main_cjs = require('./index-
|
|
4
|
+
var Schema = require('./Schema-DkSBMBwz.js');
|
|
5
|
+
var main_cjs = require('./index-B95Ng80C.js');
|
|
6
6
|
var debug = require('debug');
|
|
7
7
|
var drizzleOrm = require('drizzle-orm');
|
|
8
|
-
require('./SchemaValidationService-
|
|
8
|
+
require('./SchemaValidationService-O3FCMROl.js');
|
|
9
9
|
require('@sinclair/typebox/value');
|
|
10
10
|
require('reflect-metadata');
|
|
11
11
|
require('pluralize');
|
|
@@ -42,11 +42,13 @@ const logger$3 = debug('seedSdk:modelProperty:actors:saveToSchema');
|
|
|
42
42
|
*/
|
|
43
43
|
async function getSchemaNameFromModel(modelName) {
|
|
44
44
|
// Get the latest schema files and find which one contains this model
|
|
45
|
-
const
|
|
45
|
+
const schemaHelpersMod = await Promise.resolve().then(function () { return require('./index-B95Ng80C.js'); }).then(function (n) { return n.schema$1; });
|
|
46
|
+
const { listLatestSchemaFiles } = schemaHelpersMod;
|
|
46
47
|
const latestSchemas = await listLatestSchemaFiles();
|
|
47
48
|
for (const schema of latestSchemas) {
|
|
48
49
|
try {
|
|
49
|
-
const
|
|
50
|
+
const fileManagerMod = await Promise.resolve().then(function () { return require('./index-B95Ng80C.js'); }).then(function (n) { return n.BaseFileManager$1; });
|
|
51
|
+
const { BaseFileManager } = fileManagerMod;
|
|
50
52
|
const content = await BaseFileManager.readFileAsString(schema.filePath);
|
|
51
53
|
const schemaFile = JSON.parse(content);
|
|
52
54
|
if (schemaFile.models && schemaFile.models[modelName]) {
|
|
@@ -63,7 +65,8 @@ async function getSchemaNameFromModel(modelName) {
|
|
|
63
65
|
const saveToSchema = xstate.fromCallback(({ sendBack, input: { context } }) => {
|
|
64
66
|
const _saveToSchema = async () => {
|
|
65
67
|
// Use dynamic import to break circular dependency
|
|
66
|
-
const
|
|
68
|
+
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-O3FCMROl.js'); });
|
|
69
|
+
const { SchemaValidationService } = validationServiceMod;
|
|
67
70
|
const validationService = new SchemaValidationService();
|
|
68
71
|
// Validate property structure before saving
|
|
69
72
|
const validationResult = validationService.validatePropertyStructure(context);
|
|
@@ -91,8 +94,10 @@ const saveToSchema = xstate.fromCallback(({ sendBack, input: { context } }) => {
|
|
|
91
94
|
await Schema.updateModelProperties(schemaName, [propertyUpdate]);
|
|
92
95
|
// Clear isEdited flag in database after saving to schema file
|
|
93
96
|
try {
|
|
94
|
-
const
|
|
95
|
-
const {
|
|
97
|
+
const seedSchemaMod = await Promise.resolve().then(function () { return require('./index-B95Ng80C.js'); }).then(function (n) { return n.schema; });
|
|
98
|
+
const { properties: propertiesTable, models: modelsTable } = seedSchemaMod;
|
|
99
|
+
const drizzleMod = await import('drizzle-orm');
|
|
100
|
+
const { eq, and } = drizzleMod;
|
|
96
101
|
const db = main_cjs.BaseDb.getAppDb();
|
|
97
102
|
if (db && context.modelName && context.name) {
|
|
98
103
|
// Find model by name
|
|
@@ -147,7 +152,8 @@ const compareAndMarkDraft = xstate.fromCallback(({ sendBack, input: { context }
|
|
|
147
152
|
const schemaFileIdForResolve = fullContext._propertyFileId || (typeof fullContext.id === 'string' ? fullContext.id : undefined);
|
|
148
153
|
if (schemaFileIdForResolve && (fullContext.modelName === undefined || fullContext.dataType === undefined)) {
|
|
149
154
|
try {
|
|
150
|
-
const
|
|
155
|
+
const dbMod = await Promise.resolve().then(function () { return require('./index-B95Ng80C.js'); }).then(function (n) { return n.db; });
|
|
156
|
+
const { getPropertyModelNameAndDataType, getModelNameByModelId } = dbMod;
|
|
151
157
|
let fromDb;
|
|
152
158
|
for (let attempt = 0; attempt < 6; attempt++) {
|
|
153
159
|
fromDb = await getPropertyModelNameAndDataType(schemaFileIdForResolve);
|
|
@@ -191,7 +197,8 @@ const compareAndMarkDraft = xstate.fromCallback(({ sendBack, input: { context }
|
|
|
191
197
|
if (fullContext.modelName && fullContext.name && schemaFileId) {
|
|
192
198
|
logger$2(`[compareAndMarkDraft] _originalValues not set, but saving to database anyway for property ${context.modelName}:${context.name} (schemaFileId: ${schemaFileId})`);
|
|
193
199
|
try {
|
|
194
|
-
const
|
|
200
|
+
const dbMod = await Promise.resolve().then(function () { return require('./index-B95Ng80C.js'); }).then(function (n) { return n.db; });
|
|
201
|
+
const { savePropertyToDb } = dbMod;
|
|
195
202
|
// Ensure _propertyFileId is set for savePropertyToDb to find the property
|
|
196
203
|
const contextWithFileId = {
|
|
197
204
|
...fullContext,
|
|
@@ -250,7 +257,8 @@ const compareAndMarkDraft = xstate.fromCallback(({ sendBack, input: { context }
|
|
|
250
257
|
logger$2(`Property ${fullContext.modelName}:${fullContext.name} has changes, marking as edited`);
|
|
251
258
|
logger$2(`[compareAndMarkDraft] Context when saving: id=${fullContext.id}, _propertyFileId=${fullContext._propertyFileId}, name=${fullContext.name}, _originalValues.name=${fullContext._originalValues?.name}`);
|
|
252
259
|
// Use dynamic import to break circular dependency
|
|
253
|
-
const
|
|
260
|
+
const dbMod = await Promise.resolve().then(function () { return require('./index-B95Ng80C.js'); }).then(function (n) { return n.db; });
|
|
261
|
+
const { savePropertyToDb } = dbMod;
|
|
254
262
|
// Save to database (but not JSON file) - always save to DB when there are changes
|
|
255
263
|
try {
|
|
256
264
|
await savePropertyToDb(fullContext);
|
|
@@ -263,7 +271,8 @@ const compareAndMarkDraft = xstate.fromCallback(({ sendBack, input: { context }
|
|
|
263
271
|
// Mark schema as draft if schema name is available
|
|
264
272
|
if (fullContext._schemaName) {
|
|
265
273
|
// Get the Schema instance and mark it as draft
|
|
266
|
-
const
|
|
274
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-DkSBMBwz.js'); }).then(function (n) { return n.Schema$1; });
|
|
275
|
+
const { Schema } = schemaMod;
|
|
267
276
|
const schema = Schema.create(fullContext._schemaName, {
|
|
268
277
|
waitForReady: false,
|
|
269
278
|
});
|
|
@@ -279,8 +288,10 @@ const compareAndMarkDraft = xstate.fromCallback(({ sendBack, input: { context }
|
|
|
279
288
|
logger$2(`Property ${fullContext.modelName}:${fullContext.name} has no changes`);
|
|
280
289
|
// Clear isEdited flag in database
|
|
281
290
|
try {
|
|
282
|
-
const
|
|
283
|
-
const {
|
|
291
|
+
const seedSchemaMod = await Promise.resolve().then(function () { return require('./index-B95Ng80C.js'); }).then(function (n) { return n.schema; });
|
|
292
|
+
const { properties: propertiesTable, models: modelsTable } = seedSchemaMod;
|
|
293
|
+
const drizzleMod = await import('drizzle-orm');
|
|
294
|
+
const { eq, and } = drizzleMod;
|
|
284
295
|
const db = main_cjs.BaseDb.getAppDb();
|
|
285
296
|
if (db && fullContext.modelName && fullContext.name) {
|
|
286
297
|
// Find model by name
|
|
@@ -341,7 +352,8 @@ const validateProperty = xstate.fromCallback(({ sendBack, input: { context } })
|
|
|
341
352
|
// Brief wait so trackPendingWrite from ModelProperty.create() has time to run (it's in setTimeout(0))
|
|
342
353
|
await new Promise((r) => setTimeout(r, 60));
|
|
343
354
|
try {
|
|
344
|
-
const
|
|
355
|
+
const dbMod = await Promise.resolve().then(function () { return require('./index-B95Ng80C.js'); }).then(function (n) { return n.db; });
|
|
356
|
+
const { getPropertyModelNameAndDataType, getModelNameByModelId } = dbMod;
|
|
345
357
|
// Try pending write first (property row may not exist yet)
|
|
346
358
|
if (fullContext.modelName === undefined && schemaFileId) {
|
|
347
359
|
const mod = await Promise.resolve().then(function () { return ModelProperty$1; });
|
|
@@ -399,9 +411,11 @@ const validateProperty = xstate.fromCallback(({ sendBack, input: { context } })
|
|
|
399
411
|
_originalValues: fullContext._originalValues
|
|
400
412
|
});
|
|
401
413
|
// Use dynamic imports to break circular dependencies
|
|
402
|
-
const
|
|
414
|
+
const validationServiceMod = await Promise.resolve().then(function () { return require('./SchemaValidationService-O3FCMROl.js'); });
|
|
415
|
+
const { SchemaValidationService } = validationServiceMod;
|
|
403
416
|
const validationService = new SchemaValidationService();
|
|
404
|
-
const
|
|
417
|
+
const schemaMod = await Promise.resolve().then(function () { return require('./Schema-DkSBMBwz.js'); }).then(function (n) { return n.Schema$1; });
|
|
418
|
+
const { Schema } = schemaMod;
|
|
405
419
|
// Validate property structure
|
|
406
420
|
console.log('[validateProperty] Validating property structure...');
|
|
407
421
|
const structureResult = validationService.validatePropertyStructure(fullContext);
|
|
@@ -1763,4 +1777,4 @@ var ModelProperty$1 = /*#__PURE__*/Object.freeze({
|
|
|
1763
1777
|
});
|
|
1764
1778
|
|
|
1765
1779
|
exports.ModelProperty = ModelProperty;
|
|
1766
|
-
//# sourceMappingURL=ModelProperty-
|
|
1780
|
+
//# sourceMappingURL=ModelProperty-DpjD0o0E.js.map
|