@endge/core 1.2.5

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 (240) hide show
  1. package/ReadMe.md +21 -0
  2. package/dist/core.js +85019 -0
  3. package/dist/domain/data-source-graphql.d.ts +4 -0
  4. package/dist/domain/data-source-mock.d.ts +4 -0
  5. package/dist/domain/data-source-rest.d.ts +4 -0
  6. package/dist/domain/declare/jsx.d.ts +68 -0
  7. package/dist/domain/declare/scenario.d.ts +19 -0
  8. package/dist/domain/dependency-graph.d.ts +19 -0
  9. package/dist/domain/entities/action-flow/REndgeFlow.d.ts +27 -0
  10. package/dist/domain/entities/data/DataSource.d.ts +8 -0
  11. package/dist/domain/entities/data/DependencyEdge.d.ts +48 -0
  12. package/dist/domain/entities/data/DependencyGraph.d.ts +25 -0
  13. package/dist/domain/entities/data/DependencyNode.d.ts +30 -0
  14. package/dist/domain/entities/debug/MemoryStore.d.ts +34 -0
  15. package/dist/domain/entities/debug/tools/base.d.ts +5 -0
  16. package/dist/domain/entities/debug/tools/tree.d.ts +12 -0
  17. package/dist/domain/entities/diagnostics/DiagnosticsRecordStore.d.ts +33 -0
  18. package/dist/domain/entities/diagnostics/DiagnosticsScopeHandle.d.ts +21 -0
  19. package/dist/domain/entities/diagnostics/DiagnosticsSpan.d.ts +9 -0
  20. package/dist/domain/entities/diagnostics/DiagnosticsTrace.d.ts +9 -0
  21. package/dist/domain/entities/endge/EndgeActionJsonScript.d.ts +2 -0
  22. package/dist/domain/entities/endge/EndgeApi.d.ts +23 -0
  23. package/dist/domain/entities/endge/EndgeEvent.d.ts +33 -0
  24. package/dist/domain/entities/endge/EndgeFederation.d.ts +64 -0
  25. package/dist/domain/entities/endge/EndgeModule.d.ts +36 -0
  26. package/dist/domain/entities/endge/EndgeModuleController.d.ts +18 -0
  27. package/dist/domain/entities/endge/EndgeSlotRegistry.d.ts +14 -0
  28. package/dist/domain/entities/reflect/RAction.d.ts +30 -0
  29. package/dist/domain/entities/reflect/RBehaviorBinding.d.ts +19 -0
  30. package/dist/domain/entities/reflect/RComponent.d.ts +25 -0
  31. package/dist/domain/entities/reflect/RComponentBase.d.ts +39 -0
  32. package/dist/domain/entities/reflect/RComponentDSL.d.ts +14 -0
  33. package/dist/domain/entities/reflect/RComponentTable.d.ts +21 -0
  34. package/dist/domain/entities/reflect/RComponentTableColumn.d.ts +64 -0
  35. package/dist/domain/entities/reflect/RConverter.d.ts +14 -0
  36. package/dist/domain/entities/reflect/REntity.d.ts +47 -0
  37. package/dist/domain/entities/reflect/REnvironment.d.ts +6 -0
  38. package/dist/domain/entities/reflect/RField.d.ts +9 -0
  39. package/dist/domain/entities/reflect/RFilter.d.ts +11 -0
  40. package/dist/domain/entities/reflect/RFolder.d.ts +23 -0
  41. package/dist/domain/entities/reflect/RI18nBundle.d.ts +16 -0
  42. package/dist/domain/entities/reflect/RIntegration.d.ts +13 -0
  43. package/dist/domain/entities/reflect/RNavigation.d.ts +24 -0
  44. package/dist/domain/entities/reflect/RPage.d.ts +45 -0
  45. package/dist/domain/entities/reflect/RPageTemplate.d.ts +32 -0
  46. package/dist/domain/entities/reflect/RParameter.d.ts +13 -0
  47. package/dist/domain/entities/reflect/RPolicy.d.ts +7 -0
  48. package/dist/domain/entities/reflect/RPresentationBinding.d.ts +20 -0
  49. package/dist/domain/entities/reflect/RProject.d.ts +68 -0
  50. package/dist/domain/entities/reflect/RQuery.d.ts +43 -0
  51. package/dist/domain/entities/reflect/RQueryFilter.d.ts +12 -0
  52. package/dist/domain/entities/reflect/RQueryRest.d.ts +21 -0
  53. package/dist/domain/entities/reflect/RScenario.d.ts +20 -0
  54. package/dist/domain/entities/reflect/RSettings.d.ts +49 -0
  55. package/dist/domain/entities/reflect/RStyle.d.ts +7 -0
  56. package/dist/domain/entities/reflect/RTenant.d.ts +8 -0
  57. package/dist/domain/entities/reflect/RType.d.ts +17 -0
  58. package/dist/domain/entities/reflect/RVersion.d.ts +29 -0
  59. package/dist/domain/entities/reflect/RView.d.ts +21 -0
  60. package/dist/domain/entities/reflect/RVocabs.d.ts +16 -0
  61. package/dist/domain/entities/runtime/RuntimeBindingScope.d.ts +48 -0
  62. package/dist/domain/entities/runtime/RuntimeContext.d.ts +26 -0
  63. package/dist/domain/entities/runtime/RuntimeEnvironment.d.ts +12 -0
  64. package/dist/domain/entities/runtime/RuntimeHostBase.d.ts +100 -0
  65. package/dist/domain/entities/runtime/RuntimeHostFactory.d.ts +15 -0
  66. package/dist/domain/entities/runtime/RuntimeHostRegistry.d.ts +56 -0
  67. package/dist/domain/entities/runtime/RuntimeScope.d.ts +45 -0
  68. package/dist/domain/entities/runtime/hosts/ActionRuntimeHost.d.ts +30 -0
  69. package/dist/domain/entities/runtime/hosts/ComponentRuntimeHost.d.ts +22 -0
  70. package/dist/domain/entities/runtime/hosts/PageRuntimeHost.d.ts +22 -0
  71. package/dist/domain/entities/runtime/hosts/ProjectRuntimeHost.d.ts +22 -0
  72. package/dist/domain/entities/runtime/hosts/QueryRuntimeHost.d.ts +22 -0
  73. package/dist/domain/entities/runtime/hosts/TableRuntimeHost.d.ts +22 -0
  74. package/dist/domain/entities/runtime/hosts/ViewRuntimeHost.d.ts +22 -0
  75. package/dist/domain/script-api/expose.d.ts +6 -0
  76. package/dist/domain/script-api/mount.d.ts +7 -0
  77. package/dist/domain/script-api/query.d.ts +7 -0
  78. package/dist/domain/script-api/watch.d.ts +7 -0
  79. package/dist/domain/services/AbstractSyntaxTree_JSX.d.ts +30 -0
  80. package/dist/domain/services/AbstractSyntaxTree_TS.d.ts +18 -0
  81. package/dist/domain/services/GraphQLBuilderService.d.ts +19 -0
  82. package/dist/domain/services/ScenarioScriptBuilderService.d.ts +19 -0
  83. package/dist/domain/services/auth.d.ts +17 -0
  84. package/dist/domain/services/component-render-host.d.ts +20 -0
  85. package/dist/domain/types/action.types.d.ts +65 -0
  86. package/dist/domain/types/api.types.d.ts +29 -0
  87. package/dist/domain/types/auth.types.d.ts +82 -0
  88. package/dist/domain/types/bootstrap.types.d.ts +35 -0
  89. package/dist/domain/types/codegen.types.d.ts +23 -0
  90. package/dist/domain/types/component.types.d.ts +8 -0
  91. package/dist/domain/types/configuration-contract.types.d.ts +53 -0
  92. package/dist/domain/types/debug/base.types.d.ts +74 -0
  93. package/dist/domain/types/debug/events.types.d.ts +3 -0
  94. package/dist/domain/types/debug/tree.types.d.ts +27 -0
  95. package/dist/domain/types/diagnostics.types.d.ts +235 -0
  96. package/dist/domain/types/document.types.d.ts +93 -0
  97. package/dist/domain/types/endge-flow-runtime.types.d.ts +28 -0
  98. package/dist/domain/types/endge-flow.types.d.ts +110 -0
  99. package/dist/domain/types/events.types.d.ts +29 -0
  100. package/dist/domain/types/faceted-cascade.d.ts +300 -0
  101. package/dist/domain/types/filter.types.d.ts +39 -0
  102. package/dist/domain/types/flow-condition.types.d.ts +39 -0
  103. package/dist/domain/types/forge.types.d.ts +30 -0
  104. package/dist/domain/types/jsx.types.d.ts +16 -0
  105. package/dist/domain/types/models.types.d.ts +7 -0
  106. package/dist/domain/types/navigation.types.d.ts +27 -0
  107. package/dist/domain/types/query.types.d.ts +66 -0
  108. package/dist/domain/types/resolve.types.d.ts +70 -0
  109. package/dist/domain/types/runtime-entity-map.types.d.ts +28 -0
  110. package/dist/domain/types/runtime-host.types.d.ts +168 -0
  111. package/dist/domain/types/runtime-registry.types.d.ts +38 -0
  112. package/dist/domain/types/runtime.types.d.ts +103 -0
  113. package/dist/domain/types/schema.types.d.ts +92 -0
  114. package/dist/domain/types/settings.types.d.ts +117 -0
  115. package/dist/domain/types/styles.types.d.ts +25 -0
  116. package/dist/domain/types/table.types.d.ts +15 -0
  117. package/dist/domain/types/types.d.ts +99 -0
  118. package/dist/domain/types/ui-composition.types.d.ts +201 -0
  119. package/dist/domain/types/ui.types.d.ts +17 -0
  120. package/dist/main.d.ts +154 -0
  121. package/dist/model/config/contracts/behavior/component.d.ts +2 -0
  122. package/dist/model/config/contracts/behavior/index.d.ts +8 -0
  123. package/dist/model/config/contracts/behavior/page-template.d.ts +2 -0
  124. package/dist/model/config/contracts/behavior/page.d.ts +30 -0
  125. package/dist/model/config/contracts/behavior/project.d.ts +2 -0
  126. package/dist/model/config/contracts/behavior/query.d.ts +2 -0
  127. package/dist/model/config/contracts/behavior/view.d.ts +2 -0
  128. package/dist/model/config/contracts/configuration/index.d.ts +3 -0
  129. package/dist/model/config/contracts/configuration/navigation.d.ts +3 -0
  130. package/dist/model/config/contracts/index.d.ts +17 -0
  131. package/dist/model/config/contracts/presentation/component.d.ts +2 -0
  132. package/dist/model/config/contracts/presentation/index.d.ts +8 -0
  133. package/dist/model/config/contracts/presentation/page-template.d.ts +2 -0
  134. package/dist/model/config/contracts/presentation/page.d.ts +2 -0
  135. package/dist/model/config/contracts/presentation/project.d.ts +2 -0
  136. package/dist/model/config/contracts/presentation/query.d.ts +2 -0
  137. package/dist/model/config/contracts/presentation/view.d.ts +2 -0
  138. package/dist/model/config/debug.d.ts +11 -0
  139. package/dist/model/config/events.d.ts +16 -0
  140. package/dist/model/config/index.d.ts +7 -0
  141. package/dist/model/config/persistance_config.d.ts +6 -0
  142. package/dist/model/config/storage_config.d.ts +4 -0
  143. package/dist/model/config/ui-composition-defaults.d.ts +523 -0
  144. package/dist/model/db/repositories/Actions_Repository.d.ts +35 -0
  145. package/dist/model/db/repositories/BehaviorBindings_Repository.d.ts +16 -0
  146. package/dist/model/db/repositories/Components_Repository.d.ts +64 -0
  147. package/dist/model/db/repositories/Converters_Repository.d.ts +40 -0
  148. package/dist/model/db/repositories/Environments_Repository.d.ts +35 -0
  149. package/dist/model/db/repositories/Filters_Repository.d.ts +56 -0
  150. package/dist/model/db/repositories/Folders_Repository.d.ts +30 -0
  151. package/dist/model/db/repositories/I18nBundles_Repository.d.ts +47 -0
  152. package/dist/model/db/repositories/Integrations_Repository.d.ts +40 -0
  153. package/dist/model/db/repositories/Navigations_Repository.d.ts +40 -0
  154. package/dist/model/db/repositories/PageTemplates_Repository.d.ts +56 -0
  155. package/dist/model/db/repositories/Pages_Repository.d.ts +89 -0
  156. package/dist/model/db/repositories/Parameters_Repository.d.ts +56 -0
  157. package/dist/model/db/repositories/Policies_Repository.d.ts +35 -0
  158. package/dist/model/db/repositories/PresentationBindings_Repository.d.ts +14 -0
  159. package/dist/model/db/repositories/Projects_Repository.d.ts +38 -0
  160. package/dist/model/db/repositories/Queries_Repository.d.ts +45 -0
  161. package/dist/model/db/repositories/Scenarios_Repository.d.ts +41 -0
  162. package/dist/model/db/repositories/Settings_Repository.d.ts +48 -0
  163. package/dist/model/db/repositories/Styles_Repository.d.ts +51 -0
  164. package/dist/model/db/repositories/Tenants_Repository.d.ts +39 -0
  165. package/dist/model/db/repositories/Types_Repository.d.ts +48 -0
  166. package/dist/model/db/repositories/Versions_Repository.d.ts +15 -0
  167. package/dist/model/db/repositories/Views_Repository.d.ts +65 -0
  168. package/dist/model/db/repositories/Vocabs_Repository.d.ts +59 -0
  169. package/dist/model/db/repositories/payload-api.d.ts +10 -0
  170. package/dist/model/db/schema-database/BaseSchemaRepositoriy.d.ts +19 -0
  171. package/dist/model/db/schema-database/PayloadSchemaAdapter.d.ts +34 -0
  172. package/dist/model/db/schema-database/SchemaStorageAdapter.d.ts +40 -0
  173. package/dist/model/endge/endge-app.d.ts +47 -0
  174. package/dist/model/endge/endge-auth.d.ts +56 -0
  175. package/dist/model/endge/endge-bind.d.ts +32 -0
  176. package/dist/model/endge/endge-bindings-behavior.d.ts +39 -0
  177. package/dist/model/endge/endge-bindings-presentation.d.ts +30 -0
  178. package/dist/model/endge/endge-bootstrap.d.ts +23 -0
  179. package/dist/model/endge/endge-console.d.ts +35 -0
  180. package/dist/model/endge/endge-contracts.d.ts +77 -0
  181. package/dist/model/endge/endge-debug.d.ts +37 -0
  182. package/dist/model/endge/endge-diagnostics.d.ts +111 -0
  183. package/dist/model/endge/endge-domain.d.ts +519 -0
  184. package/dist/model/endge/endge-events.d.ts +25 -0
  185. package/dist/model/endge/endge-extract.d.ts +84 -0
  186. package/dist/model/endge/endge-flow-registry.d.ts +21 -0
  187. package/dist/model/endge/endge-flow.d.ts +51 -0
  188. package/dist/model/endge/endge-query.d.ts +20 -0
  189. package/dist/model/endge/endge-render.d.ts +17 -0
  190. package/dist/model/endge/endge-reports.d.ts +22 -0
  191. package/dist/model/endge/endge-runtime-debugger.d.ts +60 -0
  192. package/dist/model/endge/endge-runtime.d.ts +87 -0
  193. package/dist/model/endge/endge-schema-database.d.ts +217 -0
  194. package/dist/model/endge/endge-script.d.ts +42 -0
  195. package/dist/model/endge/endge-sse.d.ts +19 -0
  196. package/dist/model/endge/endge-store.d.ts +41 -0
  197. package/dist/model/endge/endge-styles.d.ts +45 -0
  198. package/dist/model/endge/endge-testing.d.ts +16 -0
  199. package/dist/model/endge/endge-ui-registry.d.ts +50 -0
  200. package/dist/model/endge/endge-ui.d.ts +43 -0
  201. package/dist/model/endge/endge-updates.d.ts +34 -0
  202. package/dist/model/endge/endge-vars.d.ts +50 -0
  203. package/dist/model/endge/endge-vocabs.d.ts +47 -0
  204. package/dist/model/endge/endge.d.ts +98 -0
  205. package/dist/model/factories/DataSourceFactory.d.ts +14 -0
  206. package/dist/model/factories/DocumentFactory.d.ts +24 -0
  207. package/dist/model/helpers/endge-resolve-engine.d.ts +93 -0
  208. package/dist/model/helpers/raph-phases/endge-runtime-boundary.d.ts +13 -0
  209. package/dist/model/helpers/raph-phases/queries-phase.d.ts +7 -0
  210. package/dist/model/helpers/raph-phases/tables-phase.d.ts +7 -0
  211. package/dist/model/seed/actions/console_log.d.ts +3 -0
  212. package/dist/model/seed/actions/load_vocabs.d.ts +3 -0
  213. package/dist/model/seed/converters/arrays/split.d.ts +2 -0
  214. package/dist/model/seed/converters/arrays/to-array.d.ts +2 -0
  215. package/dist/model/seed/converters/date/date-to-date-string.d.ts +2 -0
  216. package/dist/model/seed/converters/date/date-to-iso-string.d.ts +2 -0
  217. package/dist/model/seed/converters/date/date-to-iso-z.d.ts +2 -0
  218. package/dist/model/seed/converters/date/date-to-time-string.d.ts +2 -0
  219. package/dist/model/seed/converters/date/iso-string-to-date.d.ts +2 -0
  220. package/dist/model/seed/converters/date/iso-string-to-time-string.d.ts +2 -0
  221. package/dist/model/seed/converters/date/string-to-date.d.ts +2 -0
  222. package/dist/model/seed/converters/date/time-string-to-date.d.ts +2 -0
  223. package/dist/model/seed/converters/date/timestamp-to-date.d.ts +2 -0
  224. package/dist/model/seed/converters/date/weekdays-range.d.ts +5 -0
  225. package/dist/model/seed/converters/json/json-parse.d.ts +2 -0
  226. package/dist/model/seed/converters/json/json-stringify.d.ts +2 -0
  227. package/dist/model/seed/converters/numbers/number-to-string.d.ts +2 -0
  228. package/dist/model/seed/converters/numbers/string-to-number.d.ts +2 -0
  229. package/dist/model/seed/converters/strings/default-if-empty.d.ts +2 -0
  230. package/dist/model/seed/converters/strings/string-to-boolean.d.ts +2 -0
  231. package/dist/model/seed/converters/strings/string-trim.d.ts +2 -0
  232. package/dist/model/services/Auth_Service.d.ts +23 -0
  233. package/dist/tmp/hierarchial-faceted-configuration-cascade/tmp.d.ts +82 -0
  234. package/dist/tools/ScheduleUpdate-sse-generator.d.ts +9 -0
  235. package/dist/tools/graphql-parser.d.ts +5 -0
  236. package/dist/tools/mock-generator.d.ts +16 -0
  237. package/dist/tools/openapi-parser.d.ts +4 -0
  238. package/dist/tools/table.d.ts +4 -0
  239. package/dist/tools/updates-generator.d.ts +12 -0
  240. package/package.json +71 -0
