-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathllms.txt
More file actions
1646 lines (1456 loc) · 48.6 KB
/
llms.txt
File metadata and controls
1646 lines (1456 loc) · 48.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
========================
CODE SNIPPETS
========================
TITLE: display widget simple value
DESCRIPTION: Used to visualize the result of any jsonata expression. Here, we display the value of the session variable x
LANGUAGE: json
CODE: {
"widget" : "display",
"display" : "variable.x"
}
TITLE: display widget current database record
DESCRIPTION: Used to visualize the result of any jsonata expression. Here, we display the current record on an instance page
LANGUAGE: json
CODE: {
"widget" : "display",
"display" : "value"
}
TITLE: display widget UI state
DESCRIPTION: Used to visualize the result of any jsonata expression. Here, we display current URL, theme (light/dark), screen width, and location info
LANGUAGE: json
CODE: {
"display" : "[href, theme, width, loc]",
"widget" : "display"
}
TITLE: display widget showing object
DESCRIPTION: Used to visualize the result of any jsonata expression. Here, we display the current time as a key-value list
LANGUAGE: json
CODE: {
"widget" : "display",
"display" : "{'time': $now()}"
}
TITLE: display widget showing link
DESCRIPTION: Used to visualize the result of any jsonata expression. Here, we display a link to a record in the database
LANGUAGE: json
CODE: {
"display" : "{'database': 'northwind', 'table': 'EMPLOYEES', 'pk1':2}",
"widget" : "display"
}
TITLE: display widget showing table
DESCRIPTION: Used to visualize the result of any jsonata expression. Here, we display a list of objects as a table
LANGUAGE: json
CODE: {
"display" : "[{'x':1, 'y':1}, {'x':2, 'y':2}]",
"widget" : "display"
}
TITLE: display widget showing an image
DESCRIPTION: if the object has exactly the key 'img' (with optional width and height), the result is displayed as an HTML image with the value of the img field being used as the image src attribute
LANGUAGE: json
CODE: {
"display" : "{'img': 'https://dashjoin.com/img/fav.png'}",
"widget" : "display"
}
TITLE: display widget showing a hyperlink
DESCRIPTION: if the object has exactly the key 'href' or the keys 'href' and 'label', the object is displayed as a hyperlink
LANGUAGE: json
CODE: {
"display" : "{'href':'http://dashjoin.com', 'label':'DJ Homepage'}",
"widget" : "display"
}
TITLE: display widget showing a hyperlink
DESCRIPTION: absolute or relative links to another page in the app are specified without the 'slash hash' part of the URL - for instance, the href 'Info' or '/page/Info' links to the Info page
LANGUAGE: json
CODE: {
"display" : "{'href':'/#/page/Home', 'label':'Home'}",
"widget" : "display"
}
TITLE: display widget on dashboard page
DESCRIPTION: shows how a display widget is added on a dashboard page
FILE: model/page/test.json
LANGUAGE: json
CODE: {
"ID" : "test",
"layout" : {
"widget" : "page",
"children" : [ {
"display" : "{'database': 'northwind', 'table': 'EMPLOYEES', 'pk1':2}",
"widget" : "display"
} ]
}
}
TITLE: display widget on instance page
DESCRIPTION: shows how a display widget is added on a database instance page
FILE: model/dj-database/dj%2Fsqlite.json
LANGUAGE: json
CODE: {
"name" : "sqlite",
"ID" : "dj/sqlite",
"djClassName" : "org.dashjoin.service.SQLDatabase",
"url" : "jdbc:sqlite:dashjoin-demo.db",
"tables" : {
"REQUESTS" : {
"instanceLayout" : {
"widget" : "page",
"children" : [ {
"display" : "$now()",
"widget" : "display"
} ]
}
}
}
}
TITLE: display widget on table page
DESCRIPTION: shows how a display widget is added on a table page
FILE: model/dj-database/dj%2Fsqlite.json
LANGUAGE: json
CODE: {
"name" : "sqlite",
"ID" : "dj/sqlite",
"djClassName" : "org.dashjoin.service.SQLDatabase",
"url" : "jdbc:sqlite:dashjoin-demo.db",
"tables" : {
"REQUESTS" : {
"tableLayout" : {
"widget" : "page",
"children" : [ {
"display" : "$now()",
"widget" : "display"
} ]
}
}
}
}
TITLE: display widget with JSON keys containing special characters
DESCRIPTION: SQL queries create JSON with field names 'table.column'. In JSONata, enclose the field name in backticks (`)
LANGUAGE: json
CODE: {
"display" : "$adHocQuery('sqlite', 'select ID from REQUESTS').`REQUESTS.ID`",
"widget" : "display"
}
TITLE: card widget
DESCRIPTION: The card widget shows its children within a card
LANGUAGE: json
CODE: {
"widget" : "card"
}
TITLE: container widget for authenticated role
DESCRIPTION: Provides a logical container for its children. This example displays children only if the user in the the role 'authenticated'
LANGUAGE: json
CODE: {
"roles" : [ "authenticated" ],
"widget" : "container"
}
TITLE: container widget conditionally showing contents
DESCRIPTION: Provides a logical container for its children. This example displays children only if the jsonata expression is true
LANGUAGE: json
CODE: {
"if" : "email = 'admin@localhost'",
"widget" : "container"
}
TITLE: container widget showing contents for each value
DESCRIPTION: Provides a logical container for its children. This example shows the child for each value of the foreach expression
LANGUAGE: json
CODE: {
"foreach" : "[1..5]",
"widget" : "container",
"children" : [ {
"display" : "value",
"widget" : "display"
} ]
}
TITLE: expansion widget shows children in an expansion panel
DESCRIPTION: Provides a logical container for its children and shows them in an expansion panel
LANGUAGE: json
CODE: {
"text" : "Open Me",
"widget" : "expansion"
}
TITLE: stepper widget displays its children as a wizard
DESCRIPTION: allows stepping through its children. It displays the step number and title along with the child at the current step position
LANGUAGE: json
CODE: {
"widget" : "stepper",
"children" : [ {
"title" : "One",
"text" : "Next",
"print" : "$stepForward()",
"widget" : "button"
}, {
"text" : "Back",
"title" : "Two",
"print" : "$stepBack()",
"widget" : "button"
} ]
}
TITLE: tabs widget displays its children as tabs
DESCRIPTION: displays its children in a tab container which allows selecting the current tab on top
LANGUAGE: json
CODE: {
"widget" : "tabs",
"children" : [ {
"title" : "First",
"widget" : "text"
} ]
}
TITLE: button widget
DESCRIPTION: shows a button to trigger an action with an optional set of inputs. This example prints the contents of the form input
LANGUAGE: json
CODE: {
"widget" : "button",
"print" : "form.name",
"schema" : {
"type" : "object",
"properties" : {
"name" : {
"widget" : "string"
}
}
}
}
TITLE: button widget: Dynamically compute form fields
DESCRIPTION: schemaExpression is an expression that computes JSON Schema which in turn defines the form fields dynamically
LANGUAGE: json
CODE: {
"schemaExpression" : "{'properties':{'name': {'type':'string'}}}",
"print" : "form.name",
"widget" : "button"
}
TITLE: button widget: show a form field conditionally
DESCRIPTION: schemaExpression is an expression that computes JSON Schema which in turn defines the form fields dynamically: The 'type' field is defined as the switch. Other fields can specify 'case' with the type value of when they are shown
LANGUAGE: json
CODE: {
"widget" : "button",
"print" : "form",
"schemaExpression" : "{'switch':'type', 'properties': {'type': {'widget': 'select', 'options':'[\"circle\"]'}, 'radius': {'case': 'circle'}}}"
}
TITLE: button widget: computing select options
DESCRIPTION: The button form has a select field to input 'id'. The select options are computed from the database
LANGUAGE: json
CODE: {
"widget" : "button",
"print" : "form.field",
"schema" : {
"type" : "object",
"properties" : {
"id" : {
"widget" : "select",
"options" : "$all('northwind', 'EMPLOYEES').{'value':EMPLOYEE_ID, 'name': LAST_NAME}"
}
}
}
}
TITLE: button widget: JavaScript expressions
DESCRIPTION: Expressions that start with // JavaScript can use JavaScript. This example triggers a file download
LANGUAGE: json
CODE: {
"widget" : "button",
"print" : "// JavaScript\nvar blob = new Blob(['Hello, world!'], {type: 'text/plain;charset=utf-8'});\nsaveAs(blob, 'hello world.txt');"
}
TITLE: button widget: JavaScript expressions
DESCRIPTION: Expressions that start with // JavaScript can use JavaScript. This example calls the $read() function and returns the result
LANGUAGE: json
CODE: {
"widget" : "button",
"print" : "// JavaScript\nreturn await read('sqlite', 'REQUESTS', 1)"
}
TITLE: create widget
DESCRIPTION: Shows a form on the database table page to create a new database record
LANGUAGE: json
CODE: {
"name" : "sqlite",
"ID" : "dj/sqlite",
"djClassName" : "org.dashjoin.service.SQLDatabase",
"url" : "jdbc:sqlite:dashjoin-demo.db",
"tables" : {
"REQUESTS" : {
"tableLayout" : {
"widget" : "page",
"children" : [ {
"widget" : "create",
"schema" : {
"type" : "object",
"properties" : {
"ID" : {
"ID" : "dj/sqlite/REQUESTS/ID",
"parent" : "dj/sqlite/REQUESTS",
"dbType" : "INTEGER",
"type" : "number",
"pkpos" : 0,
"createOnly" : true
}
}
}
} ]
}
}
}
}
TITLE: edit widget
DESCRIPTION: Shows a form on the instance page to edit or delete the instance
LANGUAGE: json
CODE: {
"name" : "sqlite",
"ID" : "dj/sqlite",
"djClassName" : "org.dashjoin.service.SQLDatabase",
"url" : "jdbc:sqlite:dashjoin-demo.db",
"tables" : {
"REQUESTS" : {
"instanceLayout" : {
"widget" : "page",
"children" : [ {
"widget" : "edit",
"schema" : {
"type" : "object",
"properties" : {
"ID" : {
"ID" : "dj/sqlite/REQUESTS/ID",
"parent" : "dj/sqlite/REQUESTS",
"dbType" : "INTEGER",
"type" : "number",
"pkpos" : 0,
"createOnly" : true,
"size" : 6
}
}
}
} ]
}
}
}
}
TITLE: variable widget
DESCRIPTION: Shows a form that sets session variables. This example sets the variable 'field'
LANGUAGE: json
CODE: {
"widget" : "variable",
"schema" : {
"type" : "object",
"properties" : {
"field" : {
"widget" : "number"
}
}
}
}
TITLE: action table
DESCRIPTION: Visualizes 'expression' as a table. The 'properties' field contains an object where the keys are button labels and the values contain actions to be performed when the button is pressed. The action expression gets the context passed which includes the selected objects in the 'selected' field
LANGUAGE: json
CODE: {
"expression" : "$all('sqlite', 'REQUESTS')",
"properties" : {
"print" : "selected.$echo($)"
},
"widget" : "actionTable"
}
TITLE: aichat widget
DESCRIPTION: chat widget that allows you to react to user inputs and file uploads. this example answers (without AI) by simply repeating what the user asks. the chat is initialized with a simple message
LANGUAGE: json
CODE: {
"onChat" : "newMessage.content",
"expression" : "{'messages': [{'role': 'assistant', 'content': 'I am a parrot'}]}",
"widget" : "aichat"
}
TITLE: aichat widget
DESCRIPTION: chat widget that allows you to react to user inputs and file uploads. this example calls a AIApp function called aia
LANGUAGE: json
CODE: {
"onChat" : "$sse('aia', $append(messages, newMessage))",
"widget" : "aichat"
}
TITLE: analytics widget
DESCRIPTION: displays the results of a SQL query as a chart or table. Allows placing filters on the widget that the user can set when viewing the widget. The database, table, columns, and filter fields determine the SQL query: in this case, it is 'select user, count(ID) from REQUESTS where submitted >= ?' on the database 'sqlite'. Possible filter input widgets are: text, slider, switch, date, select, and selectmultiple.
LANGUAGE: json
CODE: {
"columns" : [ {
"name" : "user",
"aggregation" : "GROUP_BY"
}, {
"name" : "ID",
"aggregation" : "COUNT"
} ],
"filter" : [ {
"name" : "submitted",
"operator" : ">=",
"input" : "date"
} ],
"database" : "sqlite",
"table" : "REQUESTS",
"chart" : "bar",
"widget" : "analytics"
}
TITLE: chart widget
DESCRIPTION: displays a chart based on a query or expression. the first column is used as labels for the X-axis. The second column holds the Y-Values. This example shows the results of the 'group' query from the query catalog run on the northwind database. The chart is a bar chart.
LANGUAGE: json
CODE: {
"database" : "northwind",
"query" : "group",
"chart" : "bar",
"widget" : "chart"
}
TITLE: chart widget
DESCRIPTION: displays a chart based on a query or expression. the first column is used as labels for the X-axis. The second column holds the Y-Values. This example uses a JSONata expression to compute a table using two columns in order to display it as a line chart.
LANGUAGE: json
CODE: {
"chart" : "line",
"expression" : "[{'name':'joe', 'age':11}, {'name':'jane', 'age': 22}]",
"arguments" : "",
"widget" : "chart"
}
TITLE: chart widget
DESCRIPTION: chart with style options (see ChartJS)
LANGUAGE: json
CODE: {
"widget" : "chart",
"query" : "orders-over-time",
"database" : "northwind",
"chart" : "bar",
"style" : {
"elements.bar.backgroundColor" : "green",
"plugins.title.text" : "Orders in February",
"plugins.title.display" : "true",
"scales.x.type" : "time",
"scales.x.min" : "1998-02-01",
"scales.x.max" : "1998-02-28"
}
}
TITLE: datagrid widget
DESCRIPTION: Displays the result of a JSONata expression as an editable table. We have callbacks ondelete (context 'id' contains the primary key of the row to be deleted), onchange (updatedRow contains the new value of the row), and oncreate (no context is given - in this example, the code computes a new unique primary key by running select max(id) from table)
LANGUAGE: json
CODE: {
"widget" : "datagrid",
"expression" : "$all('northwind', 'EMPLOYEES')",
"onchange" : "$update('northwind', 'EMPLOYEES', id, updatedRow)",
"ondelete" : "$delete('northwind', 'EMPLOYEES', id)",
"oncreate" : "$create('northwind', 'EMPLOYEES', {'EMPLOYEE_ID': $adHocQuery('northwind', 'select max(EMPLOYEE_ID)+1 as X from EMPLOYEES').X, 'LAST_NAME': ' ', 'FIRST_NAME': ' '})",
"idColumn" : "EMPLOYEE_ID"
}
TITLE: diagram widget
DESCRIPTION: displays a boxes and lines diagram where each box represents a database record. The expression 'nodes' computes the boxes. The fields database, table, and id denote the database record (in the example an EMPLOYEE). Optionally, you can specify the box label (data.label) and the box position (position.x and position.y)
LANGUAGE: json
CODE: {
"nodes" : "$all('northwind', 'EMPLOYEES').{'database': 'northwind', 'table': 'EMPLOYEES', 'id': EMPLOYEE_ID, 'data': {'label': LAST_NAME}}",
"edges" : "$all('northwind', 'EMPLOYEES').{'source': EMPLOYEE_ID, 'target': REPORTS_TO}",
"widget" : "diagram"
}
TITLE: edit related widget
DESCRIPTION: Allows editing related records of a database record. In this example, the order instance page allows editing all the order details directly. The link between the tables is established via the 'prop' field, which contains the column ID of the foreign key
LANGUAGE: json
CODE: {
"ID" : "dj/northwind",
"name" : "northwind",
"djClassName" : "org.dashjoin.service.SQLDatabase",
"url" : "jdbc:h2:mem:northwind",
"tables" : {
"ORDERS" : {
"instanceLayout" : {
"widget" : "page",
"children" : [ {
"columns" : [ "ORDER_ID", "PRODUCT_ID", "UNIT_PRICE", "QUANTITY", "DISCOUNT" ],
"prop" : "dj/northwind/ORDER_DETAILS/ORDER_ID",
"widget" : "editRelated"
} ]
}
}
}
}
TITLE: graph widget
DESCRIPTION: display a directed labelled graph showing the result of an OpenCypher query
LANGUAGE: json
CODE: {
"nodes" : "$adHocQueryGraph('northwind', 'match p=(x:EMPLOYEES)-[:REPORTS_TO]->(y) return p').p",
"widget" : "graph"
}
TITLE: graph widget
DESCRIPTION: display a directed labelled graph showing the nodes specified by a JSONata expression. Initially, this graph has no edges
LANGUAGE: json
CODE: {
"nodes" : "$all('northwind', 'EMPLOYEES').EMPLOYEE_ID.{ 'database': 'northwind', 'table': 'EMPLOYEES', 'pk': [$]}",
"widget" : "graph"
}
TITLE: html widget
DESCRIPTION: Allows you to specify HTML. The context expression can be used to inject dynamic content into the HTML via the template ${context}. You can also provide JavaScript functions that can be called from your HTML code (e.g. function 'go')
LANGUAGE: json
CODE: {
"title" : "HTML Widgets",
"html" : "<html lang=\"en\"><style>.card {padding:2em;background:#fff;border-radius:1em;box-shadow:0 4px 12px rgba(0,0,0,.1);text-align:center}</style><body><div class=\"card\"><h1>Hello 👋</h1><p><a href='javascript:go()'>${context.x}</a></p></div></body></html>",
"context" : "{'x': 'Hello World!'}",
"script" : "function go(){alert('Hi')}",
"widget" : "html"
}
TITLE: icon widget
DESCRIPTION: shows a material icon with an optional link (href) and tooltip text
LANGUAGE: json
CODE: {
"icon" : "verified_user",
"href" : "/page/Home",
"tooltip" : "tooltip text",
"widget" : "icon"
}
TITLE: links widget
DESCRIPTION: on an instance page, shows links to all other related records and the corresponding table page
LANGUAGE: json
CODE: {
"widget" : "links"
}
TITLE: map widget showing a list of addresses
DESCRIPTION: The address can be as simple as 'jp' for Japan, or it can be a specific street address. The widget chooses the appropriate center and zoom level automatically
LANGUAGE: json
CODE: {
"display" : "['paris', 'berlin']",
"widget" : "map"
}
TITLE: map widget showing a specific address with a popup linking to a record
DESCRIPTION: Using the points field, you can specify a popup which display the data like the display widget. In this case, we show a link to a database record
LANGUAGE: json
CODE: {
"display" : "{'points': [{'address': 'London','popup': {'database': 'northwind','table': 'CUSTOMERS','pk': [ 'AROUT' ]}}]}",
"widget" : "map"
}
TITLE: markdown widget
DESCRIPTION: shows markdown that can be fed dynamic content via the 'context' JSONata expression
LANGUAGE: json
CODE: {
"markdown" : "# Hello ${user} ${context}",
"context" : "42",
"widget" : "markdown"
}
TITLE: mdxeditor widget
DESCRIPTION: a WYSIWYG editor that can be extended with custom menus. 'properties' defines the actions, 'expression' defines the menu structure
LANGUAGE: json
CODE: {
"markdown" : "# Hello ${user} ${context}",
"context" : "42",
"properties" : {
"alert" : "$alert('selection: ' & selection & '. markdown: ' & markdown)",
"log" : "$log($)",
"sleep" : "($progress({'message': 'working'});$sleep(1000))"
},
"expression" : "{'menu': [{'type': 'select','title': 'tooltip','label': 'longer operation','value': 'sleep','items': [{}]},{'type': 'select','title': 'tooltip','label': 'Label','items': [{'label': 'alert popup','value': 'alert'},{'label': 'doc to console','value': 'log'}]}]}",
"widget" : "mdxeditor"
}
TITLE: table widget
DESCRIPTION: shows the result of a query. this example uses mode auto which chooses a mobile friendly table layout when viewed on small devices
LANGUAGE: json
CODE: {
"mode" : "auto",
"database" : "northwind",
"query" : "group",
"widget" : "table"
}
TITLE: table widget
DESCRIPTION: shows the result of a JSONata expression as a table
LANGUAGE: json
CODE: {
"expression" : "[{'x':1}]",
"widget" : "table"
}
TITLE: text widget
DESCRIPTION: shows a simple static text
LANGUAGE: json
CODE: {
"text" : "Hello World!",
"widget" : "text"
}
TITLE: text widget
DESCRIPTION: shows a hyperlink with an icon in front
LANGUAGE: json
CODE: {
"href" : "/page/Home",
"text" : "Homepage",
"icon" : "home",
"widget" : "text"
}
TITLE: tree widget
DESCRIPTION: shows a tree using a recursive query 'orgchart'. The query must have a parameter 'node' and is evaluated every time a node is opened in the tree view
LANGUAGE: json
CODE: {
"widget" : "tree",
"query" : "orgchart",
"database" : "northwind"
}
TITLE: tree widget
DESCRIPTION: shows a static tree that is suitable for a side navigation. The tree nodes can provide an icon, text, href, and nested child nodes
LANGUAGE: json
CODE: {
"expression" : "[{'data': {'text': 'Menu','icon': 'person'},'children': [{'text': 'Info', 'icon': 'info', 'href': '/page/Info'}, {'text': 'Home', 'icon': 'home', 'href': '/page/Info'}]}]",
"widget" : "tree"
}
TITLE: uploadfile widget
DESCRIPTION: Allows uploading files to the upload directory. Note that WebDAV must be turned on using the WEBDEV_ENABLED environment variable
LANGUAGE: json
CODE: {
"widget" : "uploadfile"
}
TITLE: boolean input
DESCRIPTION: Boolean inputs show a on/off toggle. In this example, the toggle has the label 'Opt in'
LANGUAGE: json
CODE: {
"widget" : "boolean",
"title" : "Opt in"
}
TITLE: string input
DESCRIPTION: String inputs show a text input
LANGUAGE: json
CODE: {
"widget" : "string"
}
TITLE: number input
DESCRIPTION: Number inputs show a text input that is restricted to entering numbers
LANGUAGE: json
CODE: {
"widget" : "number"
}
TITLE: autocomplete input
DESCRIPTION: Autocomplete inputs show a text input that autocompletes to the options specified in the jsonata expression
LANGUAGE: json
CODE: {
"widget" : "auto complete",
"options" : "['one', 'two', 'three']"
}
TITLE: select input
DESCRIPTION: Select inputs show a drop-down selection with the options specified in the jsonata expression
LANGUAGE: json
CODE: {
"widget" : "select",
"options" : "['one', 'two', 'three']"
}
TITLE: multi select input
DESCRIPTION: Multi Select inputs show a drop-down selection with the options specified in the jsonata expression. Multiple options can be selected yielding an array of values
LANGUAGE: json
CODE: {
"widget" : "multi select",
"options" : "['one', 'two', 'three']"
}
TITLE: key value input
DESCRIPTION: key value inputs display a two column table to enter keys and values. Returns a JSON object
LANGUAGE: json
CODE: {
"widget" : "key value"
}
TITLE: password input
DESCRIPTION: Shows a password input field
LANGUAGE: json
CODE: {
"widget" : "password"
}
TITLE: textarea input
DESCRIPTION: Shows a multi line input field (textarea)
LANGUAGE: json
CODE: {
"widget" : "textarea"
}
TITLE: date input
DESCRIPTION: Shows a date picker input. Returns a YYYY-MM-DD string with the selected date
LANGUAGE: json
CODE: {
"widget" : "date"
}
TITLE: time input
DESCRIPTION: Shows a time picker input. Returns a ISO 8601 date string with the current day and the selected time
LANGUAGE: json
CODE: {
"widget" : "time"
}
TITLE: datetime input
DESCRIPTION: Shows a datetime picker input
LANGUAGE: json
CODE: {
"widget" : "datetime"
}
TITLE: file input
DESCRIPTION: Allows uploading a file. returns the file contents
LANGUAGE: json
CODE: {
"widget" : "file"
}
TITLE: binary file input
DESCRIPTION: Allows uploading a file. returns the file contents as a base 64 encoded data URL
LANGUAGE: json
CODE: {
"widget" : "binary file"
}
TITLE: file with metadata input
DESCRIPTION: Allows uploading a file. returns an object with name, lastModified, size, type, and value (containing the file contents)
LANGUAGE: json
CODE: {
"widget" : "file with metadata"
}
TITLE: binary file with metadata input
DESCRIPTION: Allows uploading a file. returns an object with name, lastModified, size, type, and value (containing the file contents as a base 64 encoded data URL)
LANGUAGE: json
CODE: {
"widget" : "binary file with metadata"
}
TITLE: voice input
DESCRIPTION: Shows a text input field with a voice option
LANGUAGE: json
CODE: {
"widget" : "voice"
}
TITLE: qrcode input
DESCRIPTION: Allows scanning a QR Code into the form field
LANGUAGE: json
CODE: {
"widget" : "qrcode"
}
TITLE: Query with permissions
DESCRIPTION: a query on database 'dj/northwind' called 'group', executable for the 'authenticated' role
FILE: model/dj-query-catalog/group.json
LANGUAGE: json
CODE: {
"ID" : "group",
"database" : "dj/northwind",
"query" : "SELECT CUSTOMERS.COUNTRY, COUNT(*) AS \"Number of Customers\" FROM CUSTOMERS GROUP BY CUSTOMERS.COUNTRY",
"roles" : [ "authenticated" ],
"type" : "read"
}
TITLE: Query with parameters
DESCRIPTION: a query on database 'northwind' called 'list'. Parameters limit and offset can be passed to the query
FILE: model/dj-query-catalog/list.json
LANGUAGE: json
CODE: {
"ID" : "list",
"database" : "dj/northwind",
"query" : "select * from CATEGORIES limit ${limit} offset ${offset}",
"type" : "read",
"arguments" : {
"limit" : {
"type" : "number",
"sample" : "5"
},
"offset" : {
"type" : "number",
"sample" : "0"
}
}
}
TITLE: Calling a stored procedure
DESCRIPTION: stored procedure 'sp' on database 'postgres' called with parameter 'test'
FILE: model/dj-query-catalog/sp.json
LANGUAGE: json
CODE: {
"ID" : "sp",
"database" : "dj/postgres",
"query" : "CALL my_sp('test')",
"type" : "read"
}
TITLE: Database connection
DESCRIPTION: postgres database connection information with encrypted password
FILE: model/dj-database/dj%2Fpostgres.json
LANGUAGE: json
CODE: {
"name" : "postgres",
"djClassName" : "org.dashjoin.service.SQLDatabase",
"username" : "postgres",
"url" : "jdbc:postgresql://localhost:5432/postgres",
"ID" : "dj/postgres",
"password" : "DJ1#\b/gbzX8DDZa1lVaiLat0HdX9cDST2KHJk"
}
TITLE: Database audit log trigger
DESCRIPTION: sqlite database definition. The before-update trigger is called accordingly and logs an audit record to the table audit
LANGUAGE: json
CODE: {
"name" : "sqlite",
"ID" : "dj/sqlite",
"djClassName" : "org.dashjoin.service.SQLDatabase",
"url" : "jdbc:sqlite:dashjoin-demo.db",
"tables" : {
"REQUESTS" : {
"before-update" : "$create('db', 'audit', {'timestamp': $now(), 'user': user, 'operation': command, 'payload': object})"
}
}
}
TITLE: Database with initial create table
DESCRIPTION: sqlite database definition with init script that contains: CREATE TABLE IF NOT EXISTS MY_TABLE(ID INT PRIMARY KEY, NAME VARCHAR(255))
LANGUAGE: json
CODE: {
"name" : "sqlite",
"ID" : "dj/sqlite",
"djClassName" : "org.dashjoin.service.SQLDatabase",
"url" : "jdbc:sqlite:dashjoin-demo.db",
"initScripts" : [ "upload/init.sql" ]
}
TITLE: Database with foreign key
DESCRIPTION: sqlite database definition with a foreign key pointing to the CUSTOMERS table in the northwind database
LANGUAGE: json
CODE: {
"name" : "sqlite",
"ID" : "dj/sqlite",
"djClassName" : "org.dashjoin.service.SQLDatabase",
"url" : "jdbc:sqlite:dashjoin-demo.db",
"tables" : {
"REQUESTS" : {
"properties" : {
"customer" : {
"ref" : "dj/northwind/CUSTOMERS/CUSTOMER_ID",
"displayWith" : "fk"
}
}
}
}
}
TITLE: Database with foreign key array
DESCRIPTION: postgres database definition with an array of foreign keys pointing to the CUSTOMERS table in the northwind database
LANGUAGE: json
CODE: {
"name" : "postgres",
"djClassName" : "org.dashjoin.service.SQLDatabase",
"username" : "postgres",
"password" : "DJ1#\bApQHRIfZwu6WSIJrlI2aBqbMhnLRPlsg",
"url" : "jdbc:postgresql://localhost:5432/postgres",
"ID" : "dj/postgres",
"tables" : {
"test" : {
"properties" : {
"arr" : {
"type" : "array",
"items" : {
"ref" : "dj/northwind/CUSTOMERS/CUSTOMER_ID",
"type" : "string",
"displayWith" : "fk"
}
}
}
}
}
}
TITLE: Database with record label
DESCRIPTION: EMPLOYEES table defines the record label to be the LAST_NAME. All links and page titles for EMPLOYEE records use the LAST_NAME column as labels
LANGUAGE: json
CODE: {
"ID" : "dj/northwind",
"name" : "northwind",
"parent" : "dj",
"djClassName" : "org.dashjoin.service.SQLDatabase",
"url" : "jdbc:h2:mem:northwind",
"tables" : {
"EMPLOYEES" : {
"dj-label" : "${LAST_NAME}"
}
}
}
TITLE: KnowledgeBase
DESCRIPTION: Expose the RAG document knowledge base to the platform
LANGUAGE: json
CODE: {
"ID" : "dj/kb",
"name" : "kb",
"djClassName" : "com.dashjoin.ai.KnowledgeBase",
"url" : "http://localhost:8001"
}
TITLE: Invoke
DESCRIPTION: Function that adds two numbers passed in the argument object. It can be called via $call('add') or via REST
FILE: model/dj-function/add.json
LANGUAGE: json
CODE: {
"ID" : "add",
"djClassName" : "org.dashjoin.function.Invoke",
"expression" : "{'result': x+y}",
"roles" : [ "authenticated" ],
"type" : "read"
}
TITLE: RestJson
DESCRIPTION: Function that calls a web service. The fields of the function argument are used to construct the URL via from string template
FILE: model/dj-function/address.json
LANGUAGE: json
CODE: {
"djClassName" : "org.dashjoin.function.RestJson",
"url" : "https://api.geoapify.com/v1/geocode/search?street=${street}&postcode=${postcode}&city=${city}&country=${country}&apiKey=...",
"method" : "GET",
"contentType" : "application/json",
"ID" : "address"
}
TITLE: Credentials
DESCRIPTION: Encrypted credentials for OpenAI to be used in $curl and $chat functions
FILE: model/dj-function/openai.json
LANGUAGE: json
CODE: {
"ID" : "openai",
"djClassName" : "org.dashjoin.function.Credentials",
"username" : "Authorization",
"password" : "DJ1#\b7Zw3EGtmVKaDuwwOtwXfWDG1y+awbon7WNQp9NmJ6EgUXEpYUMC8O7zRUw2kSnDxyATO0R3ke3NxjaT9zCwYyDGS5VDgYt/L",
"apiKey" : true
}
TITLE: ETL
DESCRIPTION: Extract load transform function. Loads the result of 'expression' into the database sqlite. The data is mapped using 'mappings'
FILE: model/dj-function/misp.json
LANGUAGE: json
CODE: {
"djClassName" : "com.dashjoin.function.ETL",
"database" : "sqlite",
"ID" : "misp",
"type" : "write",
"oldData" : "Delete All",
"createSchema" : true,
"mappings" : {
"MISP_Event" : {
"sourceTable" : "table",
"extractColumn" : null,
"extractKey" : null,
"pk" : "uuid",
"rowMapping" : null,
"rowFilter" : null
}
},
"expressions" : {
"expression" : "$openJson(\"https://www.circl.lu/doc/misp/feed-osint/0b988513-9535-42f0-9ebc-5d6aec2e1c79.json\").Event.Attribute"
}
}
TITLE: Email
DESCRIPTION: Configures an SMTP server
FILE: model/dj-function/email.json
LANGUAGE: json
CODE: {
"djClassName" : "org.dashjoin.function.Email",
"ID" : "email",
"type" : "write",
"properties" : {
"mail.smtp.port" : "25"
},
"username" : "user",
"password" : "DJ1#\btW06MCaBJjnRvgvGgTaTpQ=="
}