@rsconcept/domain 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/dist/cctext/index.d.ts +1 -0
- package/dist/cctext/index.js +42 -0
- package/dist/cctext/index.js.map +1 -0
- package/dist/cctext/language-api.d.ts +43 -0
- package/dist/cctext/language-api.js +252 -0
- package/dist/cctext/language-api.js.map +1 -0
- package/dist/cctext/language.d.ts +58 -0
- package/dist/cctext/language.js +44 -0
- package/dist/cctext/language.js.map +1 -0
- package/dist/graph/graph.d.ts +62 -0
- package/dist/graph/graph.js +385 -0
- package/dist/graph/graph.js.map +1 -0
- package/dist/graph/index.d.ts +1 -0
- package/dist/graph/index.js +384 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +5851 -0
- package/dist/index.js.map +1 -0
- package/dist/library/folder-tree.d.ts +32 -0
- package/dist/library/folder-tree.js +136 -0
- package/dist/library/folder-tree.js.map +1 -0
- package/dist/library/index.d.ts +17 -0
- package/dist/library/index.js +2800 -0
- package/dist/library/index.js.map +1 -0
- package/dist/library/library-api.d.ts +6 -0
- package/dist/library/library-api.js +13 -0
- package/dist/library/library-api.js.map +1 -0
- package/dist/library/library.d.ts +56 -0
- package/dist/library/library.js +23 -0
- package/dist/library/library.js.map +1 -0
- package/dist/library/oss-api.d.ts +47 -0
- package/dist/library/oss-api.js +1105 -0
- package/dist/library/oss-api.js.map +1 -0
- package/dist/library/oss-layout-api.d.ts +36 -0
- package/dist/library/oss-layout-api.js +330 -0
- package/dist/library/oss-layout-api.js.map +1 -0
- package/dist/library/oss-layout.d.ts +25 -0
- package/dist/library/oss-layout.js +1 -0
- package/dist/library/oss-layout.js.map +1 -0
- package/dist/library/oss.d.ts +136 -0
- package/dist/library/oss.js +30 -0
- package/dist/library/oss.js.map +1 -0
- package/dist/library/rsengine.d.ts +116 -0
- package/dist/library/rsengine.js +2604 -0
- package/dist/library/rsengine.js.map +1 -0
- package/dist/library/rsform-api.d.ts +74 -0
- package/dist/library/rsform-api.js +879 -0
- package/dist/library/rsform-api.js.map +1 -0
- package/dist/library/rsform.d.ts +206 -0
- package/dist/library/rsform.js +32 -0
- package/dist/library/rsform.js.map +1 -0
- package/dist/library/rsmodel-api.d.ts +43 -0
- package/dist/library/rsmodel-api.js +836 -0
- package/dist/library/rsmodel-api.js.map +1 -0
- package/dist/library/rsmodel.d.ts +52 -0
- package/dist/library/rsmodel.js +25 -0
- package/dist/library/rsmodel.js.map +1 -0
- package/dist/library/structure-planner.d.ts +33 -0
- package/dist/library/structure-planner.js +481 -0
- package/dist/library/structure-planner.js.map +1 -0
- package/dist/parsing/ast.d.ts +49 -0
- package/dist/parsing/ast.js +93 -0
- package/dist/parsing/ast.js.map +1 -0
- package/dist/parsing/index.d.ts +3 -0
- package/dist/parsing/index.js +141 -0
- package/dist/parsing/index.js.map +1 -0
- package/dist/parsing/lezer-tree.d.ts +13 -0
- package/dist/parsing/lezer-tree.js +50 -0
- package/dist/parsing/lezer-tree.js.map +1 -0
- package/dist/rslang/api.d.ts +53 -0
- package/dist/rslang/api.js +846 -0
- package/dist/rslang/api.js.map +1 -0
- package/dist/rslang/ast-annotations.d.ts +18 -0
- package/dist/rslang/ast-annotations.js +56 -0
- package/dist/rslang/ast-annotations.js.map +1 -0
- package/dist/rslang/error.d.ts +85 -0
- package/dist/rslang/error.js +159 -0
- package/dist/rslang/error.js.map +1 -0
- package/dist/rslang/eval/calculator.d.ts +43 -0
- package/dist/rslang/eval/calculator.js +1639 -0
- package/dist/rslang/eval/calculator.js.map +1 -0
- package/dist/rslang/eval/evaluation-cache.d.ts +36 -0
- package/dist/rslang/eval/evaluation-cache.js +310 -0
- package/dist/rslang/eval/evaluation-cache.js.map +1 -0
- package/dist/rslang/eval/evaluator.d.ts +70 -0
- package/dist/rslang/eval/evaluator.js +1514 -0
- package/dist/rslang/eval/evaluator.js.map +1 -0
- package/dist/rslang/eval/value-api.d.ts +48 -0
- package/dist/rslang/eval/value-api.js +490 -0
- package/dist/rslang/eval/value-api.js.map +1 -0
- package/dist/rslang/eval/value.d.ts +36 -0
- package/dist/rslang/eval/value.js +118 -0
- package/dist/rslang/eval/value.js.map +1 -0
- package/dist/rslang/index.d.ts +17 -0
- package/dist/rslang/index.js +4314 -0
- package/dist/rslang/index.js.map +1 -0
- package/dist/rslang/labels.d.ts +16 -0
- package/dist/rslang/labels.js +315 -0
- package/dist/rslang/labels.js.map +1 -0
- package/dist/rslang/parser/expression-generator.d.ts +10 -0
- package/dist/rslang/parser/expression-generator.js +451 -0
- package/dist/rslang/parser/expression-generator.js.map +1 -0
- package/dist/rslang/parser/normalize.d.ts +11 -0
- package/dist/rslang/parser/normalize.js +507 -0
- package/dist/rslang/parser/normalize.js.map +1 -0
- package/dist/rslang/parser/parser.d.ts +5 -0
- package/dist/rslang/parser/parser.js +24 -0
- package/dist/rslang/parser/parser.js.map +1 -0
- package/dist/rslang/parser/parser.terms.d.ts +42 -0
- package/dist/rslang/parser/parser.terms.js +84 -0
- package/dist/rslang/parser/parser.terms.js.map +1 -0
- package/dist/rslang/parser/syntax-errors.d.ts +11 -0
- package/dist/rslang/parser/syntax-errors.js +403 -0
- package/dist/rslang/parser/syntax-errors.js.map +1 -0
- package/dist/rslang/parser/token.d.ts +79 -0
- package/dist/rslang/parser/token.js +95 -0
- package/dist/rslang/parser/token.js.map +1 -0
- package/dist/rslang/semantic/analyzer.d.ts +39 -0
- package/dist/rslang/semantic/analyzer.js +2604 -0
- package/dist/rslang/semantic/analyzer.js.map +1 -0
- package/dist/rslang/semantic/arguments-extractor.d.ts +42 -0
- package/dist/rslang/semantic/arguments-extractor.js +366 -0
- package/dist/rslang/semantic/arguments-extractor.js.map +1 -0
- package/dist/rslang/semantic/type-auditor.d.ts +73 -0
- package/dist/rslang/semantic/type-auditor.js +1570 -0
- package/dist/rslang/semantic/type-auditor.js.map +1 -0
- package/dist/rslang/semantic/typification-api.d.ts +27 -0
- package/dist/rslang/semantic/typification-api.js +320 -0
- package/dist/rslang/semantic/typification-api.js.map +1 -0
- package/dist/rslang/semantic/typification-parser.d.ts +12 -0
- package/dist/rslang/semantic/typification-parser.js +226 -0
- package/dist/rslang/semantic/typification-parser.js.map +1 -0
- package/dist/rslang/semantic/typification.d.ts +119 -0
- package/dist/rslang/semantic/typification.js +74 -0
- package/dist/rslang/semantic/typification.js.map +1 -0
- package/dist/rslang/semantic/value-auditor.d.ts +43 -0
- package/dist/rslang/semantic/value-auditor.js +523 -0
- package/dist/rslang/semantic/value-auditor.js.map +1 -0
- package/dist/rslang/semantic/value-class.d.ts +10 -0
- package/dist/rslang/semantic/value-class.js +9 -0
- package/dist/rslang/semantic/value-class.js.map +1 -0
- package/dist/rslang/typification-graph.d.ts +33 -0
- package/dist/rslang/typification-graph.js +311 -0
- package/dist/rslang/typification-graph.js.map +1 -0
- package/dist/shared/branded.d.ts +7 -0
- package/dist/shared/branded.js +1 -0
- package/dist/shared/branded.js.map +1 -0
- package/dist/shared/hash.d.ts +6 -0
- package/dist/shared/hash.js +18 -0
- package/dist/shared/hash.js.map +1 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.js +18 -0
- package/dist/shared/index.js.map +1 -0
- package/package.json +184 -0
- package/src/cctext/index.ts +9 -0
- package/src/cctext/language-api.test.ts +149 -0
- package/src/cctext/language-api.ts +285 -0
- package/src/cctext/language.ts +80 -0
- package/src/graph/graph.test.ts +392 -0
- package/src/graph/graph.ts +433 -0
- package/src/graph/index.ts +1 -0
- package/src/index.ts +96 -0
- package/src/library/folder-tree.test.ts +47 -0
- package/src/library/folder-tree.ts +156 -0
- package/src/library/index.ts +46 -0
- package/src/library/library-api.test.ts +32 -0
- package/src/library/library-api.ts +11 -0
- package/src/library/library.ts +61 -0
- package/src/library/oss-api.ts +449 -0
- package/src/library/oss-layout-api.ts +377 -0
- package/src/library/oss-layout.ts +27 -0
- package/src/library/oss.ts +150 -0
- package/src/library/rsengine.ts +593 -0
- package/src/library/rsform-api.ts +533 -0
- package/src/library/rsform.ts +228 -0
- package/src/library/rsmodel-api.ts +340 -0
- package/src/library/rsmodel.ts +50 -0
- package/src/library/structure-planner.ts +143 -0
- package/src/parsing/ast.ts +136 -0
- package/src/parsing/index.ts +15 -0
- package/src/parsing/lezer-tree.ts +69 -0
- package/src/rslang/api.test.ts +116 -0
- package/src/rslang/api.ts +183 -0
- package/src/rslang/ast-annotations.ts +70 -0
- package/src/rslang/error.ts +129 -0
- package/src/rslang/eval/calculator.test.ts +124 -0
- package/src/rslang/eval/calculator.ts +121 -0
- package/src/rslang/eval/evaluation-cache.ts +257 -0
- package/src/rslang/eval/evaluator.test.ts +352 -0
- package/src/rslang/eval/evaluator.ts +935 -0
- package/src/rslang/eval/value-api.test.ts +105 -0
- package/src/rslang/eval/value-api.ts +444 -0
- package/src/rslang/eval/value.ts +102 -0
- package/src/rslang/index.ts +23 -0
- package/src/rslang/labels.ts +191 -0
- package/src/rslang/parser/expression-generator.test.ts +100 -0
- package/src/rslang/parser/expression-generator.ts +466 -0
- package/src/rslang/parser/normalize.test.ts +99 -0
- package/src/rslang/parser/normalize.ts +462 -0
- package/src/rslang/parser/parser.terms.ts +42 -0
- package/src/rslang/parser/parser.test.ts +153 -0
- package/src/rslang/parser/parser.ts +20 -0
- package/src/rslang/parser/rslang.grammar +251 -0
- package/src/rslang/parser/syntax-errors.ts +209 -0
- package/src/rslang/parser/token.ts +106 -0
- package/src/rslang/semantic/analyzer.test.ts +59 -0
- package/src/rslang/semantic/analyzer.ts +179 -0
- package/src/rslang/semantic/arguments-extractor.ts +327 -0
- package/src/rslang/semantic/type-auditor.test.ts +326 -0
- package/src/rslang/semantic/type-auditor.ts +1049 -0
- package/src/rslang/semantic/typification-api.test.ts +46 -0
- package/src/rslang/semantic/typification-api.ts +321 -0
- package/src/rslang/semantic/typification-parser.test.ts +50 -0
- package/src/rslang/semantic/typification-parser.ts +220 -0
- package/src/rslang/semantic/typification.ts +180 -0
- package/src/rslang/semantic/value-auditor.test.ts +206 -0
- package/src/rslang/semantic/value-auditor.ts +332 -0
- package/src/rslang/semantic/value-class.ts +11 -0
- package/src/rslang/typification-graph.ts +155 -0
- package/src/shared/branded.ts +6 -0
- package/src/shared/hash.ts +17 -0
- package/src/shared/index.ts +2 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module: Folder tree data structure. Does not support deletions.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents single node of a {@link FolderTree}.
|
|
7
|
+
*/
|
|
8
|
+
export class FolderNode {
|
|
9
|
+
rank: number = 0;
|
|
10
|
+
text: string;
|
|
11
|
+
children: Map<string, FolderNode>;
|
|
12
|
+
parent: FolderNode | null;
|
|
13
|
+
|
|
14
|
+
filesInside: number = 0;
|
|
15
|
+
filesTotal: number = 0;
|
|
16
|
+
|
|
17
|
+
constructor(text: string, parent: FolderNode | null = null) {
|
|
18
|
+
this.text = text;
|
|
19
|
+
this.parent = parent;
|
|
20
|
+
this.children = new Map();
|
|
21
|
+
if (parent) {
|
|
22
|
+
this.rank = parent.rank + 1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
addChild(text: string): FolderNode {
|
|
27
|
+
const node = new FolderNode(text, this);
|
|
28
|
+
this.children.set(text, node);
|
|
29
|
+
return node;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
hasPredecessor(target: FolderNode): boolean {
|
|
33
|
+
if (this.parent === target) {
|
|
34
|
+
return true;
|
|
35
|
+
} else if (!this.parent) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
let node = this.parent;
|
|
39
|
+
while (node.parent) {
|
|
40
|
+
if (node.parent === target) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
node = node.parent;
|
|
44
|
+
}
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
incrementFiles(count: number = 1): void {
|
|
49
|
+
this.filesInside = this.filesInside + count;
|
|
50
|
+
this.incrementTotal(count);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
incrementTotal(count: number = 1): void {
|
|
54
|
+
this.filesTotal = this.filesTotal + count;
|
|
55
|
+
if (this.parent) {
|
|
56
|
+
this.parent.incrementTotal(count);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
getPath(): string {
|
|
61
|
+
const suffix = this.text ? `/${this.text}` : '';
|
|
62
|
+
if (!this.parent) {
|
|
63
|
+
return suffix;
|
|
64
|
+
} else {
|
|
65
|
+
return this.parent.getPath() + suffix;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Represents a FolderTree. */
|
|
71
|
+
export class FolderTree {
|
|
72
|
+
roots = new Map<string, FolderNode>();
|
|
73
|
+
|
|
74
|
+
constructor(arr?: string[]) {
|
|
75
|
+
arr?.forEach(path => this.addPath(path));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
at(path: string): FolderNode | undefined {
|
|
79
|
+
let parse = ChopPathHead(path);
|
|
80
|
+
if (!this.roots.has(parse.head)) {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
let node = this.roots.get(parse.head)!;
|
|
84
|
+
while (parse.tail !== '') {
|
|
85
|
+
parse = ChopPathHead(parse.tail);
|
|
86
|
+
if (!node.children.has(parse.head)) {
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
node = node.children.get(parse.head)!;
|
|
90
|
+
}
|
|
91
|
+
return node;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
getTree(): FolderNode[] {
|
|
95
|
+
const result: FolderNode[] = [];
|
|
96
|
+
this.roots.forEach(root => this.visitNode(root, result));
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
private visitNode(target: FolderNode, result: FolderNode[]) {
|
|
101
|
+
result.push(target);
|
|
102
|
+
[...target.children.keys()]
|
|
103
|
+
.sort((a, b) => a.localeCompare(b))
|
|
104
|
+
.forEach(key => this.visitNode(target.children.get(key)!, result));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
addPath(path: string, filesCount: number = 1): FolderNode {
|
|
108
|
+
let parse = ChopPathHead(path);
|
|
109
|
+
if (!parse.head) {
|
|
110
|
+
throw Error(`Invalid path ${path}`);
|
|
111
|
+
}
|
|
112
|
+
let node = this.roots.has(parse.head) ? this.roots.get(parse.head)! : this.addNode(parse.head);
|
|
113
|
+
while (parse.tail !== '') {
|
|
114
|
+
parse = ChopPathHead(parse.tail);
|
|
115
|
+
if (node.children.has(parse.head)) {
|
|
116
|
+
node = node.children.get(parse.head)!;
|
|
117
|
+
} else {
|
|
118
|
+
node = this.addNode(parse.head, node);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
node.incrementFiles(filesCount);
|
|
122
|
+
return node;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
private addNode(text: string, parent?: FolderNode): FolderNode {
|
|
126
|
+
if (!parent) {
|
|
127
|
+
const newNode = new FolderNode(text);
|
|
128
|
+
this.roots.set(text, newNode);
|
|
129
|
+
return newNode;
|
|
130
|
+
} else {
|
|
131
|
+
return parent.addChild(text);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// ========= Internals =======
|
|
137
|
+
function ChopPathHead(path: string) {
|
|
138
|
+
if (path?.at(0) !== '/') {
|
|
139
|
+
return {
|
|
140
|
+
head: '',
|
|
141
|
+
tail: ''
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
const slash = path.indexOf('/', 1);
|
|
145
|
+
if (slash === -1) {
|
|
146
|
+
return {
|
|
147
|
+
head: path.substring(1),
|
|
148
|
+
tail: ''
|
|
149
|
+
};
|
|
150
|
+
} else {
|
|
151
|
+
return {
|
|
152
|
+
head: path.substring(1, slash),
|
|
153
|
+
tail: path.substring(slash)
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export { FolderNode, FolderTree } from './folder-tree';
|
|
2
|
+
export {
|
|
3
|
+
AccessPolicy,
|
|
4
|
+
type CurrentVersion,
|
|
5
|
+
type LibraryItem,
|
|
6
|
+
type LibraryItemReference,
|
|
7
|
+
LibraryItemType,
|
|
8
|
+
LocationHead,
|
|
9
|
+
type VersionInfo
|
|
10
|
+
} from './library';
|
|
11
|
+
export type { Block } from './oss';
|
|
12
|
+
export {
|
|
13
|
+
type CstSubstituteInfo,
|
|
14
|
+
NodeType,
|
|
15
|
+
type Operation,
|
|
16
|
+
type OperationInput,
|
|
17
|
+
type OperationSchema,
|
|
18
|
+
type OperationSchemaStats,
|
|
19
|
+
type OperationSynthesis,
|
|
20
|
+
OperationType,
|
|
21
|
+
type OssItem,
|
|
22
|
+
type SubstitutionErrorDescription,
|
|
23
|
+
SubstitutionErrorType
|
|
24
|
+
} from './oss';
|
|
25
|
+
export { type OssLayout, type Position2D } from './oss-layout';
|
|
26
|
+
export { RSEngine } from './rsengine';
|
|
27
|
+
export {
|
|
28
|
+
type ArgumentValue,
|
|
29
|
+
type Attribution,
|
|
30
|
+
type Constituenta,
|
|
31
|
+
CstClass,
|
|
32
|
+
CstStatus,
|
|
33
|
+
CstType,
|
|
34
|
+
type RSForm,
|
|
35
|
+
type RSFormStats,
|
|
36
|
+
type Substitution,
|
|
37
|
+
type TypeInfo
|
|
38
|
+
} from './rsform';
|
|
39
|
+
export {
|
|
40
|
+
type BasicBinding,
|
|
41
|
+
type BasicsContext,
|
|
42
|
+
DEFAULT_VALUE_TEXT,
|
|
43
|
+
EvalStatus,
|
|
44
|
+
type RSModel,
|
|
45
|
+
type RSModelStats
|
|
46
|
+
} from './rsmodel';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { validateLocationFormat } from './library-api';
|
|
4
|
+
|
|
5
|
+
const validateLocationData = [
|
|
6
|
+
['', 'false'],
|
|
7
|
+
['U/U', 'false'],
|
|
8
|
+
['/A', 'false'],
|
|
9
|
+
['/U/user@mail', 'false'],
|
|
10
|
+
['U/u\\asdf', 'false'],
|
|
11
|
+
['/U/ asdf', 'false'],
|
|
12
|
+
['/User', 'false'],
|
|
13
|
+
['//', 'false'],
|
|
14
|
+
['/S/1 ', 'false'],
|
|
15
|
+
['/S/1/2 /3', 'false'],
|
|
16
|
+
|
|
17
|
+
['/P', 'true'],
|
|
18
|
+
['/L', 'true'],
|
|
19
|
+
['/U', 'true'],
|
|
20
|
+
['/S', 'true'],
|
|
21
|
+
['/S/Вася пупки', 'true'],
|
|
22
|
+
['/S/123', 'true'],
|
|
23
|
+
['/S/1234', 'true'],
|
|
24
|
+
['/S/1/!asdf/тест тест', 'true']
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
describe('Testing location validation', () => {
|
|
28
|
+
it.each(validateLocationData)('isValid %p', (input: string, expected: string) => {
|
|
29
|
+
const result = validateLocationFormat(input);
|
|
30
|
+
expect(String(result)).toBe(expected);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const LOCATION_REGEXP = /^\/[PLUS]((\/[!\d\p{L}]([!\d\p{L}\- ]*[!\d\p{L}])?)*)?$/u; // cspell:disable-line
|
|
2
|
+
|
|
3
|
+
/** Combining head and body into location. */
|
|
4
|
+
export function combineLocation(head: string, body?: string): string {
|
|
5
|
+
return body ? `${head}/${body}` : head;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/** Validation location against regexp. */
|
|
9
|
+
export function validateLocationFormat(location: string): boolean {
|
|
10
|
+
return LOCATION_REGEXP.test(location);
|
|
11
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module: Models for LibraryItem.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/** Represents type of library items. */
|
|
6
|
+
export const LibraryItemType = {
|
|
7
|
+
RSFORM: 'rsform',
|
|
8
|
+
OSS: 'oss',
|
|
9
|
+
RSMODEL: 'rsmodel'
|
|
10
|
+
} as const;
|
|
11
|
+
export type LibraryItemType = (typeof LibraryItemType)[keyof typeof LibraryItemType];
|
|
12
|
+
|
|
13
|
+
/** Represents Access policy for library items.*/
|
|
14
|
+
export const AccessPolicy = {
|
|
15
|
+
PUBLIC: 'public',
|
|
16
|
+
PROTECTED: 'protected',
|
|
17
|
+
PRIVATE: 'private'
|
|
18
|
+
} as const;
|
|
19
|
+
export type AccessPolicy = (typeof AccessPolicy)[keyof typeof AccessPolicy];
|
|
20
|
+
|
|
21
|
+
/** Represents valid location headers. */
|
|
22
|
+
export const LocationHead = {
|
|
23
|
+
USER: '/U',
|
|
24
|
+
COMMON: '/S',
|
|
25
|
+
LIBRARY: '/L',
|
|
26
|
+
PROJECTS: '/P'
|
|
27
|
+
} as const;
|
|
28
|
+
export type LocationHead = (typeof LocationHead)[keyof typeof LocationHead];
|
|
29
|
+
|
|
30
|
+
/** Represents {@link LibraryItem} minimal reference data. */
|
|
31
|
+
export interface LibraryItemReference {
|
|
32
|
+
id: number;
|
|
33
|
+
alias: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Represents library item common data typical for all item types. */
|
|
37
|
+
export interface LibraryItem {
|
|
38
|
+
id: number;
|
|
39
|
+
item_type: LibraryItemType;
|
|
40
|
+
alias: string;
|
|
41
|
+
title: string;
|
|
42
|
+
description: string;
|
|
43
|
+
visible: boolean;
|
|
44
|
+
read_only: boolean;
|
|
45
|
+
location: string;
|
|
46
|
+
access_policy: AccessPolicy;
|
|
47
|
+
time_create: string;
|
|
48
|
+
time_update: string;
|
|
49
|
+
owner: number | null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Represents library item version information. */
|
|
53
|
+
export interface VersionInfo {
|
|
54
|
+
id: number;
|
|
55
|
+
version: string;
|
|
56
|
+
description: string;
|
|
57
|
+
time_create: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Represents current version */
|
|
61
|
+
export type CurrentVersion = number | 'latest';
|