dochub-sdk 0.1.328 → 0.1.330

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.
@@ -7,11 +7,18 @@
7
7
  "коммита",
8
8
  "коммите",
9
9
  "Параметризируемый",
10
+ "Промис",
10
11
  "basetypes",
11
12
  "datalake",
12
13
  "eventbus",
14
+ "GPLV",
13
15
  "localstorage",
16
+ "metamodel",
14
17
  "Nata",
15
- "PROPFIND"
18
+ "Piontik",
19
+ "PROPFIND",
20
+ "uids",
21
+ "unfollow",
22
+ "Vuetify"
16
23
  ]
17
24
  }
package/interfaces/ai.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { DocHubEditorContext } from "./editors";
2
+
1
3
  /**
2
4
  * Интерфейс открытого запроса к AI
3
5
  */
@@ -69,6 +71,12 @@ export interface IDocHubAI {
69
71
  * @returns - Запрос к AI
70
72
  */
71
73
  ask: DocHubAskFunction;
74
+ /**
75
+ * Создает глобальный контекст на основании встроенных механизмов
76
+ * @param context - Пользовательский контекст. Если не указан, то будет использован текущий контекст
77
+ * @returns - Глобальный контекст
78
+ */
79
+ makeGlobalContext(context?: DocHubEditorContext): Promise<string>;
72
80
  /**
73
81
  * Регистрирует драйвер AI
74
82
  * @param alias - Алиас драйвера
@@ -1,6 +1,7 @@
1
1
  import { IProtocolResponseOptions, IDocHubProtocolResponse, IDocHubResourceVersion } from './protocols';
2
2
  import { DocHubDataSetProfileSource, DocHubJSONataQuery, IDocHubDataSetProfile } from './datasets';
3
3
  import { DocHubUITargetWindow } from './ui';
4
+ import { DocHubJSONSchema } from '../schemas/basetypes';
4
5
 
5
6
  export enum DataLakeChange {
6
7
  update = 'update', // Обновление данных по указанному пути
@@ -592,5 +593,10 @@ export interface IDocHubDataLake {
592
593
  * @param debug - Объект реализующий отладчик
593
594
  */
594
595
  registerDebugger(debug: IDocHubDataLakeDebugger);
596
+
597
+ /**
598
+ * Возвращает JSONSchema DataLake
599
+ */
600
+ fetchSchema(): Promise<DocHubJSONSchema>;
595
601
  }
596
602
 
@@ -1,6 +1,6 @@
1
1
  import { DocHubDataSetProfileSource, IDocHubDataSetProfile } from './datasets';
2
2
  import { DataLakePath } from './datalake';
3
- import { IDocHubSchema } from './../schemas/basetypes';
3
+ import { DocHubJSONSchema } from './../schemas/basetypes';
4
4
 
5
5
  /**
6
6
  * Идентификатор типа презентации
@@ -30,7 +30,7 @@ export interface IDocHubPresentationProfile extends IDocHubDataSetProfile {
30
30
  // Шаблон представления
31
31
  template?: string;
32
32
  // Схема требуемых параметров для презентации
33
- params?: IDocHubSchema;
33
+ params?: DocHubJSONSchema;
34
34
  // Пользовательский конструктор профиля презентации
35
35
  $constructor?: DocHubDataSetProfileSource;
36
36
  // Базовый путь к объекту от которого будут разрешаться все относительные пути
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dochub-sdk",
3
- "version": "0.1.328",
3
+ "version": "0.1.330",
4
4
  "description": "The DocHub System Development Kit.",
5
5
  "private": false,
6
6
  "main": "index.ts",
@@ -1,28 +1,95 @@
1
1
  /**
2
- * Базовые типы схем
2
+ * Базовая схема для всех типов
3
3
  */
