mirror of https://github.com/abpframework/abp.git
committed by
GitHub
39 changed files with 1478 additions and 263 deletions
@ -0,0 +1,55 @@ |
|||
{ |
|||
"$schema": "https://json-schema.org/draft/2020-12/schema", |
|||
"$id": "app-descriptor.schema.json", |
|||
"title": "AppDescriptor", |
|||
"description": "Describes a low-code app. Apps partition the model into independently named scopes: other descriptors reference their owning app through the `app` field, and the default app is implicit.", |
|||
"markdownDescription": "AI guidance: create an app only when a group of entities, pages, forms, and scripts should be isolated under its own name. `name` is a lowercase kebab-case identifier such as `crm` or `field-service` and becomes part of runtime entity names (`<app>:<EntityName>`), app-scoped endpoint routes, and split descriptor file paths (`entities/<app>/...`). The name `default` denotes the implicit default app that always exists; descriptors without an `app` field belong to it. A `default` app descriptor is optional and only customizes the default app's `displayName`, `description`, and `metadata`; it cannot be archived. Set `isArchived` on other apps to hide them without deleting their descriptors.", |
|||
"type": "object", |
|||
"properties": { |
|||
"$schema": { |
|||
"type": "string", |
|||
"description": "Optional schema reference used when this descriptor is stored as a model descriptor file." |
|||
}, |
|||
"name": { |
|||
"type": "string", |
|||
"description": "Stable lowercase kebab-case app name, for example 'crm' or 'field-service'. Maximum 64 characters. 'default' addresses the implicit default app, whose descriptor is optional and cannot be archived.", |
|||
"minLength": 1, |
|||
"maxLength": 64, |
|||
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" |
|||
}, |
|||
"displayName": { |
|||
"type": "string", |
|||
"description": "User-facing app title shown by the designer and admin console. Maximum 128 characters.", |
|||
"minLength": 1, |
|||
"maxLength": 128 |
|||
}, |
|||
"description": { |
|||
"type": ["string", "null"], |
|||
"description": "Optional description for designer documentation." |
|||
}, |
|||
"isArchived": { |
|||
"type": "boolean", |
|||
"description": "When true, the app is archived and hidden from active app lists. Descriptors that belong to the app are kept.", |
|||
"default": false |
|||
}, |
|||
"metadata": { |
|||
"$ref": "descriptor-metadata.schema.json" |
|||
} |
|||
}, |
|||
"required": ["name", "displayName"], |
|||
"if": { |
|||
"properties": { "name": { "const": "default" } }, |
|||
"required": ["name"] |
|||
}, |
|||
"then": { |
|||
"properties": { "isArchived": { "const": false } } |
|||
}, |
|||
"additionalProperties": false, |
|||
"examples": [ |
|||
{ |
|||
"name": "crm", |
|||
"displayName": "CRM", |
|||
"description": "Customer relationship management app." |
|||
} |
|||
] |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
{ |
|||
"$schema": "https://json-schema.org/draft/2020-12/schema", |
|||
"$id": "boolean-value-display-descriptor.schema.json", |
|||
"title": "BooleanValueDisplayDescriptor", |
|||
"description": "Display metadata for one boolean state (true, false, or null) of a page column.", |
|||
"markdownDescription": "AI guidance: set only the fields you want to override. `displayName` replaces the default Yes/No/empty label, `color` is used by badge presentation (hex or CSS color), and `icon` is used by badge/iconOnly presentation. A `null` value for a field explicitly clears an inherited value when the page extends a lower model layer.", |
|||
"type": "object", |
|||
"properties": { |
|||
"displayName": { |
|||
"type": ["string", "null"], |
|||
"description": "Label for this boolean state, for example 'Active' or 'Inactive'." |
|||
}, |
|||
"color": { |
|||
"type": ["string", "null"], |
|||
"description": "Badge color for this state, for example '#16A34A'." |
|||
}, |
|||
"icon": { |
|||
"oneOf": [ |
|||
{ "$ref": "presentation-icon-reference.schema.json" }, |
|||
{ "type": "null" } |
|||
], |
|||
"description": "Icon for this state used by badge and iconOnly presentations." |
|||
} |
|||
}, |
|||
"additionalProperties": false, |
|||
"examples": [ |
|||
{ "displayName": "Active", "color": "#16A34A", "icon": { "kind": "class", "value": "fa-solid fa-check" } } |
|||
] |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
{ |
|||
"$schema": "https://json-schema.org/draft/2020-12/schema", |
|||
"$id": "boolean-value-presentation.schema.json", |
|||
"title": "BooleanValuePresentation", |
|||
"description": "How a boolean page column is rendered. Prefer lower-case values in descriptor JSON; PascalCase aliases are accepted for compatibility.", |
|||
"markdownDescription": "`text` renders the configured display names (or Yes/No). `checkbox` renders a read-only check mark. `badge` renders a colored badge. `iconOnly` renders only the configured icon. Per-value labels, colors, and icons come from the column `booleanValues` object.", |
|||
"type": "string", |
|||
"enum": ["text", "Text", "checkbox", "Checkbox", "badge", "Badge", "iconOnly", "IconOnly"], |
|||
"enumDescriptions": [ |
|||
"Plain text display name.", |
|||
"Plain text display name.", |
|||
"Read-only checkbox.", |
|||
"Read-only checkbox.", |
|||
"Colored badge.", |
|||
"Colored badge.", |
|||
"Icon only, display name as tooltip.", |
|||
"Icon only, display name as tooltip." |
|||
] |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
{ |
|||
"$schema": "https://json-schema.org/draft/2020-12/schema", |
|||
"$id": "descriptor-metadata.schema.json", |
|||
"title": "DescriptorMetadata", |
|||
"description": "Free-form string key/value metadata attached to a descriptor. Keys are compared case-insensitively and must be unique; values must be strings or null.", |
|||
"markdownDescription": "AI guidance: use `metadata` for tooling or documentation annotations such as `owner`, `generatedBy`, or `ticket`. The runtime does not interpret metadata; it is merged across model layers and preserved by the designer. Do not store structured data here; values must be plain strings or null.", |
|||
"type": "object", |
|||
"propertyNames": { |
|||
"minLength": 1 |
|||
}, |
|||
"additionalProperties": { |
|||
"type": ["string", "null"] |
|||
}, |
|||
"examples": [ |
|||
{ "owner": "crm-team", "generatedBy": "abp-studio" } |
|||
] |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
{ |
|||
"$schema": "https://json-schema.org/draft/2020-12/schema", |
|||
"$id": "entity-formula-descriptor.schema.json", |
|||
"title": "EntityFormulaDescriptor", |
|||
"description": "Defines a virtual calculated property evaluated from other properties of the same record with the Low-Code Expression Language.", |
|||
"markdownDescription": "AI guidance: a formula property is read-only and never stored: the runtime forces `isMappedToDbField: false`, `allowSetByClients: false`, `isRequired: false`, `isUnique: false`, and clears `defaultValue`. `expression` uses the Low-Code Expression Language (for example `If(Quantity = 0, 0, Total / Quantity)` or `FirstName & \" \" & LastName`) and may reference other scalar, formula, or rollup properties of the entity. `resultType` must match the property `type`. Formulas cannot be combined with `foreignKey`, `rollup`, or `collection`.", |
|||
"type": "object", |
|||
"properties": { |
|||
"expression": { |
|||
"type": "string", |
|||
"description": "Low-Code Expression Language expression evaluated against the current record, for example 'Round(UnitPrice * Quantity, 2)'.", |
|||
"minLength": 1 |
|||
}, |
|||
"resultType": { |
|||
"$ref": "entity-property-type.schema.json", |
|||
"description": "Type of the evaluated value. Should match the owning property type." |
|||
} |
|||
}, |
|||
"required": ["expression", "resultType"], |
|||
"additionalProperties": false, |
|||
"examples": [ |
|||
{ "expression": "Round(UnitPrice * Quantity, 2)", "resultType": "decimal" }, |
|||
{ "expression": "FirstName & \" \" & LastName", "resultType": "string" } |
|||
] |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
{ |
|||
"$schema": "https://json-schema.org/draft/2020-12/schema", |
|||
"$id": "entity-property-collection-descriptor.schema.json", |
|||
"title": "EntityPropertyCollectionDescriptor", |
|||
"description": "Turns a scalar entity property into an ordered primitive collection (a list of values of the property type).", |
|||
"markdownDescription": "AI guidance: add `collection` to store a list of values such as tags, scores, enum flags, or multiple files/images. The element type is the property `type`; supported element types are string, int, long, decimal, money, datetime, date, time, boolean, guid, enum, file, and image. Collections are stored in normalized collection tables, so `isMappedToDbField` does not apply. `uniqueItems` must be decided explicitly. A collection cannot be combined with `foreignKey`, `formula`, or `rollup`.", |
|||
"type": "object", |
|||
"properties": { |
|||
"maxCount": { |
|||
"type": ["integer", "null"], |
|||
"description": "Maximum number of items allowed. Omit or null for no limit.", |
|||
"minimum": 1 |
|||
}, |
|||
"uniqueItems": { |
|||
"type": "boolean", |
|||
"description": "Whether duplicate values are rejected. Required; choose true for tag-like lists and false for repeatable values." |
|||
} |
|||
}, |
|||
"required": ["uniqueItems"], |
|||
"additionalProperties": false, |
|||
"examples": [ |
|||
{ "uniqueItems": true }, |
|||
{ "maxCount": 10, "uniqueItems": false } |
|||
] |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
{ |
|||
"$schema": "https://json-schema.org/draft/2020-12/schema", |
|||
"$id": "entity-rollup-descriptor.schema.json", |
|||
"title": "EntityRollupDescriptor", |
|||
"description": "Defines a virtual rollup property that aggregates records of another entity whose foreign key points back to the owning record.", |
|||
"markdownDescription": "AI guidance: use rollups for counts and sums over child/related records, for example the number of orders per customer or the total amount of order lines per order. `sourceEntityName` is the entity being aggregated and `foreignKeyPropertyName` is the FK property on that entity that references the owning entity. `count` needs no `valuePropertyName`; `sum`, `average`, `min`, and `max` require a numeric/date `valuePropertyName` on the source entity. Rollup properties are read-only and never stored: the runtime forces `isMappedToDbField: false`, `allowSetByClients: false`, and clears required/unique/default settings. Rollups cannot be combined with `foreignKey`, `formula`, or `collection`.", |
|||
"type": "object", |
|||
"properties": { |
|||
"sourceEntityName": { |
|||
"type": "string", |
|||
"description": "Full name of the entity whose records are aggregated, for example 'Acme.Orders.Order'.", |
|||
"minLength": 1 |
|||
}, |
|||
"foreignKeyPropertyName": { |
|||
"type": "string", |
|||
"description": "Foreign key property on sourceEntityName that references the owning entity, for example 'CustomerId'.", |
|||
"minLength": 1 |
|||
}, |
|||
"valuePropertyName": { |
|||
"type": ["string", "null"], |
|||
"description": "Property on sourceEntityName to aggregate. Required for sum, average, min, and max; omit for count." |
|||
}, |
|||
"operation": { |
|||
"type": "string", |
|||
"description": "Aggregation operation. Prefer lower-case values; PascalCase aliases are accepted.", |
|||
"enum": ["count", "Count", "sum", "Sum", "average", "Average", "min", "Min", "max", "Max"] |
|||
} |
|||
}, |
|||
"required": ["sourceEntityName", "foreignKeyPropertyName", "operation"], |
|||
"if": { |
|||
"properties": { "operation": { "enum": ["sum", "Sum", "average", "Average", "min", "Min", "max", "Max"] } }, |
|||
"required": ["operation"] |
|||
}, |
|||
"then": { |
|||
"required": ["valuePropertyName"], |
|||
"properties": { "valuePropertyName": { "type": "string", "minLength": 1 } } |
|||
}, |
|||
"additionalProperties": false, |
|||
"examples": [ |
|||
{ "sourceEntityName": "Acme.Orders.Order", "foreignKeyPropertyName": "CustomerId", "operation": "count" }, |
|||
{ "sourceEntityName": "Acme.Orders.OrderLine", "foreignKeyPropertyName": "OrderId", "valuePropertyName": "LineTotal", "operation": "sum" } |
|||
] |
|||
} |
|||
@ -1,56 +1,112 @@ |
|||
{ |
|||
"$schema": "https://json-schema.org/draft/2020-12/schema", |
|||
"$id": "enum-descriptor.schema.json", |
|||
"title": "EnumDescriptor", |
|||
"description": "Describes an integer-backed enum definition for use in entity properties and select/kanban UI.", |
|||
"markdownDescription": "AI guidance: define enums before entity properties that reference them. Use a stable namespace-style `name` such as `Acme.Events.EventStatus`. Each value name should be PascalCase and unique within the enum. Use explicit integer `value`s for stable persistence; do not reorder or renumber after data exists.", |
|||
"type": "object", |
|||
"properties": { |
|||
"$schema": { |
|||
"type": "string", |
|||
"description": "Optional schema reference used when this descriptor is stored as a model descriptor file." |
|||
}, |
|||
"name": { |
|||
"$schema": "https://json-schema.org/draft/2020-12/schema", |
|||
"$id": "enum-descriptor.schema.json", |
|||
"title": "EnumDescriptor", |
|||
"description": "Describes an integer-backed enum definition for use in entity properties and select/kanban UI, including optional per-value display metadata.", |
|||
"markdownDescription": "AI guidance: define enums before entity properties that reference them. Use a stable namespace-style `name` such as `Acme.Events.EventStatus`. Each value name should be PascalCase and unique within the enum. Use explicit integer `value`s for stable persistence; do not reorder or renumber after data exists. Add `displayName`, `presentation`, `color`, and `icon` on values when pages should render badges or icons by default; pages can still override them with `enumPresentations`.", |
|||
"type": "object", |
|||
"properties": { |
|||
"$schema": { |
|||
"type": "string", |
|||
"description": "Optional schema reference used when this descriptor is stored as a model descriptor file." |
|||
}, |
|||
"name": { |
|||
"type": "string", |
|||
"description": "Stable unique enum name. Use a namespace-style name if the enum belongs to a module/domain, for example 'Acme.Events.EventStatus'.", |
|||
"minLength": 1 |
|||
}, |
|||
"app": { |
|||
"type": "string", |
|||
"description": "Name of the low-code app that owns this enum. Omit for the default app. Must match an apps[].name.", |
|||
"minLength": 1, |
|||
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" |
|||
}, |
|||
"displayName": { |
|||
"type": "string", |
|||
"description": "User-facing enum title used by the designer, for example 'Event Status'.", |
|||
"minLength": 1 |
|||
}, |
|||
"order": { |
|||
"type": "integer", |
|||
"description": "Optional sort order used when listing enums in the designer. Lower values appear first." |
|||
}, |
|||
"extendsLowerLayer": { |
|||
"type": "boolean", |
|||
"description": "When true, this descriptor extends an enum with the same name defined in a lower model layer (for example a code enum) by adding values or display metadata instead of defining a new enum.", |
|||
"default": false |
|||
}, |
|||
"metadata": { |
|||
"$ref": "descriptor-metadata.schema.json" |
|||
}, |
|||
"values": { |
|||
"type": "array", |
|||
"description": "Ordered list of integer-backed enum values. Values are stored as integers; names are used for display and model readability. The array is always required; it may be empty only when extendsLowerLayer is true and the descriptor changes just displayName/order/metadata.", |
|||
"items": { |
|||
"type": "object", |
|||
"properties": { |
|||
"name": { |
|||
"type": "string", |
|||
"description": "Stable unique enum name. Use a namespace-style name if the enum belongs to a module/domain, for example 'Acme.Events.EventStatus'.", |
|||
"description": "PascalCase enum value name, for example 'Draft', 'Scheduled', or 'Completed'.", |
|||
"minLength": 1 |
|||
}, |
|||
"value": { |
|||
"type": "integer", |
|||
"description": "Stable integer value. Prefer explicit values starting at 0 so generated descriptor JSON is deterministic. When omitted, the previous value plus one is assigned." |
|||
}, |
|||
"displayName": { |
|||
"type": ["string", "null"], |
|||
"description": "User-facing label for this value, for example 'In Progress'. Defaults to the value name." |
|||
}, |
|||
"presentation": { |
|||
"oneOf": [ |
|||
{ "$ref": "enum-value-presentation.schema.json" }, |
|||
{ "type": "null" } |
|||
], |
|||
"description": "Default runtime presentation for this value: text, badge, or iconOnly." |
|||
}, |
|||
"color": { |
|||
"type": ["string", "null"], |
|||
"description": "Default badge color for this value, for example '#F59E0B'." |
|||
}, |
|||
"icon": { |
|||
"oneOf": [ |
|||
{ "$ref": "presentation-icon-reference.schema.json" }, |
|||
{ "type": "null" } |
|||
], |
|||
"description": "Default icon for this value, used by badge and iconOnly presentations." |
|||
} |
|||
}, |
|||
"values": { |
|||
"type": "array", |
|||
"description": "Ordered list of integer-backed enum values. Values are stored as integers; names are used for display and model readability.", |
|||
"items": { |
|||
"type": "object", |
|||
"properties": { |
|||
"name": { |
|||
"type": "string", |
|||
"description": "PascalCase enum value name, for example 'Draft', 'Scheduled', or 'Completed'." |
|||
}, |
|||
"value": { |
|||
"type": "integer", |
|||
"description": "Stable integer value. Prefer explicit values starting at 0 so generated descriptor JSON is deterministic." |
|||
} |
|||
}, |
|||
"required": [ |
|||
"name" |
|||
], |
|||
"additionalProperties": false |
|||
}, |
|||
"minItems": 1 |
|||
} |
|||
}, |
|||
"required": [ |
|||
"name", |
|||
"values" |
|||
], |
|||
"additionalProperties": false, |
|||
"examples": [ |
|||
{ |
|||
"name": "Acme.Events.EventStatus", |
|||
"values": [ |
|||
{ "name": "Draft", "value": 0 }, |
|||
{ "name": "Scheduled", "value": 1 }, |
|||
{ "name": "Completed", "value": 2 } |
|||
] |
|||
} |
|||
] |
|||
"required": [ |
|||
"name" |
|||
], |
|||
"additionalProperties": false |
|||
} |
|||
} |
|||
}, |
|||
"required": [ |
|||
"name", |
|||
"values" |
|||
], |
|||
"if": { |
|||
"properties": { "extendsLowerLayer": { "const": true } }, |
|||
"required": ["extendsLowerLayer"] |
|||
}, |
|||
"then": {}, |
|||
"else": { |
|||
"properties": { |
|||
"values": { "minItems": 1 } |
|||
} |
|||
}, |
|||
"additionalProperties": false, |
|||
"examples": [ |
|||
{ |
|||
"name": "Acme.Events.EventStatus", |
|||
"displayName": "Event Status", |
|||
"values": [ |
|||
{ "name": "Draft", "value": 0 }, |
|||
{ "name": "Scheduled", "value": 1, "displayName": "Scheduled", "presentation": "badge", "color": "#2563EB" }, |
|||
{ "name": "Completed", "value": 2, "presentation": "badge", "color": "#16A34A", "icon": { "kind": "class", "value": "fa-solid fa-check" } } |
|||
] |
|||
} |
|||
] |
|||
} |
|||
|
|||
@ -0,0 +1,17 @@ |
|||
{ |
|||
"$schema": "https://json-schema.org/draft/2020-12/schema", |
|||
"$id": "enum-value-presentation.schema.json", |
|||
"title": "EnumValuePresentation", |
|||
"description": "How an enum value is rendered by runtime pages. Prefer lower-case values in descriptor JSON; PascalCase aliases are accepted for compatibility.", |
|||
"markdownDescription": "`text` renders the display name as plain text. `badge` renders a colored badge using `color`. `iconOnly` renders only the `icon` (with the display name as tooltip).", |
|||
"type": "string", |
|||
"enum": ["text", "Text", "badge", "Badge", "iconOnly", "IconOnly"], |
|||
"enumDescriptions": [ |
|||
"Plain text display name.", |
|||
"Plain text display name.", |
|||
"Colored badge.", |
|||
"Colored badge.", |
|||
"Icon only, display name as tooltip.", |
|||
"Icon only, display name as tooltip." |
|||
] |
|||
} |
|||
@ -0,0 +1,168 @@ |
|||
{ |
|||
"$schema": "https://json-schema.org/draft/2020-12/schema", |
|||
"$id": "page-backend-filter-expression.schema.json", |
|||
"title": "PageBackendFilterExpression", |
|||
"description": "Server-enforced filter expression for an entity page. A single condition or a nested and/or group tree that is always applied by the backend and cannot be removed by the client.", |
|||
"markdownDescription": "AI guidance: use `backendFilter` for tenant, ownership, role, or workflow scoping that must not be user-editable. The root is either one condition or a group with `items`. Inside a group the first item has no `logic`; every following item must set `logic` to `and` or `or` to combine with the previous items. A condition names a `propertyName`, an explicit `operator` (never `default`), and exactly one value source: a static `value`, a `valueProvider` name registered in `AbpLowCodePageBackendFilterOptions` (for example `CurrentUserId`, `CurrentUserRoles`, `CurrentTenantId`), or a `javaScript` expression. `isNull`/`isNotNull` take no value source; `hasValue` takes a static boolean `value` (true = isNotNull, false = isNull); `between` takes two values; `in`/`notIn` take an array. Relative-date operators (`thisMonth`, `today`, ...) and `default` are not supported by backend filters; they belong to visible page filters.", |
|||
"$defs": { |
|||
"logic": { |
|||
"type": "string", |
|||
"description": "How this item combines with the previous items of the same group.", |
|||
"enum": ["and", "And", "or", "Or"] |
|||
}, |
|||
"operator": { |
|||
"type": "string", |
|||
"description": "Filter operator. Must be explicit; 'default' and relative-date operators are not allowed for backend filters. 'equals' is accepted as an alias of 'equal'. String properties support contains/notContains/startsWith/endsWith/equal/notEqual/in/notIn; numeric, money, and date/time properties support between/equal/notEqual/greaterThan/greaterThanOrEqual/lessThan/lessThanOrEqual/in/notIn; boolean, guid, and enum properties support equal/notEqual/in/notIn; isNull/isNotNull/hasValue apply to any property.", |
|||
"enum": [ |
|||
"equal", |
|||
"equals", |
|||
"notEqual", |
|||
"contains", |
|||
"notContains", |
|||
"startsWith", |
|||
"endsWith", |
|||
"greaterThan", |
|||
"greaterThanOrEqual", |
|||
"lessThan", |
|||
"lessThanOrEqual", |
|||
"between", |
|||
"isNull", |
|||
"isNotNull", |
|||
"hasValue", |
|||
"in", |
|||
"notIn" |
|||
] |
|||
}, |
|||
"conditionFields": { |
|||
"type": "object", |
|||
"properties": { |
|||
"logic": { "$ref": "#/$defs/logic" }, |
|||
"propertyName": { |
|||
"type": "string", |
|||
"description": "Property on the page entity to filter.", |
|||
"minLength": 1 |
|||
}, |
|||
"operator": { "$ref": "#/$defs/operator" }, |
|||
"value": { |
|||
"description": "Static filter value. Use an array for in/notIn, two values for between, and true/false for hasValue." |
|||
}, |
|||
"valueProvider": { |
|||
"type": "string", |
|||
"description": "Name of a registered backend filter value provider, for example 'CurrentUserId' or 'CurrentUserRoles'.", |
|||
"minLength": 1 |
|||
}, |
|||
"javaScript": { |
|||
"type": "string", |
|||
"description": "JavaScript expression evaluated on the server to produce the filter value.", |
|||
"minLength": 1 |
|||
} |
|||
}, |
|||
"required": ["propertyName", "operator"], |
|||
"additionalProperties": false, |
|||
"allOf": [ |
|||
{ |
|||
"not": { |
|||
"anyOf": [ |
|||
{ "required": ["value", "valueProvider"] }, |
|||
{ "required": ["value", "javaScript"] }, |
|||
{ "required": ["valueProvider", "javaScript"] } |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
"if": { |
|||
"properties": { "operator": { "enum": ["isNull", "isNotNull"] } } |
|||
}, |
|||
"then": { |
|||
"not": { |
|||
"anyOf": [ |
|||
{ "required": ["value"] }, |
|||
{ "required": ["valueProvider"] }, |
|||
{ "required": ["javaScript"] } |
|||
] |
|||
} |
|||
}, |
|||
"else": { |
|||
"anyOf": [ |
|||
{ "required": ["value"] }, |
|||
{ "required": ["valueProvider"] }, |
|||
{ "required": ["javaScript"] } |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
"if": { |
|||
"properties": { "operator": { "const": "hasValue" } } |
|||
}, |
|||
"then": { |
|||
"required": ["value"], |
|||
"properties": { |
|||
"value": { |
|||
"anyOf": [ |
|||
{ "type": "boolean" }, |
|||
{ "type": "string", "enum": ["true", "false", "True", "False"] } |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
] |
|||
}, |
|||
"groupFields": { |
|||
"type": "object", |
|||
"properties": { |
|||
"logic": { "$ref": "#/$defs/logic" }, |
|||
"items": { |
|||
"type": "array", |
|||
"description": "Ordered child conditions and groups. The first item has no logic; later items require logic.", |
|||
"minItems": 1, |
|||
"prefixItems": [ |
|||
{ |
|||
"allOf": [ |
|||
{ "$ref": "#/$defs/node" }, |
|||
{ "not": { "required": ["logic"] } } |
|||
] |
|||
} |
|||
], |
|||
"items": { |
|||
"allOf": [ |
|||
{ "$ref": "#/$defs/node" }, |
|||
{ "required": ["logic"] } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
"required": ["items"], |
|||
"additionalProperties": false |
|||
}, |
|||
"node": { |
|||
"oneOf": [ |
|||
{ "$ref": "#/$defs/conditionFields" }, |
|||
{ "$ref": "#/$defs/groupFields" } |
|||
] |
|||
} |
|||
}, |
|||
"allOf": [ |
|||
{ "$ref": "#/$defs/node" }, |
|||
{ "not": { "required": ["logic"] } } |
|||
], |
|||
"examples": [ |
|||
{ |
|||
"propertyName": "Status", |
|||
"operator": "equal", |
|||
"value": "Active" |
|||
}, |
|||
{ |
|||
"items": [ |
|||
{ "propertyName": "Status", "operator": "equal", "value": "Active" }, |
|||
{ |
|||
"logic": "and", |
|||
"items": [ |
|||
{ "propertyName": "CreatorId", "operator": "equal", "valueProvider": "CurrentUserId" }, |
|||
{ "logic": "or", "propertyName": "AllowedRole", "operator": "in", "valueProvider": "CurrentUserRoles" } |
|||
] |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
{ |
|||
"$schema": "https://json-schema.org/draft/2020-12/schema", |
|||
"$id": "page-command-interceptor-descriptor.schema.json", |
|||
"title": "PageCommandInterceptorDescriptor", |
|||
"description": "Describes a JavaScript interceptor that runs for Create, Update, or Delete commands issued through a specific page, in addition to the entity-level interceptors.", |
|||
"markdownDescription": "AI guidance: use page interceptors when a rule applies only to commands sent from one page (for example a simplified public form) and entity interceptors for rules that must always apply. The script contract is the same as entity interceptors: inspect `context.commandArgs`, set `globalError` to block a Pre interceptor, and use host services on `context`. `entityExecutionOrder` controls how the page interceptor is ordered relative to the entity interceptor of the same command and phase: `entityFirst` (default), `pageFirst`, or `skipEntity` to suppress the entity interceptor for this page. It is ignored for `Replace` interceptors.", |
|||
"type": "object", |
|||
"properties": { |
|||
"commandName": { |
|||
"type": "string", |
|||
"description": "Entity command to intercept: Create, Update, Delete, or a registered custom command name.", |
|||
"minLength": 1 |
|||
}, |
|||
"type": { |
|||
"$ref": "interceptor-type.schema.json", |
|||
"description": "Whether the script runs before, after, or instead of the command." |
|||
}, |
|||
"javascript": { |
|||
"type": "string", |
|||
"description": "JavaScript code to execute. For Pre interceptors, set globalError to block the command." |
|||
}, |
|||
"entityExecutionOrder": { |
|||
"type": ["string", "null"], |
|||
"description": "Order relative to the entity interceptor with the same command and type. 'entityFirst' runs the entity interceptor first (default), 'pageFirst' runs this page interceptor first, 'skipEntity' skips the entity interceptor for this page. Not applicable to Replace interceptors.", |
|||
"enum": ["entityFirst", "EntityFirst", "pageFirst", "PageFirst", "skipEntity", "SkipEntity", null] |
|||
} |
|||
}, |
|||
"required": ["commandName", "type", "javascript"], |
|||
"additionalProperties": false, |
|||
"examples": [ |
|||
{ |
|||
"commandName": "Create", |
|||
"type": "Pre", |
|||
"javascript": "if (!context.commandArgs.data['Source']) { context.commandArgs.data['Source'] = 'public-form'; }", |
|||
"entityExecutionOrder": "pageFirst" |
|||
} |
|||
] |
|||
} |
|||
@ -0,0 +1,62 @@ |
|||
{ |
|||
"$schema": "https://json-schema.org/draft/2020-12/schema", |
|||
"$id": "page-enum-presentation-descriptor.schema.json", |
|||
"title": "PageEnumPresentationDescriptor", |
|||
"description": "Page-level overrides for how the values of one enum property are displayed. The shared enum descriptor keeps the default presentation; this object changes it for a single page.", |
|||
"markdownDescription": "AI guidance: use page enum presentations when one page needs different labels, badges, colors, or icons for an enum property without changing the enum used by other pages. `propertyName` must be an enum property of the page entity and must be unique within `enumPresentations`. Each `values[]` item targets one integer enum `value`; only the fields present are overridden. A field set to `null` clears the value inherited from the enum or a lower model layer.", |
|||
"type": "object", |
|||
"properties": { |
|||
"propertyName": { |
|||
"type": "string", |
|||
"description": "Enum property on the page entity whose value presentation is overridden.", |
|||
"minLength": 1 |
|||
}, |
|||
"values": { |
|||
"type": "array", |
|||
"description": "Per-value overrides. Each integer value may appear once.", |
|||
"items": { |
|||
"type": "object", |
|||
"properties": { |
|||
"value": { |
|||
"type": "integer", |
|||
"description": "Integer enum value to override." |
|||
}, |
|||
"displayName": { |
|||
"type": ["string", "null"], |
|||
"description": "Page-specific label for this value." |
|||
}, |
|||
"presentation": { |
|||
"oneOf": [ |
|||
{ "$ref": "enum-value-presentation.schema.json" }, |
|||
{ "type": "null" } |
|||
], |
|||
"description": "Page-specific presentation: text, badge, or iconOnly." |
|||
}, |
|||
"color": { |
|||
"type": ["string", "null"], |
|||
"description": "Page-specific badge color, for example '#F59E0B'." |
|||
}, |
|||
"icon": { |
|||
"oneOf": [ |
|||
{ "$ref": "presentation-icon-reference.schema.json" }, |
|||
{ "type": "null" } |
|||
], |
|||
"description": "Page-specific icon." |
|||
} |
|||
}, |
|||
"required": ["value"], |
|||
"additionalProperties": false |
|||
} |
|||
} |
|||
}, |
|||
"required": ["propertyName"], |
|||
"additionalProperties": false, |
|||
"examples": [ |
|||
{ |
|||
"propertyName": "Status", |
|||
"values": [ |
|||
{ "value": 10, "displayName": "Awaiting review", "presentation": "badge", "color": "#F59E0B" } |
|||
] |
|||
} |
|||
] |
|||
} |
|||
@ -0,0 +1,107 @@ |
|||
{ |
|||
"$schema": "https://json-schema.org/draft/2020-12/schema", |
|||
"$id": "page-relationship-descriptor.schema.json", |
|||
"title": "PageRelationshipDescriptor", |
|||
"description": "Describes a reverse relationship shown on an entity page: records of a source entity whose foreign key points back to the host page record.", |
|||
"markdownDescription": "AI guidance: a foreign key on the source entity defines the schema direction; a page relationship defines how related records are shown from the host (target) page. `sourceEntityName`/`sourcePropertyName` identify the FK property that points at the page entity. Use `access: \"view\"` for read-only related lists and `access: \"edit\"` for CRUD. Use `generated` modes to let the runtime build the related page/forms from the source entity, `page`/`form` modes to reuse named descriptors, and `inherit` to reuse the related page's own create/edit forms. Set `useSeparatePermission: true` when child access must not inherit the host page permissions.", |
|||
"type": "object", |
|||
"properties": { |
|||
"id": { |
|||
"type": "string", |
|||
"description": "Stable identifier unique within the page, for example 'customer-orders'. Used by relationship permissions and runtime routes.", |
|||
"minLength": 1 |
|||
}, |
|||
"sourceEntityName": { |
|||
"type": "string", |
|||
"description": "Full name of the entity that owns the foreign key pointing at this page's entity.", |
|||
"minLength": 1 |
|||
}, |
|||
"sourcePropertyName": { |
|||
"type": "string", |
|||
"description": "Foreign key property on sourceEntityName that references the page entity.", |
|||
"minLength": 1 |
|||
}, |
|||
"access": { |
|||
"type": "string", |
|||
"description": "Access level from the host page: 'view' shows related records read-only; 'edit' allows create, update, and delete.", |
|||
"enum": ["view", "View", "edit", "Edit"], |
|||
"default": "view" |
|||
}, |
|||
"relatedPageMode": { |
|||
"type": "string", |
|||
"description": "How the related list is rendered. 'generated' builds a list from the source entity; 'page' reuses the page named by relatedPageName.", |
|||
"enum": ["generated", "Generated", "page", "Page"] |
|||
}, |
|||
"relatedPageName": { |
|||
"type": ["string", "null"], |
|||
"description": "Existing page name for the source entity. Required when relatedPageMode is 'page'." |
|||
}, |
|||
"createFormMode": { |
|||
"type": "string", |
|||
"description": "Form used to create related records. 'generated' builds a form from the source entity; 'inherit' reuses the related page's create form; 'form' uses createFormName.", |
|||
"enum": ["generated", "Generated", "inherit", "Inherit", "form", "Form"] |
|||
}, |
|||
"createFormName": { |
|||
"type": ["string", "null"], |
|||
"description": "Form descriptor name for the source entity. Required when createFormMode is 'form'." |
|||
}, |
|||
"editFormMode": { |
|||
"type": "string", |
|||
"description": "Form used to edit related records. 'generated' builds a form from the source entity; 'inherit' reuses the related page's edit form; 'form' uses editFormName.", |
|||
"enum": ["generated", "Generated", "inherit", "Inherit", "form", "Form"] |
|||
}, |
|||
"editFormName": { |
|||
"type": ["string", "null"], |
|||
"description": "Form descriptor name for the source entity. Required when editFormMode is 'form'." |
|||
}, |
|||
"useSeparatePermission": { |
|||
"type": "boolean", |
|||
"description": "When true, relationship view/create/update/delete permissions are resolved for the host page and relationship id instead of inheriting the host page decision.", |
|||
"default": false |
|||
}, |
|||
"permissionConfig": { |
|||
"$ref": "page-permission-config.schema.json", |
|||
"description": "Optional relationship permission overrides used when useSeparatePermission is true." |
|||
} |
|||
}, |
|||
"required": ["id", "sourceEntityName", "sourcePropertyName", "relatedPageMode", "createFormMode", "editFormMode"], |
|||
"allOf": [ |
|||
{ |
|||
"if": { "properties": { "relatedPageMode": { "enum": ["page", "Page"] } }, "required": ["relatedPageMode"] }, |
|||
"then": { "required": ["relatedPageName"], "properties": { "relatedPageName": { "type": "string", "minLength": 1 } } } |
|||
}, |
|||
{ |
|||
"if": { "properties": { "createFormMode": { "enum": ["form", "Form"] } }, "required": ["createFormMode"] }, |
|||
"then": { "required": ["createFormName"], "properties": { "createFormName": { "type": "string", "minLength": 1 } } } |
|||
}, |
|||
{ |
|||
"if": { "properties": { "editFormMode": { "enum": ["form", "Form"] } }, "required": ["editFormMode"] }, |
|||
"then": { "required": ["editFormName"], "properties": { "editFormName": { "type": "string", "minLength": 1 } } } |
|||
} |
|||
], |
|||
"additionalProperties": false, |
|||
"examples": [ |
|||
{ |
|||
"id": "customer-orders", |
|||
"sourceEntityName": "Acme.Orders.Order", |
|||
"sourcePropertyName": "CustomerId", |
|||
"access": "edit", |
|||
"relatedPageMode": "page", |
|||
"relatedPageName": "orders", |
|||
"createFormMode": "generated", |
|||
"editFormMode": "generated" |
|||
}, |
|||
{ |
|||
"id": "author-books", |
|||
"sourceEntityName": "Acme.Books.Book", |
|||
"sourcePropertyName": "AuthorId", |
|||
"access": "edit", |
|||
"relatedPageMode": "generated", |
|||
"createFormMode": "generated", |
|||
"editFormMode": "form", |
|||
"editFormName": "book-edit-for-author", |
|||
"useSeparatePermission": true, |
|||
"permissionConfig": { "view": "default", "create": "Acme.Books.Create" } |
|||
} |
|||
] |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
{ |
|||
"$schema": "https://json-schema.org/draft/2020-12/schema", |
|||
"$id": "presentation-icon-reference.schema.json", |
|||
"title": "PresentationIconReference", |
|||
"description": "References an icon used by enum value and boolean value presentations.", |
|||
"markdownDescription": "AI guidance: prefer `kind: \"class\"` with a FontAwesome class list such as `fa-solid fa-check` for source-controlled descriptors. `blob` references an icon uploaded through the designer and is only valid in the runtime model layer. `dataUrl` embeds a base64 PNG/WebP image (`data:image/png;base64,...`). `path` references a root-relative application path such as `/images/icons/ok.svg`.", |
|||
"type": "object", |
|||
"properties": { |
|||
"kind": { |
|||
"type": "string", |
|||
"description": "Icon source kind. 'class' is a CSS class list; 'blob' is a designer-uploaded icon blob name (64 hex chars plus .png/.webp); 'dataUrl' is an inline base64 PNG/WebP data URL; 'path' is a root-relative application path.", |
|||
"enum": ["class", "Class", "blob", "Blob", "dataUrl", "DataUrl", "path", "Path"] |
|||
}, |
|||
"value": { |
|||
"type": "string", |
|||
"description": "Icon value matching kind: a CSS class list, blob name, data URL, or root-relative path.", |
|||
"minLength": 1 |
|||
} |
|||
}, |
|||
"required": ["kind", "value"], |
|||
"additionalProperties": false, |
|||
"examples": [ |
|||
{ "kind": "class", "value": "fa-solid fa-check" }, |
|||
{ "kind": "path", "value": "/images/icons/approved.svg" } |
|||
] |
|||
} |
|||
Loading…
Reference in new issue