@@ -0,0 +1,49 @@
1
+ import { REntity } from './REntity';
2
+ import { SettingsVarSchema, SettingsAuthSchema, SettingsVocabSourceSchema, SettingsCustomSectionSchema, SettingsUpdateProfileSchema, SettingsUpdateFieldSchema, SettingsSSESchema } from '../../types/settings.types';
3
+ /**
4
+ * Доменная сущность для настроек (settings).
5
+ */
6
+ export declare class RSettings extends REntity {
7
+ /** Человекочитаемое имя настроек (displayName) */
8
+ displayName: string;
9
+ /** identity проекта, к которому привязаны настройки (или null / undefined) */
10
+ project?: string | null;
11
+ /** Глобальные переменные */
12
+ vars: SettingsVarSchema[];
13
+ /** Авторизация */
14
+ auth?: SettingsAuthSchema;
15
+ /** Внешние словари (vocabs) */
16
+ vocabs: SettingsVocabSourceSchema[];
17
+ sse?: SettingsSSESchema;
18
+ updates?: SettingsUpdateProfileSchema[];
19
+ /** Пользовательские секции */
20
+ customSections: SettingsCustomSectionSchema[];
21
+ /** profileIdentity -> profile */
22
+ private _updatesByIdentity;
23
+ /**
24
+ * profileIdentity -> (eventType -> fieldSchema)
25
+ * eventType - уже нормализованный (trim)
26
+ */
27
+ private _updatesHandlersByProfile;
28
+ /** profileIdentity -> pathSegments (например ["eventInfo","name"]) */
29
+ private _updatesTypePathSegs;
30
+ getUpdateProfile(profileIdentity: string): SettingsUpdateProfileSchema | undefined;
31
+ getUpdateTypePathSegs(profileIdentity: string): string[] | undefined;
32
+ getUpdateHandler(profileIdentity: string, eventType: string): SettingsUpdateFieldSchema | undefined;
33
+ /**
34
+ * Из payload-документа (то, что приходит с REST / GraphQL Payload’а).
35
+ * raw ~ doc из коллекции settings.
36
+ */
37
+ static fromPayload(raw: any): RSettings;
38
+ /**
39
+ * Из plain-schema (EndgeSchemaDump.settings[]).
40
+ * Здесь уже нет storage-мета - только схема.
41
+ */
42
+ static fromPlain(json: any): RSettings;
43
+ /**
44
+ * Экспорт в plain-schema, чтобы складывать в EndgeSchemaDump / сохранять в файл.
45
+ * Тут мы сознательно не тащим createdAt / updatedAt и прочее.
46
+ */
47
+ toPlain(): any;
48
+ compile(): void;
49
+ }
@@ -0,0 +1,7 @@
1
+ import { DuplicateOptions, REntity } from './REntity';
2
+ /** Сущность стиля (коллекция styles). identity, displayName, folder, project, styles, meta, inherited, isSystem. */
3
+ export declare class RStyle extends REntity {
4
+ styles: Record<string, unknown>;
5
+ toPlain(): Record<string, unknown>;
6
+ duplicate(options: DuplicateOptions): RStyle;
7
+ }
@@ -0,0 +1,8 @@
1
+ import { DuplicateOptions, REntity } from './REntity';
2
+ /** Сущность тенанта (коллекция tenants). */
3
+ export declare class RTenant extends REntity {
4
+ code: string;
5
+ description?: string | null;
6
+ toPlain(): Record<string, unknown>;
7
+ duplicate(options: DuplicateOptions): RTenant;
8
+ }
@@ -0,0 +1,17 @@
1
+ import { RField } from './RField';
2
+ import { REntity } from './REntity';
3
+ /**
4
+ * Класс рефлексии для хранения информации о типе.
5
+ * Содержит название и список полей.
6
+ */
7
+ export declare class RType extends REntity {
8
+ get id(): string;
9
+ name: string;
10
+ isPrimitive: boolean;
11
+ fields: Map<string, RField>;
12
+ constructor(name: string);
13
+ addField(field: RField): void;
14
+ getField(fieldName: string | number): RField | null;
15
+ hasField(fieldName: string | number): boolean;
16
+ getFields(): string[];
17
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Доменная сущность версии (снимок домена).
3
+ * data подгружается только по требованию (скачивание).
4
+ */
5
+ export declare class RVersion {
6
+ /** Payload id (в Payload - число) */
7
+ id: number;
8
+ identity: string;
9
+ description: string;
10
+ /** Данные домена (JSON). Заполняется только при запросе (скачать). */
11
+ data?: any;
12
+ createdAt?: string;
13
+ updatedAt?: string;
14
+ /** Заполнить из ответа API (без data для списка). */
15
+ static fromPayload(doc: {
16
+ id: string | number;
17
+ identity?: string;
18
+ description?: string;
19
+ data?: any;
20
+ createdAt?: string;
21
+ updatedAt?: string;
22
+ }): RVersion;
23
+ toPlain(): {
24
+ id: string | number;
25
+ identity: string;
26
+ description: string;
27
+ data?: any;
28
+ };
29
+ }
@@ -0,0 +1,21 @@
1
+ import { DuplicateOptions, REntity } from './REntity';
2
+ export interface RViewSchema {
3
+ id: number;
4
+ identity: string;
5
+ name: string;
6
+ description?: string | null;
7
+ isSystem?: boolean;
8
+ componentId?: number | null;
9
+ filterId?: number | null;
10
+ queryId?: number | null;
11
+ meta?: Record<string, unknown>;
12
+ }
13
+ /** Сущность вида (коллекция views). */
14
+ export declare class RView extends REntity {
15
+ description: string | null;
16
+ componentId: number | null;
17
+ filterId: number | null;
18
+ queryId: number | null;
19
+ toPlain(): RViewSchema;
20
+ duplicate(options: DuplicateOptions): RView;
21
+ }
@@ -0,0 +1,16 @@
1
+ import { DuplicateOptions, REntity } from './REntity';
2
+ export type RVocabMode = 'external_payload' | 'internal';
3
+ /** Сущность словаря (коллекция vocabs). Один документ = один словарь. */
4
+ export declare class RVocabs extends REntity {
5
+ displayName: string;
6
+ description?: string | null;
7
+ mode: RVocabMode;
8
+ baseApiUrl?: string | null;
9
+ collectionSlug?: string | null;
10
+ active: boolean;
11
+ static fromPayload(json: any): RVocabs;
12
+ static fromPlain(json: any): RVocabs;
13
+ toPlain(): Record<string, unknown>;
14
+ compile(): void;
15
+ duplicate(options: DuplicateOptions): RVocabs;
16
+ }
@@ -0,0 +1,48 @@
1
+ import { RuntimeHost } from '../../types/runtime-host.types';
2
+ /**
3
+ * Минимальная binding-scope модель runtime.
4
+ * Хранит базовый путь и алиасы, от которых компоненты строят локальные selectors.
5
+ */
6
+ export interface RuntimeBindingScope {
7
+ parentRuntimeId: string | null;
8
+ basePath: string | null;
9
+ aliases: Record<string, string>;
10
+ }
11
+ /**
12
+ * Привести unknown-значение к RuntimeBindingScope, если это возможно.
13
+ */
14
+ export declare function asRuntimeBindingScope(value: unknown): RuntimeBindingScope | null;
15
+ /**
16
+ * Собрать binding-scope для runtime.
17
+ * Если explicit scope не передан, пытается унаследовать scope родителя
18
+ * и только потом fallback-ится на legacy basePath.
19
+ */
20
+ export declare function resolveRuntimeBindingScope(input: {
21
+ parent?: RuntimeHost<any, any> | null;
22
+ basePath?: string | null;
23
+ sourceVar?: string | null;
24
+ scope?: Partial<RuntimeBindingScope> | null;
25
+ }): RuntimeBindingScope;
26
+ /**
27
+ * Прочитать путь массива items из scope.
28
+ */
29
+ export declare function getRuntimeScopeItemsPath(scope: RuntimeBindingScope): string;
30
+ /**
31
+ * Прочитать шаблон пути строки из scope.
32
+ */
33
+ export declare function getRuntimeScopeRowPath(scope: RuntimeBindingScope): string;
34
+ /**
35
+ * Скомпилировать selector таблицы в абсолютный runtime path.
36
+ * Поддерживает:
37
+ * - legacy absolute: `$store...`
38
+ * - scope aliases: `@root.`, `@items.`, `@row.`
39
+ * - relative row selectors: `number`, `attrs[name='STA'].dateTime`
40
+ */
41
+ export declare function resolveScopedTablePath(input: {
42
+ rawPath: string;
43
+ scope: RuntimeBindingScope;
44
+ rowIndex?: number;
45
+ }): {
46
+ path: string;
47
+ vars: Record<string, any>;
48
+ };
@@ -0,0 +1,26 @@
1
+ export type StoreWriter = {
2
+ to: (storeKey: string) => Promise<void>;
3
+ };
4
+ export type StoreReader = {
5
+ from: (storeKey: string) => Promise<void>;
6
+ };
7
+ /**
8
+ * Контекст, который пробрасывается в скрипт (ВНУТРЕННИЙ)
9
+ */
10
+ export interface RuntimeContext extends Record<string, unknown> {
11
+ scopeId: string;
12
+ Data: {
13
+ [key: string]: any;
14
+ };
15
+ UnsafeEndge: {
16
+ domain: any;
17
+ extract: any;
18
+ render: any;
19
+ store: any;
20
+ script: any;
21
+ };
22
+ expose: (data: Record<string, CallableFunction>) => void;
23
+ query: (queryId: string) => StoreWriter;
24
+ watch: (queryId: string, seconds?: number) => StoreWriter;
25
+ mount: (componentId: string) => StoreReader;
26
+ }
@@ -0,0 +1,12 @@
1
+ import { RuntimeScope } from './RuntimeScope';
2
+ /**
3
+ * Среда исполнения скрипта для коммуникации между UI и скриптом
4
+ */
5
+ export declare class RuntimeEnvironment {
6
+ private scopes;
7
+ /**
8
+ * Возвращает RuntimeScope по id.
9
+ * Если не существует, создает новый.
10
+ */
11
+ getScope(id: string, parent?: RuntimeScope): RuntimeScope;
12
+ }
@@ -0,0 +1,100 @@
1
+ import { RuntimeEntityModelMap, RuntimeEntityType } from '../../types/runtime-entity-map.types';
2
+ import { RuntimeHost, RuntimeHostChannel, RuntimeHostContext, RuntimeHostResource, RuntimeHostSnapshot, RuntimeHostStatus } from '../../types/runtime-host.types';
3
+ import { RuntimeKind } from '../../types/runtime.types';
4
+ import { RaphNode } from '@endge/raph';
5
+ import { EventBus } from '@endge/utils';
6
+ export declare abstract class RuntimeHostBase<TType extends RuntimeEntityType, TContext extends RuntimeHostContext<TType> = RuntimeHostContext<TType>> extends EventBus<Record<string, any>> implements RuntimeHost<TType, TContext> {
7
+ /** Уникальный runtime-id host. */
8
+ readonly id: string;
9
+ /** Родительский runtime-host для отладки вложенных запусков. */
10
+ readonly parent: RuntimeHost<any, any> | null;
11
+ /** Канонический runtime kind host. */
12
+ readonly kind: RuntimeKind | 'runtime';
13
+ /** Техническое имя реализации host. */
14
+ readonly runtimeType: string;
15
+ /** Тип доменной сущности, к которой привязан host. */
16
+ readonly entityType: TType;
17
+ /** Экземпляр доменной модели, на которой работает host. */
18
+ readonly model: RuntimeEntityModelMap[TType];
19
+ /** Identity связанной доменной сущности. */
20
+ readonly entityIdentity: string;
21
+ /** Заголовок host для отображения в UI. */
22
+ readonly title: string;
23
+ /** Текущий статус жизненного цикла host. */
24
+ status: RuntimeHostStatus;
25
+ /** Время создания host (timestamp ms). */
26
+ readonly createdAt: number;
27
+ /** Время последнего изменения host (timestamp ms). */
28
+ updatedAt: number;
29
+ /** Ресурсы, ассоциированные с host. */
30
+ readonly resources: RuntimeHostResource[];
31
+ /** Каналы, используемые host для коммуникации. */
32
+ readonly channels: RuntimeHostChannel[];
33
+ /** Произвольные метаданные host. */
34
+ readonly meta: Record<string, unknown>;
35
+ /** Типизированный runtime-контекст host. */
36
+ context: TContext;
37
+ /** Корневая raph-нода host (первая добавленная). */
38
+ node: RaphNode | null;
39
+ /** Список raph-нод, которыми владеет host. */
40
+ private _raphNodes;
41
+ constructor(input: {
42
+ /** Уникальный runtime-id host. */
43
+ id: string;
44
+ /** Родительский runtime-host. */
45
+ parent?: RuntimeHost<any, any> | null;
46
+ /** Канонический runtime kind host. */
47
+ kind: RuntimeKind | 'runtime';
48
+ /** Техническое имя реализации host. */
49
+ runtimeType: string;
50
+ /** Тип доменной сущности. */
51
+ entityType: TType;
52
+ /** Экземпляр доменной модели. */
53
+ model: RuntimeEntityModelMap[TType];
54
+ /** Identity доменной сущности. */
55
+ entityIdentity: string;
56
+ /** Отображаемое имя host. */
57
+ title?: string;
58
+ /** Стартовый статус host. */
59
+ status?: RuntimeHostStatus;
60
+ /** Начальные метаданные host. */
61
+ meta?: Record<string, unknown>;
62
+ /** Начальный контекст host (тип зависит от реализации). */
63
+ context?: TContext;
64
+ });
65
+ /**
66
+ * LIFECYCLE
67
+ */
68
+ create(): void;
69
+ /**
70
+ * LIFECYCLE
71
+ */
72
+ destroy(): void;
73
+ /**
74
+ * ACCESS
75
+ */
76
+ setStatus(status: RuntimeHostStatus): void;
77
+ /**
78
+ * ACCESS
79
+ */
80
+ addResource(resource: RuntimeHostResource): void;
81
+ /**
82
+ * ACCESS
83
+ */
84
+ addChannel(channel: RuntimeHostChannel): void;
85
+ setContext(patch: Partial<TContext>): void;
86
+ replaceContext(context: TContext): void;
87
+ /**
88
+ * ACCESS
89
+ */
90
+ addRaphNode(node: RaphNode): void;
91
+ /**
92
+ * ACCESS
93
+ */
94
+ snapshot(): RuntimeHostSnapshot;
95
+ /**
96
+ * ACCESS
97
+ */
98
+ protected touch(): void;
99
+ private serializeContext;
100
+ }
@@ -0,0 +1,15 @@
1
+ import { RuntimeEntityModelMap, RuntimeEntityType } from '../../types/runtime-entity-map.types';
2
+ import { RuntimeHost } from '../../types/runtime-host.types';
3
+ export interface RuntimeHostFactoryInput<TType extends RuntimeEntityType> {
4
+ id: string;
5
+ entityType: TType;
6
+ model: RuntimeEntityModelMap[TType];
7
+ entityIdentity: string;
8
+ title?: string;
9
+ meta?: Record<string, unknown>;
10
+ }
11
+ export type RuntimeHostFactoryAnyInput = RuntimeHostFactoryInput<RuntimeEntityType>;
12
+ /**
13
+ * ACCESS
14
+ */
15
+ export declare function createRuntimeHost(input: RuntimeHostFactoryAnyInput): RuntimeHost<any>;
@@ -0,0 +1,56 @@
1
+ import { RuntimeEntityType } from '../../types/runtime-entity-map.types';
2
+ import { RuntimeHost, RuntimeHostSnapshot } from '../../types/runtime-host.types';
3
+ import { RuntimeHostRegistryLike, RuntimeHostRegistrySnapshot } from '../../types/runtime-registry.types';
4
+ export declare class RuntimeHostRegistry implements RuntimeHostRegistryLike {
5
+ private _hosts;
6
+ private _indexByEntity;
7
+ private _deletedSnapshots;
8
+ /**
9
+ * ACCESS
10
+ */
11
+ register<T extends RuntimeHost<any, any>>(host: T): T;
12
+ /**
13
+ * ACCESS
14
+ */
15
+ getById(id: string): RuntimeHost<any, any> | null;
16
+ /**
17
+ * ACCESS
18
+ */
19
+ getAll(): RuntimeHost<any, any>[];
20
+ /**
21
+ * ACCESS
22
+ */
23
+ getByEntity(entityType: RuntimeEntityType, entityIdentity: string): RuntimeHost<any, any>[];
24
+ /**
25
+ * ACCESS
26
+ */
27
+ removeById(id: string): RuntimeHost<any, any> | null;
28
+ /**
29
+ * LIFECYCLE
30
+ */
31
+ clear(): void;
32
+ /**
33
+ * ACCESS
34
+ */
35
+ rememberDeletedSnapshot(snapshot: RuntimeHostSnapshot): void;
36
+ /**
37
+ * ACCESS
38
+ */
39
+ getDeletedSnapshots(): RuntimeHostSnapshot[];
40
+ /**
41
+ * ACCESS
42
+ */
43
+ removeDeletedSnapshot(id: string): RuntimeHostSnapshot | null;
44
+ /**
45
+ * ACCESS
46
+ */
47
+ clearDeleted(): void;
48
+ /**
49
+ * ACCESS
50
+ */
51
+ snapshot(): RuntimeHostRegistrySnapshot;
52
+ /**
53
+ * ACCESS
54
+ */
55
+ private entityKey;
56
+ }
@@ -0,0 +1,45 @@
1
+ import { EventBus } from '@endge/utils';
2
+ export declare enum RuntimeEventType {
3
+ Mounted = "component:mount"
4
+ }
5
+ export interface RuntimeEvents {
6
+ [RuntimeEventType.Mounted]: {
7
+ componentId: string;
8
+ storeKey?: string;
9
+ };
10
+ }
11
+ /**
12
+ * Описывает контекст среды исполнения для некоторого сегмента.
13
+ * Сегментом может быть setup-скрипт сценария, компонента или другие runtime-скрипты, JSX контексты.
14
+ * Каждый сегмент связан с предыдущим - родительским (вложенность любая).
15
+ */
16
+ export declare class RuntimeScope extends EventBus<RuntimeEvents> {
17
+ readonly id: string;
18
+ readonly parent?: RuntimeScope;
19
+ readonly vars: Map<string, any>;
20
+ readonly ui: {
21
+ componentMountedId?: string;
22
+ componentMountedStoreId?: string;
23
+ };
24
+ readonly export: {
25
+ names?: Record<string, CallableFunction>;
26
+ };
27
+ constructor(id: string, parent?: RuntimeScope);
28
+ /**
29
+ * Рекурсивный поиск экспортируемого имени
30
+ * ToDo: рекурсия? потомку доступны родительские методы?
31
+ */
32
+ findExportedFn(name: string): CallableFunction | undefined;
33
+ /**
34
+ * Получить значение переменной, пробрасываясь по родителям
35
+ */
36
+ getVar(name: string): any;
37
+ /**
38
+ * Массовая установка переменных
39
+ */
40
+ setVars(vars: Record<string, any> | Map<string, any>): void;
41
+ /**
42
+ * Проверка наличия переменной (с учётом родителя)
43
+ */
44
+ hasVar(name: string): boolean;
45
+ }
@@ -0,0 +1,30 @@
1
+ import { RAction } from '../../reflect/RAction';
2
+ import { ActionRuntimeHostContext, RuntimeHost } from '../../../types/runtime-host.types';
3
+ import { RuntimeHostBase } from '../RuntimeHostBase';
4
+ /**
5
+ * Создаёт контекст action-runtime с опциональной ссылкой на родительский контекст.
6
+ * Всегда создаёт новый flowState (изоляция), при необходимости задаёт parent для иерархии.
7
+ */
8
+ export declare function createActionContext(options: {
9
+ input?: Record<string, unknown> | unknown;
10
+ parent?: ActionRuntimeHostContext | null;
11
+ }): ActionRuntimeHostContext;
12
+ export declare class ActionRuntimeHost extends RuntimeHostBase<'action'> {
13
+ constructor(input: {
14
+ id: string;
15
+ model: RAction;
16
+ entityIdentity: string;
17
+ parent?: RuntimeHost<any, any> | null;
18
+ title?: string;
19
+ meta?: Record<string, unknown>;
20
+ });
21
+ /**
22
+ * LIFECYCLE
23
+ */
24
+ static createRuntime(input: {
25
+ id: string;
26
+ model: RAction;
27
+ meta?: Record<string, any>;
28
+ parent?: RuntimeHost<any, any> | null;
29
+ }): RuntimeHost<'action'>;
30
+ }
@@ -0,0 +1,22 @@
1
+ import { RComponent } from '../../../types/component.types';
2
+ import { RuntimeHost } from '../../../types/runtime-host.types';
3
+ import { RuntimeHostBase } from '../RuntimeHostBase';
4
+ export declare class ComponentRuntimeHost extends RuntimeHostBase<'component'> {
5
+ constructor(input: {
6
+ id: string;
7
+ model: RComponent;
8
+ entityIdentity: string;
9
+ parent?: RuntimeHost<any, any> | null;
10
+ title?: string;
11
+ meta?: Record<string, unknown>;
12
+ });
13
+ /**
14
+ * LIFECYCLE
15
+ */
16
+ static createRuntime(input: {
17
+ id: string;
18
+ model: RComponent;
19
+ meta?: Record<string, any>;
20
+ parent?: RuntimeHost<any, any> | null;
21
+ }): RuntimeHost<'component'> | null;
22
+ }
@@ -0,0 +1,22 @@
1
+ import { RPage } from '../../reflect/RPage';
2
+ import { RuntimeHost } from '../../../types/runtime-host.types';
3
+ import { RuntimeHostBase } from '../RuntimeHostBase';
4
+ export declare class PageRuntimeHost extends RuntimeHostBase<'page'> {
5
+ constructor(input: {
6
+ id: string;
7
+ model: RPage;
8
+ entityIdentity: string;
9
+ parent?: RuntimeHost<any, any> | null;
10
+ title?: string;
11
+ meta?: Record<string, unknown>;
12
+ });
13
+ /**
14
+ * LIFECYCLE
15
+ */
16
+ static createRuntime(input: {
17
+ id: string;
18
+ model: RPage;
19
+ meta?: Record<string, any>;
20
+ parent?: RuntimeHost<any, any> | null;
21
+ }): RuntimeHost<'page'>;
22
+ }
@@ -0,0 +1,22 @@
1
+ import { RProject } from '../../reflect/RProject';
2
+ import { RuntimeHost } from '../../../types/runtime-host.types';
3
+ import { RuntimeHostBase } from '../RuntimeHostBase';
4
+ export declare class ProjectRuntimeHost extends RuntimeHostBase<'project'> {
5
+ constructor(input: {
6
+ id: string;
7
+ model: RProject;
8
+ entityIdentity: string;
9
+ parent?: RuntimeHost<any, any> | null;
10
+ title?: string;
11
+ meta?: Record<string, unknown>;
12
+ });
13
+ /**
14
+ * LIFECYCLE
15
+ */
16
+ static createRuntime(input: {
17
+ id: string;
18
+ model: RProject;
19
+ meta?: Record<string, any>;
20
+ parent?: RuntimeHost<any, any> | null;
21
+ }): RuntimeHost<'project'>;
22
+ }
@@ -0,0 +1,22 @@
1
+ import { RQuery } from '../../reflect/RQuery';
2
+ import { RuntimeHost } from '../../../types/runtime-host.types';
3
+ import { RuntimeHostBase } from '../RuntimeHostBase';
4
+ export declare class QueryRuntimeHost extends RuntimeHostBase<'query'> {
5
+ constructor(input: {
6
+ id: string;
7
+ model: RQuery;
8
+ entityIdentity: string;
9
+ parent?: RuntimeHost<any, any> | null;
10
+ title?: string;
11
+ meta?: Record<string, unknown>;
12
+ });
13
+ /**
14
+ * LIFECYCLE
15
+ */
16
+ static createRuntime(input: {
17
+ id: string;
18
+ model: RQuery;
19
+ meta?: Record<string, any>;
20
+ parent?: RuntimeHost<any, any> | null;
21
+ }): RuntimeHost<'query'> | null;
22
+ }
@@ -0,0 +1,22 @@
1
+ import { RComponentTable } from '../../reflect/RComponentTable';
2
+ import { RuntimeHost } from '../../../types/runtime-host.types';
3
+ import { RuntimeHostBase } from '../RuntimeHostBase';
4
+ export declare class TableRuntimeHost extends RuntimeHostBase<'table'> {
5
+ constructor(input: {
6
+ id: string;
7
+ model: RComponentTable;
8
+ entityIdentity: string;
9
+ parent?: RuntimeHost<any, any> | null;
10
+ title?: string;
11
+ meta?: Record<string, unknown>;
12
+ });
13
+ /**
14
+ * LIFECYCLE
15
+ */
16
+ static createRuntime(input: {
17
+ id: string;
18
+ model: RComponentTable;
19
+ meta?: Record<string, any>;
20
+ parent?: RuntimeHost<any, any> | null;
21
+ }): RuntimeHost<'table'>;
22
+ }
@@ -0,0 +1,22 @@
1
+ import { RView } from '../../reflect/RView';
2
+ import { RuntimeHost } from '../../../types/runtime-host.types';
3
+ import { RuntimeHostBase } from '../RuntimeHostBase';
4
+ export declare class ViewRuntimeHost extends RuntimeHostBase<'view'> {
5
+ constructor(input: {
6
+ id: string;
7
+ model: RView;
8
+ entityIdentity: string;
9
+ parent?: RuntimeHost<any, any> | null;
10
+ title?: string;
11
+ meta?: Record<string, unknown>;
12
+ });
13
+ /**
14
+ * LIFECYCLE
15
+ */
16
+ static createRuntime(input: {
17
+ id: string;
18
+ model: RView;
19
+ meta?: Record<string, any>;
20
+ parent?: RuntimeHost<any, any> | null;
21
+ }): RuntimeHost<'view'>;
22
+ }
@@ -0,0 +1,6 @@
1
+ import { RuntimeScope } from '../entities/runtime/RuntimeScope';
2
+ /**
3
+ * Функция expose, предоставляемая в RuntimeContext.
4
+ * Помечает функции, как экспортируемые в JSX.
5
+ */
6
+ export declare function apiExpose(scope: RuntimeScope, data: Record<string, CallableFunction>): void;
@@ -0,0 +1,7 @@
1
+ import { StoreReader } from '../entities/runtime/RuntimeContext';
2
+ import { RuntimeScope } from '../entities/runtime/RuntimeScope';
3
+ /**
4
+ * Функция mount, предоставляемая в RuntimeContext.
5
+ * При вызове с componentId возвращает .from(...), но если .from не будет вызвана вручную - выполнится автоматически.
6
+ */
7
+ export declare function apiMount(scope: RuntimeScope, componentId: string): StoreReader;
@@ -0,0 +1,7 @@
1
+ import { StoreWriter } from '../entities/runtime/RuntimeContext';
2
+ import { RuntimeScope } from '../entities/runtime/RuntimeScope';
3
+ /**
4
+ * Функция query, предоставляемая в RuntimeContext.
5
+ * При вызове с queryId возвращает .to(...), но если .to не будет вызвана вручную - выполнится автоматически.
6
+ */
7
+ export declare function apiQuery(scope: RuntimeScope, queryId: string): StoreWriter;