terminusdb 12.0.2

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 (86) hide show
  1. package/Contributing.md +36 -0
  2. package/LICENSE +201 -0
  3. package/README.md +175 -0
  4. package/RELEASE_NOTES.md +462 -0
  5. package/dist/index.html +22 -0
  6. package/dist/terminusdb-client.min.js +3 -0
  7. package/dist/terminusdb-client.min.js.LICENSE.txt +188 -0
  8. package/dist/terminusdb-client.min.js.map +1 -0
  9. package/dist/typescript/index.d.ts +14 -0
  10. package/dist/typescript/lib/accessControl.d.ts +554 -0
  11. package/dist/typescript/lib/axiosInstance.d.ts +2 -0
  12. package/dist/typescript/lib/connectionConfig.d.ts +381 -0
  13. package/dist/typescript/lib/const.d.ts +54 -0
  14. package/dist/typescript/lib/dispatchRequest.d.ts +17 -0
  15. package/dist/typescript/lib/errorMessage.d.ts +25 -0
  16. package/dist/typescript/lib/query/woqlBuilder.d.ts +75 -0
  17. package/dist/typescript/lib/query/woqlCore.d.ts +341 -0
  18. package/dist/typescript/lib/query/woqlDoc.d.ts +63 -0
  19. package/dist/typescript/lib/query/woqlLibrary.d.ts +718 -0
  20. package/dist/typescript/lib/query/woqlPrinter.d.ts +71 -0
  21. package/dist/typescript/lib/query/woqlQuery.d.ts +833 -0
  22. package/dist/typescript/lib/typedef.d.ts +624 -0
  23. package/dist/typescript/lib/utils.d.ts +199 -0
  24. package/dist/typescript/lib/valueHash.d.ts +146 -0
  25. package/dist/typescript/lib/viewer/chartConfig.d.ts +62 -0
  26. package/dist/typescript/lib/viewer/chooserConfig.d.ts +38 -0
  27. package/dist/typescript/lib/viewer/documentFrame.d.ts +44 -0
  28. package/dist/typescript/lib/viewer/frameConfig.d.ts +74 -0
  29. package/dist/typescript/lib/viewer/frameRule.d.ts +145 -0
  30. package/dist/typescript/lib/viewer/graphConfig.d.ts +73 -0
  31. package/dist/typescript/lib/viewer/objectFrame.d.ts +212 -0
  32. package/dist/typescript/lib/viewer/streamConfig.d.ts +23 -0
  33. package/dist/typescript/lib/viewer/tableConfig.d.ts +66 -0
  34. package/dist/typescript/lib/viewer/terminusRule.d.ts +75 -0
  35. package/dist/typescript/lib/viewer/viewConfig.d.ts +47 -0
  36. package/dist/typescript/lib/viewer/woqlChart.d.ts +1 -0
  37. package/dist/typescript/lib/viewer/woqlChooser.d.ts +56 -0
  38. package/dist/typescript/lib/viewer/woqlGraph.d.ts +26 -0
  39. package/dist/typescript/lib/viewer/woqlPaging.d.ts +1 -0
  40. package/dist/typescript/lib/viewer/woqlResult.d.ts +128 -0
  41. package/dist/typescript/lib/viewer/woqlRule.d.ts +96 -0
  42. package/dist/typescript/lib/viewer/woqlStream.d.ts +31 -0
  43. package/dist/typescript/lib/viewer/woqlTable.d.ts +102 -0
  44. package/dist/typescript/lib/viewer/woqlView.d.ts +49 -0
  45. package/dist/typescript/lib/woql.d.ts +1267 -0
  46. package/dist/typescript/lib/woqlClient.d.ts +1216 -0
  47. package/index.js +28 -0
  48. package/lib/.eslintrc +1 -0
  49. package/lib/accessControl.js +988 -0
  50. package/lib/axiosInstance.js +5 -0
  51. package/lib/connectionConfig.js +765 -0
  52. package/lib/const.js +59 -0
  53. package/lib/dispatchRequest.js +236 -0
  54. package/lib/errorMessage.js +110 -0
  55. package/lib/query/woqlBuilder.js +234 -0
  56. package/lib/query/woqlCore.js +934 -0
  57. package/lib/query/woqlDoc.js +177 -0
  58. package/lib/query/woqlLibrary.js +1015 -0
  59. package/lib/query/woqlPrinter.js +476 -0
  60. package/lib/query/woqlQuery.js +1865 -0
  61. package/lib/typedef.js +248 -0
  62. package/lib/utils.js +817 -0
  63. package/lib/valueHash.js_old +581 -0
  64. package/lib/viewer/chartConfig.js +411 -0
  65. package/lib/viewer/chooserConfig.js +234 -0
  66. package/lib/viewer/documentFrame.js +206 -0
  67. package/lib/viewer/frameConfig.js +469 -0
  68. package/lib/viewer/frameRule.js +519 -0
  69. package/lib/viewer/graphConfig.js +345 -0
  70. package/lib/viewer/objectFrame.js +1550 -0
  71. package/lib/viewer/streamConfig.js +82 -0
  72. package/lib/viewer/tableConfig.js +310 -0
  73. package/lib/viewer/terminusRule.js +196 -0
  74. package/lib/viewer/viewConfig.js +219 -0
  75. package/lib/viewer/woqlChart.js +17 -0
  76. package/lib/viewer/woqlChooser.js +171 -0
  77. package/lib/viewer/woqlGraph.js +295 -0
  78. package/lib/viewer/woqlPaging.js +148 -0
  79. package/lib/viewer/woqlResult.js +258 -0
  80. package/lib/viewer/woqlRule.js +312 -0
  81. package/lib/viewer/woqlStream.js +27 -0
  82. package/lib/viewer/woqlTable.js +332 -0
  83. package/lib/viewer/woqlView.js +107 -0
  84. package/lib/woql.js +1693 -0
  85. package/lib/woqlClient.js +2091 -0
  86. package/package.json +110 -0