4
- export enum BaseTypes {
5
- object = 'object',
6
- string = 'string'
4
+ export interface IDocHubJSONSchemaBase {
5
+ title?: string; // Название
6
+ description?: string; // Описание
7
+ default?: any; // Значение по умолчанию
8
+ examples?: any[]; // Примеры использования
7
9
  }
8
10
 
9
11
  /**
10
- * Свойства объекта
12
+ * Базовые типы
11
13
  */
12
- export interface IDocHubSchemaProperties {
13
- [key: string]: IDocHubSchema;
14
+ export enum DocHubJSONSchemaBasicTypes {
15
+ boolean = 'boolean',
16
+ null = 'null',
17
+ string = 'string',
18
+ number = 'number',
19
+ integer = 'integer',
20
+ array = 'array',
21
+ object = 'object'
14
22
  }
15
23
 
16
- /**
17
- * JSON Schema
18
- */
19
- export interface IDocHubSchema {
20
- title: string;
21
- type: BaseTypes;
22
- properties?: IDocHubSchemaProperties;
23
- patternProperties?: IDocHubSchemaProperties;
24
- required?: string[];
25
- pattern?: string;
24
+ export interface ISchemaArray extends IDocHubJSONSchemaBase {
25
+ type: DocHubJSONSchemaBasicTypes.array;
26
+ items: DocHubJSONSchema;
27
+ minItems?: number;
28
+ maxItems?: number;
29
+ uniqueItems?: boolean;
30
+ }
31
+
32
+ export interface ISchemaBoolean extends IDocHubJSONSchemaBase {
33
+ type: DocHubJSONSchemaBasicTypes.boolean;
34
+ }
35
+
36
+ export interface ISchemaNull extends IDocHubJSONSchemaBase {
37
+ type: DocHubJSONSchemaBasicTypes.null;
38
+ }
39
+
40
+ export enum SchemaStringFormat {
41
+ date = 'date',
42
+ datetime = 'date-time',
43
+ enum = 'enum',
44
+ string = 'string',
45
+ label = 'label',
46
+ textarea = 'textarea',
47
+ alert = 'alert'
48
+ }
49
+
50
+ export interface ISchemaString extends IDocHubJSONSchemaBase {
51
+ type: DocHubJSONSchemaBasicTypes.string;
52
+ minLength?: number;
53
+ maxLength?: number;
54
+ enum?: string[];
55
+ format?: SchemaStringFormat;
56
+ }
57
+
58
+ export interface ISchemaNumber extends IDocHubJSONSchemaBase {
59
+ type: DocHubJSONSchemaBasicTypes.number;
60
+ minimum?: number;
61
+ maximum?: number;
62
+ exclusiveMinimum?: number;
63
+ exclusiveMaximum?: number;
64
+ multipleOf?: any;
65
+ }
66
+
67
+ export interface ISchemaInteger extends IDocHubJSONSchemaBase {
68
+ type: DocHubJSONSchemaBasicTypes.integer;
69
+ minimum?: number;
70
+ maximum?: number;
71
+ exclusiveMinimum?: number;
72
+ exclusiveMaximum?: number;
73
+ multipleOf?: any;
74
+ }
75
+
76
+ export interface ISchemaObjectProperties {
77
+ [key: string]: DocHubJSONSchema;
78
+ }
79
+
80
+ export interface ISchemaObject extends IDocHubJSONSchemaBase {
81
+ type: DocHubJSONSchemaBasicTypes.object;
82
+ properties: ISchemaObjectProperties;
26
83
  additionalProperties?: boolean;
84
+ required?: string[];
85
+ minProperties?: number;
86
+ maxProperties?: number;
87
+ patternProperties?: RegExp;
88
+ regexp?: RegExp;
89
+ dependencies?: any;
90
+ // Порядок вывода полей сверху вниз и слева направо
91
+ order?: string[];
27
92
  }
28
93
 
94
+ export type DocHubJSONSchema = ISchemaArray | ISchemaString | ISchemaNumber | ISchemaInteger | ISchemaObject | ISchemaBoolean;
95
+