@api-client/core 0.18.62 → 0.18.64

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.
Files changed (80) hide show
  1. package/API_MODELING_EXPLAINER.md +57 -0
  2. package/DATA_MODELING_EXPLAINER.md +74 -0
  3. package/build/src/modeling/DataDomain.d.ts +6 -5
  4. package/build/src/modeling/DataDomain.d.ts.map +1 -1
  5. package/build/src/modeling/DataDomain.js +5 -4
  6. package/build/src/modeling/DataDomain.js.map +1 -1
  7. package/build/src/modeling/DomainAssociation.js +1 -1
  8. package/build/src/modeling/DomainAssociation.js.map +1 -1
  9. package/build/src/modeling/DomainEntity.d.ts +9 -6
  10. package/build/src/modeling/DomainEntity.d.ts.map +1 -1
  11. package/build/src/modeling/DomainEntity.js +34 -18
  12. package/build/src/modeling/DomainEntity.js.map +1 -1
  13. package/build/src/modeling/ai/Semantics.d.ts +7 -0
  14. package/build/src/modeling/ai/Semantics.d.ts.map +1 -0
  15. package/build/src/modeling/ai/Semantics.js +552 -0
  16. package/build/src/modeling/ai/Semantics.js.map +1 -0
  17. package/build/src/modeling/definitions/Calculated.d.ts +1 -1
  18. package/build/src/modeling/definitions/Calculated.js.map +1 -1
  19. package/build/src/modeling/definitions/Country.d.ts +1 -1
  20. package/build/src/modeling/definitions/Country.js.map +1 -1
  21. package/build/src/modeling/definitions/Derived.d.ts +1 -1
  22. package/build/src/modeling/definitions/Derived.js.map +1 -1
  23. package/build/src/modeling/definitions/Description.d.ts +0 -1
  24. package/build/src/modeling/definitions/Description.d.ts.map +1 -1
  25. package/build/src/modeling/definitions/Description.js.map +1 -1
  26. package/build/src/modeling/definitions/Email.d.ts +5 -1
  27. package/build/src/modeling/definitions/Email.d.ts.map +1 -1
  28. package/build/src/modeling/definitions/Email.js.map +1 -1
  29. package/build/src/modeling/definitions/HTML.d.ts +0 -22
  30. package/build/src/modeling/definitions/HTML.d.ts.map +1 -1
  31. package/build/src/modeling/definitions/HTML.js +0 -1
  32. package/build/src/modeling/definitions/HTML.js.map +1 -1
  33. package/build/src/modeling/definitions/Markdown.d.ts +0 -16
  34. package/build/src/modeling/definitions/Markdown.d.ts.map +1 -1
  35. package/build/src/modeling/definitions/Markdown.js +0 -1
  36. package/build/src/modeling/definitions/Markdown.js.map +1 -1
  37. package/build/src/modeling/helpers/Intelisense.d.ts.map +1 -1
  38. package/build/src/modeling/helpers/Intelisense.js +2 -2
  39. package/build/src/modeling/helpers/Intelisense.js.map +1 -1
  40. package/build/src/modeling/importers/JsonSchemaImporter.js +1 -1
  41. package/build/src/modeling/importers/JsonSchemaImporter.js.map +1 -1
  42. package/build/src/modeling/types.d.ts +0 -14
  43. package/build/src/modeling/types.d.ts.map +1 -1
  44. package/build/src/modeling/types.js.map +1 -1
  45. package/build/tsconfig.tsbuildinfo +1 -1
  46. package/data/models/example-generator-api.json +15 -15
  47. package/package.json +4 -4
  48. package/src/modeling/DataDomain.ts +6 -6
  49. package/src/modeling/DomainAssociation.ts +1 -1
  50. package/src/modeling/DomainEntity.ts +36 -18
  51. package/src/modeling/ai/Semantics.ts +597 -0
  52. package/src/modeling/ai/readme.md +7 -0
  53. package/src/modeling/definitions/Calculated.ts +1 -1
  54. package/src/modeling/definitions/Country.ts +1 -1
  55. package/src/modeling/definitions/Derived.ts +1 -1
  56. package/src/modeling/definitions/Description.ts +0 -1
  57. package/src/modeling/definitions/Email.ts +5 -1
  58. package/src/modeling/definitions/HTML.ts +0 -23
  59. package/src/modeling/definitions/Markdown.ts +0 -17
  60. package/src/modeling/helpers/Intelisense.ts +8 -14
  61. package/src/modeling/importers/JsonSchemaImporter.ts +1 -1
  62. package/src/modeling/types.ts +0 -15
  63. package/tests/unit/modeling/amf/shape_generator.spec.ts +4 -4
  64. package/tests/unit/modeling/api_model_expose_entity.spec.ts +11 -11
  65. package/tests/unit/modeling/api_model_remove_entity.spec.ts +1 -1
  66. package/tests/unit/modeling/data_domain_associations.spec.ts +6 -6
  67. package/tests/unit/modeling/data_domain_foreign.spec.ts +2 -2
  68. package/tests/unit/modeling/data_domain_namespaces.spec.ts +1 -1
  69. package/tests/unit/modeling/data_domain_serialization.spec.ts +15 -15
  70. package/tests/unit/modeling/domain_asociation.spec.ts +15 -15
  71. package/tests/unit/modeling/domain_entity.spec.ts +3 -3
  72. package/tests/unit/modeling/domain_entity_associations.spec.ts +4 -4
  73. package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +16 -16
  74. package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +14 -14
  75. package/tests/unit/modeling/domain_property.spec.ts +1 -1
  76. package/tests/unit/modeling/domain_validation.spec.ts +3 -3
  77. package/tests/unit/modeling/domain_versioning.spec.ts +5 -5
  78. package/tests/unit/modeling/exposed_entity_setter_validation.spec.ts +1 -1
  79. package/tests/unit/modeling/validation/association_validation.spec.ts +40 -56
  80. package/tests/unit/modeling/validation/entity_validation.spec.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"JsonSchemaImporter.js","sourceRoot":"","sources":["../../../../src/modeling/importers/JsonSchemaImporter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAA6B,MAAM,sBAAsB,CAAA;AAIhF,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACjG,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAqCxC;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IACrB,MAAM,CAAY;IAClB,KAAK,CAAc;IACnB,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAA;IAClC,QAAQ,GAAoB,EAAE,CAAA;IAC9B,KAAK,GAAG,IAAI,GAAG,EAAuB,CAAA;IAE9C,YAAY,MAAkB;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;OAEG;IACK,UAAU,CAAC,SAAiB;QAClC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,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AAK,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YACxD,MAAM,CAAC,IAAI,GAAG,EAAE,CAAA;YAChB,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;gBACpC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,IAAI,IAAI,CAAC,EAAE,CAAC;oBACnD,IAAI,CAAC,MAAM,CACT,SAAS,EACT,+BAA+B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,6CAA6C,EAChG,GAAG,eAAe,IAAI,QAAQ,EAAE,CACjC,CAAA;oBACD,SAAQ;gBACV,CAAC;gBACD,IAAI,OAAQ,IAAoB,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;oBACpD,IAAI,CAAC,MAAM,CACT,SAAS,EACT,6BAA6B,IAAI,CAAC,SAAS,CAAE,IAAoB,CAAC,KAAK,CAAC,sBAAsB,EAC9F,GAAG,eAAe,IAAI,QAAQ,EAAE,CACjC,CAAA;oBACD,SAAQ;gBACV,CAAC;gBACD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAE,IAAoB,CAAC,KAAe,CAAC,CAAA;YACzD,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,2EAA2E;YAC3E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACtB,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["import type { JSONSchema7, JSONSchema7Definition, JSONSchema7TypeName } from 'json-schema'\nimport { DataDomain } from '../DataDomain.js'\nimport { DomainModel } from '../DomainModel.js'\nimport { DomainEntity } from '../DomainEntity.js'\nimport { DomainProperty, type DomainPropertySchema } from '../DomainProperty.js'\nimport type { PropertySchema } from '../types.js'\nimport type { PropertyWebBindings } from '../Bindings.js'\nimport type { DomainPropertyFormat, DomainPropertyType } from '../DataFormat.js'\nimport { sanitizeInput, toDatabaseColumnName, toDatabaseTableName } from '../helpers/database.js'\nimport { nanoid } from '../../nanoid.js'\n\n/**\n * Represents a single message (info, warning, or error) generated during the import process.\n */\nexport interface ImportMessage {\n level: 'warning' | 'info'\n message: string\n location?: string\n}\n\n/**\n * A report containing the result of the import process, including the created model\n * and any non-blocking messages.\n */\nexport interface JsonImportReport {\n /**\n * An array of messages generated during the import process.\n * These can include warnings, info messages, or other non-blocking notifications.\n */\n messages: ImportMessage[]\n /**\n * The model that was created during the import.\n */\n model: DomainModel\n}\n\n/**\n * A structure to hold in-memory JSON schema files for browser-based import.\n */\nexport interface InMemorySchema {\n /** A virtual path or identifier for the schema, used in `$ref` values. */\n path: string\n /** The parsed content of the JSON schema file. */\n contents: JSONSchema7\n}\n\n/**\n * Imports JSON Schema definitions into a DataDomain.\n *\n * This class parses a root JSON Schema file, bundles all its dependencies,\n * and translates the object definitions into DomainEntity instances within a specified DomainModel.\n */\nexport class JsonSchemaImporter {\n private domain: DataDomain\n private model!: DomainModel\n private refMap = new Map<string, string>()\n private messages: ImportMessage[] = []\n private enums = new Map<string, JSONSchema7>()\n\n constructor(domain: DataDomain) {\n this.domain = domain\n }\n\n /**\n * Resets the internal state for a new import operation.\n */\n private resetState(modelName: string) {\n this.model = this.domain.addModel({ info: { name: modelName } })\n this.refMap.clear()\n this.enums.clear()\n this.messages = []\n }\n\n /**\n * Centralized reporting for warnings and info messages.\n */\n private report(level: 'warning' | 'info', message: string, location?: string): void {\n this.messages.push({ level, message, location })\n }\n\n /**\n * Main import method: orchestrates schema bundling, entity creation, and population.\n */\n public async import(schemas: InMemorySchema[], modelName: string): Promise<JsonImportReport> {\n this.resetState(modelName)\n\n // Build a flat map of all definitions and $id-indexed schemas\n const definitionMap = new Map<string, JSONSchema7>()\n const idMap = new Map<string, JSONSchema7>()\n const processedSchemas = new Set<JSONSchema7>() // Track processed schema objects to avoid duplicates\n\n for (const schema of schemas) {\n // Add $id mapping if present\n if (schema.contents.$id) {\n idMap.set(schema.contents.$id, schema.contents)\n // Add the entire schema to the definitions maps as well as they can be referenced by other schemas.\n definitionMap.set(schema.contents.$id, schema.contents)\n }\n // Add the schema itself by its path\n definitionMap.set(schema.path, schema.contents)\n // Add all definitions inside this schema\n const definitions = schema.contents.definitions\n const defs = (schema.contents as unknown as { $defs: Record<string, JSONSchema7Definition> }).$defs\n\n if (definitions) {\n for (const [defName, defSchema] of Object.entries(definitions)) {\n if (typeof defSchema === 'object') {\n // Use a JSON pointer for the key - include both full path and short form\n definitionMap.set(`${schema.path}#/definitions/${defName}`, defSchema as JSONSchema7)\n definitionMap.set(`#/definitions/${defName}`, defSchema as JSONSchema7)\n }\n }\n }\n\n if (defs) {\n for (const [defName, defSchema] of Object.entries(defs)) {\n if (typeof defSchema === 'object') {\n // Use a JSON pointer for the key - include both full path and short form\n definitionMap.set(`${schema.path}#/$defs/${defName}`, defSchema as JSONSchema7)\n definitionMap.set(`#/$defs/${defName}`, defSchema as JSONSchema7)\n }\n }\n }\n }\n\n // == Pass 1: Create all entities ==\n for (const [key, schema] of definitionMap.entries()) {\n // Skip if this schema object has already been processed\n if (processedSchemas.has(schema)) {\n continue\n }\n\n if (typeof schema === 'object' && schema.type === 'object') {\n this.createEntity(key, schema, key)\n processedSchemas.add(schema)\n } else if (this.isEnum(schema)) {\n this.enums.set(key, schema)\n } else {\n this.report('warning', `Skipping non-object schema at ${key}`, key)\n }\n }\n // Also create entities for all $id-indexed schemas if not already present\n for (const [id, schema] of idMap.entries()) {\n // Skip if this schema object has already been processed\n if (processedSchemas.has(schema)) {\n continue\n }\n\n if (!this.refMap.has(id) && typeof schema === 'object' && schema.type === 'object') {\n this.createEntity(id, schema, id)\n processedSchemas.add(schema)\n } else if (this.isEnum(schema) && !this.enums.has(id)) {\n this.enums.set(id, schema)\n } else {\n this.report('warning', `Skipping non-object schema at ${id}`, id)\n }\n }\n // == Pass 2: Populate entities ==\n for (const [refPath, entityKey] of this.refMap.entries()) {\n const entity = this.domain.findEntity(entityKey)\n if (!entity) {\n this.report('warning', `Entity not found: ${entityKey}`, refPath)\n continue\n }\n const schema = this.resolveSchemaRef(refPath, definitionMap, idMap)\n if (!schema) {\n this.report('warning', `Schema not found for ref: ${refPath}`, refPath)\n continue\n }\n this.populateEntity(entity, schema)\n }\n\n return { model: this.model, messages: this.messages }\n }\n\n private isEnum(schema: JSONSchema7): boolean {\n if (schema.type !== 'string') {\n // I might be wrong about it, but I think enums are only for strings\n return false\n }\n if (!Array.isArray(schema.oneOf)) {\n return false\n }\n const notConst = schema.oneOf.find((s) => typeof s !== 'object' || !('const' in s))\n return !notConst // If all schemas in oneOf have 'const', it's an enum\n }\n\n /**\n * Resolves a schema reference from the flat definition/id maps.\n * Supports #/definitions/..., $id, or direct path keys.\n */\n private resolveSchemaRef(\n refPath: string,\n definitionMap: Map<string, JSONSchema7>,\n idMap: Map<string, JSONSchema7>\n ): JSONSchema7 | undefined {\n // Try direct match\n if (definitionMap.has(refPath)) return definitionMap.get(refPath)\n if (idMap.has(refPath)) return idMap.get(refPath)\n // Try to resolve #/definitions/Name or #/$defs/Name from any schema\n if (refPath.startsWith('#/definitions/') || refPath.startsWith('#/$defs/')) {\n for (const [key, schema] of definitionMap.entries()) {\n if (key === refPath) return schema\n }\n }\n // Try to resolve by $id fragment\n if (refPath.startsWith('#')) {\n for (const [id, schema] of idMap.entries()) {\n if (id.endsWith(refPath)) return schema\n }\n }\n return undefined\n }\n\n /**\n * Helper for entity creation, can be extended for custom logic.\n */\n private createEntity(name: string, schema: JSONSchema7, refPath: string): DomainEntity {\n let fixedName = schema.title || name\n\n // Extract just the definition name from JSON pointers (both short and full paths)\n if (name.includes('#/definitions/')) {\n const parts = name.split('#/definitions/')\n fixedName = schema.title || parts[parts.length - 1]\n } else if (name.includes('#/$defs/')) {\n const parts = name.split('#/$defs/')\n fixedName = schema.title || parts[parts.length - 1]\n }\n\n const cleanName = toDatabaseTableName(fixedName, 'untitled_entity')\n const entity = this.model.addEntity({\n info: {\n name: cleanName,\n displayName: fixedName,\n },\n })\n if (fixedName !== cleanName) {\n entity.info.displayName = fixedName // Keep original title for display\n }\n if (schema.description) {\n entity.info.description = schema.description\n }\n this.refMap.set(refPath, entity.key)\n return entity\n }\n\n /**\n * Generates a meaningful name for inline entities based on their parent context.\n */\n private generateInlineEntityName(parentEntityKey: string, propName: string, schema: JSONSchema7): string {\n // Try to use the schema title first\n if (schema.title) {\n return toDatabaseTableName(schema.title, 'untitled_entity')\n }\n\n // Find the parent entity to create a meaningful name\n const parentEntity = this.domain.findEntity(parentEntityKey)\n const parentName = parentEntity?.info.name || 'unknown'\n\n // Create a name like \"User_Address\" or \"Order_ShippingInfo\"\n const combinedName = `${parentName}_${propName}`\n return toDatabaseTableName(combinedName, 'untitled_entity')\n }\n\n /**\n * Populates a DomainEntity with its properties, associations, and parent relationships.\n */\n private populateEntity(entity: DomainEntity, schema: JSONSchema7): void {\n const properties = schema.properties || {}\n const required = new Set(schema.required || [])\n\n for (const [propName, propSchema] of Object.entries(properties)) {\n if (typeof propSchema === 'object') {\n this.createPropertyOrAssociation(entity, propName, propSchema, required.has(propName))\n }\n }\n\n // Handle 'allOf' for inheritance and composition.\n if (schema.allOf) {\n this.processAllOf(entity, schema.allOf)\n }\n }\n\n /**\n * Processes the `allOf` keyword, which can contain references (for inheritance)\n * or inline schemas (for composition/mixins).\n */\n private processAllOf(entity: DomainEntity, allOfSchemas: JSONSchema7Definition[]): void {\n allOfSchemas.forEach((subSchema, index) => {\n if (typeof subSchema !== 'object') {\n return\n }\n // Case 1: It's a reference to another entity (standard inheritance).\n if (subSchema.$ref) {\n // Try to resolve the referenced entity by $ref (could be #/definitions/..., $id, or path)\n const parentKey = this.refMap.get(subSchema.$ref)\n if (parentKey) {\n try {\n entity.addParent(parentKey)\n } catch (e) {\n this.report(\n 'warning',\n `Could not add parent ${parentKey} to ${entity.key}: ${(e as Error).message}`,\n entity.key\n )\n }\n } else {\n this.report('warning', `Could not resolve parent reference: ${subSchema.$ref}`, entity.key)\n }\n return\n }\n // Case 2: It's an inline schema to be mixed in.\n // const mixinKey = `${entity.key}_mixin_${index}`\n const mixinName = subSchema.title || `${entity.info.name} Mixin ${index + 1}`\n const mixinEntity = this.model.addEntity({\n // key: mixinKey,\n info: {\n name: mixinName,\n description:\n subSchema.description ||\n `Auto-generated mixin entity from an 'allOf' clause in the schema for '${entity.info.name}'. This entity is not intended for direct use.`,\n },\n })\n this.populateEntity(mixinEntity, subSchema)\n try {\n entity.addParent(mixinEntity.key)\n } catch (e) {\n this.report(\n 'warning',\n `Could not add mixin parent ${mixinEntity.key} to ${entity.key}: ${(e as Error).message}`,\n entity.key\n )\n }\n })\n }\n /**\n * Recursively analyzes a schema definition to find all contained primitive types and `$ref`s.\n * It's used to understand the nature of a property (is it a primitive, an association, or a mix).\n */\n private collectTypesAndRefs(\n schema: JSONSchema7Definition,\n parentEntityKey?: string,\n propName?: string\n ): {\n refs: Set<string>\n types: Set<JSONSchema7TypeName>\n isArray: boolean\n } {\n const collected = { refs: new Set<string>(), types: new Set<JSONSchema7TypeName>(), isArray: false }\n\n if (typeof schema !== 'object') {\n return collected\n }\n\n if (schema.$ref) {\n collected.refs.add(schema.$ref)\n return collected\n }\n\n if (schema.type) {\n const types = Array.isArray(schema.type) ? schema.type : [schema.type]\n for (const t of types) {\n if (t !== 'null') collected.types.add(t)\n }\n }\n\n // Handle inline object types by creating entities immediately\n if (schema.type === 'object' && schema.properties && parentEntityKey && propName) {\n // Create an entity for this inline object immediately\n const inlineEntityName = this.generateInlineEntityName(parentEntityKey, propName, schema)\n const inlineEntity = this.createEntity(inlineEntityName, schema, inlineEntityName)\n\n // Populate it immediately since we have the schema\n this.populateEntity(inlineEntity, schema)\n\n // Add a reference to it so it gets treated as an association\n collected.refs.add(inlineEntityName)\n\n return collected\n }\n\n if (schema.type === 'array') {\n collected.isArray = true\n if (typeof schema.items === 'object') {\n // Recurse into items - pass along parent context for inline objects in arrays\n const itemInfo = this.collectTypesAndRefs(\n Array.isArray(schema.items) ? schema.items[0] : schema.items,\n parentEntityKey,\n propName ? `${propName}_item` : undefined\n )\n itemInfo.refs.forEach((r) => collected.refs.add(r))\n itemInfo.types.forEach((t) => collected.types.add(t))\n }\n return collected\n }\n\n const choices = schema.anyOf || schema.oneOf\n if (choices) {\n for (const choice of choices) {\n const choiceInfo = this.collectTypesAndRefs(choice, parentEntityKey)\n choiceInfo.refs.forEach((r) => collected.refs.add(r))\n choiceInfo.types.forEach((t) => collected.types.add(t))\n if (choiceInfo.isArray) {\n collected.isArray = true\n }\n }\n }\n\n if (schema.enum) {\n // If the schema has an enum, we treat it as a string type with specific values.\n collected.types.add('string')\n // consider the following schema: `\"enum\": [\"one\", \"two\", \"three\"]`\n const id = nanoid(8)\n this.enums.set(id, {\n type: 'string',\n oneOf: schema.enum.map((value) => ({\n const: String(value), // Ensure enum values are strings\n })),\n })\n collected.refs.add(id) // Add the enum reference\n }\n\n return collected\n }\n\n /**\n * Determines whether to create a DomainProperty or a DomainAssociation for a given schema property.\n */\n private createPropertyOrAssociation(\n entity: DomainEntity,\n propName: string,\n propSchema: JSONSchema7,\n isRequired: boolean\n ): void {\n // Analyze the property schema to understand its composition (primitives, refs, arrays).\n // Pass entity context to collectTypesAndRefs for inline object handling\n const analysis = this.collectTypesAndRefs(propSchema, entity.key, propName)\n // console.log(`Analyzing property '${propName}' in entity '${entity.info.name}':`, analysis, propSchema)\n // Case 1: If the property has `$ref` to an enum, we treat it as a DomainProperty.\n if (analysis.refs.size === 1 && this.enums.has([...analysis.refs][0])) {\n const prop = this.createEnumProperty(\n propName,\n propSchema,\n this.enums.get([...analysis.refs][0]) as JSONSchema7,\n entity.info.name as string\n )\n if (prop) {\n prop.multiple = analysis.isArray\n // console.log(`Adding enum property '${propName}' to entity '${entity.info.name}'`, prop.toJSON())\n entity.addProperty(prop.toJSON())\n }\n return\n }\n\n // Case 2: If any `$ref` was found, we treat it as an Association.\n if (analysis.refs.size > 0) {\n const sanitizedName = toDatabaseColumnName(propName, 'untitled_association')\n const assoc = entity.addAssociation({}, { info: { name: sanitizedName } })\n if (sanitizedName !== propName) {\n assoc.info.displayName = propName // Keep original name for display\n }\n if (propSchema.description) {\n assoc.info.description = propSchema.description\n }\n assoc.required = isRequired\n assoc.multiple = analysis.isArray\n for (const ref of analysis.refs) {\n const targetKey = this.refMap.get(ref)\n if (targetKey) {\n assoc.addTarget(targetKey)\n }\n }\n if (analysis.types.size > 0) {\n this.report(\n 'warning',\n `Property '${propName}' has a mix of reference and primitive types. Only the reference(s) will be used to create an association. The primitive types (${[\n ...analysis.types,\n ].join(', ')}) are ignored.`,\n entity.key\n )\n }\n return\n }\n // Case 3: No `$ref`s found, only primitive types. We treat it as a DomainProperty.\n if (analysis.types.size > 0) {\n // We need to create a temporary schema object to pass to createDomainProperty,\n // as it expects a single schema. We'll use the first detected type.\n const tempSchema: JSONSchema7 = {\n ...propSchema,\n // Pass the collected types to be resolved by mapJsonTypeToDomainType\n type: [...analysis.types],\n }\n const prop = this.createDomainProperty(entity.key, propName, tempSchema, isRequired)\n if (prop) {\n prop.multiple = analysis.isArray\n entity.addProperty(prop.toJSON())\n }\n return\n }\n }\n\n /**\n * Creates and configures a DomainProperty based on a JSON schema property definition.\n */\n private createDomainProperty(\n parentEntityKey: string,\n propName: string,\n propSchema: JSONSchema7,\n isRequired: boolean\n ): DomainProperty | null {\n const typeInfo = this.mapJsonTypeToDomainType(propSchema.type, propSchema, `${parentEntityKey}.${propName}`)\n if (!typeInfo) return null\n const sanitizedName = toDatabaseColumnName(propName, 'untitled_property')\n const propertyInit: Partial<DomainPropertySchema> = {\n info: { name: sanitizedName, description: propSchema.description },\n type: typeInfo.type,\n required: isRequired,\n }\n\n // Use the constructor that doesn't add to the graph immediately.\n const prop = new DomainProperty(this.domain, parentEntityKey, propertyInit)\n if (sanitizedName !== propName) {\n prop.info.displayName = propName // Keep original name for display\n }\n\n const schema: PropertySchema = {}\n const webBindings: PropertyWebBindings = {}\n\n if (propSchema.pattern) schema.pattern = propSchema.pattern\n if (propSchema.enum) schema.enum = propSchema.enum.map(String)\n if (propSchema.default !== undefined) schema.defaultValue = { type: 'literal', value: String(propSchema.default) }\n\n if (typeInfo.type === 'string') {\n if (typeof propSchema.minLength === 'number') schema.minimum = propSchema.minLength\n if (typeof propSchema.maxLength === 'number') schema.maximum = propSchema.maxLength\n } else if (typeInfo.type === 'number') {\n if (typeof propSchema.minimum === 'number') schema.minimum = propSchema.minimum\n if (typeof propSchema.maximum === 'number') schema.maximum = propSchema.maximum\n if (typeof propSchema.exclusiveMinimum === 'number') {\n schema.minimum = propSchema.exclusiveMinimum\n schema.exclusiveMinimum = true\n }\n if (typeof propSchema.exclusiveMaximum === 'number') {\n schema.maximum = propSchema.exclusiveMaximum\n schema.exclusiveMaximum = true\n }\n if (typeof propSchema.multipleOf === 'number') schema.multipleOf = propSchema.multipleOf\n if (typeInfo.format) {\n webBindings.format = typeInfo.format\n }\n }\n\n if (Object.keys(schema).length > 0) {\n prop.schema = schema\n }\n if (Object.keys(webBindings).length > 0) {\n prop.bindings = [{ type: 'web', schema: webBindings }]\n }\n\n return prop\n }\n\n /**\n * Maps a JSON Schema type to a DomainPropertyType.\n */\n private mapJsonTypeToDomainType(\n jsonType: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined,\n schema: JSONSchema7,\n location?: string\n ): { type: DomainPropertyType; format?: DomainPropertyFormat } | null {\n if (!jsonType) {\n return null\n }\n\n if (Array.isArray(jsonType)) {\n const nonNullTypes = jsonType.filter((t) => t !== 'null')\n if (nonNullTypes.length === 0) {\n return null\n }\n if (nonNullTypes.length === 2 && nonNullTypes.includes('array')) {\n const nonArrayType = nonNullTypes.filter((t) => t !== 'array')[0]\n return this.mapJsonTypeToDomainType(nonArrayType, schema, location)\n }\n if (nonNullTypes.length > 1) {\n this.report(\n 'warning',\n `Property has a union of primitive types: [${nonNullTypes.join(', ')}]. The importer will use the first type ('${nonNullTypes[0]}').`,\n location\n )\n }\n // Pick the first non-null type from the union.\n return this.mapJsonTypeToDomainType(nonNullTypes[0], schema, location)\n }\n\n if (jsonType === 'string') {\n // JSON Schema has the `format` property which can specify more about the string type.\n // We need to decide how to handle these formats.\n const choices = schema.anyOf || schema.oneOf\n if (Array.isArray(choices)) {\n // If we have a list of choices, we need to pick one.\n const formats: string[] = []\n for (const choice of choices) {\n const typed = choice as JSONSchema7\n if (typed.format) {\n formats.push(typed.format)\n }\n }\n // we will list dates from the most specific to the least specific\n if (formats.includes('date-time')) {\n return { type: 'datetime' }\n }\n if (formats.includes('date')) {\n return { type: 'date' }\n }\n if (formats.includes('time')) {\n return { type: 'time' }\n }\n }\n // If no specific format is found, we default to string.\n return { type: 'string' }\n }\n\n switch (jsonType) {\n case 'number':\n return { type: 'number', format: 'double' }\n case 'integer':\n return { type: 'number', format: 'int64' }\n case 'boolean':\n return { type: 'boolean' }\n // JSON Schema's 'object' and 'array' are handled as associations or multi-valued properties.\n // Other types like 'null' are handled by making the property not required.\n default:\n return null\n }\n }\n\n private createEnumProperty(\n propName: string,\n propSchema: JSONSchema7,\n enumSchema: JSONSchema7,\n parentEntityKey: string\n ): DomainProperty | null {\n const description = propSchema.description ?? enumSchema.description\n const typeInfo = this.mapJsonTypeToDomainType(enumSchema.type, enumSchema, `${parentEntityKey}.${propName}`)\n if (!typeInfo) return null\n\n const sanitizedName = toDatabaseColumnName(propName)\n const propertyInit: Partial<DomainPropertySchema> = {\n info: { name: sanitizedName },\n type: typeInfo.type,\n // required: isRequired,\n required: false,\n }\n\n // Use the constructor that doesn't add to the graph immediately.\n const prop = new DomainProperty(this.domain, parentEntityKey, propertyInit)\n if (sanitizedName !== propName) {\n prop.info.displayName = propName // Keep original name for display\n }\n if (description) {\n prop.info.description = sanitizeInput(description)\n }\n\n const schema: PropertySchema = {}\n\n const pattern = propSchema.pattern ?? enumSchema.pattern\n if (pattern) {\n schema.pattern = pattern\n }\n const defaultValue = propSchema.default ?? enumSchema.default\n if (defaultValue !== undefined) {\n schema.defaultValue = { type: 'literal', value: String(defaultValue) }\n }\n\n if (typeInfo.type === 'string') {\n const minLength = propSchema.minLength ?? enumSchema.minLength\n const maxLength = propSchema.maxLength ?? enumSchema.maxLength\n if (minLength !== undefined) schema.minimum = minLength\n if (maxLength !== undefined) schema.maximum = maxLength\n } else if (typeInfo.type === 'number') {\n const minimum = propSchema.minimum ?? enumSchema.minimum\n const maximum = propSchema.maximum ?? enumSchema.maximum\n if (minimum !== undefined) {\n schema.minimum = minimum\n }\n if (maximum !== undefined) {\n schema.maximum = maximum\n }\n const exclusiveMinimum = propSchema.exclusiveMinimum ?? enumSchema.exclusiveMinimum\n const exclusiveMaximum = propSchema.exclusiveMaximum ?? enumSchema.exclusiveMaximum\n if (typeof exclusiveMinimum === 'number') {\n schema.minimum = exclusiveMinimum\n schema.exclusiveMinimum = true\n }\n if (typeof exclusiveMaximum === 'number') {\n schema.maximum = exclusiveMaximum\n schema.exclusiveMaximum = true\n }\n const multipleOf = propSchema.multipleOf ?? enumSchema.multipleOf\n if (typeof multipleOf === 'number') {\n schema.multipleOf = multipleOf\n }\n }\n if (enumSchema.oneOf && Array.isArray(enumSchema.oneOf)) {\n schema.enum = []\n for (const item of enumSchema.oneOf) {\n if (typeof item !== 'object' || !('const' in item)) {\n this.report(\n 'warning',\n `Invalid enum item in oneOf: ${JSON.stringify(item)}. Expected an object with 'const' property.`,\n `${parentEntityKey}.${propName}`\n )\n continue\n }\n if (typeof (item as JSONSchema7).const !== 'string') {\n this.report(\n 'warning',\n `Invalid enum const value: ${JSON.stringify((item as JSONSchema7).const)}. Expected a string.`,\n `${parentEntityKey}.${propName}`\n )\n continue\n }\n schema.enum.push((item as JSONSchema7).const as string)\n }\n }\n\n if (Object.keys(schema).length > 0) {\n // console.log(`Creating enum property '${propName}' with schema:`, schema)\n prop.schema = schema\n }\n return prop\n }\n}\n"]}
1
+ {"version":3,"file":"JsonSchemaImporter.js","sourceRoot":"","sources":["../../../../src/modeling/importers/JsonSch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AAQ;gBACV,CAAC;gBACD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAE,IAAoB,CAAC,KAAe,CAAC,CAAA;YACzD,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,2EAA2E;YAC3E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACtB,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["import type { JSONSchema7, JSONSchema7Definition, JSONSchema7TypeName } from 'json-schema'\nimport { DataDomain } from '../DataDomain.js'\nimport { DomainModel } from '../DomainModel.js'\nimport { DomainEntity } from '../DomainEntity.js'\nimport { DomainProperty, type DomainPropertySchema } from '../DomainProperty.js'\nimport type { PropertySchema } from '../types.js'\nimport type { PropertyWebBindings } from '../Bindings.js'\nimport type { DomainPropertyFormat, DomainPropertyType } from '../DataFormat.js'\nimport { sanitizeInput, toDatabaseColumnName, toDatabaseTableName } from '../helpers/database.js'\nimport { nanoid } from '../../nanoid.js'\n\n/**\n * Represents a single message (info, warning, or error) generated during the import process.\n */\nexport interface ImportMessage {\n level: 'warning' | 'info'\n message: string\n location?: string\n}\n\n/**\n * A report containing the result of the import process, including the created model\n * and any non-blocking messages.\n */\nexport interface JsonImportReport {\n /**\n * An array of messages generated during the import process.\n * These can include warnings, info messages, or other non-blocking notifications.\n */\n messages: ImportMessage[]\n /**\n * The model that was created during the import.\n */\n model: DomainModel\n}\n\n/**\n * A structure to hold in-memory JSON schema files for browser-based import.\n */\nexport interface InMemorySchema {\n /** A virtual path or identifier for the schema, used in `$ref` values. */\n path: string\n /** The parsed content of the JSON schema file. */\n contents: JSONSchema7\n}\n\n/**\n * Imports JSON Schema definitions into a DataDomain.\n *\n * This class parses a root JSON Schema file, bundles all its dependencies,\n * and translates the object definitions into DomainEntity instances within a specified DomainModel.\n */\nexport class JsonSchemaImporter {\n private domain: DataDomain\n private model!: DomainModel\n private refMap = new Map<string, string>()\n private messages: ImportMessage[] = []\n private enums = new Map<string, JSONSchema7>()\n\n constructor(domain: DataDomain) {\n this.domain = domain\n }\n\n /**\n * Resets the internal state for a new import operation.\n */\n private resetState(modelName: string) {\n this.model = this.domain.addModel({ info: { name: modelName } })\n this.refMap.clear()\n this.enums.clear()\n this.messages = []\n }\n\n /**\n * Centralized reporting for warnings and info messages.\n */\n private report(level: 'warning' | 'info', message: string, location?: string): void {\n this.messages.push({ level, message, location })\n }\n\n /**\n * Main import method: orchestrates schema bundling, entity creation, and population.\n */\n public async import(schemas: InMemorySchema[], modelName: string): Promise<JsonImportReport> {\n this.resetState(modelName)\n\n // Build a flat map of all definitions and $id-indexed schemas\n const definitionMap = new Map<string, JSONSchema7>()\n const idMap = new Map<string, JSONSchema7>()\n const processedSchemas = new Set<JSONSchema7>() // Track processed schema objects to avoid duplicates\n\n for (const schema of schemas) {\n // Add $id mapping if present\n if (schema.contents.$id) {\n idMap.set(schema.contents.$id, schema.contents)\n // Add the entire schema to the definitions maps as well as they can be referenced by other schemas.\n definitionMap.set(schema.contents.$id, schema.contents)\n }\n // Add the schema itself by its path\n definitionMap.set(schema.path, schema.contents)\n // Add all definitions inside this schema\n const definitions = schema.contents.definitions\n const defs = (schema.contents as unknown as { $defs: Record<string, JSONSchema7Definition> }).$defs\n\n if (definitions) {\n for (const [defName, defSchema] of Object.entries(definitions)) {\n if (typeof defSchema === 'object') {\n // Use a JSON pointer for the key - include both full path and short form\n definitionMap.set(`${schema.path}#/definitions/${defName}`, defSchema as JSONSchema7)\n definitionMap.set(`#/definitions/${defName}`, defSchema as JSONSchema7)\n }\n }\n }\n\n if (defs) {\n for (const [defName, defSchema] of Object.entries(defs)) {\n if (typeof defSchema === 'object') {\n // Use a JSON pointer for the key - include both full path and short form\n definitionMap.set(`${schema.path}#/$defs/${defName}`, defSchema as JSONSchema7)\n definitionMap.set(`#/$defs/${defName}`, defSchema as JSONSchema7)\n }\n }\n }\n }\n\n // == Pass 1: Create all entities ==\n for (const [key, schema] of definitionMap.entries()) {\n // Skip if this schema object has already been processed\n if (processedSchemas.has(schema)) {\n continue\n }\n\n if (typeof schema === 'object' && schema.type === 'object') {\n this.createEntity(key, schema, key)\n processedSchemas.add(schema)\n } else if (this.isEnum(schema)) {\n this.enums.set(key, schema)\n } else {\n this.report('warning', `Skipping non-object schema at ${key}`, key)\n }\n }\n // Also create entities for all $id-indexed schemas if not already present\n for (const [id, schema] of idMap.entries()) {\n // Skip if this schema object has already been processed\n if (processedSchemas.has(schema)) {\n continue\n }\n\n if (!this.refMap.has(id) && typeof schema === 'object' && schema.type === 'object') {\n this.createEntity(id, schema, id)\n processedSchemas.add(schema)\n } else if (this.isEnum(schema) && !this.enums.has(id)) {\n this.enums.set(id, schema)\n } else {\n this.report('warning', `Skipping non-object schema at ${id}`, id)\n }\n }\n // == Pass 2: Populate entities ==\n for (const [refPath, entityKey] of this.refMap.entries()) {\n const entity = this.domain.findEntity(entityKey)\n if (!entity) {\n this.report('warning', `Entity not found: ${entityKey}`, refPath)\n continue\n }\n const schema = this.resolveSchemaRef(refPath, definitionMap, idMap)\n if (!schema) {\n this.report('warning', `Schema not found for ref: ${refPath}`, refPath)\n continue\n }\n this.populateEntity(entity, schema)\n }\n\n return { model: this.model, messages: this.messages }\n }\n\n private isEnum(schema: JSONSchema7): boolean {\n if (schema.type !== 'string') {\n // I might be wrong about it, but I think enums are only for strings\n return false\n }\n if (!Array.isArray(schema.oneOf)) {\n return false\n }\n const notConst = schema.oneOf.find((s) => typeof s !== 'object' || !('const' in s))\n return !notConst // If all schemas in oneOf have 'const', it's an enum\n }\n\n /**\n * Resolves a schema reference from the flat definition/id maps.\n * Supports #/definitions/..., $id, or direct path keys.\n */\n private resolveSchemaRef(\n refPath: string,\n definitionMap: Map<string, JSONSchema7>,\n idMap: Map<string, JSONSchema7>\n ): JSONSchema7 | undefined {\n // Try direct match\n if (definitionMap.has(refPath)) return definitionMap.get(refPath)\n if (idMap.has(refPath)) return idMap.get(refPath)\n // Try to resolve #/definitions/Name or #/$defs/Name from any schema\n if (refPath.startsWith('#/definitions/') || refPath.startsWith('#/$defs/')) {\n for (const [key, schema] of definitionMap.entries()) {\n if (key === refPath) return schema\n }\n }\n // Try to resolve by $id fragment\n if (refPath.startsWith('#')) {\n for (const [id, schema] of idMap.entries()) {\n if (id.endsWith(refPath)) return schema\n }\n }\n return undefined\n }\n\n /**\n * Helper for entity creation, can be extended for custom logic.\n */\n private createEntity(name: string, schema: JSONSchema7, refPath: string): DomainEntity {\n let fixedName = schema.title || name\n\n // Extract just the definition name from JSON pointers (both short and full paths)\n if (name.includes('#/definitions/')) {\n const parts = name.split('#/definitions/')\n fixedName = schema.title || parts[parts.length - 1]\n } else if (name.includes('#/$defs/')) {\n const parts = name.split('#/$defs/')\n fixedName = schema.title || parts[parts.length - 1]\n }\n\n const cleanName = toDatabaseTableName(fixedName, 'untitled_entity')\n const entity = this.model.addEntity({\n info: {\n name: cleanName,\n displayName: fixedName,\n },\n })\n if (fixedName !== cleanName) {\n entity.info.displayName = fixedName // Keep original title for display\n }\n if (schema.description) {\n entity.info.description = schema.description\n }\n this.refMap.set(refPath, entity.key)\n return entity\n }\n\n /**\n * Generates a meaningful name for inline entities based on their parent context.\n */\n private generateInlineEntityName(parentEntityKey: string, propName: string, schema: JSONSchema7): string {\n // Try to use the schema title first\n if (schema.title) {\n return toDatabaseTableName(schema.title, 'untitled_entity')\n }\n\n // Find the parent entity to create a meaningful name\n const parentEntity = this.domain.findEntity(parentEntityKey)\n const parentName = parentEntity?.info.name || 'unknown'\n\n // Create a name like \"User_Address\" or \"Order_ShippingInfo\"\n const combinedName = `${parentName}_${propName}`\n return toDatabaseTableName(combinedName, 'untitled_entity')\n }\n\n /**\n * Populates a DomainEntity with its properties, associations, and parent relationships.\n */\n private populateEntity(entity: DomainEntity, schema: JSONSchema7): void {\n const properties = schema.properties || {}\n const required = new Set(schema.required || [])\n\n for (const [propName, propSchema] of Object.entries(properties)) {\n if (typeof propSchema === 'object') {\n this.createPropertyOrAssociation(entity, propName, propSchema, required.has(propName))\n }\n }\n\n // Handle 'allOf' for inheritance and composition.\n if (schema.allOf) {\n this.processAllOf(entity, schema.allOf)\n }\n }\n\n /**\n * Processes the `allOf` keyword, which can contain references (for inheritance)\n * or inline schemas (for composition/mixins).\n */\n private processAllOf(entity: DomainEntity, allOfSchemas: JSONSchema7Definition[]): void {\n allOfSchemas.forEach((subSchema, index) => {\n if (typeof subSchema !== 'object') {\n return\n }\n // Case 1: It's a reference to another entity (standard inheritance).\n if (subSchema.$ref) {\n // Try to resolve the referenced entity by $ref (could be #/definitions/..., $id, or path)\n const parentKey = this.refMap.get(subSchema.$ref)\n if (parentKey) {\n try {\n entity.addParent(parentKey)\n } catch (e) {\n this.report(\n 'warning',\n `Could not add parent ${parentKey} to ${entity.key}: ${(e as Error).message}`,\n entity.key\n )\n }\n } else {\n this.report('warning', `Could not resolve parent reference: ${subSchema.$ref}`, entity.key)\n }\n return\n }\n // Case 2: It's an inline schema to be mixed in.\n // const mixinKey = `${entity.key}_mixin_${index}`\n const mixinName = subSchema.title || `${entity.info.name} Mixin ${index + 1}`\n const mixinEntity = this.model.addEntity({\n // key: mixinKey,\n info: {\n name: mixinName,\n description:\n subSchema.description ||\n `Auto-generated mixin entity from an 'allOf' clause in the schema for '${entity.info.name}'. This entity is not intended for direct use.`,\n },\n })\n this.populateEntity(mixinEntity, subSchema)\n try {\n entity.addParent(mixinEntity.key)\n } catch (e) {\n this.report(\n 'warning',\n `Could not add mixin parent ${mixinEntity.key} to ${entity.key}: ${(e as Error).message}`,\n entity.key\n )\n }\n })\n }\n /**\n * Recursively analyzes a schema definition to find all contained primitive types and `$ref`s.\n * It's used to understand the nature of a property (is it a primitive, an association, or a mix).\n */\n private collectTypesAndRefs(\n schema: JSONSchema7Definition,\n parentEntityKey?: string,\n propName?: string\n ): {\n refs: Set<string>\n types: Set<JSONSchema7TypeName>\n isArray: boolean\n } {\n const collected = { refs: new Set<string>(), types: new Set<JSONSchema7TypeName>(), isArray: false }\n\n if (typeof schema !== 'object') {\n return collected\n }\n\n if (schema.$ref) {\n collected.refs.add(schema.$ref)\n return collected\n }\n\n if (schema.type) {\n const types = Array.isArray(schema.type) ? schema.type : [schema.type]\n for (const t of types) {\n if (t !== 'null') collected.types.add(t)\n }\n }\n\n // Handle inline object types by creating entities immediately\n if (schema.type === 'object' && schema.properties && parentEntityKey && propName) {\n // Create an entity for this inline object immediately\n const inlineEntityName = this.generateInlineEntityName(parentEntityKey, propName, schema)\n const inlineEntity = this.createEntity(inlineEntityName, schema, inlineEntityName)\n\n // Populate it immediately since we have the schema\n this.populateEntity(inlineEntity, schema)\n\n // Add a reference to it so it gets treated as an association\n collected.refs.add(inlineEntityName)\n\n return collected\n }\n\n if (schema.type === 'array') {\n collected.isArray = true\n if (typeof schema.items === 'object') {\n // Recurse into items - pass along parent context for inline objects in arrays\n const itemInfo = this.collectTypesAndRefs(\n Array.isArray(schema.items) ? schema.items[0] : schema.items,\n parentEntityKey,\n propName ? `${propName}_item` : undefined\n )\n itemInfo.refs.forEach((r) => collected.refs.add(r))\n itemInfo.types.forEach((t) => collected.types.add(t))\n }\n return collected\n }\n\n const choices = schema.anyOf || schema.oneOf\n if (choices) {\n for (const choice of choices) {\n const choiceInfo = this.collectTypesAndRefs(choice, parentEntityKey)\n choiceInfo.refs.forEach((r) => collected.refs.add(r))\n choiceInfo.types.forEach((t) => collected.types.add(t))\n if (choiceInfo.isArray) {\n collected.isArray = true\n }\n }\n }\n\n if (schema.enum) {\n // If the schema has an enum, we treat it as a string type with specific values.\n collected.types.add('string')\n // consider the following schema: `\"enum\": [\"one\", \"two\", \"three\"]`\n const id = nanoid(8)\n this.enums.set(id, {\n type: 'string',\n oneOf: schema.enum.map((value) => ({\n const: String(value), // Ensure enum values are strings\n })),\n })\n collected.refs.add(id) // Add the enum reference\n }\n\n return collected\n }\n\n /**\n * Determines whether to create a DomainProperty or a DomainAssociation for a given schema property.\n */\n private createPropertyOrAssociation(\n entity: DomainEntity,\n propName: string,\n propSchema: JSONSchema7,\n isRequired: boolean\n ): void {\n // Analyze the property schema to understand its composition (primitives, refs, arrays).\n // Pass entity context to collectTypesAndRefs for inline object handling\n const analysis = this.collectTypesAndRefs(propSchema, entity.key, propName)\n // console.log(`Analyzing property '${propName}' in entity '${entity.info.name}':`, analysis, propSchema)\n // Case 1: If the property has `$ref` to an enum, we treat it as a DomainProperty.\n if (analysis.refs.size === 1 && this.enums.has([...analysis.refs][0])) {\n const prop = this.createEnumProperty(\n propName,\n propSchema,\n this.enums.get([...analysis.refs][0]) as JSONSchema7,\n entity.info.name as string\n )\n if (prop) {\n prop.multiple = analysis.isArray\n // console.log(`Adding enum property '${propName}' to entity '${entity.info.name}'`, prop.toJSON())\n entity.addProperty(prop.toJSON())\n }\n return\n }\n\n // Case 2: If any `$ref` was found, we treat it as an Association.\n if (analysis.refs.size > 0) {\n const sanitizedName = toDatabaseColumnName(propName, 'untitled_association')\n const assoc = entity.addAssociation({ info: { name: sanitizedName } })\n if (sanitizedName !== propName) {\n assoc.info.displayName = propName // Keep original name for display\n }\n if (propSchema.description) {\n assoc.info.description = propSchema.description\n }\n assoc.required = isRequired\n assoc.multiple = analysis.isArray\n for (const ref of analysis.refs) {\n const targetKey = this.refMap.get(ref)\n if (targetKey) {\n assoc.addTarget(targetKey)\n }\n }\n if (analysis.types.size > 0) {\n this.report(\n 'warning',\n `Property '${propName}' has a mix of reference and primitive types. Only the reference(s) will be used to create an association. The primitive types (${[\n ...analysis.types,\n ].join(', ')}) are ignored.`,\n entity.key\n )\n }\n return\n }\n // Case 3: No `$ref`s found, only primitive types. We treat it as a DomainProperty.\n if (analysis.types.size > 0) {\n // We need to create a temporary schema object to pass to createDomainProperty,\n // as it expects a single schema. We'll use the first detected type.\n const tempSchema: JSONSchema7 = {\n ...propSchema,\n // Pass the collected types to be resolved by mapJsonTypeToDomainType\n type: [...analysis.types],\n }\n const prop = this.createDomainProperty(entity.key, propName, tempSchema, isRequired)\n if (prop) {\n prop.multiple = analysis.isArray\n entity.addProperty(prop.toJSON())\n }\n return\n }\n }\n\n /**\n * Creates and configures a DomainProperty based on a JSON schema property definition.\n */\n private createDomainProperty(\n parentEntityKey: string,\n propName: string,\n propSchema: JSONSchema7,\n isRequired: boolean\n ): DomainProperty | null {\n const typeInfo = this.mapJsonTypeToDomainType(propSchema.type, propSchema, `${parentEntityKey}.${propName}`)\n if (!typeInfo) return null\n const sanitizedName = toDatabaseColumnName(propName, 'untitled_property')\n const propertyInit: Partial<DomainPropertySchema> = {\n info: { name: sanitizedName, description: propSchema.description },\n type: typeInfo.type,\n required: isRequired,\n }\n\n // Use the constructor that doesn't add to the graph immediately.\n const prop = new DomainProperty(this.domain, parentEntityKey, propertyInit)\n if (sanitizedName !== propName) {\n prop.info.displayName = propName // Keep original name for display\n }\n\n const schema: PropertySchema = {}\n const webBindings: PropertyWebBindings = {}\n\n if (propSchema.pattern) schema.pattern = propSchema.pattern\n if (propSchema.enum) schema.enum = propSchema.enum.map(String)\n if (propSchema.default !== undefined) schema.defaultValue = { type: 'literal', value: String(propSchema.default) }\n\n if (typeInfo.type === 'string') {\n if (typeof propSchema.minLength === 'number') schema.minimum = propSchema.minLength\n if (typeof propSchema.maxLength === 'number') schema.maximum = propSchema.maxLength\n } else if (typeInfo.type === 'number') {\n if (typeof propSchema.minimum === 'number') schema.minimum = propSchema.minimum\n if (typeof propSchema.maximum === 'number') schema.maximum = propSchema.maximum\n if (typeof propSchema.exclusiveMinimum === 'number') {\n schema.minimum = propSchema.exclusiveMinimum\n schema.exclusiveMinimum = true\n }\n if (typeof propSchema.exclusiveMaximum === 'number') {\n schema.maximum = propSchema.exclusiveMaximum\n schema.exclusiveMaximum = true\n }\n if (typeof propSchema.multipleOf === 'number') schema.multipleOf = propSchema.multipleOf\n if (typeInfo.format) {\n webBindings.format = typeInfo.format\n }\n }\n\n if (Object.keys(schema).length > 0) {\n prop.schema = schema\n }\n if (Object.keys(webBindings).length > 0) {\n prop.bindings = [{ type: 'web', schema: webBindings }]\n }\n\n return prop\n }\n\n /**\n * Maps a JSON Schema type to a DomainPropertyType.\n */\n private mapJsonTypeToDomainType(\n jsonType: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined,\n schema: JSONSchema7,\n location?: string\n ): { type: DomainPropertyType; format?: DomainPropertyFormat } | null {\n if (!jsonType) {\n return null\n }\n\n if (Array.isArray(jsonType)) {\n const nonNullTypes = jsonType.filter((t) => t !== 'null')\n if (nonNullTypes.length === 0) {\n return null\n }\n if (nonNullTypes.length === 2 && nonNullTypes.includes('array')) {\n const nonArrayType = nonNullTypes.filter((t) => t !== 'array')[0]\n return this.mapJsonTypeToDomainType(nonArrayType, schema, location)\n }\n if (nonNullTypes.length > 1) {\n this.report(\n 'warning',\n `Property has a union of primitive types: [${nonNullTypes.join(', ')}]. The importer will use the first type ('${nonNullTypes[0]}').`,\n location\n )\n }\n // Pick the first non-null type from the union.\n return this.mapJsonTypeToDomainType(nonNullTypes[0], schema, location)\n }\n\n if (jsonType === 'string') {\n // JSON Schema has the `format` property which can specify more about the string type.\n // We need to decide how to handle these formats.\n const choices = schema.anyOf || schema.oneOf\n if (Array.isArray(choices)) {\n // If we have a list of choices, we need to pick one.\n const formats: string[] = []\n for (const choice of choices) {\n const typed = choice as JSONSchema7\n if (typed.format) {\n formats.push(typed.format)\n }\n }\n // we will list dates from the most specific to the least specific\n if (formats.includes('date-time')) {\n return { type: 'datetime' }\n }\n if (formats.includes('date')) {\n return { type: 'date' }\n }\n if (formats.includes('time')) {\n return { type: 'time' }\n }\n }\n // If no specific format is found, we default to string.\n return { type: 'string' }\n }\n\n switch (jsonType) {\n case 'number':\n return { type: 'number', format: 'double' }\n case 'integer':\n return { type: 'number', format: 'int64' }\n case 'boolean':\n return { type: 'boolean' }\n // JSON Schema's 'object' and 'array' are handled as associations or multi-valued properties.\n // Other types like 'null' are handled by making the property not required.\n default:\n return null\n }\n }\n\n private createEnumProperty(\n propName: string,\n propSchema: JSONSchema7,\n enumSchema: JSONSchema7,\n parentEntityKey: string\n ): DomainProperty | null {\n const description = propSchema.description ?? enumSchema.description\n const typeInfo = this.mapJsonTypeToDomainType(enumSchema.type, enumSchema, `${parentEntityKey}.${propName}`)\n if (!typeInfo) return null\n\n const sanitizedName = toDatabaseColumnName(propName)\n const propertyInit: Partial<DomainPropertySchema> = {\n info: { name: sanitizedName },\n type: typeInfo.type,\n // required: isRequired,\n required: false,\n }\n\n // Use the constructor that doesn't add to the graph immediately.\n const prop = new DomainProperty(this.domain, parentEntityKey, propertyInit)\n if (sanitizedName !== propName) {\n prop.info.displayName = propName // Keep original name for display\n }\n if (description) {\n prop.info.description = sanitizeInput(description)\n }\n\n const schema: PropertySchema = {}\n\n const pattern = propSchema.pattern ?? enumSchema.pattern\n if (pattern) {\n schema.pattern = pattern\n }\n const defaultValue = propSchema.default ?? enumSchema.default\n if (defaultValue !== undefined) {\n schema.defaultValue = { type: 'literal', value: String(defaultValue) }\n }\n\n if (typeInfo.type === 'string') {\n const minLength = propSchema.minLength ?? enumSchema.minLength\n const maxLength = propSchema.maxLength ?? enumSchema.maxLength\n if (minLength !== undefined) schema.minimum = minLength\n if (maxLength !== undefined) schema.maximum = maxLength\n } else if (typeInfo.type === 'number') {\n const minimum = propSchema.minimum ?? enumSchema.minimum\n const maximum = propSchema.maximum ?? enumSchema.maximum\n if (minimum !== undefined) {\n schema.minimum = minimum\n }\n if (maximum !== undefined) {\n schema.maximum = maximum\n }\n const exclusiveMinimum = propSchema.exclusiveMinimum ?? enumSchema.exclusiveMinimum\n const exclusiveMaximum = propSchema.exclusiveMaximum ?? enumSchema.exclusiveMaximum\n if (typeof exclusiveMinimum === 'number') {\n schema.minimum = exclusiveMinimum\n schema.exclusiveMinimum = true\n }\n if (typeof exclusiveMaximum === 'number') {\n schema.maximum = exclusiveMaximum\n schema.exclusiveMaximum = true\n }\n const multipleOf = propSchema.multipleOf ?? enumSchema.multipleOf\n if (typeof multipleOf === 'number') {\n schema.multipleOf = multipleOf\n }\n }\n if (enumSchema.oneOf && Array.isArray(enumSchema.oneOf)) {\n schema.enum = []\n for (const item of enumSchema.oneOf) {\n if (typeof item !== 'object' || !('const' in item)) {\n this.report(\n 'warning',\n `Invalid enum item in oneOf: ${JSON.stringify(item)}. Expected an object with 'const' property.`,\n `${parentEntityKey}.${propName}`\n )\n continue\n }\n if (typeof (item as JSONSchema7).const !== 'string') {\n this.report(\n 'warning',\n `Invalid enum const value: ${JSON.stringify((item as JSONSchema7).const)}. Expected a string.`,\n `${parentEntityKey}.${propName}`\n )\n continue\n }\n schema.enum.push((item as JSONSchema7).const as string)\n }\n }\n\n if (Object.keys(schema).length > 0) {\n // console.log(`Creating enum property '${propName}' with schema:`, schema)\n prop.schema = schema\n }\n return prop\n }\n}\n"]}
@@ -23,20 +23,6 @@ export interface DataDomainRemoveOptions {
23
23
  */
24
24
  force?: boolean;
25
25
  }
26
- export interface AssociationAddOptions {
27
- /**
28
- * When set, it is the the association target's origin data domain.
29
- * The key of the target data domain where this target entity is defined.
30
- * Only used when `key` is specified.
31
- */
32
- domain?: string;
33
- /**
34
- * The key of the association target, if known.
35
- * If the target of the association is not specified, and the association has no other targets,
36
- * the association is ignored in the namespace while processing.
37
- */
38
- key?: string;
39
- }
40
26
  export interface DomainGraphEdge {
41
27
  /**
42
28
  * Indicates that the edge is to or from a foreign domain.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modeling/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAA;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,O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AAO,eAAe,GACtB,OAAO,gBAAgB,GACvB,OAAO,kBAAkB,GACzB,OAAO,qBAAqB,CAAA;AAEhC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEvB;;OAEG;IACH,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAA;IAEhC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAE/B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,EAAE,mBAAmB,CAAA;IAEzB;;OAEG;IACH,aAAa,EAAE,CAAC,MAAM,GAAG,aAAa,GAAG,aAAa,CAAC,EAAE,CAAA;IAEzD;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,SAAS,EAAE,OAAO,CAAA;CACnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modeling/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { GraphJson } from '@api-client/graph/graph/types.js'\nimport type { Graph } from '@api-client/graph/graph/Graph.js'\nimport type { DomainAssociation } from './DomainAssociation.js'\nimport type { DomainEntity } from './DomainEntity.js'\nimport type { DomainModel } from './DomainModel.js'\nimport type { DomainNamespace } from './DomainNamespace.js'\nimport type { DomainProperty } from './DomainProperty.js'\nimport type {\n DomainNamespaceKind,\n DomainEntityKind,\n DomainModelKind,\n DomainPropertyKind,\n DomainAssociationKind,\n DataDomainKind,\n ExposedEntityKind,\n} from '../models/kinds.js'\nimport type { DataDomain } from './DataDomain.js'\nimport { AccessRuleSchema } from './rules/AccessRule.js'\nimport { RateLimitingConfigurationSchema } from './rules/RateLimitingConfiguration.js'\nimport { ActionSchema } from './actions/Action.js'\n\nexport interface DataDomainRemoveOptions {\n /**\n * When true, the object will be forcibly removed.\n * The resolution defined in the `ImpactResolution` class will be applied.\n *\n * For example, when removing an entity that is a parent to another entity, it will\n * removed itself as a parent from the child entity.\n *\n * Note, this option should only be used when the DomainImpactAnalysis has been performed\n * and the user was informed of the impact.\n */\n force?: boolean\n}\n\nexport interface AssociationAddOptions {\n /**\n * When set, it is the the association target's origin data domain.\n * The key of the target data domain where this target entity is defined.\n * Only used when `key` is specified.\n */\n domain?: string\n /**\n * The key of the association target, if known.\n * If the target of the association is not specified, and the association has no other targets,\n * the association is ignored in the namespace while processing.\n */\n key?: string\n}\n\nexport interface DomainGraphEdge {\n /**\n * Indicates that the edge is to or from a foreign domain.\n */\n foreign?: boolean\n /**\n * The key of the foreign domain. Always set with the `foreign` property.\n */\n domain?: string\n /**\n * The type of the edge.\n * - `association` The edge is to an association object.\n * - When coming **from** an entity (the `v` property), that entity owns the association.\n * - When coming **to** an entity (the `w` property), that entity is the target of the association.\n * An association can have multiple targets.\n * - `property` The edge is to a property object. Can only be created between an entity and a property.\n * - The **from** (`v`) is the entity.\n * - The **to** (`w`) is the property.\n * - `parent` The edge is to a parent object.\n * - The **from** (`v`) is the child entity.\n * - The **to** (`w`) is the parent entity.\n */\n type: 'association' | 'property' | 'parent'\n}\n\nexport type DomainGraphNodeType = DomainNamespace | DomainModel | DomainEntity | DomainProperty | DomainAssociation\n\n/**\n * An interface that describes the data domain dependency.\n */\nexport interface ForeignDomainDependency {\n /**\n * The system registered key of the foreign domain.\n */\n key: string\n /**\n * The version of the foreign domain used in this domain.\n */\n version: string\n}\n\nexport interface AssociationTarget {\n /**\n * The key of the target entity.\n */\n key: string\n /**\n * The key of the target data domain.\n * This is only set when the target is in a different data domain.\n */\n domain?: string\n}\n\n/**\n * Describes the default value set on a property schema.\n */\nexport interface SchemaDefaultValue {\n /**\n * The type of the default value.\n *\n * - `literal` The `value` should be used as-is.\n * - `function` The value represents the name of the function to be used.\n */\n type: 'literal' | 'function'\n /**\n * The actual value type depends on the `type`.\n * It is always a string and it has to be casted to the property's data type.\n */\n value: string\n}\n\n/**\n * A general schema definition for a property.\n * This is propagated to all bindings (when they support these properties).\n */\nexport interface PropertySchema {\n /**\n * The minimum value of the property.\n *\n * By default it is inclusive value. Use the `exclusiveMinimum` property to make it exclusive.\n *\n * Used with:\n * - string\n * - number\n * - date\n * - time\n * - datetime\n */\n minimum?: number\n /**\n * The maximum value of the property.\n *\n * By default it is inclusive value. Use the `exclusiveMaximum` property to make it exclusive.\n *\n * Used with:\n * - string\n * - number\n * - date\n * - time\n * - datetime\n */\n maximum?: number\n /**\n * When set, the minimum value is exclusive.\n *\n * - When `false`: value ≥ minimum.\n * - When `true`: value > minimum.\n */\n exclusiveMinimum?: boolean\n /**\n * When set, the exclusiveMaximum value is exclusive.\n *\n * - When `false`: value ≤ maximum.\n * - When `true`: value < minimum.\n */\n exclusiveMaximum?: boolean\n /**\n * The multiplier value for a number scalar.\n *\n * Examples:\n * - if `1` then every integer is allowed\n * - if `2` than every even number is allowed\n * - if `0.5` than every number dividable by `0.5` is allowed\n */\n multipleOf?: number\n /**\n * The enum values for the property.\n * They are always encoded as strings. The actual type is defined in the `dataType` property.\n */\n enum?: string[]\n /**\n * The default value for the property.\n * This is always encoded as a string. The actual type is defined in the `dataType` property.\n */\n defaultValue?: SchemaDefaultValue\n /**\n * The example values for the property.\n * They are always encoded as strings. The actual type is defined in the `dataType` property.\n */\n examples?: string[]\n /**\n * The pattern to use with a string scalar.\n */\n pattern?: string\n}\n\n/**\n * The shortcut type for the data domain graph.\n */\nexport type DataDomainGraph = Graph<unknown, DomainGraphNodeType, DomainGraphEdge>\n/**\n * The serialized version of the data domain graph.\n */\nexport type SerializedGraph = GraphJson<unknown, object, DomainGraphEdge>\n\n/**\n * Represents a standardized, machine-readable error response body\n * as defined by RFC 7807 for HTTP APIs.\n */\nexport interface ProblemDetails {\n /**\n * A URI that identifies the specific problem type. Should resolve to human-readable docs.\n * e.g., \"https://docs.apinow.app/errors/validation-failed\"\n */\n type: string\n\n /**\n * A short, human-readable summary of the problem type.\n * e.g., \"Validation Error\"\n */\n title: string\n\n /**\n * The HTTP status code generated by the origin server for this problem.\n */\n status?: number\n\n /**\n * A human-readable explanation specific to this occurrence of the problem.\n */\n detail?: string\n\n /**\n * A URI that identifies the specific occurrence of the problem.\n * Can be the API request path that caused the error.\n */\n instance: string\n}\n\n/**\n * The set of supported filter operators for the List action.\n * These are used in query parameters, e.g., ?price[gte]=100\n *\n * - eq: Equal\n * - nq: Not Equal\n * - lt: Less Than\n * - lte: Less Than or Equal\n * - gt: Greater Than\n * - gte: Greater Than or Equal\n * - ex: Checks if the field exists\n * - re: Regular expression match\n * - bf: Date before a specific value\n * - af: Date after a specific value\n * - cn: String contains substring / Array contains element\n * - st: String starts with\n * - end: String ends with\n * - in: Value is one of the elements in the provided array\n * - nin: Value is not one of the elements in the provided array\n */\nexport type ResourceFilterOperator =\n | 'eq' // Equal\n | 'nq' // Not equal\n | 'lt' // Less than\n | 'lte' // Less than or equal\n | 'gt' // Greater than\n | 'gte' // Greater than or equal\n | 'ex' // Checks if the field exists\n | 're' // Regular expression match\n | 'bf' // Date before a specific value\n | 'af' // Date after a specific value\n | 'cn' // String contains substring / Array contains element\n | 'st' // String starts with\n | 'end' // String ends with\n | 'in' // Value is one of the elements in the provided array\n | 'nin' // Value is not one of the elements in the provided array\n\n/**\n * The session transport configuration interface.\n * This defines the properties that are common to all session transports.\n */\ninterface SessionTransport {\n /**\n * Whether the session transport is enabled.\n */\n enabled: boolean\n /**\n * The kind of session transport. Each interface defines its own kind.\n */\n kind: string\n}\n\n/**\n * Configuration for cookie-based session transport.\n */\nexport interface CookieConfiguration extends SessionTransport {\n kind: 'cookie'\n /**\n * The lifetime of the cookie session.\n * This is a string representing the duration, e.g., \"7d\" for 7 days or \"24h\" for 24 hours.\n *\n * @default \"7d\"\n */\n lifetime: string\n /**\n * Whether the cookie can only be accessed by the server.\n * This is a security feature to prevent client-side scripts from accessing the cookie.\n * If set to false, the cookie can be accessed by client-side scripts.\n * @default true\n */\n httpOnly: boolean // Defaults to true\n /**\n * Whether the cookie should only be sent over secure connections (HTTPS).\n * This is a security feature to prevent the cookie from being sent over unencrypted connections.\n * @default true\n */\n secure: boolean\n /**\n * The SameSite attribute of the cookie.\n * This attribute controls whether the cookie is sent with cross-site requests.\n * - 'none' means the cookie is sent with cross-site requests.\n * - 'lax' means the cookie is sent with top-level navigations and will be sent along with GET\n * requests initiated by third-party websites.\n * @default 'none'\n */\n sameSite: 'none' | 'lax'\n /**\n * The name of the cookie.\n * This is the key under which the session data will be stored in the cookie.\n * @default 'as' - 'as' stands for \"api session\"\n */\n name: string\n}\n\n/**\n * Configuration for JWT-based session transport.\n */\nexport interface JwtConfiguration extends SessionTransport {\n kind: 'jwt'\n /**\n * The lifetime of the JWT token.\n * This is a string representing the duration, e.g., \"7d\" for 7 days or \"15m\" for 15 minutes.\n *\n * @default \"7d\"\n */\n lifetime: string\n}\n\nexport interface SessionConfiguration {\n /**\n * The secret used to sign the JWT and cookies. Should be handled securely.\n * Not visible in the UI after being set.\n */\n secret: string\n /**\n * The properties from the `User` entity to be encoded into the session payload (JWT/cookie).\n * These properties become available in the `request.auth` object at runtime.\n *\n * In practice, these are the ids of the properties in the `User` entity.\n */\n properties: string[]\n /**\n * The cookie-based session transport configuration.\n */\n cookie?: CookieConfiguration\n\n /**\n * The JWT-based session transport configuration.\n */\n jwt?: JwtConfiguration\n}\n\n/**\n * Defines the authorization strategy for the API.\n * It is a base interface that can be extended for different strategies.\n * For MVP, we will start with Roles-Based Access Control (RBAC).\n */\nexport interface AuthorizationConfiguration {\n /**\n * The authorization strategy. For MVP, we will start with RBAC.\n * Post-MVP will include Permission-Based Access Control (PBAC).\n * The strategy determines how users are granted access to resources.\n *\n * - RBAC (Roles-Based Access Control): Users are assigned roles, and permissions are granted to those roles.\n * - PBAC (Permission-Based Access Control): Users are granted permissions directly, allowing for more\n * granular control.\n */\n strategy: string\n}\n\nexport interface RolesBasedAccessControl extends AuthorizationConfiguration {\n strategy: 'RBAC'\n /**\n * The property within the designated \"User\" entity that defines the user's role.\n * This field is used in access rules to grant permissions.\n *\n * This property must be marked with the \"Role\" data semantic in the Data Modeler.\n * It is required to publish the API.\n */\n roleKey: string\n}\n\n/**\n * Configures the strategy for authenticating end-users.\n * An API can only support one authentication strategy at a time.\n * This is a base interface that can be extended for different strategies.\n */\nexport interface AuthenticationConfiguration {\n /**\n * The authentication method. For MVP, this is focused on username/password.\n * This can be extended in the future to include 'SSO'.\n */\n strategy: string\n}\n\n/**\n * Configuration for username/password authentication.\n * This is the primary authentication method for the API (MVP).\n */\nexport interface UsernamePasswordConfiguration extends AuthenticationConfiguration {\n strategy: 'UsernamePassword'\n /**\n * The specific property within the User entity that holds the password.\n * This property must be marked with the \"Password\" data semantic in the Data Modeler.\n *\n * This property is required to publish the API.\n */\n passwordKey?: string\n}\n\n/**\n * Represents a Data Entity from the Data Domain that the API will expose and operate upon.\n */\nexport interface ExposedEntitySchema {\n kind: typeof ExposedEntityKind\n /**\n * The unique identifier for this exposure instance.\n * In the exposure model, we need to uniquely identify each exposure instance, because\n * an entity can be exposed multiple times in different contexts. Consider the following structure:\n *\n * ```\n * /categories/{categoryId}\n * /products/{productId}/categories\n * /products/{productId}/categories/{categoryId}\n * /promotions/{promotionId}/categories\n * /promotions/{promotionId}/categories/{categoryId}\n * ```\n *\n * The `category` entity would be exposed multiple times (as root and nested under products and promotions).\n * We need a way to distinguish between these different exposure instances.\n */\n key: string\n /**\n * A pointer to a Data Entity from the Data Domain.\n */\n entity: AssociationTarget\n /**\n * Indicates whether this exposure has a collection endpoint.\n * A collection endpoint is optional for nested exposures where the association is 1:1\n * and the schema is embedded directly under the parent resource.\n */\n hasCollection: boolean\n /**\n * A path to the collection endpoint for this exposure.\n * Starts with '/'. Not set for 1:1 nested exposures where collection does not exist.\n */\n collectionPath?: string\n\n /**\n * A path to the resource endpoint for this exposure.\n * Starts with '/'. For 1:1 nested exposures the resource path typically does not include an id segment.\n */\n resourcePath: string\n\n /**\n * Whether this exposure is a root exposure (top-level collection).\n * If this is set then the `parent` reference must be populated.\n */\n isRoot?: boolean\n\n /**\n * Parent reference when this exposure was created via following an association.\n */\n parent?: ExposeParentRef\n\n /**\n * Expose-time config used to create this exposure (persisted for auditing/UI).\n * This is only populated for the root exposure. All children exposures inherit this config.\n */\n exposeOptions?: ExposeOptions\n\n /**\n * The list of enabled API actions for this exposure (List/Read/Create/etc.)\n */\n actions: ActionSchema[]\n\n /**\n * Optional array of access rules that define the access control policies for this exposure.\n */\n accessRule?: AccessRuleSchema[]\n\n /**\n * Optional configuration for rate limiting for this exposure.\n */\n rateLimiting?: RateLimitingConfigurationSchema\n\n /**\n * When true, generation for this exposure hit configured limits\n */\n truncated?: boolean\n}\n\n/**\n * Parent reference stored on a nested exposure\n */\nexport interface ExposeParentRef {\n /**\n * The key of the parent exposed entity. This references the `ExposedEntity.key` property.\n */\n key: string\n /**\n * The association from the parent that produced this exposure.\n * A sub-entity must always have a parent association.\n */\n association: AssociationTarget\n /**\n * The numeric depth from the root exposure (root = 0)\n */\n depth?: number\n}\n\n/**\n * Options passed when creating a new exposure\n */\nexport interface ExposeOptions {\n /**\n * Whether to follow associations when creating the exposure.\n * When not set, it only exposes the passed entity.\n */\n followAssociations?: boolean\n /**\n * The maximum depth to follow associations when creating the exposure.\n */\n maxDepth?: number\n}\n\n/**\n * Represents a pagination strategy for API actions that return collections of resources.\n * This is a base interface that can be extended for different pagination strategies.\n */\nexport interface PaginationStrategy {\n /**\n * The kind of pagination strategy. This is used to identify the specific pagination method.\n * For example, 'cursor' for cursor-based pagination or 'offset' for offset-based pagination.\n */\n kind: string\n /**\n * The default page size for the pagination strategy.\n * This is the number of items returned per page when no specific page size is requested.\n */\n pageSize?: number\n}\n\n/**\n * Represents the cursor-based pagination strategy.\n */\nexport interface CursorPaginationStrategy extends PaginationStrategy {\n kind: 'cursor'\n}\n\n/**\n * Represents the offset-based pagination strategy.\n */\nexport interface OffsetPaginationStrategy extends PaginationStrategy {\n kind: 'offset'\n}\n\nexport type DomainImpactKinds =\n | typeof DomainNamespaceKind\n | typeof DomainEntityKind\n | typeof DomainModelKind\n | typeof DomainPropertyKind\n | typeof DomainAssociationKind\n | typeof DataDomainKind\n\n/**\n * The impact analysis report\n */\nexport interface DomainImpactReport {\n /**\n * The key of the impacted data object.\n * This is the key of the object that is being changed.\n */\n key: string\n /**\n * The kind of the impacted data object.\n * This is the kind of the object that is being changed.\n */\n kind: DomainImpactKinds\n /**\n * The list of impacted data objects.\n */\n impact: DomainImpactItem[]\n /**\n * Whether it is possible to proceed with the change.\n * If the change is not possible, the reason will be in the impact list.\n */\n canProceed: boolean\n}\n\nexport interface DomainImpactItem {\n /**\n * The key of the impacted data object.\n */\n key: string\n /**\n * The kind of the impacted data object.\n */\n kind: string\n /**\n * The type of the impact.\n *\n * - `delete` - The data object would be deleted.\n */\n type: 'delete' | 'publish'\n /**\n * The impact description.\n * Explains what will happen to the impacted data object.\n * This is a human-readable description of the impact.\n * It should be clear and concise.\n */\n impact: string\n /**\n * The severity of the impact.\n *\n * - `info` - The impact is informational.\n * - `warning` - The impact can potentially cause problems but is not a blocker.\n * - `error` - The impact is a blocker and needs to be resolved before proceeding.\n */\n severity: 'info' | 'warning' | 'error'\n /**\n * The type of the relationship between two impacted objects.\n */\n relationship?: 'child'\n /**\n * The resolution of the conflict if the change will be forced.\n */\n resolution?: string\n /**\n * The optional parent of the impacted data object.\n * For example, if the impacted item is a property, this will be the entity it belongs to.\n */\n parent?: string\n}\n\nexport interface DeserializeOptions {\n /**\n * The mode to use for deserialization.\n */\n mode?: DeserializationMode\n /**\n * The serialized graph to deserialize.\n * This is the JSON representation of the graph.\n */\n json?: SerializedGraph\n /**\n * The list of foreign domains that this domain depends on.\n */\n dependencies?: DataDomain[]\n}\n\n/**\n * Describes the mode for deserializing a domain graph.\n */\nexport type DeserializationMode = 'strict' | 'lenient'\n\n/**\n * Describes an issue found during deserialization.\n */\nexport interface DeserializationIssue {\n /**\n * The type of issue encountered.\n */\n type: 'missing_node' | 'missing_edge' | 'invalid_parent' | 'missing_dependency' | 'malformed_entry' | 'unknown_kind'\n /**\n * The severity of the issue.\n */\n severity: 'error' | 'warning' | 'info'\n /**\n * A human-readable description of the issue.\n */\n message: string\n /**\n * The key of the affected node, edge, or entity if applicable.\n */\n affectedKey?: string\n /**\n * Additional context about the issue.\n */\n context?: Record<string, unknown>\n /**\n * The action taken to handle this issue in lenient mode.\n */\n resolution?: string\n}\n\n/**\n * The result of a deserialization operation.\n */\nexport interface DeserializationResult {\n /**\n * The deserialized graph.\n */\n graph: DataDomainGraph\n /**\n * Issues encountered during deserialization.\n */\n issues: DeserializationIssue[]\n /**\n * Whether the deserialization was successful.\n * This is set to true when a critical failures occurred.\n */\n success: boolean\n}\n\n/**\n * Available node types for search filtering.\n */\nexport type SearchableNodeType =\n | typeof DomainNamespaceKind\n | typeof DomainModelKind\n | typeof DomainEntityKind\n | typeof DomainPropertyKind\n | typeof DomainAssociationKind\n\n/**\n * Search criteria for filtering domain nodes.\n */\nexport interface DomainSearchCriteria {\n /**\n * Text query to search for in name, displayName, and description fields.\n * Can be a string for exact match or RegExp for pattern matching.\n */\n query?: string | RegExp\n\n /**\n * Filter by specific node types. If not provided, all node types are included.\n */\n nodeTypes?: SearchableNodeType[]\n\n /**\n * Whether to include nodes from foreign domains in the search results.\n * Defaults to false.\n */\n includeForeignDomains?: boolean\n\n /**\n * Case-sensitive search when using string query.\n * Defaults to false (case-insensitive).\n */\n caseSensitive?: boolean\n}\n\n/**\n * A search result containing a matching domain node and metadata.\n */\nexport interface DomainSearchResult {\n /**\n * The matching domain node.\n */\n node: DomainGraphNodeType\n\n /**\n * The field(s) that matched the search query.\n */\n matchedFields: ('name' | 'displayName' | 'description')[]\n\n /**\n * The key used to identify this node in the graph.\n */\n key: string\n\n /**\n * Whether this node belongs to a foreign domain.\n */\n isForeign: boolean\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modeling/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { GraphJson } from '@api-client/graph/graph/types.js'\nimport type { Graph } from '@api-client/graph/graph/Graph.js'\nimport type { DomainAssociation } from './DomainAssociation.js'\nimport type { DomainEntity } from './DomainEntity.js'\nimport type { DomainModel } from './DomainModel.js'\nimport type { DomainNamespace } from './DomainNamespace.js'\nimport type { DomainProperty } from './DomainProperty.js'\nimport type {\n DomainNamespaceKind,\n DomainEntityKind,\n DomainModelKind,\n DomainPropertyKind,\n DomainAssociationKind,\n DataDomainKind,\n ExposedEntityKind,\n} from '../models/kinds.js'\nimport type { DataDomain } from './DataDomain.js'\nimport { AccessRuleSchema } from './rules/AccessRule.js'\nimport { RateLimitingConfigurationSchema } from './rules/RateLimitingConfiguration.js'\nimport { ActionSchema } from './actions/Action.js'\n\nexport interface DataDomainRemoveOptions {\n /**\n * When true, the object will be forcibly removed.\n * The resolution defined in the `ImpactResolution` class will be applied.\n *\n * For example, when removing an entity that is a parent to another entity, it will\n * removed itself as a parent from the child entity.\n *\n * Note, this option should only be used when the DomainImpactAnalysis has been performed\n * and the user was informed of the impact.\n */\n force?: boolean\n}\n\nexport interface DomainGraphEdge {\n /**\n * Indicates that the edge is to or from a foreign domain.\n */\n foreign?: boolean\n /**\n * The key of the foreign domain. Always set with the `foreign` property.\n */\n domain?: string\n /**\n * The type of the edge.\n * - `association` The edge is to an association object.\n * - When coming **from** an entity (the `v` property), that entity owns the association.\n * - When coming **to** an entity (the `w` property), that entity is the target of the association.\n * An association can have multiple targets.\n * - `property` The edge is to a property object. Can only be created between an entity and a property.\n * - The **from** (`v`) is the entity.\n * - The **to** (`w`) is the property.\n * - `parent` The edge is to a parent object.\n * - The **from** (`v`) is the child entity.\n * - The **to** (`w`) is the parent entity.\n */\n type: 'association' | 'property' | 'parent'\n}\n\nexport type DomainGraphNodeType = DomainNamespace | DomainModel | DomainEntity | DomainProperty | DomainAssociation\n\n/**\n * An interface that describes the data domain dependency.\n */\nexport interface ForeignDomainDependency {\n /**\n * The system registered key of the foreign domain.\n */\n key: string\n /**\n * The version of the foreign domain used in this domain.\n */\n version: string\n}\n\nexport interface AssociationTarget {\n /**\n * The key of the target entity.\n */\n key: string\n /**\n * The key of the target data domain.\n * This is only set when the target is in a different data domain.\n */\n domain?: string\n}\n\n/**\n * Describes the default value set on a property schema.\n */\nexport interface SchemaDefaultValue {\n /**\n * The type of the default value.\n *\n * - `literal` The `value` should be used as-is.\n * - `function` The value represents the name of the function to be used.\n */\n type: 'literal' | 'function'\n /**\n * The actual value type depends on the `type`.\n * It is always a string and it has to be casted to the property's data type.\n */\n value: string\n}\n\n/**\n * A general schema definition for a property.\n * This is propagated to all bindings (when they support these properties).\n */\nexport interface PropertySchema {\n /**\n * The minimum value of the property.\n *\n * By default it is inclusive value. Use the `exclusiveMinimum` property to make it exclusive.\n *\n * Used with:\n * - string\n * - number\n * - date\n * - time\n * - datetime\n */\n minimum?: number\n /**\n * The maximum value of the property.\n *\n * By default it is inclusive value. Use the `exclusiveMaximum` property to make it exclusive.\n *\n * Used with:\n * - string\n * - number\n * - date\n * - time\n * - datetime\n */\n maximum?: number\n /**\n * When set, the minimum value is exclusive.\n *\n * - When `false`: value ≥ minimum.\n * - When `true`: value > minimum.\n */\n exclusiveMinimum?: boolean\n /**\n * When set, the exclusiveMaximum value is exclusive.\n *\n * - When `false`: value ≤ maximum.\n * - When `true`: value < minimum.\n */\n exclusiveMaximum?: boolean\n /**\n * The multiplier value for a number scalar.\n *\n * Examples:\n * - if `1` then every integer is allowed\n * - if `2` than every even number is allowed\n * - if `0.5` than every number dividable by `0.5` is allowed\n */\n multipleOf?: number\n /**\n * The enum values for the property.\n * They are always encoded as strings. The actual type is defined in the `dataType` property.\n */\n enum?: string[]\n /**\n * The default value for the property.\n * This is always encoded as a string. The actual type is defined in the `dataType` property.\n */\n defaultValue?: SchemaDefaultValue\n /**\n * The example values for the property.\n * They are always encoded as strings. The actual type is defined in the `dataType` property.\n */\n examples?: string[]\n /**\n * The pattern to use with a string scalar.\n */\n pattern?: string\n}\n\n/**\n * The shortcut type for the data domain graph.\n */\nexport type DataDomainGraph = Graph<unknown, DomainGraphNodeType, DomainGraphEdge>\n/**\n * The serialized version of the data domain graph.\n */\nexport type SerializedGraph = GraphJson<unknown, object, DomainGraphEdge>\n\n/**\n * Represents a standardized, machine-readable error response body\n * as defined by RFC 7807 for HTTP APIs.\n */\nexport interface ProblemDetails {\n /**\n * A URI that identifies the specific problem type. Should resolve to human-readable docs.\n * e.g., \"https://docs.apinow.app/errors/validation-failed\"\n */\n type: string\n\n /**\n * A short, human-readable summary of the problem type.\n * e.g., \"Validation Error\"\n */\n title: string\n\n /**\n * The HTTP status code generated by the origin server for this problem.\n */\n status?: number\n\n /**\n * A human-readable explanation specific to this occurrence of the problem.\n */\n detail?: string\n\n /**\n * A URI that identifies the specific occurrence of the problem.\n * Can be the API request path that caused the error.\n */\n instance: string\n}\n\n/**\n * The set of supported filter operators for the List action.\n * These are used in query parameters, e.g., ?price[gte]=100\n *\n * - eq: Equal\n * - nq: Not Equal\n * - lt: Less Than\n * - lte: Less Than or Equal\n * - gt: Greater Than\n * - gte: Greater Than or Equal\n * - ex: Checks if the field exists\n * - re: Regular expression match\n * - bf: Date before a specific value\n * - af: Date after a specific value\n * - cn: String contains substring / Array contains element\n * - st: String starts with\n * - end: String ends with\n * - in: Value is one of the elements in the provided array\n * - nin: Value is not one of the elements in the provided array\n */\nexport type ResourceFilterOperator =\n | 'eq' // Equal\n | 'nq' // Not equal\n | 'lt' // Less than\n | 'lte' // Less than or equal\n | 'gt' // Greater than\n | 'gte' // Greater than or equal\n | 'ex' // Checks if the field exists\n | 're' // Regular expression match\n | 'bf' // Date before a specific value\n | 'af' // Date after a specific value\n | 'cn' // String contains substring / Array contains element\n | 'st' // String starts with\n | 'end' // String ends with\n | 'in' // Value is one of the elements in the provided array\n | 'nin' // Value is not one of the elements in the provided array\n\n/**\n * The session transport configuration interface.\n * This defines the properties that are common to all session transports.\n */\ninterface SessionTransport {\n /**\n * Whether the session transport is enabled.\n */\n enabled: boolean\n /**\n * The kind of session transport. Each interface defines its own kind.\n */\n kind: string\n}\n\n/**\n * Configuration for cookie-based session transport.\n */\nexport interface CookieConfiguration extends SessionTransport {\n kind: 'cookie'\n /**\n * The lifetime of the cookie session.\n * This is a string representing the duration, e.g., \"7d\" for 7 days or \"24h\" for 24 hours.\n *\n * @default \"7d\"\n */\n lifetime: string\n /**\n * Whether the cookie can only be accessed by the server.\n * This is a security feature to prevent client-side scripts from accessing the cookie.\n * If set to false, the cookie can be accessed by client-side scripts.\n * @default true\n */\n httpOnly: boolean // Defaults to true\n /**\n * Whether the cookie should only be sent over secure connections (HTTPS).\n * This is a security feature to prevent the cookie from being sent over unencrypted connections.\n * @default true\n */\n secure: boolean\n /**\n * The SameSite attribute of the cookie.\n * This attribute controls whether the cookie is sent with cross-site requests.\n * - 'none' means the cookie is sent with cross-site requests.\n * - 'lax' means the cookie is sent with top-level navigations and will be sent along with GET\n * requests initiated by third-party websites.\n * @default 'none'\n */\n sameSite: 'none' | 'lax'\n /**\n * The name of the cookie.\n * This is the key under which the session data will be stored in the cookie.\n * @default 'as' - 'as' stands for \"api session\"\n */\n name: string\n}\n\n/**\n * Configuration for JWT-based session transport.\n */\nexport interface JwtConfiguration extends SessionTransport {\n kind: 'jwt'\n /**\n * The lifetime of the JWT token.\n * This is a string representing the duration, e.g., \"7d\" for 7 days or \"15m\" for 15 minutes.\n *\n * @default \"7d\"\n */\n lifetime: string\n}\n\nexport interface SessionConfiguration {\n /**\n * The secret used to sign the JWT and cookies. Should be handled securely.\n * Not visible in the UI after being set.\n */\n secret: string\n /**\n * The properties from the `User` entity to be encoded into the session payload (JWT/cookie).\n * These properties become available in the `request.auth` object at runtime.\n *\n * In practice, these are the ids of the properties in the `User` entity.\n */\n properties: string[]\n /**\n * The cookie-based session transport configuration.\n */\n cookie?: CookieConfiguration\n\n /**\n * The JWT-based session transport configuration.\n */\n jwt?: JwtConfiguration\n}\n\n/**\n * Defines the authorization strategy for the API.\n * It is a base interface that can be extended for different strategies.\n * For MVP, we will start with Roles-Based Access Control (RBAC).\n */\nexport interface AuthorizationConfiguration {\n /**\n * The authorization strategy. For MVP, we will start with RBAC.\n * Post-MVP will include Permission-Based Access Control (PBAC).\n * The strategy determines how users are granted access to resources.\n *\n * - RBAC (Roles-Based Access Control): Users are assigned roles, and permissions are granted to those roles.\n * - PBAC (Permission-Based Access Control): Users are granted permissions directly, allowing for more\n * granular control.\n */\n strategy: string\n}\n\nexport interface RolesBasedAccessControl extends AuthorizationConfiguration {\n strategy: 'RBAC'\n /**\n * The property within the designated \"User\" entity that defines the user's role.\n * This field is used in access rules to grant permissions.\n *\n * This property must be marked with the \"Role\" data semantic in the Data Modeler.\n * It is required to publish the API.\n */\n roleKey: string\n}\n\n/**\n * Configures the strategy for authenticating end-users.\n * An API can only support one authentication strategy at a time.\n * This is a base interface that can be extended for different strategies.\n */\nexport interface AuthenticationConfiguration {\n /**\n * The authentication method. For MVP, this is focused on username/password.\n * This can be extended in the future to include 'SSO'.\n */\n strategy: string\n}\n\n/**\n * Configuration for username/password authentication.\n * This is the primary authentication method for the API (MVP).\n */\nexport interface UsernamePasswordConfiguration extends AuthenticationConfiguration {\n strategy: 'UsernamePassword'\n /**\n * The specific property within the User entity that holds the password.\n * This property must be marked with the \"Password\" data semantic in the Data Modeler.\n *\n * This property is required to publish the API.\n */\n passwordKey?: string\n}\n\n/**\n * Represents a Data Entity from the Data Domain that the API will expose and operate upon.\n */\nexport interface ExposedEntitySchema {\n kind: typeof ExposedEntityKind\n /**\n * The unique identifier for this exposure instance.\n * In the exposure model, we need to uniquely identify each exposure instance, because\n * an entity can be exposed multiple times in different contexts. Consider the following structure:\n *\n * ```\n * /categories/{categoryId}\n * /products/{productId}/categories\n * /products/{productId}/categories/{categoryId}\n * /promotions/{promotionId}/categories\n * /promotions/{promotionId}/categories/{categoryId}\n * ```\n *\n * The `category` entity would be exposed multiple times (as root and nested under products and promotions).\n * We need a way to distinguish between these different exposure instances.\n */\n key: string\n /**\n * A pointer to a Data Entity from the Data Domain.\n */\n entity: AssociationTarget\n /**\n * Indicates whether this exposure has a collection endpoint.\n * A collection endpoint is optional for nested exposures where the association is 1:1\n * and the schema is embedded directly under the parent resource.\n */\n hasCollection: boolean\n /**\n * A path to the collection endpoint for this exposure.\n * Starts with '/'. Not set for 1:1 nested exposures where collection does not exist.\n */\n collectionPath?: string\n\n /**\n * A path to the resource endpoint for this exposure.\n * Starts with '/'. For 1:1 nested exposures the resource path typically does not include an id segment.\n */\n resourcePath: string\n\n /**\n * Whether this exposure is a root exposure (top-level collection).\n * If this is set then the `parent` reference must be populated.\n */\n isRoot?: boolean\n\n /**\n * Parent reference when this exposure was created via following an association.\n */\n parent?: ExposeParentRef\n\n /**\n * Expose-time config used to create this exposure (persisted for auditing/UI).\n * This is only populated for the root exposure. All children exposures inherit this config.\n */\n exposeOptions?: ExposeOptions\n\n /**\n * The list of enabled API actions for this exposure (List/Read/Create/etc.)\n */\n actions: ActionSchema[]\n\n /**\n * Optional array of access rules that define the access control policies for this exposure.\n */\n accessRule?: AccessRuleSchema[]\n\n /**\n * Optional configuration for rate limiting for this exposure.\n */\n rateLimiting?: RateLimitingConfigurationSchema\n\n /**\n * When true, generation for this exposure hit configured limits\n */\n truncated?: boolean\n}\n\n/**\n * Parent reference stored on a nested exposure\n */\nexport interface ExposeParentRef {\n /**\n * The key of the parent exposed entity. This references the `ExposedEntity.key` property.\n */\n key: string\n /**\n * The association from the parent that produced this exposure.\n * A sub-entity must always have a parent association.\n */\n association: AssociationTarget\n /**\n * The numeric depth from the root exposure (root = 0)\n */\n depth?: number\n}\n\n/**\n * Options passed when creating a new exposure\n */\nexport interface ExposeOptions {\n /**\n * Whether to follow associations when creating the exposure.\n * When not set, it only exposes the passed entity.\n */\n followAssociations?: boolean\n /**\n * The maximum depth to follow associations when creating the exposure.\n */\n maxDepth?: number\n}\n\n/**\n * Represents a pagination strategy for API actions that return collections of resources.\n * This is a base interface that can be extended for different pagination strategies.\n */\nexport interface PaginationStrategy {\n /**\n * The kind of pagination strategy. This is used to identify the specific pagination method.\n * For example, 'cursor' for cursor-based pagination or 'offset' for offset-based pagination.\n */\n kind: string\n /**\n * The default page size for the pagination strategy.\n * This is the number of items returned per page when no specific page size is requested.\n */\n pageSize?: number\n}\n\n/**\n * Represents the cursor-based pagination strategy.\n */\nexport interface CursorPaginationStrategy extends PaginationStrategy {\n kind: 'cursor'\n}\n\n/**\n * Represents the offset-based pagination strategy.\n */\nexport interface OffsetPaginationStrategy extends PaginationStrategy {\n kind: 'offset'\n}\n\nexport type DomainImpactKinds =\n | typeof DomainNamespaceKind\n | typeof DomainEntityKind\n | typeof DomainModelKind\n | typeof DomainPropertyKind\n | typeof DomainAssociationKind\n | typeof DataDomainKind\n\n/**\n * The impact analysis report\n */\nexport interface DomainImpactReport {\n /**\n * The key of the impacted data object.\n * This is the key of the object that is being changed.\n */\n key: string\n /**\n * The kind of the impacted data object.\n * This is the kind of the object that is being changed.\n */\n kind: DomainImpactKinds\n /**\n * The list of impacted data objects.\n */\n impact: DomainImpactItem[]\n /**\n * Whether it is possible to proceed with the change.\n * If the change is not possible, the reason will be in the impact list.\n */\n canProceed: boolean\n}\n\nexport interface DomainImpactItem {\n /**\n * The key of the impacted data object.\n */\n key: string\n /**\n * The kind of the impacted data object.\n */\n kind: string\n /**\n * The type of the impact.\n *\n * - `delete` - The data object would be deleted.\n */\n type: 'delete' | 'publish'\n /**\n * The impact description.\n * Explains what will happen to the impacted data object.\n * This is a human-readable description of the impact.\n * It should be clear and concise.\n */\n impact: string\n /**\n * The severity of the impact.\n *\n * - `info` - The impact is informational.\n * - `warning` - The impact can potentially cause problems but is not a blocker.\n * - `error` - The impact is a blocker and needs to be resolved before proceeding.\n */\n severity: 'info' | 'warning' | 'error'\n /**\n * The type of the relationship between two impacted objects.\n */\n relationship?: 'child'\n /**\n * The resolution of the conflict if the change will be forced.\n */\n resolution?: string\n /**\n * The optional parent of the impacted data object.\n * For example, if the impacted item is a property, this will be the entity it belongs to.\n */\n parent?: string\n}\n\nexport interface DeserializeOptions {\n /**\n * The mode to use for deserialization.\n */\n mode?: DeserializationMode\n /**\n * The serialized graph to deserialize.\n * This is the JSON representation of the graph.\n */\n json?: SerializedGraph\n /**\n * The list of foreign domains that this domain depends on.\n */\n dependencies?: DataDomain[]\n}\n\n/**\n * Describes the mode for deserializing a domain graph.\n */\nexport type DeserializationMode = 'strict' | 'lenient'\n\n/**\n * Describes an issue found during deserialization.\n */\nexport interface DeserializationIssue {\n /**\n * The type of issue encountered.\n */\n type: 'missing_node' | 'missing_edge' | 'invalid_parent' | 'missing_dependency' | 'malformed_entry' | 'unknown_kind'\n /**\n * The severity of the issue.\n */\n severity: 'error' | 'warning' | 'info'\n /**\n * A human-readable description of the issue.\n */\n message: string\n /**\n * The key of the affected node, edge, or entity if applicable.\n */\n affectedKey?: string\n /**\n * Additional context about the issue.\n */\n context?: Record<string, unknown>\n /**\n * The action taken to handle this issue in lenient mode.\n */\n resolution?: string\n}\n\n/**\n * The result of a deserialization operation.\n */\nexport interface DeserializationResult {\n /**\n * The deserialized graph.\n */\n graph: DataDomainGraph\n /**\n * Issues encountered during deserialization.\n */\n issues: DeserializationIssue[]\n /**\n * Whether the deserialization was successful.\n * This is set to true when a critical failures occurred.\n */\n success: boolean\n}\n\n/**\n * Available node types for search filtering.\n */\nexport type SearchableNodeType =\n | typeof DomainNamespaceKind\n | typeof DomainModelKind\n | typeof DomainEntityKind\n | typeof DomainPropertyKind\n | typeof DomainAssociationKind\n\n/**\n * Search criteria for filtering domain nodes.\n */\nexport interface DomainSearchCriteria {\n /**\n * Text query to search for in name, displayName, and description fields.\n * Can be a string for exact match or RegExp for pattern matching.\n */\n query?: string | RegExp\n\n /**\n * Filter by specific node types. If not provided, all node types are included.\n */\n nodeTypes?: SearchableNodeType[]\n\n /**\n * Whether to include nodes from foreign domains in the search results.\n * Defaults to false.\n */\n includeForeignDomains?: boolean\n\n /**\n * Case-sensitive search when using string query.\n * Defaults to false (case-insensitive).\n */\n caseSensitive?: boolean\n}\n\n/**\n * A search result containing a matching domain node and metadata.\n */\nexport interface DomainSearchResult {\n /**\n * The matching domain node.\n */\n node: DomainGraphNodeType\n\n /**\n * The field(s) that matched the search query.\n */\n matchedFields: ('name' | 'displayName' | 'description')[]\n\n /**\n * The key used to identify this node in the graph.\n */\n key: string\n\n /**\n * Whether this node belongs to a foreign domain.\n */\n isForeign: boolean\n}\n"]}