@@ -0,0 +1,145 @@
1
+ export type Frame = any;
2
+ /**
3
+ * @typedef {Object} Frame
4
+ */
5
+ /**
6
+ * @file Frame Rule
7
+ * @license Apache Version 2
8
+ */
9
+ export function FrameRule(): void;
10
+ export class FrameRule {
11
+ pattern: FramePattern;
12
+ /**
13
+ * Returns an array of rules that match the paased frame
14
+ * @param {Array<FrameRule>} rules - array of rules to be tested
15
+ * @param {Frame | object} frame - document frame, object frame, or property frame to be tested
16
+ * @param {function} [onmatch] - optional function to be called with args (frame, rule)
17
+ * on each match
18
+ */
19
+ testRules(rules: Array<FrameRule>, frame: Frame | object, onmatch?: Function): FrameRule[];
20
+ /**
21
+ * Determines whether a given pattern matches a given frame
22
+ */
23
+ patternMatchesFrame(pattern: any, frame: any): any;
24
+ /**
25
+ * Specifies that only one from among the list of properties will match
26
+ */
27
+ property(...prop: any[]): any;
28
+ /**
29
+ * Specifies that only one from among the list of frame_types will match
30
+ * frame_types are: data, oneOf, document, object?
31
+ */
32
+ frame_type(...frame_type: any[]): any;
33
+ /**
34
+ * Specifies that only one from among the list of labels will match
35
+ */
36
+ label(...prop: any[]): any;
37
+ /**
38
+ * Specifies that only one from among the list of subject ids will match
39
+ */
40
+ subject(...prop: any[]): any;
41
+ /**
42
+ * Specifies that only one from among the list of subject classes will match
43
+ */
44
+ subjectClass(...prop: any[]): any;
45
+ /**
46
+ * Specifies that only one from among the list of range types will match
47
+ */
48
+ range(...prop: any[]): any;
49
+ /**
50
+ * Specifies that only one from among the list of range types will match
51
+ */
52
+ value(...prop: any[]): any;
53
+ /**
54
+ * Specifies that only frames of the specified depth will match the rule
55
+ */
56
+ depth(depth: any): any;
57
+ /**
58
+ * Specifies that only frames of the specified index will match the rule (index is the order of a
59
+ * value in the property frame)
60
+ */
61
+ index(...index: any[]): any;
62
+ /**
63
+ * Specifies that only frames with the given statuses will match the rule
64
+ */
65
+ status(...status: any[]): any;
66
+ /**
67
+ * Specifies that the frame will only match if its parent matches the pattern passed as par
68
+ */
69
+ parent(par: any): any;
70
+ children(...children: any[]): any[] | this;
71
+ }
72
+ /**
73
+ * @file Frame Pattern
74
+ * A frame pattern can have the following variables
75
+ * scope : object, property, data, * - matches a specific part of the frame
76
+ * label : matches the label of a property
77
+ * frame_type: object, data, document, id, oneOf
78
+ * subject: id of the subject
79
+ * subjectClass: class of the subject
80
+ * range: type of a property (applies to property and data)
81
+ * property: property id or list of property ids (parent property if it is an object or data)
82
+ * value: value of the property
83
+ * parent: a pattern relating to the parent of this frame
84
+ * children: patterns for matching on the children of a frame
85
+ * depth: how deep are we in the document? starts from 0
86
+ * index: the index of a value in an array
87
+ * status: updated, error, new, ok,
88
+ */
89
+ export function FramePattern(): void;
90
+ export class FramePattern {
91
+ setPattern(pattern: any): void;
92
+ scope: any;
93
+ literal: any;
94
+ type: any;
95
+ label: any;
96
+ frame_type: any;
97
+ subject: any;
98
+ subjectClass: any;
99
+ range: any;
100
+ property: any;
101
+ value: any;
102
+ parent: any;
103
+ children: any[];
104
+ depth: any;
105
+ index: any;
106
+ status: any;
107
+ json(): {
108
+ literal: any;
109
+ type: any;
110
+ scope: any;
111
+ value: any;
112
+ label: any;
113
+ frame_type: any;
114
+ subject: any;
115
+ subjectClass: any;
116
+ range: any;
117
+ property: any;
118
+ parent: any;
119
+ children: any[];
120
+ depth: any;
121
+ index: any;
122
+ status: any;
123
+ };
124
+ checkFrame(frame: any): boolean;
125
+ prettyPrint(): string;
126
+ illegalRuleType(rtype: any): boolean;
127
+ checkSubject(subject: any, frame: any): boolean;
128
+ checkChildren(rtype: any, frame: any): boolean;
129
+ checkStatus(rtype: any, frame: any): boolean;
130
+ checkDepth(rtype: any, frame: any): any;
131
+ checkParent(rtype: any, frame: any): any;
132
+ checkIndex(rtype: any, frame: any): boolean;
133
+ checkProperty(rtype: any, frame: any): boolean;
134
+ /**
135
+ * Checks to make sure the frame is among the specified types
136
+ */
137
+ checkType(rtype: any, frame: any): boolean;
138
+ checkLiteral(rtype: any, frame: any): any;
139
+ checkValue(rtype: any, frame: any): boolean;
140
+ checkRange(rtype: any, frame: any): boolean;
141
+ checkSubjectClass(rtype: any, frame: any): boolean;
142
+ checkFrameType(rtype: any, frame: any): boolean;
143
+ checkLabel(rtype: any, frame: any): boolean;
144
+ getRendererType(frame: any): any;
145
+ }
@@ -0,0 +1,73 @@
1
+ export = WOQLGraphConfig;
2
+ declare function WOQLGraphConfig(): void;
3
+ declare class WOQLGraphConfig {
4
+ type: string;
5
+ create(client: any): WOQLGraph;
6
+ literals(v: any): any;
7
+ show_literals: any;
8
+ source(v: any): any;
9
+ source_variable: any;
10
+ fontfamily(v: any): any;
11
+ fontfam: any;
12
+ show_force(v: any): any;
13
+ force: any;
14
+ fix_nodes(v: any): any;
15
+ fixed: any;
16
+ explode_out(v: any): any;
17
+ explode: any;
18
+ selected_grows(v: any): any;
19
+ bigsel: any;
20
+ /**
21
+ * no parameter get the graph width or
22
+ * set the graph width and return the WOQLGraphConfig
23
+ * @param {size} Number
24
+ */
25
+ width(size: any): any;
26
+ gwidth: any;
27
+ /**
28
+ * no parameter get the graph height or
29
+ * set the graph height and return the WOQLGraphConfig
30
+ * @param {size} Number
31
+ */
32
+ height(size: any): any;
33
+ gheight: any;
34
+ /**
35
+ *
36
+ * @param {...any} edges
37
+ * @returns {any[][]}
38
+ */
39
+ edges(...edges: any[]): any[][];
40
+ show_edges: any[][];
41
+ edge(source: any, target: any): any;
42
+ node(...cols: any[]): WOQLGraphRule;
43
+ loadJSON(config: any, rules: any): void;
44
+ rules: WOQLGraphRule[];
45
+ prettyPrint(): string;
46
+ json(): {
47
+ graph: {
48
+ literals: any;
49
+ source: any;
50
+ fontfamily: any;
51
+ show_force: any;
52
+ fix_nodes: any;
53
+ explode_out: any;
54
+ selected_grows: any;
55
+ width: any;
56
+ height: any;
57
+ edges: any[][];
58
+ };
59
+ rules: any[];
60
+ };
61
+ }
62
+ import WOQLGraph = require("./woqlGraph.js");
63
+ declare function WOQLGraphRule(scope: any): void;
64
+ declare class WOQLGraphRule {
65
+ constructor(scope: any);
66
+ charge(v: any): any;
67
+ collisionRadius(v: any): any;
68
+ arrow(json: any): any;
69
+ distance(d: any): any;
70
+ symmetric(d: any): any;
71
+ weight(w: any): any;
72
+ prettyPrint(): any;
73
+ }
@@ -0,0 +1,212 @@
1
+ export = ObjectFrame;
2
+ /**
3
+ * @file Javascript Terminus Document Classes
4
+ * @license Apache Version 2
5
+ * Helper classes for accessing documents returned by the Terminus DB API programmatically
6
+ *
7
+ * @example
8
+ * let doc = new TerminusDocument(client);
9
+ *
10
+ * //These set the objects document property and return promises:
11
+ *
12
+ * doc.loadDocument(URL).then(() => console.log(this.document));
13
+ * doc.loadComplete(URL, CLS).then(() => console.log(this.document))
14
+ * doc.loadSchema(cls).then(() => console.log(this.document))
15
+ *
16
+ * //These just set the object's document property
17
+ * doc.loadJSON(json_frames, cls) //console.log(this.document)
18
+ * doc.loadDataFrames(json_frames, cls)
19
+ * doc.loadClassFrames(json_frames, cls)
20
+ * @description Represents a frame for programmatic access to object frame,
21
+ * anywhere within a document
22
+ * Recursive data structure where this.children contains an indexed array of object frames
23
+ * and this.dataframes contains a property indexed array of data frames
24
+ * Every object frame carries a reference to its classframe
25
+ * This gives us instructions as to how to create new frames according to the schema
26
+ * After that it's turtles all the way down.
27
+ * @param cls - ID of the class (URL)
28
+ * @param classframe - an array of frames representing a class
29
+ * @param archetypes list of class frames
30
+ * @param parent parent object
31
+ * @returns {ObjectFrame}
32
+ */
33
+ declare function ObjectFrame(cls: any, jsonld: any, classframes: any, parent: any): ObjectFrame;
34
+ declare class ObjectFrame {
35
+ /**
36
+ * @file Javascript Terminus Document Classes
37
+ * @license Apache Version 2
38
+ * Helper classes for accessing documents returned by the Terminus DB API programmatically
39
+ *
40
+ * @example
41
+ * let doc = new TerminusDocument(client);
42
+ *
43
+ * //These set the objects document property and return promises:
44
+ *
45
+ * doc.loadDocument(URL).then(() => console.log(this.document));
46
+ * doc.loadComplete(URL, CLS).then(() => console.log(this.document))
47
+ * doc.loadSchema(cls).then(() => console.log(this.document))
48
+ *
49
+ * //These just set the object's document property
50
+ * doc.loadJSON(json_frames, cls) //console.log(this.document)
51
+ * doc.loadDataFrames(json_frames, cls)
52
+ * doc.loadClassFrames(json_frames, cls)
53
+ * @description Represents a frame for programmatic access to object frame,
54
+ * anywhere within a document
55
+ * Recursive data structure where this.children contains an indexed array of object frames
56
+ * and this.dataframes contains a property indexed array of data frames
57
+ * Every object frame carries a reference to its classframe
58
+ * This gives us instructions as to how to create new frames according to the schema
59
+ * After that it's turtles all the way down.
60
+ * @param cls - ID of the class (URL)
61
+ * @param classframe - an array of frames representing a class
62
+ * @param archetypes list of class frames
63
+ * @param parent parent object
64
+ * @returns {ObjectFrame}
65
+ */
66
+ constructor(cls: any, jsonld: any, classframes: any, parent: any);
67
+ cls: string;
68
+ originalDocument: any;
69
+ parent: any;
70
+ newDoc: boolean;
71
+ /**
72
+ * Loads class frames for the object's class - the instructions about how to put an object together
73
+ */
74
+ loadClassFrames(classframes: any): this;
75
+ jsonld_context: any;
76
+ classframes: {};
77
+ /**
78
+ * Does this object have a schema loaded?
79
+ */
80
+ hasSchema(): boolean;
81
+ loadJSONLDDocument(rdoc: any): this;
82
+ subjid: any;
83
+ getAsFrame(prop: any, parent: any): any;
84
+ getAsFrames(prop: any, parent: any): any[];
85
+ /**
86
+ * Cleans out object and sets everything empty
87
+ */
88
+ empty(): void;
89
+ properties: {};
90
+ restrictions: {};
91
+ reset(prop: any): void;
92
+ clear(): this;
93
+ mfilter(rules: any, onmatch: any): this;
94
+ /**
95
+ * If a class frame is present, it is returned for the given property
96
+ * If no class frame is present and an instance frame is passed in the
97
+ * this enables make it up as you go along editing
98
+ * second argument a class frame will be created from the instance frame.
99
+ */
100
+ getPropertyClassFrame(prop: any, jsonlddoc: any): any;
101
+ getProperties(type: any): string[];
102
+ /**
103
+ * Missing properties are those that are present in the classframe,
104
+ * but not instantiated in the current object frame
105
+ * for this to work we need to load the frame with the associated classframe
106
+ */
107
+ getMissingPropertyList(): {
108
+ label: any;
109
+ value: string;
110
+ }[];
111
+ /**
112
+ * Returns a list of all the classes that can show up in the frame
113
+ */
114
+ getPossibleContainedClasses(): any[];
115
+ getDocumentLinks(): any[];
116
+ /**
117
+ * List of properties that are filled in the object
118
+ */
119
+ getFilledPropertyList(): {
120
+ label: any;
121
+ value: string;
122
+ }[];
123
+ fillFromSchema(newid: any): this;
124
+ originalFrames: any[];
125
+ clone(newid: any): ObjectFrame;
126
+ /**
127
+ * Returns a child frame with a particular id
128
+ * If the second parameter is included, it will only look in that specific property
129
+ * Otherwise searches all properties for the child
130
+ */
131
+ getChild(childid: any, prop: any): any;
132
+ addProperty(prop: any, cls: any): false | PropertyFrame;
133
+ addPropertyValue(prop: any, value: any): any;
134
+ removeProperty(prop: any): void;
135
+ removePropertyValue(prop: any, value: any, index: any): void;
136
+ error(msg: any): void;
137
+ errors: any[];
138
+ extract(): any;
139
+ extractJSONLD(extracts: any): any;
140
+ subject(): any;
141
+ get: any;
142
+ set(val: any): void;
143
+ isObject(): boolean;
144
+ isProperty(): boolean;
145
+ isData(): boolean;
146
+ isClassChoice(): boolean;
147
+ subjectClass(): string;
148
+ depth(): any;
149
+ getProperty(prop: any): any;
150
+ first(prop: any): any;
151
+ property(prop: any): any;
152
+ parentObject(): any;
153
+ root(): boolean;
154
+ renderProperties(): any[];
155
+ sortProperties(): string[];
156
+ standardCompare(a: any, b: any, doc: any): 0 | 1 | -1;
157
+ cardControlAllows(action: any): boolean;
158
+ isUpdated(): boolean;
159
+ isNew(): boolean;
160
+ getSummary(): {
161
+ status: string;
162
+ };
163
+ saveQuery(): any;
164
+ pathToDoc(q: any): void;
165
+ deleteQuery(): any;
166
+ getLabel: any;
167
+ getComment: any;
168
+ }
169
+ declare function PropertyFrame(property: any, cframe: any, parent: any): void;
170
+ declare class PropertyFrame {
171
+ constructor(property: any, cframe: any, parent: any);
172
+ predicate: any;
173
+ cframe: any;
174
+ parent: any;
175
+ values: any[];
176
+ addJSONLDDocument(jsonld: any): void;
177
+ addFrame(frame: any): void;
178
+ addValueFrame(oframe: any): void;
179
+ addValue(val: any): any;
180
+ fillFromSchema(newid: any): void;
181
+ isData(): any;
182
+ isObject(): any;
183
+ isProperty(): boolean;
184
+ property(): any;
185
+ extract(): any[];
186
+ subject(): any;
187
+ subjectClass(): any;
188
+ depth(): any;
189
+ updated(): any;
190
+ range(): any;
191
+ getLabel(): any;
192
+ getComment(): any;
193
+ hasCardinalityRestriction(): any;
194
+ getRestriction(): any;
195
+ isClassChoice(): any;
196
+ deletePropertyValue(value: any, index: any): void;
197
+ removeValue(value: any, index: any): void;
198
+ get(): any[];
199
+ set(val: any): void;
200
+ clear(): void;
201
+ clone(): PropertyFrame;
202
+ getAsFrames(): any[];
203
+ createEmpty(): any;
204
+ mfilter(rules: any, onmatch: any): this;
205
+ first(): any;
206
+ renderValues(): any[];
207
+ sortValues(): any[];
208
+ cardControlAllows(action: any): boolean;
209
+ isUpdated(): boolean;
210
+ saveQuery(): import("../query/woqlBuilder");
211
+ deleteQuery(): import("../query/woqlBuilder");
212
+ }
@@ -0,0 +1,23 @@
1
+ export = WOQLStreamConfig;
2
+ declare function WOQLStreamConfig(): void;
3
+ declare class WOQLStreamConfig {
4
+ type: string;
5
+ create(client: any): WOQLStream;
6
+ row(): any;
7
+ template(template: any): any;
8
+ mtemplate: any;
9
+ prettyPrint(): string;
10
+ loadJSON(config: any, rules: any): void;
11
+ rules: WOQLStreamRule[];
12
+ json(): {
13
+ stream: {
14
+ template: any;
15
+ };
16
+ rules: any[];
17
+ };
18
+ }
19
+ import WOQLStream = require("./woqlStream");
20
+ declare function WOQLStreamRule(): void;
21
+ declare class WOQLStreamRule {
22
+ template(template: any): any;
23
+ }
@@ -0,0 +1,66 @@
1
+ export = WOQLTableConfig;
2
+ declare function WOQLTableConfig(): void;
3
+ declare class WOQLTableConfig {
4
+ type: string;
5
+ create(client: any): WOQLTable;
6
+ json(): {
7
+ table: {
8
+ column_order: any;
9
+ pagesize: any;
10
+ renderer: any;
11
+ filter: any;
12
+ filterable: boolean | WOQLTableConfig;
13
+ pager: any;
14
+ bindings: any;
15
+ page: any;
16
+ changesize: any;
17
+ };
18
+ rules: any[];
19
+ };
20
+ loadJSON(config: any, rules: any): this;
21
+ rules: WOQLTableRule[];
22
+ prettyPrint(): string;
23
+ /**
24
+ * Gets or sets whether the table is filterable
25
+ * @param {boolean} [canfilter] - If provided, sets the filterable state
26
+ * @returns {boolean|WOQLTableConfig} - Returns the filterable state (boolean) when called
27
+ * without arguments, or returns this instance (WOQLTableConfig) for chaining when setting
28
+ */
29
+ filterable(canfilter?: boolean): boolean | WOQLTableConfig;
30
+ tfilterable: boolean;
31
+ filter(filter: any): any;
32
+ tfilter: any;
33
+ renderer(rend: any): any;
34
+ trenderer: any;
35
+ header(theader: any): any;
36
+ theader: any;
37
+ /**
38
+ * @param {...any} val
39
+ * @returns {object}
40
+ */
41
+ column_order(...val: any[]): object;
42
+ order: any[];
43
+ pager(val: any): any;
44
+ show_pager: any;
45
+ changesize(val: any): any;
46
+ change_pagesize: any;
47
+ pagesize(val: any): any;
48
+ show_pagesize: any;
49
+ page(val: any): any;
50
+ show_pagenumber: any;
51
+ column(...cols: any[]): any;
52
+ row(): any;
53
+ }
54
+ import WOQLTable = require("./woqlTable");
55
+ declare function WOQLTableRule(): void;
56
+ declare class WOQLTableRule {
57
+ header(hdr: any): any;
58
+ filter(hdr: any): any;
59
+ filterable(hdr: any): any;
60
+ width(wid: any): any;
61
+ maxWidth(wid: any): any;
62
+ minWidth(wid: any): any;
63
+ unsortable(unsortable: any): any;
64
+ uncompressed(uncompressed: any): any;
65
+ prettyPrint(): any;
66
+ }
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @file Terminus Rules
3
+ * @license Apache Version 2
4
+ * Abstract object to support applying matching rules to result sets and documents
5
+ * sub-classes are FrameRule and WOQLRule - this just has common functions
6
+ */
7
+ export function TerminusRule(): void;
8
+ export class TerminusRule {
9
+ /**
10
+ * @param {Boolean} tf - the rule will match all literals or all non-literals
11
+ */
12
+ literal(tf: boolean): any;
13
+ /**
14
+ * @param {...string} list - parameters are types identified by prefixed URLS (xsd:string...)
15
+ */
16
+ type(...list: string[]): any;
17
+ /**
18
+ * Specifies the scope of a rule - row / cell / object / property / * .. what part
19
+ * of the result does the rule apply to
20
+ */
21
+ scope(scope: any): any;
22
+ /**
23
+ * Specifies that the rule matches a specific value
24
+ */
25
+ value(...val: any[]): any;
26
+ /**
27
+ * Produces a canonical json format to represent the rule
28
+ */
29
+ json(mjson: any): this | {
30
+ pattern: any;
31
+ rule: any;
32
+ };
33
+ rule: any;
34
+ }
35
+ /**
36
+ * Contained Pattern Object to encapsulate pattern matching
37
+ * @param {Object} pattern
38
+ */
39
+ export function TerminusPattern(pattern: any): void;
40
+ export class TerminusPattern {
41
+ /**
42
+ * Contained Pattern Object to encapsulate pattern matching
43
+ * @param {Object} pattern
44
+ */
45
+ constructor(pattern: any);
46
+ setPattern(pattern: any): void;
47
+ literal: any;
48
+ type: any;
49
+ scope: any;
50
+ value: any;
51
+ json(): {
52
+ literal: any;
53
+ type: any;
54
+ scope: any;
55
+ value: any;
56
+ };
57
+ /**
58
+ * Tests whether the passed values matches the basic pattern
59
+ */
60
+ testBasics(scope: any, value: any): boolean;
61
+ testValue(value: any, constraint: any): any;
62
+ /**
63
+ * Unpacks an array into a list of arguments
64
+ * @param {Boolean} nonstring - if set, the values will be double-quoted only when
65
+ * they are strings, otherwise, all will be quoted as strings
66
+ */
67
+ unpack(arr: any, nonstring: boolean): string;
68
+ IDsMatch(ida: any, idb: any): boolean;
69
+ classIDsMatch(ida: any, idb: any): boolean;
70
+ propertyIDsMatch(ida: any, idb: any): boolean;
71
+ rangeIDsMatch(ida: any, idb: any): boolean;
72
+ valuesMatch(vala: any, valb: any): boolean;
73
+ numberMatch(vala: any, valb: any): any;
74
+ stringMatch(vala: any, valb: any): boolean;
75
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @module WOQLViewRule
3
+ * @constructor
4
+ */
5
+ export function WOQLViewRule(): void;
6
+ export class WOQLViewRule {
7
+ rule: {};
8
+ prettyPrint(type: any): string;
9
+ json(mjson: any): this | {
10
+ pattern: any;
11
+ rule: {};
12
+ };
13
+ size(size: any): any;
14
+ color(color: any): any;
15
+ icon(json: any): any;
16
+ text(json: any): any;
17
+ border(json: any): any;
18
+ renderer(rend: any): any;
19
+ render(func: any): any;
20
+ click(onClick: any): any;
21
+ hover(onHover: any): any;
22
+ hidden(hidden: any): any;
23
+ args(args: any): any;
24
+ }
25
+ /**
26
+ * Generic functions / configs that are available to all config types
27
+ * @module ViewConfig
28
+ * @constructor
29
+ */
30
+ export function ViewConfig(): void;
31
+ export class ViewConfig {
32
+ rules: any[];
33
+ render(func: any): any;
34
+ view_render: any;
35
+ renderer(val: any): any;
36
+ view_renderer: any;
37
+ getRulesJSON(): any[];
38
+ getBasicJSON(): {
39
+ render: any;
40
+ renderer: any;
41
+ bindings: any;
42
+ };
43
+ loadBasicJSON(json: any): void;
44
+ vbindings: any;
45
+ getBasicprettyPrint(): string;
46
+ bindings(bindings: any): any;
47
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,56 @@
1
+ export = WOQLChooser;
2
+ /**
3
+ * @typedef {Object} WOQLClient
4
+ */
5
+ /**
6
+ * Very simple implementation of a WOQL backed chooser
7
+ * Makes a drop down from a WOQL query - configuration tells it which columns to use...
8
+ * @param {WOQLClient} client
9
+ * @param {WOQLChooserConfig} config
10
+ * @returns {WOQLChooser}
11
+ */
12
+ declare function WOQLChooser(client: WOQLClient, config: WOQLChooserConfig): WOQLChooser;
13
+ declare class WOQLChooser {
14
+ /**
15
+ * @typedef {Object} WOQLClient
16
+ */
17
+ /**
18
+ * Very simple implementation of a WOQL backed chooser
19
+ * Makes a drop down from a WOQL query - configuration tells it which columns to use...
20
+ * @param {WOQLClient} client
21
+ * @param {WOQLChooserConfig} config
22
+ * @returns {WOQLChooser}
23
+ */
24
+ constructor(client: WOQLClient, config: WOQLChooserConfig);
25
+ client: any;
26
+ config: WOQLChooserConfig;
27
+ selected: boolean;
28
+ cursor: number;
29
+ options(config: any): this;
30
+ set(id: any): void;
31
+ setResult(result: any): this;
32
+ result: any;
33
+ choices: any[];
34
+ includeRow(row: any, index: any): boolean;
35
+ rowToChoice(row: any, rownum: any): {
36
+ id: any;
37
+ };
38
+ getRowID(row: any): any;
39
+ getLabelFromBinding(row: any, rownum: any): any;
40
+ getTitleFromBinding(row: any, rownum: any): any;
41
+ getSelectedFromBinding(row: any, rownum: any): any;
42
+ render(): any;
43
+ setRenderer(rend: any): this;
44
+ renderer: any;
45
+ getSpecialRenderer(row: any, index: any, type: any): any;
46
+ renderSpecial(rule: any, row: any): any;
47
+ count(): any;
48
+ first(): any;
49
+ next(): any;
50
+ prev(): any;
51
+ }
52
+ declare namespace WOQLChooser {
53
+ export { WOQLClient };
54
+ }
55
+ import WOQLChooserConfig = require("./chooserConfig");
56
+ type WOQLClient = any;