From 2aca3a1704177590175415e847847518ea011ffb Mon Sep 17 00:00:00 2001 From: "R.Piontik" Date: Tue, 5 Dec 2023 12:27:55 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=81=D1=85=D0=B5=D0=BC=D0=B0=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B9.=20=D0=98?= =?UTF-8?q?=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=BE?= =?UTF-8?q?=D0=BF=D0=B5=D1=87=D0=B0=D1=82=D0=BA=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../docs/manual/functions/example.yaml | 2 +- .../docs/manual/functions/functions.md | 2 +- public/metamodel/dochub/functions/tools.yaml | 2 +- src/assets/master-schema.yaml | 26 +++++++++++++++++++ src/frontend/main.js | 2 +- 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/public/documentation/docs/manual/functions/example.yaml b/public/documentation/docs/manual/functions/example.yaml index 6448d76a..bf4c405d 100644 --- a/public/documentation/docs/manual/functions/example.yaml +++ b/public/documentation/docs/manual/functions/example.yaml @@ -12,7 +12,7 @@ functions: title: Объект конвертации required: true # Признак обязательности параметра функции # JSONSchema схема результата. Не обязательно. - result_: + result: type: number # Код функции code: > diff --git a/public/documentation/docs/manual/functions/functions.md b/public/documentation/docs/manual/functions/functions.md index 1f447b86..d1df7793 100644 --- a/public/documentation/docs/manual/functions/functions.md +++ b/public/documentation/docs/manual/functions/functions.md @@ -24,7 +24,7 @@ functions: title: Объект конвертации required: true # Признак обязательности параметра функции # JSONSchema схема результата. Не обязательно. - result_: + result: type: number # Код функции code: > diff --git a/public/metamodel/dochub/functions/tools.yaml b/public/metamodel/dochub/functions/tools.yaml index 18d533d3..208bc59d 100644 --- a/public/metamodel/dochub/functions/tools.yaml +++ b/public/metamodel/dochub/functions/tools.yaml @@ -13,7 +13,7 @@ functions: - type: object title: Объект конвертации # Схема результата - result_: + result: type: string # Код функции code: > diff --git a/src/assets/master-schema.yaml b/src/assets/master-schema.yaml index 99975cce..cc5d7224 100644 --- a/src/assets/master-schema.yaml +++ b/src/assets/master-schema.yaml @@ -237,8 +237,34 @@ $defs: $ref: "#/$defs/$res-uri-reference" # Схема базовых сущностей $entities: + functions: + type: object + additionalProperties: false + patternProperties: + "^[a-zA-Z0-9_]*(\\.[a-zA-Z0-9_]*)*$": + title: Идентификатор сущности + type: object + properties: + title: + type: string + title: Описание функции + params: + type: array + title: Параметры функции + items: + $ref: "#/$defs/$jsonschema" + code: + title: JSONata код функции + type: string + result: + title: Схема результата + $ref: "#/$defs/$jsonschema" + required: + - code + entities: type: object + additionalProperties: false patternProperties: "^[0-9a-zA-Z][a-zA-Z0-9_-]*(\\.[a-zA-Z][a-zA-Z0-9_-]*)*$": type: object diff --git a/src/frontend/main.js b/src/frontend/main.js index 6827f917..6458ad16 100644 --- a/src/frontend/main.js +++ b/src/frontend/main.js @@ -20,5 +20,5 @@ document.addEventListener('DOMContentLoaded', async() => { store }).$mount('#app'); - window.$PAPI?.loaded(); + window.$PAPI?.loaded && window.$PAPI.loaded(); });